diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..ebefd93 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,38 @@ +name: CD + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: v1.21.2 + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4d0ae47 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + workflow_dispatch: + pull_request: + +permissions: + contents: read + pull-requests: read + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: v1.21.2 + args: build --clean --single-target --snapshot + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 + args: --timeout=5m --out-format=github-actions + + diff --git a/.gitignore b/.gitignore index c4becbb..2715449 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,5 @@ debug radix-cli rx rx-test -/generated-client/client/* -/generated-client/models/* .idea/ -.dccache \ No newline at end of file +.dccache diff --git a/.goreleaser.yml b/.goreleaser.yml index 3496c10..f6b2721 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,6 +17,7 @@ builds: dockers: - image_templates: - "ghcr.io/equinor/radix/rx:latest" + - "ghcr.io/equinor/radix/rx:{{ .Version}}" dockerfile: Dockerfile.goreleaser ids: - rx diff --git a/Makefile b/Makefile index ec60a51..c93e4f3 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ generate-client: .PHONY: release release: - swagger generate client -t ./generated-client -f https://api.radix.equinor.com/swaggerui/swagger.json -A radixapi git tag -a v$(VERSION) -m "$(RELEASE_NOTE)" git push origin v$(VERSION) git config --global credential.helper cache @@ -21,4 +20,4 @@ push: docker push ghcr.io/equinor/radix/rx:latest staticcheck: - staticcheck ./... \ No newline at end of file + staticcheck ./... diff --git a/cmd/root.go b/cmd/root.go index e1ea23e..c12399b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -19,7 +19,7 @@ import ( const ( radixCLIError = "Error: Radix CLI executed with error" - version = "1.9.0" + version = "1.9.1" ) var rootLongHelp = strings.TrimSpace(` diff --git a/generated-client/client/application/application_client.go b/generated-client/client/application/application_client.go new file mode 100644 index 0000000..886ad74 --- /dev/null +++ b/generated-client/client/application/application_client.go @@ -0,0 +1,1064 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new application API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for application API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ChangeRegistrationDetails(params *ChangeRegistrationDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeRegistrationDetailsOK, error) + + DeleteApplication(params *DeleteApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteApplicationOK, error) + + DisableApplicationAlerting(params *DisableApplicationAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableApplicationAlertingOK, error) + + EnableApplicationAlerting(params *EnableApplicationAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableApplicationAlertingOK, error) + + GetApplication(params *GetApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationOK, error) + + GetApplicationAlertingConfig(params *GetApplicationAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationAlertingConfigOK, error) + + GetBuildSecrets(params *GetBuildSecretsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBuildSecretsOK, error) + + GetDeployKeyAndSecret(params *GetDeployKeyAndSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeployKeyAndSecretOK, error) + + GetDeployments(params *GetDeploymentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentsOK, error) + + GetPrivateImageHubs(params *GetPrivateImageHubsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPrivateImageHubsOK, error) + + IsDeployKeyValid(params *IsDeployKeyValidParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IsDeployKeyValidOK, error) + + ListPipelines(params *ListPipelinesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPipelinesOK, error) + + ModifyRegistrationDetails(params *ModifyRegistrationDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ModifyRegistrationDetailsOK, error) + + RegenerateDeployKey(params *RegenerateDeployKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RegenerateDeployKeyNoContent, error) + + RegenerateMachineUserToken(params *RegenerateMachineUserTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RegenerateMachineUserTokenOK, error) + + RestartApplication(params *RestartApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartApplicationOK, error) + + StartApplication(params *StartApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartApplicationOK, error) + + StopApplication(params *StopApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopApplicationOK, error) + + TriggerPipelineBuild(params *TriggerPipelineBuildParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelineBuildOK, error) + + TriggerPipelineBuildDeploy(params *TriggerPipelineBuildDeployParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelineBuildDeployOK, error) + + TriggerPipelineDeploy(params *TriggerPipelineDeployParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelineDeployOK, error) + + TriggerPipelinePromote(params *TriggerPipelinePromoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelinePromoteOK, error) + + UpdateApplicationAlertingConfig(params *UpdateApplicationAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateApplicationAlertingConfigOK, error) + + UpdateBuildSecretsSecretValue(params *UpdateBuildSecretsSecretValueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateBuildSecretsSecretValueOK, error) + + UpdatePrivateImageHubsSecretValue(params *UpdatePrivateImageHubsSecretValueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePrivateImageHubsSecretValueOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +ChangeRegistrationDetails updates application registration +*/ +func (a *Client) ChangeRegistrationDetails(params *ChangeRegistrationDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeRegistrationDetailsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewChangeRegistrationDetailsParams() + } + op := &runtime.ClientOperation{ + ID: "changeRegistrationDetails", + Method: "PUT", + PathPattern: "/applications/{appName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ChangeRegistrationDetailsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ChangeRegistrationDetailsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for changeRegistrationDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteApplication deletes application +*/ +func (a *Client) DeleteApplication(params *DeleteApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteApplicationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteApplicationParams() + } + op := &runtime.ClientOperation{ + ID: "deleteApplication", + Method: "DELETE", + PathPattern: "/applications/{appName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteApplicationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteApplicationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteApplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DisableApplicationAlerting disables alerting for application namespace +*/ +func (a *Client) DisableApplicationAlerting(params *DisableApplicationAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableApplicationAlertingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDisableApplicationAlertingParams() + } + op := &runtime.ClientOperation{ + ID: "disableApplicationAlerting", + Method: "POST", + PathPattern: "/applications/{appName}/alerting/disable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DisableApplicationAlertingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DisableApplicationAlertingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for disableApplicationAlerting: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +EnableApplicationAlerting enables alerting for application namespace +*/ +func (a *Client) EnableApplicationAlerting(params *EnableApplicationAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableApplicationAlertingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewEnableApplicationAlertingParams() + } + op := &runtime.ClientOperation{ + ID: "enableApplicationAlerting", + Method: "POST", + PathPattern: "/applications/{appName}/alerting/enable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &EnableApplicationAlertingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*EnableApplicationAlertingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for enableApplicationAlerting: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetApplication gets the application by name +*/ +func (a *Client) GetApplication(params *GetApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetApplicationParams() + } + op := &runtime.ClientOperation{ + ID: "getApplication", + Method: "GET", + PathPattern: "/applications/{appName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetApplicationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetApplicationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getApplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetApplicationAlertingConfig gets alerts configuration for application namespace +*/ +func (a *Client) GetApplicationAlertingConfig(params *GetApplicationAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationAlertingConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetApplicationAlertingConfigParams() + } + op := &runtime.ClientOperation{ + ID: "getApplicationAlertingConfig", + Method: "GET", + PathPattern: "/applications/{appName}/alerting", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetApplicationAlertingConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetApplicationAlertingConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getApplicationAlertingConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetBuildSecrets lists the application build secrets +*/ +func (a *Client) GetBuildSecrets(params *GetBuildSecretsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBuildSecretsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBuildSecretsParams() + } + op := &runtime.ClientOperation{ + ID: "getBuildSecrets", + Method: "GET", + PathPattern: "/applications/{appName}/buildsecrets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetBuildSecretsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBuildSecretsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBuildSecrets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetDeployKeyAndSecret gets deploy key and secret +*/ +func (a *Client) GetDeployKeyAndSecret(params *GetDeployKeyAndSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeployKeyAndSecretOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDeployKeyAndSecretParams() + } + op := &runtime.ClientOperation{ + ID: "getDeployKeyAndSecret", + Method: "GET", + PathPattern: "/applications/{appName}/deploy-key-and-secret", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetDeployKeyAndSecretReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetDeployKeyAndSecretOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getDeployKeyAndSecret: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetDeployments lists the application deployments +*/ +func (a *Client) GetDeployments(params *GetDeploymentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDeploymentsParams() + } + op := &runtime.ClientOperation{ + ID: "getDeployments", + Method: "GET", + PathPattern: "/applications/{appName}/deployments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetDeploymentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetDeploymentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getDeployments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetPrivateImageHubs lists the application private image hubs +*/ +func (a *Client) GetPrivateImageHubs(params *GetPrivateImageHubsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPrivateImageHubsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPrivateImageHubsParams() + } + op := &runtime.ClientOperation{ + ID: "getPrivateImageHubs", + Method: "GET", + PathPattern: "/applications/{appName}/privateimagehubs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetPrivateImageHubsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetPrivateImageHubsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getPrivateImageHubs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +IsDeployKeyValid checks if the deploy key is correctly setup for application by cloning the repository +*/ +func (a *Client) IsDeployKeyValid(params *IsDeployKeyValidParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IsDeployKeyValidOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIsDeployKeyValidParams() + } + op := &runtime.ClientOperation{ + ID: "isDeployKeyValid", + Method: "GET", + PathPattern: "/applications/{appName}/deploykey-valid", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &IsDeployKeyValidReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IsDeployKeyValidOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for isDeployKeyValid: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListPipelines lists the supported pipelines +*/ +func (a *Client) ListPipelines(params *ListPipelinesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPipelinesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListPipelinesParams() + } + op := &runtime.ClientOperation{ + ID: "listPipelines", + Method: "GET", + PathPattern: "/applications/{appName}/pipelines", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListPipelinesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListPipelinesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listPipelines: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ModifyRegistrationDetails updates specific field s of an application registration +*/ +func (a *Client) ModifyRegistrationDetails(params *ModifyRegistrationDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ModifyRegistrationDetailsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewModifyRegistrationDetailsParams() + } + op := &runtime.ClientOperation{ + ID: "modifyRegistrationDetails", + Method: "PATCH", + PathPattern: "/applications/{appName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ModifyRegistrationDetailsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ModifyRegistrationDetailsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for modifyRegistrationDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RegenerateDeployKey regenerates deploy key +*/ +func (a *Client) RegenerateDeployKey(params *RegenerateDeployKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RegenerateDeployKeyNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRegenerateDeployKeyParams() + } + op := &runtime.ClientOperation{ + ID: "regenerateDeployKey", + Method: "POST", + PathPattern: "/applications/{appName}/regenerate-deploy-key", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RegenerateDeployKeyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RegenerateDeployKeyNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for regenerateDeployKey: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RegenerateMachineUserToken regenerates machine user token +*/ +func (a *Client) RegenerateMachineUserToken(params *RegenerateMachineUserTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RegenerateMachineUserTokenOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRegenerateMachineUserTokenParams() + } + op := &runtime.ClientOperation{ + ID: "regenerateMachineUserToken", + Method: "POST", + PathPattern: "/applications/{appName}/regenerate-machine-user-token", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RegenerateMachineUserTokenReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RegenerateMachineUserTokenOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for regenerateMachineUserToken: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RestartApplication restarts all components in all environments of the application stops all running components in all environments of the application pulls new images from image hub in radix configuration starts all components in all environments of the application again using up to date image +*/ +func (a *Client) RestartApplication(params *RestartApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartApplicationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestartApplicationParams() + } + op := &runtime.ClientOperation{ + ID: "restartApplication", + Method: "POST", + PathPattern: "/applications/{appName}/restart", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RestartApplicationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RestartApplicationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for restartApplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StartApplication starts all components in all environments of the application +*/ +func (a *Client) StartApplication(params *StartApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartApplicationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStartApplicationParams() + } + op := &runtime.ClientOperation{ + ID: "startApplication", + Method: "POST", + PathPattern: "/applications/{appName}/start", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StartApplicationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StartApplicationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for startApplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StopApplication stops all components in the environment +*/ +func (a *Client) StopApplication(params *StopApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopApplicationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStopApplicationParams() + } + op := &runtime.ClientOperation{ + ID: "stopApplication", + Method: "POST", + PathPattern: "/applications/{appName}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StopApplicationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StopApplicationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stopApplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +TriggerPipelineBuild runs a build pipeline for a given application and branch +*/ +func (a *Client) TriggerPipelineBuild(params *TriggerPipelineBuildParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelineBuildOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTriggerPipelineBuildParams() + } + op := &runtime.ClientOperation{ + ID: "triggerPipelineBuild", + Method: "POST", + PathPattern: "/applications/{appName}/pipelines/build", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &TriggerPipelineBuildReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TriggerPipelineBuildOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for triggerPipelineBuild: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +TriggerPipelineBuildDeploy runs a build deploy pipeline for a given application and branch +*/ +func (a *Client) TriggerPipelineBuildDeploy(params *TriggerPipelineBuildDeployParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelineBuildDeployOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTriggerPipelineBuildDeployParams() + } + op := &runtime.ClientOperation{ + ID: "triggerPipelineBuildDeploy", + Method: "POST", + PathPattern: "/applications/{appName}/pipelines/build-deploy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &TriggerPipelineBuildDeployReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TriggerPipelineBuildDeployOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for triggerPipelineBuildDeploy: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +TriggerPipelineDeploy runs a deploy pipeline for a given application and environment +*/ +func (a *Client) TriggerPipelineDeploy(params *TriggerPipelineDeployParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelineDeployOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTriggerPipelineDeployParams() + } + op := &runtime.ClientOperation{ + ID: "triggerPipelineDeploy", + Method: "POST", + PathPattern: "/applications/{appName}/pipelines/deploy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &TriggerPipelineDeployReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TriggerPipelineDeployOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for triggerPipelineDeploy: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +TriggerPipelinePromote runs a promote pipeline for a given application and branch +*/ +func (a *Client) TriggerPipelinePromote(params *TriggerPipelinePromoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TriggerPipelinePromoteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTriggerPipelinePromoteParams() + } + op := &runtime.ClientOperation{ + ID: "triggerPipelinePromote", + Method: "POST", + PathPattern: "/applications/{appName}/pipelines/promote", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &TriggerPipelinePromoteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TriggerPipelinePromoteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for triggerPipelinePromote: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateApplicationAlertingConfig updates alerts configuration for application namespace +*/ +func (a *Client) UpdateApplicationAlertingConfig(params *UpdateApplicationAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateApplicationAlertingConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateApplicationAlertingConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateApplicationAlertingConfig", + Method: "PUT", + PathPattern: "/applications/{appName}/alerting", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateApplicationAlertingConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateApplicationAlertingConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateApplicationAlertingConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateBuildSecretsSecretValue updates an application build secret +*/ +func (a *Client) UpdateBuildSecretsSecretValue(params *UpdateBuildSecretsSecretValueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateBuildSecretsSecretValueOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateBuildSecretsSecretValueParams() + } + op := &runtime.ClientOperation{ + ID: "updateBuildSecretsSecretValue", + Method: "PUT", + PathPattern: "/applications/{appName}/buildsecrets/{secretName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateBuildSecretsSecretValueReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateBuildSecretsSecretValueOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateBuildSecretsSecretValue: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdatePrivateImageHubsSecretValue updates an application private image hub secret +*/ +func (a *Client) UpdatePrivateImageHubsSecretValue(params *UpdatePrivateImageHubsSecretValueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePrivateImageHubsSecretValueOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdatePrivateImageHubsSecretValueParams() + } + op := &runtime.ClientOperation{ + ID: "updatePrivateImageHubsSecretValue", + Method: "PUT", + PathPattern: "/applications/{appName}/privateimagehubs/{serverName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdatePrivateImageHubsSecretValueReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdatePrivateImageHubsSecretValueOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updatePrivateImageHubsSecretValue: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/application/change_registration_details_parameters.go b/generated-client/client/application/change_registration_details_parameters.go new file mode 100644 index 0000000..50352cf --- /dev/null +++ b/generated-client/client/application/change_registration_details_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewChangeRegistrationDetailsParams creates a new ChangeRegistrationDetailsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewChangeRegistrationDetailsParams() *ChangeRegistrationDetailsParams { + return &ChangeRegistrationDetailsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewChangeRegistrationDetailsParamsWithTimeout creates a new ChangeRegistrationDetailsParams object +// with the ability to set a timeout on a request. +func NewChangeRegistrationDetailsParamsWithTimeout(timeout time.Duration) *ChangeRegistrationDetailsParams { + return &ChangeRegistrationDetailsParams{ + timeout: timeout, + } +} + +// NewChangeRegistrationDetailsParamsWithContext creates a new ChangeRegistrationDetailsParams object +// with the ability to set a context for a request. +func NewChangeRegistrationDetailsParamsWithContext(ctx context.Context) *ChangeRegistrationDetailsParams { + return &ChangeRegistrationDetailsParams{ + Context: ctx, + } +} + +// NewChangeRegistrationDetailsParamsWithHTTPClient creates a new ChangeRegistrationDetailsParams object +// with the ability to set a custom HTTPClient for a request. +func NewChangeRegistrationDetailsParamsWithHTTPClient(client *http.Client) *ChangeRegistrationDetailsParams { + return &ChangeRegistrationDetailsParams{ + HTTPClient: client, + } +} + +/* +ChangeRegistrationDetailsParams contains all the parameters to send to the API endpoint + + for the change registration details operation. + + Typically these are written to a http.Request. +*/ +type ChangeRegistrationDetailsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ApplicationRegistration. + + request for Application to change + */ + ApplicationRegistration *models.ApplicationRegistrationRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the change registration details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeRegistrationDetailsParams) WithDefaults() *ChangeRegistrationDetailsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change registration details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeRegistrationDetailsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the change registration details params +func (o *ChangeRegistrationDetailsParams) WithTimeout(timeout time.Duration) *ChangeRegistrationDetailsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the change registration details params +func (o *ChangeRegistrationDetailsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the change registration details params +func (o *ChangeRegistrationDetailsParams) WithContext(ctx context.Context) *ChangeRegistrationDetailsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the change registration details params +func (o *ChangeRegistrationDetailsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the change registration details params +func (o *ChangeRegistrationDetailsParams) WithHTTPClient(client *http.Client) *ChangeRegistrationDetailsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the change registration details params +func (o *ChangeRegistrationDetailsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the change registration details params +func (o *ChangeRegistrationDetailsParams) WithImpersonateGroup(impersonateGroup []string) *ChangeRegistrationDetailsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the change registration details params +func (o *ChangeRegistrationDetailsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the change registration details params +func (o *ChangeRegistrationDetailsParams) WithImpersonateUser(impersonateUser *string) *ChangeRegistrationDetailsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the change registration details params +func (o *ChangeRegistrationDetailsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the change registration details params +func (o *ChangeRegistrationDetailsParams) WithAppName(appName string) *ChangeRegistrationDetailsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the change registration details params +func (o *ChangeRegistrationDetailsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithApplicationRegistration adds the applicationRegistration to the change registration details params +func (o *ChangeRegistrationDetailsParams) WithApplicationRegistration(applicationRegistration *models.ApplicationRegistrationRequest) *ChangeRegistrationDetailsParams { + o.SetApplicationRegistration(applicationRegistration) + return o +} + +// SetApplicationRegistration adds the applicationRegistration to the change registration details params +func (o *ChangeRegistrationDetailsParams) SetApplicationRegistration(applicationRegistration *models.ApplicationRegistrationRequest) { + o.ApplicationRegistration = applicationRegistration +} + +// WriteToRequest writes these params to a swagger request +func (o *ChangeRegistrationDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + if o.ApplicationRegistration != nil { + if err := r.SetBodyParam(o.ApplicationRegistration); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamChangeRegistrationDetails binds the parameter Impersonate-Group +func (o *ChangeRegistrationDetailsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/change_registration_details_responses.go b/generated-client/client/application/change_registration_details_responses.go new file mode 100644 index 0000000..0908935 --- /dev/null +++ b/generated-client/client/application/change_registration_details_responses.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// ChangeRegistrationDetailsReader is a Reader for the ChangeRegistrationDetails structure. +type ChangeRegistrationDetailsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ChangeRegistrationDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewChangeRegistrationDetailsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewChangeRegistrationDetailsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewChangeRegistrationDetailsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewChangeRegistrationDetailsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewChangeRegistrationDetailsConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /applications/{appName}] changeRegistrationDetails", response, response.Code()) + } +} + +// NewChangeRegistrationDetailsOK creates a ChangeRegistrationDetailsOK with default headers values +func NewChangeRegistrationDetailsOK() *ChangeRegistrationDetailsOK { + return &ChangeRegistrationDetailsOK{} +} + +/* +ChangeRegistrationDetailsOK describes a response with status code 200, with default header values. + +Change registration operation result +*/ +type ChangeRegistrationDetailsOK struct { + Payload *models.ApplicationRegistrationUpsertResponse +} + +// IsSuccess returns true when this change registration details o k response has a 2xx status code +func (o *ChangeRegistrationDetailsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this change registration details o k response has a 3xx status code +func (o *ChangeRegistrationDetailsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change registration details o k response has a 4xx status code +func (o *ChangeRegistrationDetailsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this change registration details o k response has a 5xx status code +func (o *ChangeRegistrationDetailsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this change registration details o k response a status code equal to that given +func (o *ChangeRegistrationDetailsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the change registration details o k response +func (o *ChangeRegistrationDetailsOK) Code() int { + return 200 +} + +func (o *ChangeRegistrationDetailsOK) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsOK %+v", 200, o.Payload) +} + +func (o *ChangeRegistrationDetailsOK) String() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsOK %+v", 200, o.Payload) +} + +func (o *ChangeRegistrationDetailsOK) GetPayload() *models.ApplicationRegistrationUpsertResponse { + return o.Payload +} + +func (o *ChangeRegistrationDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ApplicationRegistrationUpsertResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewChangeRegistrationDetailsBadRequest creates a ChangeRegistrationDetailsBadRequest with default headers values +func NewChangeRegistrationDetailsBadRequest() *ChangeRegistrationDetailsBadRequest { + return &ChangeRegistrationDetailsBadRequest{} +} + +/* +ChangeRegistrationDetailsBadRequest describes a response with status code 400, with default header values. + +Invalid application +*/ +type ChangeRegistrationDetailsBadRequest struct { +} + +// IsSuccess returns true when this change registration details bad request response has a 2xx status code +func (o *ChangeRegistrationDetailsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change registration details bad request response has a 3xx status code +func (o *ChangeRegistrationDetailsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change registration details bad request response has a 4xx status code +func (o *ChangeRegistrationDetailsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this change registration details bad request response has a 5xx status code +func (o *ChangeRegistrationDetailsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this change registration details bad request response a status code equal to that given +func (o *ChangeRegistrationDetailsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the change registration details bad request response +func (o *ChangeRegistrationDetailsBadRequest) Code() int { + return 400 +} + +func (o *ChangeRegistrationDetailsBadRequest) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsBadRequest ", 400) +} + +func (o *ChangeRegistrationDetailsBadRequest) String() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsBadRequest ", 400) +} + +func (o *ChangeRegistrationDetailsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeRegistrationDetailsUnauthorized creates a ChangeRegistrationDetailsUnauthorized with default headers values +func NewChangeRegistrationDetailsUnauthorized() *ChangeRegistrationDetailsUnauthorized { + return &ChangeRegistrationDetailsUnauthorized{} +} + +/* +ChangeRegistrationDetailsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type ChangeRegistrationDetailsUnauthorized struct { +} + +// IsSuccess returns true when this change registration details unauthorized response has a 2xx status code +func (o *ChangeRegistrationDetailsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change registration details unauthorized response has a 3xx status code +func (o *ChangeRegistrationDetailsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change registration details unauthorized response has a 4xx status code +func (o *ChangeRegistrationDetailsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this change registration details unauthorized response has a 5xx status code +func (o *ChangeRegistrationDetailsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this change registration details unauthorized response a status code equal to that given +func (o *ChangeRegistrationDetailsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the change registration details unauthorized response +func (o *ChangeRegistrationDetailsUnauthorized) Code() int { + return 401 +} + +func (o *ChangeRegistrationDetailsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsUnauthorized ", 401) +} + +func (o *ChangeRegistrationDetailsUnauthorized) String() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsUnauthorized ", 401) +} + +func (o *ChangeRegistrationDetailsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeRegistrationDetailsNotFound creates a ChangeRegistrationDetailsNotFound with default headers values +func NewChangeRegistrationDetailsNotFound() *ChangeRegistrationDetailsNotFound { + return &ChangeRegistrationDetailsNotFound{} +} + +/* +ChangeRegistrationDetailsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ChangeRegistrationDetailsNotFound struct { +} + +// IsSuccess returns true when this change registration details not found response has a 2xx status code +func (o *ChangeRegistrationDetailsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change registration details not found response has a 3xx status code +func (o *ChangeRegistrationDetailsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change registration details not found response has a 4xx status code +func (o *ChangeRegistrationDetailsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this change registration details not found response has a 5xx status code +func (o *ChangeRegistrationDetailsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this change registration details not found response a status code equal to that given +func (o *ChangeRegistrationDetailsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the change registration details not found response +func (o *ChangeRegistrationDetailsNotFound) Code() int { + return 404 +} + +func (o *ChangeRegistrationDetailsNotFound) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsNotFound ", 404) +} + +func (o *ChangeRegistrationDetailsNotFound) String() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsNotFound ", 404) +} + +func (o *ChangeRegistrationDetailsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeRegistrationDetailsConflict creates a ChangeRegistrationDetailsConflict with default headers values +func NewChangeRegistrationDetailsConflict() *ChangeRegistrationDetailsConflict { + return &ChangeRegistrationDetailsConflict{} +} + +/* +ChangeRegistrationDetailsConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type ChangeRegistrationDetailsConflict struct { +} + +// IsSuccess returns true when this change registration details conflict response has a 2xx status code +func (o *ChangeRegistrationDetailsConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change registration details conflict response has a 3xx status code +func (o *ChangeRegistrationDetailsConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change registration details conflict response has a 4xx status code +func (o *ChangeRegistrationDetailsConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this change registration details conflict response has a 5xx status code +func (o *ChangeRegistrationDetailsConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this change registration details conflict response a status code equal to that given +func (o *ChangeRegistrationDetailsConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the change registration details conflict response +func (o *ChangeRegistrationDetailsConflict) Code() int { + return 409 +} + +func (o *ChangeRegistrationDetailsConflict) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsConflict ", 409) +} + +func (o *ChangeRegistrationDetailsConflict) String() string { + return fmt.Sprintf("[PUT /applications/{appName}][%d] changeRegistrationDetailsConflict ", 409) +} + +func (o *ChangeRegistrationDetailsConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/delete_application_parameters.go b/generated-client/client/application/delete_application_parameters.go new file mode 100644 index 0000000..5c68451 --- /dev/null +++ b/generated-client/client/application/delete_application_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteApplicationParams creates a new DeleteApplicationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteApplicationParams() *DeleteApplicationParams { + return &DeleteApplicationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteApplicationParamsWithTimeout creates a new DeleteApplicationParams object +// with the ability to set a timeout on a request. +func NewDeleteApplicationParamsWithTimeout(timeout time.Duration) *DeleteApplicationParams { + return &DeleteApplicationParams{ + timeout: timeout, + } +} + +// NewDeleteApplicationParamsWithContext creates a new DeleteApplicationParams object +// with the ability to set a context for a request. +func NewDeleteApplicationParamsWithContext(ctx context.Context) *DeleteApplicationParams { + return &DeleteApplicationParams{ + Context: ctx, + } +} + +// NewDeleteApplicationParamsWithHTTPClient creates a new DeleteApplicationParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteApplicationParamsWithHTTPClient(client *http.Client) *DeleteApplicationParams { + return &DeleteApplicationParams{ + HTTPClient: client, + } +} + +/* +DeleteApplicationParams contains all the parameters to send to the API endpoint + + for the delete application operation. + + Typically these are written to a http.Request. +*/ +type DeleteApplicationParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteApplicationParams) WithDefaults() *DeleteApplicationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteApplicationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete application params +func (o *DeleteApplicationParams) WithTimeout(timeout time.Duration) *DeleteApplicationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete application params +func (o *DeleteApplicationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete application params +func (o *DeleteApplicationParams) WithContext(ctx context.Context) *DeleteApplicationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete application params +func (o *DeleteApplicationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete application params +func (o *DeleteApplicationParams) WithHTTPClient(client *http.Client) *DeleteApplicationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete application params +func (o *DeleteApplicationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the delete application params +func (o *DeleteApplicationParams) WithImpersonateGroup(impersonateGroup []string) *DeleteApplicationParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the delete application params +func (o *DeleteApplicationParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the delete application params +func (o *DeleteApplicationParams) WithImpersonateUser(impersonateUser *string) *DeleteApplicationParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the delete application params +func (o *DeleteApplicationParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the delete application params +func (o *DeleteApplicationParams) WithAppName(appName string) *DeleteApplicationParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the delete application params +func (o *DeleteApplicationParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteApplicationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDeleteApplication binds the parameter Impersonate-Group +func (o *DeleteApplicationParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/delete_application_responses.go b/generated-client/client/application/delete_application_responses.go new file mode 100644 index 0000000..1aa16f5 --- /dev/null +++ b/generated-client/client/application/delete_application_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteApplicationReader is a Reader for the DeleteApplication structure. +type DeleteApplicationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteApplicationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteApplicationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteApplicationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteApplicationForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteApplicationNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /applications/{appName}] deleteApplication", response, response.Code()) + } +} + +// NewDeleteApplicationOK creates a DeleteApplicationOK with default headers values +func NewDeleteApplicationOK() *DeleteApplicationOK { + return &DeleteApplicationOK{} +} + +/* +DeleteApplicationOK describes a response with status code 200, with default header values. + +Application deleted ok +*/ +type DeleteApplicationOK struct { +} + +// IsSuccess returns true when this delete application o k response has a 2xx status code +func (o *DeleteApplicationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete application o k response has a 3xx status code +func (o *DeleteApplicationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete application o k response has a 4xx status code +func (o *DeleteApplicationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete application o k response has a 5xx status code +func (o *DeleteApplicationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete application o k response a status code equal to that given +func (o *DeleteApplicationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete application o k response +func (o *DeleteApplicationOK) Code() int { + return 200 +} + +func (o *DeleteApplicationOK) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationOK ", 200) +} + +func (o *DeleteApplicationOK) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationOK ", 200) +} + +func (o *DeleteApplicationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteApplicationUnauthorized creates a DeleteApplicationUnauthorized with default headers values +func NewDeleteApplicationUnauthorized() *DeleteApplicationUnauthorized { + return &DeleteApplicationUnauthorized{} +} + +/* +DeleteApplicationUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type DeleteApplicationUnauthorized struct { +} + +// IsSuccess returns true when this delete application unauthorized response has a 2xx status code +func (o *DeleteApplicationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete application unauthorized response has a 3xx status code +func (o *DeleteApplicationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete application unauthorized response has a 4xx status code +func (o *DeleteApplicationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete application unauthorized response has a 5xx status code +func (o *DeleteApplicationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this delete application unauthorized response a status code equal to that given +func (o *DeleteApplicationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the delete application unauthorized response +func (o *DeleteApplicationUnauthorized) Code() int { + return 401 +} + +func (o *DeleteApplicationUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationUnauthorized ", 401) +} + +func (o *DeleteApplicationUnauthorized) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationUnauthorized ", 401) +} + +func (o *DeleteApplicationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteApplicationForbidden creates a DeleteApplicationForbidden with default headers values +func NewDeleteApplicationForbidden() *DeleteApplicationForbidden { + return &DeleteApplicationForbidden{} +} + +/* +DeleteApplicationForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DeleteApplicationForbidden struct { +} + +// IsSuccess returns true when this delete application forbidden response has a 2xx status code +func (o *DeleteApplicationForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete application forbidden response has a 3xx status code +func (o *DeleteApplicationForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete application forbidden response has a 4xx status code +func (o *DeleteApplicationForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete application forbidden response has a 5xx status code +func (o *DeleteApplicationForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this delete application forbidden response a status code equal to that given +func (o *DeleteApplicationForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the delete application forbidden response +func (o *DeleteApplicationForbidden) Code() int { + return 403 +} + +func (o *DeleteApplicationForbidden) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationForbidden ", 403) +} + +func (o *DeleteApplicationForbidden) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationForbidden ", 403) +} + +func (o *DeleteApplicationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteApplicationNotFound creates a DeleteApplicationNotFound with default headers values +func NewDeleteApplicationNotFound() *DeleteApplicationNotFound { + return &DeleteApplicationNotFound{} +} + +/* +DeleteApplicationNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type DeleteApplicationNotFound struct { +} + +// IsSuccess returns true when this delete application not found response has a 2xx status code +func (o *DeleteApplicationNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete application not found response has a 3xx status code +func (o *DeleteApplicationNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete application not found response has a 4xx status code +func (o *DeleteApplicationNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete application not found response has a 5xx status code +func (o *DeleteApplicationNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete application not found response a status code equal to that given +func (o *DeleteApplicationNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete application not found response +func (o *DeleteApplicationNotFound) Code() int { + return 404 +} + +func (o *DeleteApplicationNotFound) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationNotFound ", 404) +} + +func (o *DeleteApplicationNotFound) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}][%d] deleteApplicationNotFound ", 404) +} + +func (o *DeleteApplicationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/disable_application_alerting_parameters.go b/generated-client/client/application/disable_application_alerting_parameters.go new file mode 100644 index 0000000..b75b13b --- /dev/null +++ b/generated-client/client/application/disable_application_alerting_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDisableApplicationAlertingParams creates a new DisableApplicationAlertingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDisableApplicationAlertingParams() *DisableApplicationAlertingParams { + return &DisableApplicationAlertingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDisableApplicationAlertingParamsWithTimeout creates a new DisableApplicationAlertingParams object +// with the ability to set a timeout on a request. +func NewDisableApplicationAlertingParamsWithTimeout(timeout time.Duration) *DisableApplicationAlertingParams { + return &DisableApplicationAlertingParams{ + timeout: timeout, + } +} + +// NewDisableApplicationAlertingParamsWithContext creates a new DisableApplicationAlertingParams object +// with the ability to set a context for a request. +func NewDisableApplicationAlertingParamsWithContext(ctx context.Context) *DisableApplicationAlertingParams { + return &DisableApplicationAlertingParams{ + Context: ctx, + } +} + +// NewDisableApplicationAlertingParamsWithHTTPClient creates a new DisableApplicationAlertingParams object +// with the ability to set a custom HTTPClient for a request. +func NewDisableApplicationAlertingParamsWithHTTPClient(client *http.Client) *DisableApplicationAlertingParams { + return &DisableApplicationAlertingParams{ + HTTPClient: client, + } +} + +/* +DisableApplicationAlertingParams contains all the parameters to send to the API endpoint + + for the disable application alerting operation. + + Typically these are written to a http.Request. +*/ +type DisableApplicationAlertingParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the disable application alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DisableApplicationAlertingParams) WithDefaults() *DisableApplicationAlertingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the disable application alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DisableApplicationAlertingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the disable application alerting params +func (o *DisableApplicationAlertingParams) WithTimeout(timeout time.Duration) *DisableApplicationAlertingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the disable application alerting params +func (o *DisableApplicationAlertingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the disable application alerting params +func (o *DisableApplicationAlertingParams) WithContext(ctx context.Context) *DisableApplicationAlertingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the disable application alerting params +func (o *DisableApplicationAlertingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the disable application alerting params +func (o *DisableApplicationAlertingParams) WithHTTPClient(client *http.Client) *DisableApplicationAlertingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the disable application alerting params +func (o *DisableApplicationAlertingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the disable application alerting params +func (o *DisableApplicationAlertingParams) WithImpersonateGroup(impersonateGroup []string) *DisableApplicationAlertingParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the disable application alerting params +func (o *DisableApplicationAlertingParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the disable application alerting params +func (o *DisableApplicationAlertingParams) WithImpersonateUser(impersonateUser *string) *DisableApplicationAlertingParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the disable application alerting params +func (o *DisableApplicationAlertingParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the disable application alerting params +func (o *DisableApplicationAlertingParams) WithAppName(appName string) *DisableApplicationAlertingParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the disable application alerting params +func (o *DisableApplicationAlertingParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *DisableApplicationAlertingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDisableApplicationAlerting binds the parameter Impersonate-Group +func (o *DisableApplicationAlertingParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/disable_application_alerting_responses.go b/generated-client/client/application/disable_application_alerting_responses.go new file mode 100644 index 0000000..a0d8949 --- /dev/null +++ b/generated-client/client/application/disable_application_alerting_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// DisableApplicationAlertingReader is a Reader for the DisableApplicationAlerting structure. +type DisableApplicationAlertingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DisableApplicationAlertingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDisableApplicationAlertingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDisableApplicationAlertingBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewDisableApplicationAlertingUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDisableApplicationAlertingForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDisableApplicationAlertingNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDisableApplicationAlertingInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/alerting/disable] disableApplicationAlerting", response, response.Code()) + } +} + +// NewDisableApplicationAlertingOK creates a DisableApplicationAlertingOK with default headers values +func NewDisableApplicationAlertingOK() *DisableApplicationAlertingOK { + return &DisableApplicationAlertingOK{} +} + +/* +DisableApplicationAlertingOK describes a response with status code 200, with default header values. + +Successful disable alerting +*/ +type DisableApplicationAlertingOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this disable application alerting o k response has a 2xx status code +func (o *DisableApplicationAlertingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this disable application alerting o k response has a 3xx status code +func (o *DisableApplicationAlertingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable application alerting o k response has a 4xx status code +func (o *DisableApplicationAlertingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this disable application alerting o k response has a 5xx status code +func (o *DisableApplicationAlertingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this disable application alerting o k response a status code equal to that given +func (o *DisableApplicationAlertingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the disable application alerting o k response +func (o *DisableApplicationAlertingOK) Code() int { + return 200 +} + +func (o *DisableApplicationAlertingOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingOK %+v", 200, o.Payload) +} + +func (o *DisableApplicationAlertingOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingOK %+v", 200, o.Payload) +} + +func (o *DisableApplicationAlertingOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *DisableApplicationAlertingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDisableApplicationAlertingBadRequest creates a DisableApplicationAlertingBadRequest with default headers values +func NewDisableApplicationAlertingBadRequest() *DisableApplicationAlertingBadRequest { + return &DisableApplicationAlertingBadRequest{} +} + +/* +DisableApplicationAlertingBadRequest describes a response with status code 400, with default header values. + +Alerting already enabled +*/ +type DisableApplicationAlertingBadRequest struct { +} + +// IsSuccess returns true when this disable application alerting bad request response has a 2xx status code +func (o *DisableApplicationAlertingBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable application alerting bad request response has a 3xx status code +func (o *DisableApplicationAlertingBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable application alerting bad request response has a 4xx status code +func (o *DisableApplicationAlertingBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable application alerting bad request response has a 5xx status code +func (o *DisableApplicationAlertingBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this disable application alerting bad request response a status code equal to that given +func (o *DisableApplicationAlertingBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the disable application alerting bad request response +func (o *DisableApplicationAlertingBadRequest) Code() int { + return 400 +} + +func (o *DisableApplicationAlertingBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingBadRequest ", 400) +} + +func (o *DisableApplicationAlertingBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingBadRequest ", 400) +} + +func (o *DisableApplicationAlertingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableApplicationAlertingUnauthorized creates a DisableApplicationAlertingUnauthorized with default headers values +func NewDisableApplicationAlertingUnauthorized() *DisableApplicationAlertingUnauthorized { + return &DisableApplicationAlertingUnauthorized{} +} + +/* +DisableApplicationAlertingUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type DisableApplicationAlertingUnauthorized struct { +} + +// IsSuccess returns true when this disable application alerting unauthorized response has a 2xx status code +func (o *DisableApplicationAlertingUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable application alerting unauthorized response has a 3xx status code +func (o *DisableApplicationAlertingUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable application alerting unauthorized response has a 4xx status code +func (o *DisableApplicationAlertingUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable application alerting unauthorized response has a 5xx status code +func (o *DisableApplicationAlertingUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this disable application alerting unauthorized response a status code equal to that given +func (o *DisableApplicationAlertingUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the disable application alerting unauthorized response +func (o *DisableApplicationAlertingUnauthorized) Code() int { + return 401 +} + +func (o *DisableApplicationAlertingUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingUnauthorized ", 401) +} + +func (o *DisableApplicationAlertingUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingUnauthorized ", 401) +} + +func (o *DisableApplicationAlertingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableApplicationAlertingForbidden creates a DisableApplicationAlertingForbidden with default headers values +func NewDisableApplicationAlertingForbidden() *DisableApplicationAlertingForbidden { + return &DisableApplicationAlertingForbidden{} +} + +/* +DisableApplicationAlertingForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DisableApplicationAlertingForbidden struct { +} + +// IsSuccess returns true when this disable application alerting forbidden response has a 2xx status code +func (o *DisableApplicationAlertingForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable application alerting forbidden response has a 3xx status code +func (o *DisableApplicationAlertingForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable application alerting forbidden response has a 4xx status code +func (o *DisableApplicationAlertingForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable application alerting forbidden response has a 5xx status code +func (o *DisableApplicationAlertingForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this disable application alerting forbidden response a status code equal to that given +func (o *DisableApplicationAlertingForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the disable application alerting forbidden response +func (o *DisableApplicationAlertingForbidden) Code() int { + return 403 +} + +func (o *DisableApplicationAlertingForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingForbidden ", 403) +} + +func (o *DisableApplicationAlertingForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingForbidden ", 403) +} + +func (o *DisableApplicationAlertingForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableApplicationAlertingNotFound creates a DisableApplicationAlertingNotFound with default headers values +func NewDisableApplicationAlertingNotFound() *DisableApplicationAlertingNotFound { + return &DisableApplicationAlertingNotFound{} +} + +/* +DisableApplicationAlertingNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type DisableApplicationAlertingNotFound struct { +} + +// IsSuccess returns true when this disable application alerting not found response has a 2xx status code +func (o *DisableApplicationAlertingNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable application alerting not found response has a 3xx status code +func (o *DisableApplicationAlertingNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable application alerting not found response has a 4xx status code +func (o *DisableApplicationAlertingNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable application alerting not found response has a 5xx status code +func (o *DisableApplicationAlertingNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this disable application alerting not found response a status code equal to that given +func (o *DisableApplicationAlertingNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the disable application alerting not found response +func (o *DisableApplicationAlertingNotFound) Code() int { + return 404 +} + +func (o *DisableApplicationAlertingNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingNotFound ", 404) +} + +func (o *DisableApplicationAlertingNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingNotFound ", 404) +} + +func (o *DisableApplicationAlertingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableApplicationAlertingInternalServerError creates a DisableApplicationAlertingInternalServerError with default headers values +func NewDisableApplicationAlertingInternalServerError() *DisableApplicationAlertingInternalServerError { + return &DisableApplicationAlertingInternalServerError{} +} + +/* +DisableApplicationAlertingInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type DisableApplicationAlertingInternalServerError struct { +} + +// IsSuccess returns true when this disable application alerting internal server error response has a 2xx status code +func (o *DisableApplicationAlertingInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable application alerting internal server error response has a 3xx status code +func (o *DisableApplicationAlertingInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable application alerting internal server error response has a 4xx status code +func (o *DisableApplicationAlertingInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this disable application alerting internal server error response has a 5xx status code +func (o *DisableApplicationAlertingInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this disable application alerting internal server error response a status code equal to that given +func (o *DisableApplicationAlertingInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the disable application alerting internal server error response +func (o *DisableApplicationAlertingInternalServerError) Code() int { + return 500 +} + +func (o *DisableApplicationAlertingInternalServerError) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingInternalServerError ", 500) +} + +func (o *DisableApplicationAlertingInternalServerError) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/disable][%d] disableApplicationAlertingInternalServerError ", 500) +} + +func (o *DisableApplicationAlertingInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/enable_application_alerting_parameters.go b/generated-client/client/application/enable_application_alerting_parameters.go new file mode 100644 index 0000000..c47b8d8 --- /dev/null +++ b/generated-client/client/application/enable_application_alerting_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewEnableApplicationAlertingParams creates a new EnableApplicationAlertingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewEnableApplicationAlertingParams() *EnableApplicationAlertingParams { + return &EnableApplicationAlertingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewEnableApplicationAlertingParamsWithTimeout creates a new EnableApplicationAlertingParams object +// with the ability to set a timeout on a request. +func NewEnableApplicationAlertingParamsWithTimeout(timeout time.Duration) *EnableApplicationAlertingParams { + return &EnableApplicationAlertingParams{ + timeout: timeout, + } +} + +// NewEnableApplicationAlertingParamsWithContext creates a new EnableApplicationAlertingParams object +// with the ability to set a context for a request. +func NewEnableApplicationAlertingParamsWithContext(ctx context.Context) *EnableApplicationAlertingParams { + return &EnableApplicationAlertingParams{ + Context: ctx, + } +} + +// NewEnableApplicationAlertingParamsWithHTTPClient creates a new EnableApplicationAlertingParams object +// with the ability to set a custom HTTPClient for a request. +func NewEnableApplicationAlertingParamsWithHTTPClient(client *http.Client) *EnableApplicationAlertingParams { + return &EnableApplicationAlertingParams{ + HTTPClient: client, + } +} + +/* +EnableApplicationAlertingParams contains all the parameters to send to the API endpoint + + for the enable application alerting operation. + + Typically these are written to a http.Request. +*/ +type EnableApplicationAlertingParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the enable application alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnableApplicationAlertingParams) WithDefaults() *EnableApplicationAlertingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enable application alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnableApplicationAlertingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the enable application alerting params +func (o *EnableApplicationAlertingParams) WithTimeout(timeout time.Duration) *EnableApplicationAlertingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the enable application alerting params +func (o *EnableApplicationAlertingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the enable application alerting params +func (o *EnableApplicationAlertingParams) WithContext(ctx context.Context) *EnableApplicationAlertingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the enable application alerting params +func (o *EnableApplicationAlertingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the enable application alerting params +func (o *EnableApplicationAlertingParams) WithHTTPClient(client *http.Client) *EnableApplicationAlertingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the enable application alerting params +func (o *EnableApplicationAlertingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the enable application alerting params +func (o *EnableApplicationAlertingParams) WithImpersonateGroup(impersonateGroup []string) *EnableApplicationAlertingParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the enable application alerting params +func (o *EnableApplicationAlertingParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the enable application alerting params +func (o *EnableApplicationAlertingParams) WithImpersonateUser(impersonateUser *string) *EnableApplicationAlertingParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the enable application alerting params +func (o *EnableApplicationAlertingParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the enable application alerting params +func (o *EnableApplicationAlertingParams) WithAppName(appName string) *EnableApplicationAlertingParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the enable application alerting params +func (o *EnableApplicationAlertingParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *EnableApplicationAlertingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamEnableApplicationAlerting binds the parameter Impersonate-Group +func (o *EnableApplicationAlertingParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/enable_application_alerting_responses.go b/generated-client/client/application/enable_application_alerting_responses.go new file mode 100644 index 0000000..dc553f1 --- /dev/null +++ b/generated-client/client/application/enable_application_alerting_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// EnableApplicationAlertingReader is a Reader for the EnableApplicationAlerting structure. +type EnableApplicationAlertingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EnableApplicationAlertingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewEnableApplicationAlertingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewEnableApplicationAlertingBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewEnableApplicationAlertingUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewEnableApplicationAlertingForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewEnableApplicationAlertingNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewEnableApplicationAlertingInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/alerting/enable] enableApplicationAlerting", response, response.Code()) + } +} + +// NewEnableApplicationAlertingOK creates a EnableApplicationAlertingOK with default headers values +func NewEnableApplicationAlertingOK() *EnableApplicationAlertingOK { + return &EnableApplicationAlertingOK{} +} + +/* +EnableApplicationAlertingOK describes a response with status code 200, with default header values. + +Successful enable alerting +*/ +type EnableApplicationAlertingOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this enable application alerting o k response has a 2xx status code +func (o *EnableApplicationAlertingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this enable application alerting o k response has a 3xx status code +func (o *EnableApplicationAlertingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable application alerting o k response has a 4xx status code +func (o *EnableApplicationAlertingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this enable application alerting o k response has a 5xx status code +func (o *EnableApplicationAlertingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this enable application alerting o k response a status code equal to that given +func (o *EnableApplicationAlertingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the enable application alerting o k response +func (o *EnableApplicationAlertingOK) Code() int { + return 200 +} + +func (o *EnableApplicationAlertingOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingOK %+v", 200, o.Payload) +} + +func (o *EnableApplicationAlertingOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingOK %+v", 200, o.Payload) +} + +func (o *EnableApplicationAlertingOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *EnableApplicationAlertingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewEnableApplicationAlertingBadRequest creates a EnableApplicationAlertingBadRequest with default headers values +func NewEnableApplicationAlertingBadRequest() *EnableApplicationAlertingBadRequest { + return &EnableApplicationAlertingBadRequest{} +} + +/* +EnableApplicationAlertingBadRequest describes a response with status code 400, with default header values. + +Alerting already enabled +*/ +type EnableApplicationAlertingBadRequest struct { +} + +// IsSuccess returns true when this enable application alerting bad request response has a 2xx status code +func (o *EnableApplicationAlertingBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable application alerting bad request response has a 3xx status code +func (o *EnableApplicationAlertingBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable application alerting bad request response has a 4xx status code +func (o *EnableApplicationAlertingBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable application alerting bad request response has a 5xx status code +func (o *EnableApplicationAlertingBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this enable application alerting bad request response a status code equal to that given +func (o *EnableApplicationAlertingBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the enable application alerting bad request response +func (o *EnableApplicationAlertingBadRequest) Code() int { + return 400 +} + +func (o *EnableApplicationAlertingBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingBadRequest ", 400) +} + +func (o *EnableApplicationAlertingBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingBadRequest ", 400) +} + +func (o *EnableApplicationAlertingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableApplicationAlertingUnauthorized creates a EnableApplicationAlertingUnauthorized with default headers values +func NewEnableApplicationAlertingUnauthorized() *EnableApplicationAlertingUnauthorized { + return &EnableApplicationAlertingUnauthorized{} +} + +/* +EnableApplicationAlertingUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type EnableApplicationAlertingUnauthorized struct { +} + +// IsSuccess returns true when this enable application alerting unauthorized response has a 2xx status code +func (o *EnableApplicationAlertingUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable application alerting unauthorized response has a 3xx status code +func (o *EnableApplicationAlertingUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable application alerting unauthorized response has a 4xx status code +func (o *EnableApplicationAlertingUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable application alerting unauthorized response has a 5xx status code +func (o *EnableApplicationAlertingUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this enable application alerting unauthorized response a status code equal to that given +func (o *EnableApplicationAlertingUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the enable application alerting unauthorized response +func (o *EnableApplicationAlertingUnauthorized) Code() int { + return 401 +} + +func (o *EnableApplicationAlertingUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingUnauthorized ", 401) +} + +func (o *EnableApplicationAlertingUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingUnauthorized ", 401) +} + +func (o *EnableApplicationAlertingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableApplicationAlertingForbidden creates a EnableApplicationAlertingForbidden with default headers values +func NewEnableApplicationAlertingForbidden() *EnableApplicationAlertingForbidden { + return &EnableApplicationAlertingForbidden{} +} + +/* +EnableApplicationAlertingForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type EnableApplicationAlertingForbidden struct { +} + +// IsSuccess returns true when this enable application alerting forbidden response has a 2xx status code +func (o *EnableApplicationAlertingForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable application alerting forbidden response has a 3xx status code +func (o *EnableApplicationAlertingForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable application alerting forbidden response has a 4xx status code +func (o *EnableApplicationAlertingForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable application alerting forbidden response has a 5xx status code +func (o *EnableApplicationAlertingForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this enable application alerting forbidden response a status code equal to that given +func (o *EnableApplicationAlertingForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the enable application alerting forbidden response +func (o *EnableApplicationAlertingForbidden) Code() int { + return 403 +} + +func (o *EnableApplicationAlertingForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingForbidden ", 403) +} + +func (o *EnableApplicationAlertingForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingForbidden ", 403) +} + +func (o *EnableApplicationAlertingForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableApplicationAlertingNotFound creates a EnableApplicationAlertingNotFound with default headers values +func NewEnableApplicationAlertingNotFound() *EnableApplicationAlertingNotFound { + return &EnableApplicationAlertingNotFound{} +} + +/* +EnableApplicationAlertingNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type EnableApplicationAlertingNotFound struct { +} + +// IsSuccess returns true when this enable application alerting not found response has a 2xx status code +func (o *EnableApplicationAlertingNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable application alerting not found response has a 3xx status code +func (o *EnableApplicationAlertingNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable application alerting not found response has a 4xx status code +func (o *EnableApplicationAlertingNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable application alerting not found response has a 5xx status code +func (o *EnableApplicationAlertingNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this enable application alerting not found response a status code equal to that given +func (o *EnableApplicationAlertingNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the enable application alerting not found response +func (o *EnableApplicationAlertingNotFound) Code() int { + return 404 +} + +func (o *EnableApplicationAlertingNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingNotFound ", 404) +} + +func (o *EnableApplicationAlertingNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingNotFound ", 404) +} + +func (o *EnableApplicationAlertingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableApplicationAlertingInternalServerError creates a EnableApplicationAlertingInternalServerError with default headers values +func NewEnableApplicationAlertingInternalServerError() *EnableApplicationAlertingInternalServerError { + return &EnableApplicationAlertingInternalServerError{} +} + +/* +EnableApplicationAlertingInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type EnableApplicationAlertingInternalServerError struct { +} + +// IsSuccess returns true when this enable application alerting internal server error response has a 2xx status code +func (o *EnableApplicationAlertingInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable application alerting internal server error response has a 3xx status code +func (o *EnableApplicationAlertingInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable application alerting internal server error response has a 4xx status code +func (o *EnableApplicationAlertingInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this enable application alerting internal server error response has a 5xx status code +func (o *EnableApplicationAlertingInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this enable application alerting internal server error response a status code equal to that given +func (o *EnableApplicationAlertingInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the enable application alerting internal server error response +func (o *EnableApplicationAlertingInternalServerError) Code() int { + return 500 +} + +func (o *EnableApplicationAlertingInternalServerError) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingInternalServerError ", 500) +} + +func (o *EnableApplicationAlertingInternalServerError) String() string { + return fmt.Sprintf("[POST /applications/{appName}/alerting/enable][%d] enableApplicationAlertingInternalServerError ", 500) +} + +func (o *EnableApplicationAlertingInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/get_application_alerting_config_parameters.go b/generated-client/client/application/get_application_alerting_config_parameters.go new file mode 100644 index 0000000..918cc7d --- /dev/null +++ b/generated-client/client/application/get_application_alerting_config_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetApplicationAlertingConfigParams creates a new GetApplicationAlertingConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetApplicationAlertingConfigParams() *GetApplicationAlertingConfigParams { + return &GetApplicationAlertingConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetApplicationAlertingConfigParamsWithTimeout creates a new GetApplicationAlertingConfigParams object +// with the ability to set a timeout on a request. +func NewGetApplicationAlertingConfigParamsWithTimeout(timeout time.Duration) *GetApplicationAlertingConfigParams { + return &GetApplicationAlertingConfigParams{ + timeout: timeout, + } +} + +// NewGetApplicationAlertingConfigParamsWithContext creates a new GetApplicationAlertingConfigParams object +// with the ability to set a context for a request. +func NewGetApplicationAlertingConfigParamsWithContext(ctx context.Context) *GetApplicationAlertingConfigParams { + return &GetApplicationAlertingConfigParams{ + Context: ctx, + } +} + +// NewGetApplicationAlertingConfigParamsWithHTTPClient creates a new GetApplicationAlertingConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetApplicationAlertingConfigParamsWithHTTPClient(client *http.Client) *GetApplicationAlertingConfigParams { + return &GetApplicationAlertingConfigParams{ + HTTPClient: client, + } +} + +/* +GetApplicationAlertingConfigParams contains all the parameters to send to the API endpoint + + for the get application alerting config operation. + + Typically these are written to a http.Request. +*/ +type GetApplicationAlertingConfigParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get application alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationAlertingConfigParams) WithDefaults() *GetApplicationAlertingConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get application alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationAlertingConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) WithTimeout(timeout time.Duration) *GetApplicationAlertingConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) WithContext(ctx context.Context) *GetApplicationAlertingConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) WithHTTPClient(client *http.Client) *GetApplicationAlertingConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) WithImpersonateGroup(impersonateGroup []string) *GetApplicationAlertingConfigParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) WithImpersonateUser(impersonateUser *string) *GetApplicationAlertingConfigParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) WithAppName(appName string) *GetApplicationAlertingConfigParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get application alerting config params +func (o *GetApplicationAlertingConfigParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetApplicationAlertingConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetApplicationAlertingConfig binds the parameter Impersonate-Group +func (o *GetApplicationAlertingConfigParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/get_application_alerting_config_responses.go b/generated-client/client/application/get_application_alerting_config_responses.go new file mode 100644 index 0000000..aea8f0a --- /dev/null +++ b/generated-client/client/application/get_application_alerting_config_responses.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetApplicationAlertingConfigReader is a Reader for the GetApplicationAlertingConfig structure. +type GetApplicationAlertingConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetApplicationAlertingConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetApplicationAlertingConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetApplicationAlertingConfigUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetApplicationAlertingConfigForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetApplicationAlertingConfigNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetApplicationAlertingConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/alerting] getApplicationAlertingConfig", response, response.Code()) + } +} + +// NewGetApplicationAlertingConfigOK creates a GetApplicationAlertingConfigOK with default headers values +func NewGetApplicationAlertingConfigOK() *GetApplicationAlertingConfigOK { + return &GetApplicationAlertingConfigOK{} +} + +/* +GetApplicationAlertingConfigOK describes a response with status code 200, with default header values. + +Successful get alerts config +*/ +type GetApplicationAlertingConfigOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this get application alerting config o k response has a 2xx status code +func (o *GetApplicationAlertingConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get application alerting config o k response has a 3xx status code +func (o *GetApplicationAlertingConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application alerting config o k response has a 4xx status code +func (o *GetApplicationAlertingConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get application alerting config o k response has a 5xx status code +func (o *GetApplicationAlertingConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get application alerting config o k response a status code equal to that given +func (o *GetApplicationAlertingConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get application alerting config o k response +func (o *GetApplicationAlertingConfigOK) Code() int { + return 200 +} + +func (o *GetApplicationAlertingConfigOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *GetApplicationAlertingConfigOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *GetApplicationAlertingConfigOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *GetApplicationAlertingConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetApplicationAlertingConfigUnauthorized creates a GetApplicationAlertingConfigUnauthorized with default headers values +func NewGetApplicationAlertingConfigUnauthorized() *GetApplicationAlertingConfigUnauthorized { + return &GetApplicationAlertingConfigUnauthorized{} +} + +/* +GetApplicationAlertingConfigUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetApplicationAlertingConfigUnauthorized struct { +} + +// IsSuccess returns true when this get application alerting config unauthorized response has a 2xx status code +func (o *GetApplicationAlertingConfigUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application alerting config unauthorized response has a 3xx status code +func (o *GetApplicationAlertingConfigUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application alerting config unauthorized response has a 4xx status code +func (o *GetApplicationAlertingConfigUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application alerting config unauthorized response has a 5xx status code +func (o *GetApplicationAlertingConfigUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get application alerting config unauthorized response a status code equal to that given +func (o *GetApplicationAlertingConfigUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get application alerting config unauthorized response +func (o *GetApplicationAlertingConfigUnauthorized) Code() int { + return 401 +} + +func (o *GetApplicationAlertingConfigUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigUnauthorized ", 401) +} + +func (o *GetApplicationAlertingConfigUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigUnauthorized ", 401) +} + +func (o *GetApplicationAlertingConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationAlertingConfigForbidden creates a GetApplicationAlertingConfigForbidden with default headers values +func NewGetApplicationAlertingConfigForbidden() *GetApplicationAlertingConfigForbidden { + return &GetApplicationAlertingConfigForbidden{} +} + +/* +GetApplicationAlertingConfigForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetApplicationAlertingConfigForbidden struct { +} + +// IsSuccess returns true when this get application alerting config forbidden response has a 2xx status code +func (o *GetApplicationAlertingConfigForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application alerting config forbidden response has a 3xx status code +func (o *GetApplicationAlertingConfigForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application alerting config forbidden response has a 4xx status code +func (o *GetApplicationAlertingConfigForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application alerting config forbidden response has a 5xx status code +func (o *GetApplicationAlertingConfigForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get application alerting config forbidden response a status code equal to that given +func (o *GetApplicationAlertingConfigForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get application alerting config forbidden response +func (o *GetApplicationAlertingConfigForbidden) Code() int { + return 403 +} + +func (o *GetApplicationAlertingConfigForbidden) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigForbidden ", 403) +} + +func (o *GetApplicationAlertingConfigForbidden) String() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigForbidden ", 403) +} + +func (o *GetApplicationAlertingConfigForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationAlertingConfigNotFound creates a GetApplicationAlertingConfigNotFound with default headers values +func NewGetApplicationAlertingConfigNotFound() *GetApplicationAlertingConfigNotFound { + return &GetApplicationAlertingConfigNotFound{} +} + +/* +GetApplicationAlertingConfigNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetApplicationAlertingConfigNotFound struct { +} + +// IsSuccess returns true when this get application alerting config not found response has a 2xx status code +func (o *GetApplicationAlertingConfigNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application alerting config not found response has a 3xx status code +func (o *GetApplicationAlertingConfigNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application alerting config not found response has a 4xx status code +func (o *GetApplicationAlertingConfigNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application alerting config not found response has a 5xx status code +func (o *GetApplicationAlertingConfigNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get application alerting config not found response a status code equal to that given +func (o *GetApplicationAlertingConfigNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get application alerting config not found response +func (o *GetApplicationAlertingConfigNotFound) Code() int { + return 404 +} + +func (o *GetApplicationAlertingConfigNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigNotFound ", 404) +} + +func (o *GetApplicationAlertingConfigNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigNotFound ", 404) +} + +func (o *GetApplicationAlertingConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationAlertingConfigInternalServerError creates a GetApplicationAlertingConfigInternalServerError with default headers values +func NewGetApplicationAlertingConfigInternalServerError() *GetApplicationAlertingConfigInternalServerError { + return &GetApplicationAlertingConfigInternalServerError{} +} + +/* +GetApplicationAlertingConfigInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetApplicationAlertingConfigInternalServerError struct { +} + +// IsSuccess returns true when this get application alerting config internal server error response has a 2xx status code +func (o *GetApplicationAlertingConfigInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application alerting config internal server error response has a 3xx status code +func (o *GetApplicationAlertingConfigInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application alerting config internal server error response has a 4xx status code +func (o *GetApplicationAlertingConfigInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get application alerting config internal server error response has a 5xx status code +func (o *GetApplicationAlertingConfigInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get application alerting config internal server error response a status code equal to that given +func (o *GetApplicationAlertingConfigInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get application alerting config internal server error response +func (o *GetApplicationAlertingConfigInternalServerError) Code() int { + return 500 +} + +func (o *GetApplicationAlertingConfigInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigInternalServerError ", 500) +} + +func (o *GetApplicationAlertingConfigInternalServerError) String() string { + return fmt.Sprintf("[GET /applications/{appName}/alerting][%d] getApplicationAlertingConfigInternalServerError ", 500) +} + +func (o *GetApplicationAlertingConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/get_application_parameters.go b/generated-client/client/application/get_application_parameters.go new file mode 100644 index 0000000..9f976b1 --- /dev/null +++ b/generated-client/client/application/get_application_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetApplicationParams creates a new GetApplicationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetApplicationParams() *GetApplicationParams { + return &GetApplicationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetApplicationParamsWithTimeout creates a new GetApplicationParams object +// with the ability to set a timeout on a request. +func NewGetApplicationParamsWithTimeout(timeout time.Duration) *GetApplicationParams { + return &GetApplicationParams{ + timeout: timeout, + } +} + +// NewGetApplicationParamsWithContext creates a new GetApplicationParams object +// with the ability to set a context for a request. +func NewGetApplicationParamsWithContext(ctx context.Context) *GetApplicationParams { + return &GetApplicationParams{ + Context: ctx, + } +} + +// NewGetApplicationParamsWithHTTPClient creates a new GetApplicationParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetApplicationParamsWithHTTPClient(client *http.Client) *GetApplicationParams { + return &GetApplicationParams{ + HTTPClient: client, + } +} + +/* +GetApplicationParams contains all the parameters to send to the API endpoint + + for the get application operation. + + Typically these are written to a http.Request. +*/ +type GetApplicationParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationParams) WithDefaults() *GetApplicationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get application params +func (o *GetApplicationParams) WithTimeout(timeout time.Duration) *GetApplicationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get application params +func (o *GetApplicationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get application params +func (o *GetApplicationParams) WithContext(ctx context.Context) *GetApplicationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get application params +func (o *GetApplicationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get application params +func (o *GetApplicationParams) WithHTTPClient(client *http.Client) *GetApplicationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get application params +func (o *GetApplicationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get application params +func (o *GetApplicationParams) WithImpersonateGroup(impersonateGroup []string) *GetApplicationParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get application params +func (o *GetApplicationParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get application params +func (o *GetApplicationParams) WithImpersonateUser(impersonateUser *string) *GetApplicationParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get application params +func (o *GetApplicationParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get application params +func (o *GetApplicationParams) WithAppName(appName string) *GetApplicationParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get application params +func (o *GetApplicationParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetApplicationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetApplication binds the parameter Impersonate-Group +func (o *GetApplicationParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/get_application_responses.go b/generated-client/client/application/get_application_responses.go new file mode 100644 index 0000000..6fa1bf7 --- /dev/null +++ b/generated-client/client/application/get_application_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetApplicationReader is a Reader for the GetApplication structure. +type GetApplicationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetApplicationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetApplicationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetApplicationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetApplicationForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetApplicationNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewGetApplicationConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetApplicationInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}] getApplication", response, response.Code()) + } +} + +// NewGetApplicationOK creates a GetApplicationOK with default headers values +func NewGetApplicationOK() *GetApplicationOK { + return &GetApplicationOK{} +} + +/* +GetApplicationOK describes a response with status code 200, with default header values. + +Successful get application +*/ +type GetApplicationOK struct { + Payload *models.Application +} + +// IsSuccess returns true when this get application o k response has a 2xx status code +func (o *GetApplicationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get application o k response has a 3xx status code +func (o *GetApplicationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application o k response has a 4xx status code +func (o *GetApplicationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get application o k response has a 5xx status code +func (o *GetApplicationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get application o k response a status code equal to that given +func (o *GetApplicationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get application o k response +func (o *GetApplicationOK) Code() int { + return 200 +} + +func (o *GetApplicationOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationOK %+v", 200, o.Payload) +} + +func (o *GetApplicationOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationOK %+v", 200, o.Payload) +} + +func (o *GetApplicationOK) GetPayload() *models.Application { + return o.Payload +} + +func (o *GetApplicationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Application) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetApplicationUnauthorized creates a GetApplicationUnauthorized with default headers values +func NewGetApplicationUnauthorized() *GetApplicationUnauthorized { + return &GetApplicationUnauthorized{} +} + +/* +GetApplicationUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetApplicationUnauthorized struct { +} + +// IsSuccess returns true when this get application unauthorized response has a 2xx status code +func (o *GetApplicationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application unauthorized response has a 3xx status code +func (o *GetApplicationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application unauthorized response has a 4xx status code +func (o *GetApplicationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application unauthorized response has a 5xx status code +func (o *GetApplicationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get application unauthorized response a status code equal to that given +func (o *GetApplicationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get application unauthorized response +func (o *GetApplicationUnauthorized) Code() int { + return 401 +} + +func (o *GetApplicationUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationUnauthorized ", 401) +} + +func (o *GetApplicationUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationUnauthorized ", 401) +} + +func (o *GetApplicationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationForbidden creates a GetApplicationForbidden with default headers values +func NewGetApplicationForbidden() *GetApplicationForbidden { + return &GetApplicationForbidden{} +} + +/* +GetApplicationForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetApplicationForbidden struct { +} + +// IsSuccess returns true when this get application forbidden response has a 2xx status code +func (o *GetApplicationForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application forbidden response has a 3xx status code +func (o *GetApplicationForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application forbidden response has a 4xx status code +func (o *GetApplicationForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application forbidden response has a 5xx status code +func (o *GetApplicationForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get application forbidden response a status code equal to that given +func (o *GetApplicationForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get application forbidden response +func (o *GetApplicationForbidden) Code() int { + return 403 +} + +func (o *GetApplicationForbidden) Error() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationForbidden ", 403) +} + +func (o *GetApplicationForbidden) String() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationForbidden ", 403) +} + +func (o *GetApplicationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationNotFound creates a GetApplicationNotFound with default headers values +func NewGetApplicationNotFound() *GetApplicationNotFound { + return &GetApplicationNotFound{} +} + +/* +GetApplicationNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetApplicationNotFound struct { +} + +// IsSuccess returns true when this get application not found response has a 2xx status code +func (o *GetApplicationNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application not found response has a 3xx status code +func (o *GetApplicationNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application not found response has a 4xx status code +func (o *GetApplicationNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application not found response has a 5xx status code +func (o *GetApplicationNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get application not found response a status code equal to that given +func (o *GetApplicationNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get application not found response +func (o *GetApplicationNotFound) Code() int { + return 404 +} + +func (o *GetApplicationNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationNotFound ", 404) +} + +func (o *GetApplicationNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationNotFound ", 404) +} + +func (o *GetApplicationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationConflict creates a GetApplicationConflict with default headers values +func NewGetApplicationConflict() *GetApplicationConflict { + return &GetApplicationConflict{} +} + +/* +GetApplicationConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type GetApplicationConflict struct { +} + +// IsSuccess returns true when this get application conflict response has a 2xx status code +func (o *GetApplicationConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application conflict response has a 3xx status code +func (o *GetApplicationConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application conflict response has a 4xx status code +func (o *GetApplicationConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application conflict response has a 5xx status code +func (o *GetApplicationConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this get application conflict response a status code equal to that given +func (o *GetApplicationConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the get application conflict response +func (o *GetApplicationConflict) Code() int { + return 409 +} + +func (o *GetApplicationConflict) Error() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationConflict ", 409) +} + +func (o *GetApplicationConflict) String() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationConflict ", 409) +} + +func (o *GetApplicationConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationInternalServerError creates a GetApplicationInternalServerError with default headers values +func NewGetApplicationInternalServerError() *GetApplicationInternalServerError { + return &GetApplicationInternalServerError{} +} + +/* +GetApplicationInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetApplicationInternalServerError struct { +} + +// IsSuccess returns true when this get application internal server error response has a 2xx status code +func (o *GetApplicationInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application internal server error response has a 3xx status code +func (o *GetApplicationInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application internal server error response has a 4xx status code +func (o *GetApplicationInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get application internal server error response has a 5xx status code +func (o *GetApplicationInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get application internal server error response a status code equal to that given +func (o *GetApplicationInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get application internal server error response +func (o *GetApplicationInternalServerError) Code() int { + return 500 +} + +func (o *GetApplicationInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationInternalServerError ", 500) +} + +func (o *GetApplicationInternalServerError) String() string { + return fmt.Sprintf("[GET /applications/{appName}][%d] getApplicationInternalServerError ", 500) +} + +func (o *GetApplicationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/get_build_secrets_parameters.go b/generated-client/client/application/get_build_secrets_parameters.go new file mode 100644 index 0000000..4a64753 --- /dev/null +++ b/generated-client/client/application/get_build_secrets_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetBuildSecretsParams creates a new GetBuildSecretsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBuildSecretsParams() *GetBuildSecretsParams { + return &GetBuildSecretsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBuildSecretsParamsWithTimeout creates a new GetBuildSecretsParams object +// with the ability to set a timeout on a request. +func NewGetBuildSecretsParamsWithTimeout(timeout time.Duration) *GetBuildSecretsParams { + return &GetBuildSecretsParams{ + timeout: timeout, + } +} + +// NewGetBuildSecretsParamsWithContext creates a new GetBuildSecretsParams object +// with the ability to set a context for a request. +func NewGetBuildSecretsParamsWithContext(ctx context.Context) *GetBuildSecretsParams { + return &GetBuildSecretsParams{ + Context: ctx, + } +} + +// NewGetBuildSecretsParamsWithHTTPClient creates a new GetBuildSecretsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBuildSecretsParamsWithHTTPClient(client *http.Client) *GetBuildSecretsParams { + return &GetBuildSecretsParams{ + HTTPClient: client, + } +} + +/* +GetBuildSecretsParams contains all the parameters to send to the API endpoint + + for the get build secrets operation. + + Typically these are written to a http.Request. +*/ +type GetBuildSecretsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get build secrets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBuildSecretsParams) WithDefaults() *GetBuildSecretsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get build secrets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBuildSecretsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get build secrets params +func (o *GetBuildSecretsParams) WithTimeout(timeout time.Duration) *GetBuildSecretsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get build secrets params +func (o *GetBuildSecretsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get build secrets params +func (o *GetBuildSecretsParams) WithContext(ctx context.Context) *GetBuildSecretsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get build secrets params +func (o *GetBuildSecretsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get build secrets params +func (o *GetBuildSecretsParams) WithHTTPClient(client *http.Client) *GetBuildSecretsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get build secrets params +func (o *GetBuildSecretsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get build secrets params +func (o *GetBuildSecretsParams) WithImpersonateGroup(impersonateGroup []string) *GetBuildSecretsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get build secrets params +func (o *GetBuildSecretsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get build secrets params +func (o *GetBuildSecretsParams) WithImpersonateUser(impersonateUser *string) *GetBuildSecretsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get build secrets params +func (o *GetBuildSecretsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get build secrets params +func (o *GetBuildSecretsParams) WithAppName(appName string) *GetBuildSecretsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get build secrets params +func (o *GetBuildSecretsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBuildSecretsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetBuildSecrets binds the parameter Impersonate-Group +func (o *GetBuildSecretsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/get_build_secrets_responses.go b/generated-client/client/application/get_build_secrets_responses.go new file mode 100644 index 0000000..2ed1ed8 --- /dev/null +++ b/generated-client/client/application/get_build_secrets_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetBuildSecretsReader is a Reader for the GetBuildSecrets structure. +type GetBuildSecretsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBuildSecretsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBuildSecretsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetBuildSecretsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetBuildSecretsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/buildsecrets] getBuildSecrets", response, response.Code()) + } +} + +// NewGetBuildSecretsOK creates a GetBuildSecretsOK with default headers values +func NewGetBuildSecretsOK() *GetBuildSecretsOK { + return &GetBuildSecretsOK{} +} + +/* +GetBuildSecretsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetBuildSecretsOK struct { + Payload []*models.BuildSecret +} + +// IsSuccess returns true when this get build secrets o k response has a 2xx status code +func (o *GetBuildSecretsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get build secrets o k response has a 3xx status code +func (o *GetBuildSecretsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get build secrets o k response has a 4xx status code +func (o *GetBuildSecretsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get build secrets o k response has a 5xx status code +func (o *GetBuildSecretsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get build secrets o k response a status code equal to that given +func (o *GetBuildSecretsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get build secrets o k response +func (o *GetBuildSecretsOK) Code() int { + return 200 +} + +func (o *GetBuildSecretsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/buildsecrets][%d] getBuildSecretsOK %+v", 200, o.Payload) +} + +func (o *GetBuildSecretsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/buildsecrets][%d] getBuildSecretsOK %+v", 200, o.Payload) +} + +func (o *GetBuildSecretsOK) GetPayload() []*models.BuildSecret { + return o.Payload +} + +func (o *GetBuildSecretsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBuildSecretsUnauthorized creates a GetBuildSecretsUnauthorized with default headers values +func NewGetBuildSecretsUnauthorized() *GetBuildSecretsUnauthorized { + return &GetBuildSecretsUnauthorized{} +} + +/* +GetBuildSecretsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetBuildSecretsUnauthorized struct { +} + +// IsSuccess returns true when this get build secrets unauthorized response has a 2xx status code +func (o *GetBuildSecretsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get build secrets unauthorized response has a 3xx status code +func (o *GetBuildSecretsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get build secrets unauthorized response has a 4xx status code +func (o *GetBuildSecretsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get build secrets unauthorized response has a 5xx status code +func (o *GetBuildSecretsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get build secrets unauthorized response a status code equal to that given +func (o *GetBuildSecretsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get build secrets unauthorized response +func (o *GetBuildSecretsUnauthorized) Code() int { + return 401 +} + +func (o *GetBuildSecretsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/buildsecrets][%d] getBuildSecretsUnauthorized ", 401) +} + +func (o *GetBuildSecretsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/buildsecrets][%d] getBuildSecretsUnauthorized ", 401) +} + +func (o *GetBuildSecretsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetBuildSecretsNotFound creates a GetBuildSecretsNotFound with default headers values +func NewGetBuildSecretsNotFound() *GetBuildSecretsNotFound { + return &GetBuildSecretsNotFound{} +} + +/* +GetBuildSecretsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetBuildSecretsNotFound struct { +} + +// IsSuccess returns true when this get build secrets not found response has a 2xx status code +func (o *GetBuildSecretsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get build secrets not found response has a 3xx status code +func (o *GetBuildSecretsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get build secrets not found response has a 4xx status code +func (o *GetBuildSecretsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get build secrets not found response has a 5xx status code +func (o *GetBuildSecretsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get build secrets not found response a status code equal to that given +func (o *GetBuildSecretsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get build secrets not found response +func (o *GetBuildSecretsNotFound) Code() int { + return 404 +} + +func (o *GetBuildSecretsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/buildsecrets][%d] getBuildSecretsNotFound ", 404) +} + +func (o *GetBuildSecretsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/buildsecrets][%d] getBuildSecretsNotFound ", 404) +} + +func (o *GetBuildSecretsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/get_deploy_key_and_secret_parameters.go b/generated-client/client/application/get_deploy_key_and_secret_parameters.go new file mode 100644 index 0000000..6e14645 --- /dev/null +++ b/generated-client/client/application/get_deploy_key_and_secret_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDeployKeyAndSecretParams creates a new GetDeployKeyAndSecretParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDeployKeyAndSecretParams() *GetDeployKeyAndSecretParams { + return &GetDeployKeyAndSecretParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDeployKeyAndSecretParamsWithTimeout creates a new GetDeployKeyAndSecretParams object +// with the ability to set a timeout on a request. +func NewGetDeployKeyAndSecretParamsWithTimeout(timeout time.Duration) *GetDeployKeyAndSecretParams { + return &GetDeployKeyAndSecretParams{ + timeout: timeout, + } +} + +// NewGetDeployKeyAndSecretParamsWithContext creates a new GetDeployKeyAndSecretParams object +// with the ability to set a context for a request. +func NewGetDeployKeyAndSecretParamsWithContext(ctx context.Context) *GetDeployKeyAndSecretParams { + return &GetDeployKeyAndSecretParams{ + Context: ctx, + } +} + +// NewGetDeployKeyAndSecretParamsWithHTTPClient creates a new GetDeployKeyAndSecretParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDeployKeyAndSecretParamsWithHTTPClient(client *http.Client) *GetDeployKeyAndSecretParams { + return &GetDeployKeyAndSecretParams{ + HTTPClient: client, + } +} + +/* +GetDeployKeyAndSecretParams contains all the parameters to send to the API endpoint + + for the get deploy key and secret operation. + + Typically these are written to a http.Request. +*/ +type GetDeployKeyAndSecretParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get deploy key and secret params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeployKeyAndSecretParams) WithDefaults() *GetDeployKeyAndSecretParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deploy key and secret params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeployKeyAndSecretParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) WithTimeout(timeout time.Duration) *GetDeployKeyAndSecretParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) WithContext(ctx context.Context) *GetDeployKeyAndSecretParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) WithHTTPClient(client *http.Client) *GetDeployKeyAndSecretParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) WithImpersonateGroup(impersonateGroup []string) *GetDeployKeyAndSecretParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) WithImpersonateUser(impersonateUser *string) *GetDeployKeyAndSecretParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) WithAppName(appName string) *GetDeployKeyAndSecretParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get deploy key and secret params +func (o *GetDeployKeyAndSecretParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDeployKeyAndSecretParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetDeployKeyAndSecret binds the parameter Impersonate-Group +func (o *GetDeployKeyAndSecretParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/get_deploy_key_and_secret_responses.go b/generated-client/client/application/get_deploy_key_and_secret_responses.go new file mode 100644 index 0000000..2558a02 --- /dev/null +++ b/generated-client/client/application/get_deploy_key_and_secret_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetDeployKeyAndSecretReader is a Reader for the GetDeployKeyAndSecret structure. +type GetDeployKeyAndSecretReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDeployKeyAndSecretReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDeployKeyAndSecretOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDeployKeyAndSecretUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDeployKeyAndSecretNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/deploy-key-and-secret] getDeployKeyAndSecret", response, response.Code()) + } +} + +// NewGetDeployKeyAndSecretOK creates a GetDeployKeyAndSecretOK with default headers values +func NewGetDeployKeyAndSecretOK() *GetDeployKeyAndSecretOK { + return &GetDeployKeyAndSecretOK{} +} + +/* +GetDeployKeyAndSecretOK describes a response with status code 200, with default header values. + +Successful get deploy key and secret +*/ +type GetDeployKeyAndSecretOK struct { + Payload *models.DeployKeyAndSecret +} + +// IsSuccess returns true when this get deploy key and secret o k response has a 2xx status code +func (o *GetDeployKeyAndSecretOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get deploy key and secret o k response has a 3xx status code +func (o *GetDeployKeyAndSecretOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deploy key and secret o k response has a 4xx status code +func (o *GetDeployKeyAndSecretOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get deploy key and secret o k response has a 5xx status code +func (o *GetDeployKeyAndSecretOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get deploy key and secret o k response a status code equal to that given +func (o *GetDeployKeyAndSecretOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get deploy key and secret o k response +func (o *GetDeployKeyAndSecretOK) Code() int { + return 200 +} + +func (o *GetDeployKeyAndSecretOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploy-key-and-secret][%d] getDeployKeyAndSecretOK %+v", 200, o.Payload) +} + +func (o *GetDeployKeyAndSecretOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploy-key-and-secret][%d] getDeployKeyAndSecretOK %+v", 200, o.Payload) +} + +func (o *GetDeployKeyAndSecretOK) GetPayload() *models.DeployKeyAndSecret { + return o.Payload +} + +func (o *GetDeployKeyAndSecretOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeployKeyAndSecret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDeployKeyAndSecretUnauthorized creates a GetDeployKeyAndSecretUnauthorized with default headers values +func NewGetDeployKeyAndSecretUnauthorized() *GetDeployKeyAndSecretUnauthorized { + return &GetDeployKeyAndSecretUnauthorized{} +} + +/* +GetDeployKeyAndSecretUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetDeployKeyAndSecretUnauthorized struct { +} + +// IsSuccess returns true when this get deploy key and secret unauthorized response has a 2xx status code +func (o *GetDeployKeyAndSecretUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deploy key and secret unauthorized response has a 3xx status code +func (o *GetDeployKeyAndSecretUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deploy key and secret unauthorized response has a 4xx status code +func (o *GetDeployKeyAndSecretUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get deploy key and secret unauthorized response has a 5xx status code +func (o *GetDeployKeyAndSecretUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get deploy key and secret unauthorized response a status code equal to that given +func (o *GetDeployKeyAndSecretUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get deploy key and secret unauthorized response +func (o *GetDeployKeyAndSecretUnauthorized) Code() int { + return 401 +} + +func (o *GetDeployKeyAndSecretUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploy-key-and-secret][%d] getDeployKeyAndSecretUnauthorized ", 401) +} + +func (o *GetDeployKeyAndSecretUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploy-key-and-secret][%d] getDeployKeyAndSecretUnauthorized ", 401) +} + +func (o *GetDeployKeyAndSecretUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetDeployKeyAndSecretNotFound creates a GetDeployKeyAndSecretNotFound with default headers values +func NewGetDeployKeyAndSecretNotFound() *GetDeployKeyAndSecretNotFound { + return &GetDeployKeyAndSecretNotFound{} +} + +/* +GetDeployKeyAndSecretNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetDeployKeyAndSecretNotFound struct { +} + +// IsSuccess returns true when this get deploy key and secret not found response has a 2xx status code +func (o *GetDeployKeyAndSecretNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deploy key and secret not found response has a 3xx status code +func (o *GetDeployKeyAndSecretNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deploy key and secret not found response has a 4xx status code +func (o *GetDeployKeyAndSecretNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get deploy key and secret not found response has a 5xx status code +func (o *GetDeployKeyAndSecretNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get deploy key and secret not found response a status code equal to that given +func (o *GetDeployKeyAndSecretNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get deploy key and secret not found response +func (o *GetDeployKeyAndSecretNotFound) Code() int { + return 404 +} + +func (o *GetDeployKeyAndSecretNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploy-key-and-secret][%d] getDeployKeyAndSecretNotFound ", 404) +} + +func (o *GetDeployKeyAndSecretNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploy-key-and-secret][%d] getDeployKeyAndSecretNotFound ", 404) +} + +func (o *GetDeployKeyAndSecretNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/get_deployments_parameters.go b/generated-client/client/application/get_deployments_parameters.go new file mode 100644 index 0000000..caefb61 --- /dev/null +++ b/generated-client/client/application/get_deployments_parameters.go @@ -0,0 +1,292 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDeploymentsParams creates a new GetDeploymentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDeploymentsParams() *GetDeploymentsParams { + return &GetDeploymentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDeploymentsParamsWithTimeout creates a new GetDeploymentsParams object +// with the ability to set a timeout on a request. +func NewGetDeploymentsParamsWithTimeout(timeout time.Duration) *GetDeploymentsParams { + return &GetDeploymentsParams{ + timeout: timeout, + } +} + +// NewGetDeploymentsParamsWithContext creates a new GetDeploymentsParams object +// with the ability to set a context for a request. +func NewGetDeploymentsParamsWithContext(ctx context.Context) *GetDeploymentsParams { + return &GetDeploymentsParams{ + Context: ctx, + } +} + +// NewGetDeploymentsParamsWithHTTPClient creates a new GetDeploymentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDeploymentsParamsWithHTTPClient(client *http.Client) *GetDeploymentsParams { + return &GetDeploymentsParams{ + HTTPClient: client, + } +} + +/* +GetDeploymentsParams contains all the parameters to send to the API endpoint + + for the get deployments operation. + + Typically these are written to a http.Request. +*/ +type GetDeploymentsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* Environment. + + environment of Radix application + */ + Environment *string + + /* Latest. + + indicator to allow only listing latest + */ + Latest *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsParams) WithDefaults() *GetDeploymentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get deployments params +func (o *GetDeploymentsParams) WithTimeout(timeout time.Duration) *GetDeploymentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get deployments params +func (o *GetDeploymentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get deployments params +func (o *GetDeploymentsParams) WithContext(ctx context.Context) *GetDeploymentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get deployments params +func (o *GetDeploymentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get deployments params +func (o *GetDeploymentsParams) WithHTTPClient(client *http.Client) *GetDeploymentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get deployments params +func (o *GetDeploymentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get deployments params +func (o *GetDeploymentsParams) WithImpersonateGroup(impersonateGroup []string) *GetDeploymentsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get deployments params +func (o *GetDeploymentsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get deployments params +func (o *GetDeploymentsParams) WithImpersonateUser(impersonateUser *string) *GetDeploymentsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get deployments params +func (o *GetDeploymentsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get deployments params +func (o *GetDeploymentsParams) WithAppName(appName string) *GetDeploymentsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get deployments params +func (o *GetDeploymentsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvironment adds the environment to the get deployments params +func (o *GetDeploymentsParams) WithEnvironment(environment *string) *GetDeploymentsParams { + o.SetEnvironment(environment) + return o +} + +// SetEnvironment adds the environment to the get deployments params +func (o *GetDeploymentsParams) SetEnvironment(environment *string) { + o.Environment = environment +} + +// WithLatest adds the latest to the get deployments params +func (o *GetDeploymentsParams) WithLatest(latest *bool) *GetDeploymentsParams { + o.SetLatest(latest) + return o +} + +// SetLatest adds the latest to the get deployments params +func (o *GetDeploymentsParams) SetLatest(latest *bool) { + o.Latest = latest +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDeploymentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if o.Environment != nil { + + // query param environment + var qrEnvironment string + + if o.Environment != nil { + qrEnvironment = *o.Environment + } + qEnvironment := qrEnvironment + if qEnvironment != "" { + + if err := r.SetQueryParam("environment", qEnvironment); err != nil { + return err + } + } + } + + if o.Latest != nil { + + // query param latest + var qrLatest bool + + if o.Latest != nil { + qrLatest = *o.Latest + } + qLatest := swag.FormatBool(qrLatest) + if qLatest != "" { + + if err := r.SetQueryParam("latest", qLatest); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetDeployments binds the parameter Impersonate-Group +func (o *GetDeploymentsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/get_deployments_responses.go b/generated-client/client/application/get_deployments_responses.go new file mode 100644 index 0000000..4aef7cd --- /dev/null +++ b/generated-client/client/application/get_deployments_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetDeploymentsReader is a Reader for the GetDeployments structure. +type GetDeploymentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDeploymentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDeploymentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDeploymentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDeploymentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/deployments] getDeployments", response, response.Code()) + } +} + +// NewGetDeploymentsOK creates a GetDeploymentsOK with default headers values +func NewGetDeploymentsOK() *GetDeploymentsOK { + return &GetDeploymentsOK{} +} + +/* +GetDeploymentsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetDeploymentsOK struct { + Payload []*models.DeploymentSummary +} + +// IsSuccess returns true when this get deployments o k response has a 2xx status code +func (o *GetDeploymentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get deployments o k response has a 3xx status code +func (o *GetDeploymentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployments o k response has a 4xx status code +func (o *GetDeploymentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get deployments o k response has a 5xx status code +func (o *GetDeploymentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployments o k response a status code equal to that given +func (o *GetDeploymentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get deployments o k response +func (o *GetDeploymentsOK) Code() int { + return 200 +} + +func (o *GetDeploymentsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments][%d] getDeploymentsOK %+v", 200, o.Payload) +} + +func (o *GetDeploymentsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments][%d] getDeploymentsOK %+v", 200, o.Payload) +} + +func (o *GetDeploymentsOK) GetPayload() []*models.DeploymentSummary { + return o.Payload +} + +func (o *GetDeploymentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDeploymentsUnauthorized creates a GetDeploymentsUnauthorized with default headers values +func NewGetDeploymentsUnauthorized() *GetDeploymentsUnauthorized { + return &GetDeploymentsUnauthorized{} +} + +/* +GetDeploymentsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetDeploymentsUnauthorized struct { +} + +// IsSuccess returns true when this get deployments unauthorized response has a 2xx status code +func (o *GetDeploymentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deployments unauthorized response has a 3xx status code +func (o *GetDeploymentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployments unauthorized response has a 4xx status code +func (o *GetDeploymentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get deployments unauthorized response has a 5xx status code +func (o *GetDeploymentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployments unauthorized response a status code equal to that given +func (o *GetDeploymentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get deployments unauthorized response +func (o *GetDeploymentsUnauthorized) Code() int { + return 401 +} + +func (o *GetDeploymentsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments][%d] getDeploymentsUnauthorized ", 401) +} + +func (o *GetDeploymentsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments][%d] getDeploymentsUnauthorized ", 401) +} + +func (o *GetDeploymentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetDeploymentsNotFound creates a GetDeploymentsNotFound with default headers values +func NewGetDeploymentsNotFound() *GetDeploymentsNotFound { + return &GetDeploymentsNotFound{} +} + +/* +GetDeploymentsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetDeploymentsNotFound struct { +} + +// IsSuccess returns true when this get deployments not found response has a 2xx status code +func (o *GetDeploymentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deployments not found response has a 3xx status code +func (o *GetDeploymentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployments not found response has a 4xx status code +func (o *GetDeploymentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get deployments not found response has a 5xx status code +func (o *GetDeploymentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployments not found response a status code equal to that given +func (o *GetDeploymentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get deployments not found response +func (o *GetDeploymentsNotFound) Code() int { + return 404 +} + +func (o *GetDeploymentsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments][%d] getDeploymentsNotFound ", 404) +} + +func (o *GetDeploymentsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments][%d] getDeploymentsNotFound ", 404) +} + +func (o *GetDeploymentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/get_private_image_hubs_parameters.go b/generated-client/client/application/get_private_image_hubs_parameters.go new file mode 100644 index 0000000..f9f5517 --- /dev/null +++ b/generated-client/client/application/get_private_image_hubs_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetPrivateImageHubsParams creates a new GetPrivateImageHubsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPrivateImageHubsParams() *GetPrivateImageHubsParams { + return &GetPrivateImageHubsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPrivateImageHubsParamsWithTimeout creates a new GetPrivateImageHubsParams object +// with the ability to set a timeout on a request. +func NewGetPrivateImageHubsParamsWithTimeout(timeout time.Duration) *GetPrivateImageHubsParams { + return &GetPrivateImageHubsParams{ + timeout: timeout, + } +} + +// NewGetPrivateImageHubsParamsWithContext creates a new GetPrivateImageHubsParams object +// with the ability to set a context for a request. +func NewGetPrivateImageHubsParamsWithContext(ctx context.Context) *GetPrivateImageHubsParams { + return &GetPrivateImageHubsParams{ + Context: ctx, + } +} + +// NewGetPrivateImageHubsParamsWithHTTPClient creates a new GetPrivateImageHubsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPrivateImageHubsParamsWithHTTPClient(client *http.Client) *GetPrivateImageHubsParams { + return &GetPrivateImageHubsParams{ + HTTPClient: client, + } +} + +/* +GetPrivateImageHubsParams contains all the parameters to send to the API endpoint + + for the get private image hubs operation. + + Typically these are written to a http.Request. +*/ +type GetPrivateImageHubsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get private image hubs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPrivateImageHubsParams) WithDefaults() *GetPrivateImageHubsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get private image hubs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPrivateImageHubsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get private image hubs params +func (o *GetPrivateImageHubsParams) WithTimeout(timeout time.Duration) *GetPrivateImageHubsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get private image hubs params +func (o *GetPrivateImageHubsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get private image hubs params +func (o *GetPrivateImageHubsParams) WithContext(ctx context.Context) *GetPrivateImageHubsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get private image hubs params +func (o *GetPrivateImageHubsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get private image hubs params +func (o *GetPrivateImageHubsParams) WithHTTPClient(client *http.Client) *GetPrivateImageHubsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get private image hubs params +func (o *GetPrivateImageHubsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get private image hubs params +func (o *GetPrivateImageHubsParams) WithImpersonateGroup(impersonateGroup []string) *GetPrivateImageHubsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get private image hubs params +func (o *GetPrivateImageHubsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get private image hubs params +func (o *GetPrivateImageHubsParams) WithImpersonateUser(impersonateUser *string) *GetPrivateImageHubsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get private image hubs params +func (o *GetPrivateImageHubsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get private image hubs params +func (o *GetPrivateImageHubsParams) WithAppName(appName string) *GetPrivateImageHubsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get private image hubs params +func (o *GetPrivateImageHubsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPrivateImageHubsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetPrivateImageHubs binds the parameter Impersonate-Group +func (o *GetPrivateImageHubsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/get_private_image_hubs_responses.go b/generated-client/client/application/get_private_image_hubs_responses.go new file mode 100644 index 0000000..3ae219f --- /dev/null +++ b/generated-client/client/application/get_private_image_hubs_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetPrivateImageHubsReader is a Reader for the GetPrivateImageHubs structure. +type GetPrivateImageHubsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPrivateImageHubsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPrivateImageHubsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPrivateImageHubsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPrivateImageHubsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/privateimagehubs] getPrivateImageHubs", response, response.Code()) + } +} + +// NewGetPrivateImageHubsOK creates a GetPrivateImageHubsOK with default headers values +func NewGetPrivateImageHubsOK() *GetPrivateImageHubsOK { + return &GetPrivateImageHubsOK{} +} + +/* +GetPrivateImageHubsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetPrivateImageHubsOK struct { + Payload []*models.ImageHubSecret +} + +// IsSuccess returns true when this get private image hubs o k response has a 2xx status code +func (o *GetPrivateImageHubsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get private image hubs o k response has a 3xx status code +func (o *GetPrivateImageHubsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get private image hubs o k response has a 4xx status code +func (o *GetPrivateImageHubsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get private image hubs o k response has a 5xx status code +func (o *GetPrivateImageHubsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get private image hubs o k response a status code equal to that given +func (o *GetPrivateImageHubsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get private image hubs o k response +func (o *GetPrivateImageHubsOK) Code() int { + return 200 +} + +func (o *GetPrivateImageHubsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/privateimagehubs][%d] getPrivateImageHubsOK %+v", 200, o.Payload) +} + +func (o *GetPrivateImageHubsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/privateimagehubs][%d] getPrivateImageHubsOK %+v", 200, o.Payload) +} + +func (o *GetPrivateImageHubsOK) GetPayload() []*models.ImageHubSecret { + return o.Payload +} + +func (o *GetPrivateImageHubsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPrivateImageHubsUnauthorized creates a GetPrivateImageHubsUnauthorized with default headers values +func NewGetPrivateImageHubsUnauthorized() *GetPrivateImageHubsUnauthorized { + return &GetPrivateImageHubsUnauthorized{} +} + +/* +GetPrivateImageHubsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetPrivateImageHubsUnauthorized struct { +} + +// IsSuccess returns true when this get private image hubs unauthorized response has a 2xx status code +func (o *GetPrivateImageHubsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get private image hubs unauthorized response has a 3xx status code +func (o *GetPrivateImageHubsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get private image hubs unauthorized response has a 4xx status code +func (o *GetPrivateImageHubsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get private image hubs unauthorized response has a 5xx status code +func (o *GetPrivateImageHubsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get private image hubs unauthorized response a status code equal to that given +func (o *GetPrivateImageHubsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get private image hubs unauthorized response +func (o *GetPrivateImageHubsUnauthorized) Code() int { + return 401 +} + +func (o *GetPrivateImageHubsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/privateimagehubs][%d] getPrivateImageHubsUnauthorized ", 401) +} + +func (o *GetPrivateImageHubsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/privateimagehubs][%d] getPrivateImageHubsUnauthorized ", 401) +} + +func (o *GetPrivateImageHubsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetPrivateImageHubsNotFound creates a GetPrivateImageHubsNotFound with default headers values +func NewGetPrivateImageHubsNotFound() *GetPrivateImageHubsNotFound { + return &GetPrivateImageHubsNotFound{} +} + +/* +GetPrivateImageHubsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetPrivateImageHubsNotFound struct { +} + +// IsSuccess returns true when this get private image hubs not found response has a 2xx status code +func (o *GetPrivateImageHubsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get private image hubs not found response has a 3xx status code +func (o *GetPrivateImageHubsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get private image hubs not found response has a 4xx status code +func (o *GetPrivateImageHubsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get private image hubs not found response has a 5xx status code +func (o *GetPrivateImageHubsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get private image hubs not found response a status code equal to that given +func (o *GetPrivateImageHubsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get private image hubs not found response +func (o *GetPrivateImageHubsNotFound) Code() int { + return 404 +} + +func (o *GetPrivateImageHubsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/privateimagehubs][%d] getPrivateImageHubsNotFound ", 404) +} + +func (o *GetPrivateImageHubsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/privateimagehubs][%d] getPrivateImageHubsNotFound ", 404) +} + +func (o *GetPrivateImageHubsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/is_deploy_key_valid_parameters.go b/generated-client/client/application/is_deploy_key_valid_parameters.go new file mode 100644 index 0000000..f6df347 --- /dev/null +++ b/generated-client/client/application/is_deploy_key_valid_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIsDeployKeyValidParams creates a new IsDeployKeyValidParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIsDeployKeyValidParams() *IsDeployKeyValidParams { + return &IsDeployKeyValidParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIsDeployKeyValidParamsWithTimeout creates a new IsDeployKeyValidParams object +// with the ability to set a timeout on a request. +func NewIsDeployKeyValidParamsWithTimeout(timeout time.Duration) *IsDeployKeyValidParams { + return &IsDeployKeyValidParams{ + timeout: timeout, + } +} + +// NewIsDeployKeyValidParamsWithContext creates a new IsDeployKeyValidParams object +// with the ability to set a context for a request. +func NewIsDeployKeyValidParamsWithContext(ctx context.Context) *IsDeployKeyValidParams { + return &IsDeployKeyValidParams{ + Context: ctx, + } +} + +// NewIsDeployKeyValidParamsWithHTTPClient creates a new IsDeployKeyValidParams object +// with the ability to set a custom HTTPClient for a request. +func NewIsDeployKeyValidParamsWithHTTPClient(client *http.Client) *IsDeployKeyValidParams { + return &IsDeployKeyValidParams{ + HTTPClient: client, + } +} + +/* +IsDeployKeyValidParams contains all the parameters to send to the API endpoint + + for the is deploy key valid operation. + + Typically these are written to a http.Request. +*/ +type IsDeployKeyValidParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the is deploy key valid params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IsDeployKeyValidParams) WithDefaults() *IsDeployKeyValidParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the is deploy key valid params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IsDeployKeyValidParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the is deploy key valid params +func (o *IsDeployKeyValidParams) WithTimeout(timeout time.Duration) *IsDeployKeyValidParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the is deploy key valid params +func (o *IsDeployKeyValidParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the is deploy key valid params +func (o *IsDeployKeyValidParams) WithContext(ctx context.Context) *IsDeployKeyValidParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the is deploy key valid params +func (o *IsDeployKeyValidParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the is deploy key valid params +func (o *IsDeployKeyValidParams) WithHTTPClient(client *http.Client) *IsDeployKeyValidParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the is deploy key valid params +func (o *IsDeployKeyValidParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the is deploy key valid params +func (o *IsDeployKeyValidParams) WithImpersonateGroup(impersonateGroup []string) *IsDeployKeyValidParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the is deploy key valid params +func (o *IsDeployKeyValidParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the is deploy key valid params +func (o *IsDeployKeyValidParams) WithImpersonateUser(impersonateUser *string) *IsDeployKeyValidParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the is deploy key valid params +func (o *IsDeployKeyValidParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the is deploy key valid params +func (o *IsDeployKeyValidParams) WithAppName(appName string) *IsDeployKeyValidParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the is deploy key valid params +func (o *IsDeployKeyValidParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *IsDeployKeyValidParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamIsDeployKeyValid binds the parameter Impersonate-Group +func (o *IsDeployKeyValidParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/is_deploy_key_valid_responses.go b/generated-client/client/application/is_deploy_key_valid_responses.go new file mode 100644 index 0000000..c7c140c --- /dev/null +++ b/generated-client/client/application/is_deploy_key_valid_responses.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IsDeployKeyValidReader is a Reader for the IsDeployKeyValid structure. +type IsDeployKeyValidReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IsDeployKeyValidReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIsDeployKeyValidOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewIsDeployKeyValidUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewIsDeployKeyValidForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewIsDeployKeyValidNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewIsDeployKeyValidConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewIsDeployKeyValidInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/deploykey-valid] isDeployKeyValid", response, response.Code()) + } +} + +// NewIsDeployKeyValidOK creates a IsDeployKeyValidOK with default headers values +func NewIsDeployKeyValidOK() *IsDeployKeyValidOK { + return &IsDeployKeyValidOK{} +} + +/* +IsDeployKeyValidOK describes a response with status code 200, with default header values. + +Deploy key is valid +*/ +type IsDeployKeyValidOK struct { +} + +// IsSuccess returns true when this is deploy key valid o k response has a 2xx status code +func (o *IsDeployKeyValidOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this is deploy key valid o k response has a 3xx status code +func (o *IsDeployKeyValidOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this is deploy key valid o k response has a 4xx status code +func (o *IsDeployKeyValidOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this is deploy key valid o k response has a 5xx status code +func (o *IsDeployKeyValidOK) IsServerError() bool { + return false +} + +// IsCode returns true when this is deploy key valid o k response a status code equal to that given +func (o *IsDeployKeyValidOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the is deploy key valid o k response +func (o *IsDeployKeyValidOK) Code() int { + return 200 +} + +func (o *IsDeployKeyValidOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidOK ", 200) +} + +func (o *IsDeployKeyValidOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidOK ", 200) +} + +func (o *IsDeployKeyValidOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewIsDeployKeyValidUnauthorized creates a IsDeployKeyValidUnauthorized with default headers values +func NewIsDeployKeyValidUnauthorized() *IsDeployKeyValidUnauthorized { + return &IsDeployKeyValidUnauthorized{} +} + +/* +IsDeployKeyValidUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type IsDeployKeyValidUnauthorized struct { +} + +// IsSuccess returns true when this is deploy key valid unauthorized response has a 2xx status code +func (o *IsDeployKeyValidUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this is deploy key valid unauthorized response has a 3xx status code +func (o *IsDeployKeyValidUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this is deploy key valid unauthorized response has a 4xx status code +func (o *IsDeployKeyValidUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this is deploy key valid unauthorized response has a 5xx status code +func (o *IsDeployKeyValidUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this is deploy key valid unauthorized response a status code equal to that given +func (o *IsDeployKeyValidUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the is deploy key valid unauthorized response +func (o *IsDeployKeyValidUnauthorized) Code() int { + return 401 +} + +func (o *IsDeployKeyValidUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidUnauthorized ", 401) +} + +func (o *IsDeployKeyValidUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidUnauthorized ", 401) +} + +func (o *IsDeployKeyValidUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewIsDeployKeyValidForbidden creates a IsDeployKeyValidForbidden with default headers values +func NewIsDeployKeyValidForbidden() *IsDeployKeyValidForbidden { + return &IsDeployKeyValidForbidden{} +} + +/* +IsDeployKeyValidForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type IsDeployKeyValidForbidden struct { +} + +// IsSuccess returns true when this is deploy key valid forbidden response has a 2xx status code +func (o *IsDeployKeyValidForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this is deploy key valid forbidden response has a 3xx status code +func (o *IsDeployKeyValidForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this is deploy key valid forbidden response has a 4xx status code +func (o *IsDeployKeyValidForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this is deploy key valid forbidden response has a 5xx status code +func (o *IsDeployKeyValidForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this is deploy key valid forbidden response a status code equal to that given +func (o *IsDeployKeyValidForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the is deploy key valid forbidden response +func (o *IsDeployKeyValidForbidden) Code() int { + return 403 +} + +func (o *IsDeployKeyValidForbidden) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidForbidden ", 403) +} + +func (o *IsDeployKeyValidForbidden) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidForbidden ", 403) +} + +func (o *IsDeployKeyValidForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewIsDeployKeyValidNotFound creates a IsDeployKeyValidNotFound with default headers values +func NewIsDeployKeyValidNotFound() *IsDeployKeyValidNotFound { + return &IsDeployKeyValidNotFound{} +} + +/* +IsDeployKeyValidNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type IsDeployKeyValidNotFound struct { +} + +// IsSuccess returns true when this is deploy key valid not found response has a 2xx status code +func (o *IsDeployKeyValidNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this is deploy key valid not found response has a 3xx status code +func (o *IsDeployKeyValidNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this is deploy key valid not found response has a 4xx status code +func (o *IsDeployKeyValidNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this is deploy key valid not found response has a 5xx status code +func (o *IsDeployKeyValidNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this is deploy key valid not found response a status code equal to that given +func (o *IsDeployKeyValidNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the is deploy key valid not found response +func (o *IsDeployKeyValidNotFound) Code() int { + return 404 +} + +func (o *IsDeployKeyValidNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidNotFound ", 404) +} + +func (o *IsDeployKeyValidNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidNotFound ", 404) +} + +func (o *IsDeployKeyValidNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewIsDeployKeyValidConflict creates a IsDeployKeyValidConflict with default headers values +func NewIsDeployKeyValidConflict() *IsDeployKeyValidConflict { + return &IsDeployKeyValidConflict{} +} + +/* +IsDeployKeyValidConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type IsDeployKeyValidConflict struct { +} + +// IsSuccess returns true when this is deploy key valid conflict response has a 2xx status code +func (o *IsDeployKeyValidConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this is deploy key valid conflict response has a 3xx status code +func (o *IsDeployKeyValidConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this is deploy key valid conflict response has a 4xx status code +func (o *IsDeployKeyValidConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this is deploy key valid conflict response has a 5xx status code +func (o *IsDeployKeyValidConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this is deploy key valid conflict response a status code equal to that given +func (o *IsDeployKeyValidConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the is deploy key valid conflict response +func (o *IsDeployKeyValidConflict) Code() int { + return 409 +} + +func (o *IsDeployKeyValidConflict) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidConflict ", 409) +} + +func (o *IsDeployKeyValidConflict) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidConflict ", 409) +} + +func (o *IsDeployKeyValidConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewIsDeployKeyValidInternalServerError creates a IsDeployKeyValidInternalServerError with default headers values +func NewIsDeployKeyValidInternalServerError() *IsDeployKeyValidInternalServerError { + return &IsDeployKeyValidInternalServerError{} +} + +/* +IsDeployKeyValidInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type IsDeployKeyValidInternalServerError struct { +} + +// IsSuccess returns true when this is deploy key valid internal server error response has a 2xx status code +func (o *IsDeployKeyValidInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this is deploy key valid internal server error response has a 3xx status code +func (o *IsDeployKeyValidInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this is deploy key valid internal server error response has a 4xx status code +func (o *IsDeployKeyValidInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this is deploy key valid internal server error response has a 5xx status code +func (o *IsDeployKeyValidInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this is deploy key valid internal server error response a status code equal to that given +func (o *IsDeployKeyValidInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the is deploy key valid internal server error response +func (o *IsDeployKeyValidInternalServerError) Code() int { + return 500 +} + +func (o *IsDeployKeyValidInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidInternalServerError ", 500) +} + +func (o *IsDeployKeyValidInternalServerError) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deploykey-valid][%d] isDeployKeyValidInternalServerError ", 500) +} + +func (o *IsDeployKeyValidInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/list_pipelines_parameters.go b/generated-client/client/application/list_pipelines_parameters.go new file mode 100644 index 0000000..e63843b --- /dev/null +++ b/generated-client/client/application/list_pipelines_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListPipelinesParams creates a new ListPipelinesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListPipelinesParams() *ListPipelinesParams { + return &ListPipelinesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListPipelinesParamsWithTimeout creates a new ListPipelinesParams object +// with the ability to set a timeout on a request. +func NewListPipelinesParamsWithTimeout(timeout time.Duration) *ListPipelinesParams { + return &ListPipelinesParams{ + timeout: timeout, + } +} + +// NewListPipelinesParamsWithContext creates a new ListPipelinesParams object +// with the ability to set a context for a request. +func NewListPipelinesParamsWithContext(ctx context.Context) *ListPipelinesParams { + return &ListPipelinesParams{ + Context: ctx, + } +} + +// NewListPipelinesParamsWithHTTPClient creates a new ListPipelinesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListPipelinesParamsWithHTTPClient(client *http.Client) *ListPipelinesParams { + return &ListPipelinesParams{ + HTTPClient: client, + } +} + +/* +ListPipelinesParams contains all the parameters to send to the API endpoint + + for the list pipelines operation. + + Typically these are written to a http.Request. +*/ +type ListPipelinesParams struct { + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list pipelines params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPipelinesParams) WithDefaults() *ListPipelinesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list pipelines params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPipelinesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list pipelines params +func (o *ListPipelinesParams) WithTimeout(timeout time.Duration) *ListPipelinesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list pipelines params +func (o *ListPipelinesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list pipelines params +func (o *ListPipelinesParams) WithContext(ctx context.Context) *ListPipelinesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list pipelines params +func (o *ListPipelinesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list pipelines params +func (o *ListPipelinesParams) WithHTTPClient(client *http.Client) *ListPipelinesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list pipelines params +func (o *ListPipelinesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAppName adds the appName to the list pipelines params +func (o *ListPipelinesParams) WithAppName(appName string) *ListPipelinesParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the list pipelines params +func (o *ListPipelinesParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *ListPipelinesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/generated-client/client/application/list_pipelines_responses.go b/generated-client/client/application/list_pipelines_responses.go new file mode 100644 index 0000000..224a009 --- /dev/null +++ b/generated-client/client/application/list_pipelines_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListPipelinesReader is a Reader for the ListPipelines structure. +type ListPipelinesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListPipelinesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListPipelinesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/pipelines] listPipelines", response, response.Code()) + } +} + +// NewListPipelinesOK creates a ListPipelinesOK with default headers values +func NewListPipelinesOK() *ListPipelinesOK { + return &ListPipelinesOK{} +} + +/* +ListPipelinesOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type ListPipelinesOK struct { + Payload []string +} + +// IsSuccess returns true when this list pipelines o k response has a 2xx status code +func (o *ListPipelinesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list pipelines o k response has a 3xx status code +func (o *ListPipelinesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list pipelines o k response has a 4xx status code +func (o *ListPipelinesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list pipelines o k response has a 5xx status code +func (o *ListPipelinesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list pipelines o k response a status code equal to that given +func (o *ListPipelinesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list pipelines o k response +func (o *ListPipelinesOK) Code() int { + return 200 +} + +func (o *ListPipelinesOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/pipelines][%d] listPipelinesOK %+v", 200, o.Payload) +} + +func (o *ListPipelinesOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/pipelines][%d] listPipelinesOK %+v", 200, o.Payload) +} + +func (o *ListPipelinesOK) GetPayload() []string { + return o.Payload +} + +func (o *ListPipelinesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/generated-client/client/application/modify_registration_details_parameters.go b/generated-client/client/application/modify_registration_details_parameters.go new file mode 100644 index 0000000..5a57ea5 --- /dev/null +++ b/generated-client/client/application/modify_registration_details_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewModifyRegistrationDetailsParams creates a new ModifyRegistrationDetailsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewModifyRegistrationDetailsParams() *ModifyRegistrationDetailsParams { + return &ModifyRegistrationDetailsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewModifyRegistrationDetailsParamsWithTimeout creates a new ModifyRegistrationDetailsParams object +// with the ability to set a timeout on a request. +func NewModifyRegistrationDetailsParamsWithTimeout(timeout time.Duration) *ModifyRegistrationDetailsParams { + return &ModifyRegistrationDetailsParams{ + timeout: timeout, + } +} + +// NewModifyRegistrationDetailsParamsWithContext creates a new ModifyRegistrationDetailsParams object +// with the ability to set a context for a request. +func NewModifyRegistrationDetailsParamsWithContext(ctx context.Context) *ModifyRegistrationDetailsParams { + return &ModifyRegistrationDetailsParams{ + Context: ctx, + } +} + +// NewModifyRegistrationDetailsParamsWithHTTPClient creates a new ModifyRegistrationDetailsParams object +// with the ability to set a custom HTTPClient for a request. +func NewModifyRegistrationDetailsParamsWithHTTPClient(client *http.Client) *ModifyRegistrationDetailsParams { + return &ModifyRegistrationDetailsParams{ + HTTPClient: client, + } +} + +/* +ModifyRegistrationDetailsParams contains all the parameters to send to the API endpoint + + for the modify registration details operation. + + Typically these are written to a http.Request. +*/ +type ModifyRegistrationDetailsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* PatchRequest. + + Request for Application to patch + */ + PatchRequest *models.ApplicationRegistrationPatchRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the modify registration details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ModifyRegistrationDetailsParams) WithDefaults() *ModifyRegistrationDetailsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the modify registration details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ModifyRegistrationDetailsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the modify registration details params +func (o *ModifyRegistrationDetailsParams) WithTimeout(timeout time.Duration) *ModifyRegistrationDetailsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the modify registration details params +func (o *ModifyRegistrationDetailsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the modify registration details params +func (o *ModifyRegistrationDetailsParams) WithContext(ctx context.Context) *ModifyRegistrationDetailsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the modify registration details params +func (o *ModifyRegistrationDetailsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the modify registration details params +func (o *ModifyRegistrationDetailsParams) WithHTTPClient(client *http.Client) *ModifyRegistrationDetailsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the modify registration details params +func (o *ModifyRegistrationDetailsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the modify registration details params +func (o *ModifyRegistrationDetailsParams) WithImpersonateGroup(impersonateGroup []string) *ModifyRegistrationDetailsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the modify registration details params +func (o *ModifyRegistrationDetailsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the modify registration details params +func (o *ModifyRegistrationDetailsParams) WithImpersonateUser(impersonateUser *string) *ModifyRegistrationDetailsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the modify registration details params +func (o *ModifyRegistrationDetailsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the modify registration details params +func (o *ModifyRegistrationDetailsParams) WithAppName(appName string) *ModifyRegistrationDetailsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the modify registration details params +func (o *ModifyRegistrationDetailsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithPatchRequest adds the patchRequest to the modify registration details params +func (o *ModifyRegistrationDetailsParams) WithPatchRequest(patchRequest *models.ApplicationRegistrationPatchRequest) *ModifyRegistrationDetailsParams { + o.SetPatchRequest(patchRequest) + return o +} + +// SetPatchRequest adds the patchRequest to the modify registration details params +func (o *ModifyRegistrationDetailsParams) SetPatchRequest(patchRequest *models.ApplicationRegistrationPatchRequest) { + o.PatchRequest = patchRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *ModifyRegistrationDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + if o.PatchRequest != nil { + if err := r.SetBodyParam(o.PatchRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamModifyRegistrationDetails binds the parameter Impersonate-Group +func (o *ModifyRegistrationDetailsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/modify_registration_details_responses.go b/generated-client/client/application/modify_registration_details_responses.go new file mode 100644 index 0000000..8272185 --- /dev/null +++ b/generated-client/client/application/modify_registration_details_responses.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// ModifyRegistrationDetailsReader is a Reader for the ModifyRegistrationDetails structure. +type ModifyRegistrationDetailsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ModifyRegistrationDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewModifyRegistrationDetailsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewModifyRegistrationDetailsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewModifyRegistrationDetailsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewModifyRegistrationDetailsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewModifyRegistrationDetailsConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /applications/{appName}] modifyRegistrationDetails", response, response.Code()) + } +} + +// NewModifyRegistrationDetailsOK creates a ModifyRegistrationDetailsOK with default headers values +func NewModifyRegistrationDetailsOK() *ModifyRegistrationDetailsOK { + return &ModifyRegistrationDetailsOK{} +} + +/* +ModifyRegistrationDetailsOK describes a response with status code 200, with default header values. + +Modifying registration operation details +*/ +type ModifyRegistrationDetailsOK struct { + Payload *models.ApplicationRegistrationUpsertResponse +} + +// IsSuccess returns true when this modify registration details o k response has a 2xx status code +func (o *ModifyRegistrationDetailsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this modify registration details o k response has a 3xx status code +func (o *ModifyRegistrationDetailsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this modify registration details o k response has a 4xx status code +func (o *ModifyRegistrationDetailsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this modify registration details o k response has a 5xx status code +func (o *ModifyRegistrationDetailsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this modify registration details o k response a status code equal to that given +func (o *ModifyRegistrationDetailsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the modify registration details o k response +func (o *ModifyRegistrationDetailsOK) Code() int { + return 200 +} + +func (o *ModifyRegistrationDetailsOK) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsOK %+v", 200, o.Payload) +} + +func (o *ModifyRegistrationDetailsOK) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsOK %+v", 200, o.Payload) +} + +func (o *ModifyRegistrationDetailsOK) GetPayload() *models.ApplicationRegistrationUpsertResponse { + return o.Payload +} + +func (o *ModifyRegistrationDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ApplicationRegistrationUpsertResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewModifyRegistrationDetailsBadRequest creates a ModifyRegistrationDetailsBadRequest with default headers values +func NewModifyRegistrationDetailsBadRequest() *ModifyRegistrationDetailsBadRequest { + return &ModifyRegistrationDetailsBadRequest{} +} + +/* +ModifyRegistrationDetailsBadRequest describes a response with status code 400, with default header values. + +Invalid application +*/ +type ModifyRegistrationDetailsBadRequest struct { +} + +// IsSuccess returns true when this modify registration details bad request response has a 2xx status code +func (o *ModifyRegistrationDetailsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this modify registration details bad request response has a 3xx status code +func (o *ModifyRegistrationDetailsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this modify registration details bad request response has a 4xx status code +func (o *ModifyRegistrationDetailsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this modify registration details bad request response has a 5xx status code +func (o *ModifyRegistrationDetailsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this modify registration details bad request response a status code equal to that given +func (o *ModifyRegistrationDetailsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the modify registration details bad request response +func (o *ModifyRegistrationDetailsBadRequest) Code() int { + return 400 +} + +func (o *ModifyRegistrationDetailsBadRequest) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsBadRequest ", 400) +} + +func (o *ModifyRegistrationDetailsBadRequest) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsBadRequest ", 400) +} + +func (o *ModifyRegistrationDetailsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewModifyRegistrationDetailsUnauthorized creates a ModifyRegistrationDetailsUnauthorized with default headers values +func NewModifyRegistrationDetailsUnauthorized() *ModifyRegistrationDetailsUnauthorized { + return &ModifyRegistrationDetailsUnauthorized{} +} + +/* +ModifyRegistrationDetailsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type ModifyRegistrationDetailsUnauthorized struct { +} + +// IsSuccess returns true when this modify registration details unauthorized response has a 2xx status code +func (o *ModifyRegistrationDetailsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this modify registration details unauthorized response has a 3xx status code +func (o *ModifyRegistrationDetailsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this modify registration details unauthorized response has a 4xx status code +func (o *ModifyRegistrationDetailsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this modify registration details unauthorized response has a 5xx status code +func (o *ModifyRegistrationDetailsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this modify registration details unauthorized response a status code equal to that given +func (o *ModifyRegistrationDetailsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the modify registration details unauthorized response +func (o *ModifyRegistrationDetailsUnauthorized) Code() int { + return 401 +} + +func (o *ModifyRegistrationDetailsUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsUnauthorized ", 401) +} + +func (o *ModifyRegistrationDetailsUnauthorized) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsUnauthorized ", 401) +} + +func (o *ModifyRegistrationDetailsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewModifyRegistrationDetailsNotFound creates a ModifyRegistrationDetailsNotFound with default headers values +func NewModifyRegistrationDetailsNotFound() *ModifyRegistrationDetailsNotFound { + return &ModifyRegistrationDetailsNotFound{} +} + +/* +ModifyRegistrationDetailsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ModifyRegistrationDetailsNotFound struct { +} + +// IsSuccess returns true when this modify registration details not found response has a 2xx status code +func (o *ModifyRegistrationDetailsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this modify registration details not found response has a 3xx status code +func (o *ModifyRegistrationDetailsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this modify registration details not found response has a 4xx status code +func (o *ModifyRegistrationDetailsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this modify registration details not found response has a 5xx status code +func (o *ModifyRegistrationDetailsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this modify registration details not found response a status code equal to that given +func (o *ModifyRegistrationDetailsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the modify registration details not found response +func (o *ModifyRegistrationDetailsNotFound) Code() int { + return 404 +} + +func (o *ModifyRegistrationDetailsNotFound) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsNotFound ", 404) +} + +func (o *ModifyRegistrationDetailsNotFound) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsNotFound ", 404) +} + +func (o *ModifyRegistrationDetailsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewModifyRegistrationDetailsConflict creates a ModifyRegistrationDetailsConflict with default headers values +func NewModifyRegistrationDetailsConflict() *ModifyRegistrationDetailsConflict { + return &ModifyRegistrationDetailsConflict{} +} + +/* +ModifyRegistrationDetailsConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type ModifyRegistrationDetailsConflict struct { +} + +// IsSuccess returns true when this modify registration details conflict response has a 2xx status code +func (o *ModifyRegistrationDetailsConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this modify registration details conflict response has a 3xx status code +func (o *ModifyRegistrationDetailsConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this modify registration details conflict response has a 4xx status code +func (o *ModifyRegistrationDetailsConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this modify registration details conflict response has a 5xx status code +func (o *ModifyRegistrationDetailsConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this modify registration details conflict response a status code equal to that given +func (o *ModifyRegistrationDetailsConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the modify registration details conflict response +func (o *ModifyRegistrationDetailsConflict) Code() int { + return 409 +} + +func (o *ModifyRegistrationDetailsConflict) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsConflict ", 409) +} + +func (o *ModifyRegistrationDetailsConflict) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}][%d] modifyRegistrationDetailsConflict ", 409) +} + +func (o *ModifyRegistrationDetailsConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/regenerate_deploy_key_parameters.go b/generated-client/client/application/regenerate_deploy_key_parameters.go new file mode 100644 index 0000000..bd26441 --- /dev/null +++ b/generated-client/client/application/regenerate_deploy_key_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewRegenerateDeployKeyParams creates a new RegenerateDeployKeyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRegenerateDeployKeyParams() *RegenerateDeployKeyParams { + return &RegenerateDeployKeyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRegenerateDeployKeyParamsWithTimeout creates a new RegenerateDeployKeyParams object +// with the ability to set a timeout on a request. +func NewRegenerateDeployKeyParamsWithTimeout(timeout time.Duration) *RegenerateDeployKeyParams { + return &RegenerateDeployKeyParams{ + timeout: timeout, + } +} + +// NewRegenerateDeployKeyParamsWithContext creates a new RegenerateDeployKeyParams object +// with the ability to set a context for a request. +func NewRegenerateDeployKeyParamsWithContext(ctx context.Context) *RegenerateDeployKeyParams { + return &RegenerateDeployKeyParams{ + Context: ctx, + } +} + +// NewRegenerateDeployKeyParamsWithHTTPClient creates a new RegenerateDeployKeyParams object +// with the ability to set a custom HTTPClient for a request. +func NewRegenerateDeployKeyParamsWithHTTPClient(client *http.Client) *RegenerateDeployKeyParams { + return &RegenerateDeployKeyParams{ + HTTPClient: client, + } +} + +/* +RegenerateDeployKeyParams contains all the parameters to send to the API endpoint + + for the regenerate deploy key operation. + + Typically these are written to a http.Request. +*/ +type RegenerateDeployKeyParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of application + */ + AppName string + + /* RegenerateDeployKeyAndSecretData. + + Regenerate deploy key and secret data + */ + RegenerateDeployKeyAndSecretData *models.RegenerateDeployKeyAndSecretData + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the regenerate deploy key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegenerateDeployKeyParams) WithDefaults() *RegenerateDeployKeyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the regenerate deploy key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegenerateDeployKeyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) WithTimeout(timeout time.Duration) *RegenerateDeployKeyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) WithContext(ctx context.Context) *RegenerateDeployKeyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) WithHTTPClient(client *http.Client) *RegenerateDeployKeyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) WithImpersonateGroup(impersonateGroup []string) *RegenerateDeployKeyParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) WithImpersonateUser(impersonateUser *string) *RegenerateDeployKeyParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) WithAppName(appName string) *RegenerateDeployKeyParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithRegenerateDeployKeyAndSecretData adds the regenerateDeployKeyAndSecretData to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) WithRegenerateDeployKeyAndSecretData(regenerateDeployKeyAndSecretData *models.RegenerateDeployKeyAndSecretData) *RegenerateDeployKeyParams { + o.SetRegenerateDeployKeyAndSecretData(regenerateDeployKeyAndSecretData) + return o +} + +// SetRegenerateDeployKeyAndSecretData adds the regenerateDeployKeyAndSecretData to the regenerate deploy key params +func (o *RegenerateDeployKeyParams) SetRegenerateDeployKeyAndSecretData(regenerateDeployKeyAndSecretData *models.RegenerateDeployKeyAndSecretData) { + o.RegenerateDeployKeyAndSecretData = regenerateDeployKeyAndSecretData +} + +// WriteToRequest writes these params to a swagger request +func (o *RegenerateDeployKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + if o.RegenerateDeployKeyAndSecretData != nil { + if err := r.SetBodyParam(o.RegenerateDeployKeyAndSecretData); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRegenerateDeployKey binds the parameter Impersonate-Group +func (o *RegenerateDeployKeyParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/regenerate_deploy_key_responses.go b/generated-client/client/application/regenerate_deploy_key_responses.go new file mode 100644 index 0000000..b18940b --- /dev/null +++ b/generated-client/client/application/regenerate_deploy_key_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RegenerateDeployKeyReader is a Reader for the RegenerateDeployKey structure. +type RegenerateDeployKeyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RegenerateDeployKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewRegenerateDeployKeyNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewRegenerateDeployKeyUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRegenerateDeployKeyNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/regenerate-deploy-key] regenerateDeployKey", response, response.Code()) + } +} + +// NewRegenerateDeployKeyNoContent creates a RegenerateDeployKeyNoContent with default headers values +func NewRegenerateDeployKeyNoContent() *RegenerateDeployKeyNoContent { + return &RegenerateDeployKeyNoContent{} +} + +/* +RegenerateDeployKeyNoContent describes a response with status code 204, with default header values. + +Successfully regenerated deploy key and set shared secret +*/ +type RegenerateDeployKeyNoContent struct { +} + +// IsSuccess returns true when this regenerate deploy key no content response has a 2xx status code +func (o *RegenerateDeployKeyNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this regenerate deploy key no content response has a 3xx status code +func (o *RegenerateDeployKeyNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate deploy key no content response has a 4xx status code +func (o *RegenerateDeployKeyNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this regenerate deploy key no content response has a 5xx status code +func (o *RegenerateDeployKeyNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate deploy key no content response a status code equal to that given +func (o *RegenerateDeployKeyNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the regenerate deploy key no content response +func (o *RegenerateDeployKeyNoContent) Code() int { + return 204 +} + +func (o *RegenerateDeployKeyNoContent) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-deploy-key][%d] regenerateDeployKeyNoContent ", 204) +} + +func (o *RegenerateDeployKeyNoContent) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-deploy-key][%d] regenerateDeployKeyNoContent ", 204) +} + +func (o *RegenerateDeployKeyNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegenerateDeployKeyUnauthorized creates a RegenerateDeployKeyUnauthorized with default headers values +func NewRegenerateDeployKeyUnauthorized() *RegenerateDeployKeyUnauthorized { + return &RegenerateDeployKeyUnauthorized{} +} + +/* +RegenerateDeployKeyUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RegenerateDeployKeyUnauthorized struct { +} + +// IsSuccess returns true when this regenerate deploy key unauthorized response has a 2xx status code +func (o *RegenerateDeployKeyUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this regenerate deploy key unauthorized response has a 3xx status code +func (o *RegenerateDeployKeyUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate deploy key unauthorized response has a 4xx status code +func (o *RegenerateDeployKeyUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this regenerate deploy key unauthorized response has a 5xx status code +func (o *RegenerateDeployKeyUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate deploy key unauthorized response a status code equal to that given +func (o *RegenerateDeployKeyUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the regenerate deploy key unauthorized response +func (o *RegenerateDeployKeyUnauthorized) Code() int { + return 401 +} + +func (o *RegenerateDeployKeyUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-deploy-key][%d] regenerateDeployKeyUnauthorized ", 401) +} + +func (o *RegenerateDeployKeyUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-deploy-key][%d] regenerateDeployKeyUnauthorized ", 401) +} + +func (o *RegenerateDeployKeyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegenerateDeployKeyNotFound creates a RegenerateDeployKeyNotFound with default headers values +func NewRegenerateDeployKeyNotFound() *RegenerateDeployKeyNotFound { + return &RegenerateDeployKeyNotFound{} +} + +/* +RegenerateDeployKeyNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RegenerateDeployKeyNotFound struct { +} + +// IsSuccess returns true when this regenerate deploy key not found response has a 2xx status code +func (o *RegenerateDeployKeyNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this regenerate deploy key not found response has a 3xx status code +func (o *RegenerateDeployKeyNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate deploy key not found response has a 4xx status code +func (o *RegenerateDeployKeyNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this regenerate deploy key not found response has a 5xx status code +func (o *RegenerateDeployKeyNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate deploy key not found response a status code equal to that given +func (o *RegenerateDeployKeyNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the regenerate deploy key not found response +func (o *RegenerateDeployKeyNotFound) Code() int { + return 404 +} + +func (o *RegenerateDeployKeyNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-deploy-key][%d] regenerateDeployKeyNotFound ", 404) +} + +func (o *RegenerateDeployKeyNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-deploy-key][%d] regenerateDeployKeyNotFound ", 404) +} + +func (o *RegenerateDeployKeyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/regenerate_machine_user_token_parameters.go b/generated-client/client/application/regenerate_machine_user_token_parameters.go new file mode 100644 index 0000000..683b348 --- /dev/null +++ b/generated-client/client/application/regenerate_machine_user_token_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRegenerateMachineUserTokenParams creates a new RegenerateMachineUserTokenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRegenerateMachineUserTokenParams() *RegenerateMachineUserTokenParams { + return &RegenerateMachineUserTokenParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRegenerateMachineUserTokenParamsWithTimeout creates a new RegenerateMachineUserTokenParams object +// with the ability to set a timeout on a request. +func NewRegenerateMachineUserTokenParamsWithTimeout(timeout time.Duration) *RegenerateMachineUserTokenParams { + return &RegenerateMachineUserTokenParams{ + timeout: timeout, + } +} + +// NewRegenerateMachineUserTokenParamsWithContext creates a new RegenerateMachineUserTokenParams object +// with the ability to set a context for a request. +func NewRegenerateMachineUserTokenParamsWithContext(ctx context.Context) *RegenerateMachineUserTokenParams { + return &RegenerateMachineUserTokenParams{ + Context: ctx, + } +} + +// NewRegenerateMachineUserTokenParamsWithHTTPClient creates a new RegenerateMachineUserTokenParams object +// with the ability to set a custom HTTPClient for a request. +func NewRegenerateMachineUserTokenParamsWithHTTPClient(client *http.Client) *RegenerateMachineUserTokenParams { + return &RegenerateMachineUserTokenParams{ + HTTPClient: client, + } +} + +/* +RegenerateMachineUserTokenParams contains all the parameters to send to the API endpoint + + for the regenerate machine user token operation. + + Typically these are written to a http.Request. +*/ +type RegenerateMachineUserTokenParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the regenerate machine user token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegenerateMachineUserTokenParams) WithDefaults() *RegenerateMachineUserTokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the regenerate machine user token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegenerateMachineUserTokenParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) WithTimeout(timeout time.Duration) *RegenerateMachineUserTokenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) WithContext(ctx context.Context) *RegenerateMachineUserTokenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) WithHTTPClient(client *http.Client) *RegenerateMachineUserTokenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) WithImpersonateGroup(impersonateGroup []string) *RegenerateMachineUserTokenParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) WithImpersonateUser(impersonateUser *string) *RegenerateMachineUserTokenParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) WithAppName(appName string) *RegenerateMachineUserTokenParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the regenerate machine user token params +func (o *RegenerateMachineUserTokenParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *RegenerateMachineUserTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRegenerateMachineUserToken binds the parameter Impersonate-Group +func (o *RegenerateMachineUserTokenParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/regenerate_machine_user_token_responses.go b/generated-client/client/application/regenerate_machine_user_token_responses.go new file mode 100644 index 0000000..4fc6439 --- /dev/null +++ b/generated-client/client/application/regenerate_machine_user_token_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// RegenerateMachineUserTokenReader is a Reader for the RegenerateMachineUserToken structure. +type RegenerateMachineUserTokenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RegenerateMachineUserTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRegenerateMachineUserTokenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewRegenerateMachineUserTokenUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewRegenerateMachineUserTokenForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRegenerateMachineUserTokenNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewRegenerateMachineUserTokenConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewRegenerateMachineUserTokenInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/regenerate-machine-user-token] regenerateMachineUserToken", response, response.Code()) + } +} + +// NewRegenerateMachineUserTokenOK creates a RegenerateMachineUserTokenOK with default headers values +func NewRegenerateMachineUserTokenOK() *RegenerateMachineUserTokenOK { + return &RegenerateMachineUserTokenOK{} +} + +/* +RegenerateMachineUserTokenOK describes a response with status code 200, with default header values. + +Successful regenerate machine-user token +*/ +type RegenerateMachineUserTokenOK struct { + Payload *models.MachineUser +} + +// IsSuccess returns true when this regenerate machine user token o k response has a 2xx status code +func (o *RegenerateMachineUserTokenOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this regenerate machine user token o k response has a 3xx status code +func (o *RegenerateMachineUserTokenOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate machine user token o k response has a 4xx status code +func (o *RegenerateMachineUserTokenOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this regenerate machine user token o k response has a 5xx status code +func (o *RegenerateMachineUserTokenOK) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate machine user token o k response a status code equal to that given +func (o *RegenerateMachineUserTokenOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the regenerate machine user token o k response +func (o *RegenerateMachineUserTokenOK) Code() int { + return 200 +} + +func (o *RegenerateMachineUserTokenOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenOK %+v", 200, o.Payload) +} + +func (o *RegenerateMachineUserTokenOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenOK %+v", 200, o.Payload) +} + +func (o *RegenerateMachineUserTokenOK) GetPayload() *models.MachineUser { + return o.Payload +} + +func (o *RegenerateMachineUserTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MachineUser) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRegenerateMachineUserTokenUnauthorized creates a RegenerateMachineUserTokenUnauthorized with default headers values +func NewRegenerateMachineUserTokenUnauthorized() *RegenerateMachineUserTokenUnauthorized { + return &RegenerateMachineUserTokenUnauthorized{} +} + +/* +RegenerateMachineUserTokenUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RegenerateMachineUserTokenUnauthorized struct { +} + +// IsSuccess returns true when this regenerate machine user token unauthorized response has a 2xx status code +func (o *RegenerateMachineUserTokenUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this regenerate machine user token unauthorized response has a 3xx status code +func (o *RegenerateMachineUserTokenUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate machine user token unauthorized response has a 4xx status code +func (o *RegenerateMachineUserTokenUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this regenerate machine user token unauthorized response has a 5xx status code +func (o *RegenerateMachineUserTokenUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate machine user token unauthorized response a status code equal to that given +func (o *RegenerateMachineUserTokenUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the regenerate machine user token unauthorized response +func (o *RegenerateMachineUserTokenUnauthorized) Code() int { + return 401 +} + +func (o *RegenerateMachineUserTokenUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenUnauthorized ", 401) +} + +func (o *RegenerateMachineUserTokenUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenUnauthorized ", 401) +} + +func (o *RegenerateMachineUserTokenUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegenerateMachineUserTokenForbidden creates a RegenerateMachineUserTokenForbidden with default headers values +func NewRegenerateMachineUserTokenForbidden() *RegenerateMachineUserTokenForbidden { + return &RegenerateMachineUserTokenForbidden{} +} + +/* +RegenerateMachineUserTokenForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type RegenerateMachineUserTokenForbidden struct { +} + +// IsSuccess returns true when this regenerate machine user token forbidden response has a 2xx status code +func (o *RegenerateMachineUserTokenForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this regenerate machine user token forbidden response has a 3xx status code +func (o *RegenerateMachineUserTokenForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate machine user token forbidden response has a 4xx status code +func (o *RegenerateMachineUserTokenForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this regenerate machine user token forbidden response has a 5xx status code +func (o *RegenerateMachineUserTokenForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate machine user token forbidden response a status code equal to that given +func (o *RegenerateMachineUserTokenForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the regenerate machine user token forbidden response +func (o *RegenerateMachineUserTokenForbidden) Code() int { + return 403 +} + +func (o *RegenerateMachineUserTokenForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenForbidden ", 403) +} + +func (o *RegenerateMachineUserTokenForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenForbidden ", 403) +} + +func (o *RegenerateMachineUserTokenForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegenerateMachineUserTokenNotFound creates a RegenerateMachineUserTokenNotFound with default headers values +func NewRegenerateMachineUserTokenNotFound() *RegenerateMachineUserTokenNotFound { + return &RegenerateMachineUserTokenNotFound{} +} + +/* +RegenerateMachineUserTokenNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RegenerateMachineUserTokenNotFound struct { +} + +// IsSuccess returns true when this regenerate machine user token not found response has a 2xx status code +func (o *RegenerateMachineUserTokenNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this regenerate machine user token not found response has a 3xx status code +func (o *RegenerateMachineUserTokenNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate machine user token not found response has a 4xx status code +func (o *RegenerateMachineUserTokenNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this regenerate machine user token not found response has a 5xx status code +func (o *RegenerateMachineUserTokenNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate machine user token not found response a status code equal to that given +func (o *RegenerateMachineUserTokenNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the regenerate machine user token not found response +func (o *RegenerateMachineUserTokenNotFound) Code() int { + return 404 +} + +func (o *RegenerateMachineUserTokenNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenNotFound ", 404) +} + +func (o *RegenerateMachineUserTokenNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenNotFound ", 404) +} + +func (o *RegenerateMachineUserTokenNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegenerateMachineUserTokenConflict creates a RegenerateMachineUserTokenConflict with default headers values +func NewRegenerateMachineUserTokenConflict() *RegenerateMachineUserTokenConflict { + return &RegenerateMachineUserTokenConflict{} +} + +/* +RegenerateMachineUserTokenConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type RegenerateMachineUserTokenConflict struct { +} + +// IsSuccess returns true when this regenerate machine user token conflict response has a 2xx status code +func (o *RegenerateMachineUserTokenConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this regenerate machine user token conflict response has a 3xx status code +func (o *RegenerateMachineUserTokenConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate machine user token conflict response has a 4xx status code +func (o *RegenerateMachineUserTokenConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this regenerate machine user token conflict response has a 5xx status code +func (o *RegenerateMachineUserTokenConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this regenerate machine user token conflict response a status code equal to that given +func (o *RegenerateMachineUserTokenConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the regenerate machine user token conflict response +func (o *RegenerateMachineUserTokenConflict) Code() int { + return 409 +} + +func (o *RegenerateMachineUserTokenConflict) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenConflict ", 409) +} + +func (o *RegenerateMachineUserTokenConflict) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenConflict ", 409) +} + +func (o *RegenerateMachineUserTokenConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegenerateMachineUserTokenInternalServerError creates a RegenerateMachineUserTokenInternalServerError with default headers values +func NewRegenerateMachineUserTokenInternalServerError() *RegenerateMachineUserTokenInternalServerError { + return &RegenerateMachineUserTokenInternalServerError{} +} + +/* +RegenerateMachineUserTokenInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type RegenerateMachineUserTokenInternalServerError struct { +} + +// IsSuccess returns true when this regenerate machine user token internal server error response has a 2xx status code +func (o *RegenerateMachineUserTokenInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this regenerate machine user token internal server error response has a 3xx status code +func (o *RegenerateMachineUserTokenInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this regenerate machine user token internal server error response has a 4xx status code +func (o *RegenerateMachineUserTokenInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this regenerate machine user token internal server error response has a 5xx status code +func (o *RegenerateMachineUserTokenInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this regenerate machine user token internal server error response a status code equal to that given +func (o *RegenerateMachineUserTokenInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the regenerate machine user token internal server error response +func (o *RegenerateMachineUserTokenInternalServerError) Code() int { + return 500 +} + +func (o *RegenerateMachineUserTokenInternalServerError) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenInternalServerError ", 500) +} + +func (o *RegenerateMachineUserTokenInternalServerError) String() string { + return fmt.Sprintf("[POST /applications/{appName}/regenerate-machine-user-token][%d] regenerateMachineUserTokenInternalServerError ", 500) +} + +func (o *RegenerateMachineUserTokenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/restart_application_parameters.go b/generated-client/client/application/restart_application_parameters.go new file mode 100644 index 0000000..cc2f34f --- /dev/null +++ b/generated-client/client/application/restart_application_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRestartApplicationParams creates a new RestartApplicationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRestartApplicationParams() *RestartApplicationParams { + return &RestartApplicationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRestartApplicationParamsWithTimeout creates a new RestartApplicationParams object +// with the ability to set a timeout on a request. +func NewRestartApplicationParamsWithTimeout(timeout time.Duration) *RestartApplicationParams { + return &RestartApplicationParams{ + timeout: timeout, + } +} + +// NewRestartApplicationParamsWithContext creates a new RestartApplicationParams object +// with the ability to set a context for a request. +func NewRestartApplicationParamsWithContext(ctx context.Context) *RestartApplicationParams { + return &RestartApplicationParams{ + Context: ctx, + } +} + +// NewRestartApplicationParamsWithHTTPClient creates a new RestartApplicationParams object +// with the ability to set a custom HTTPClient for a request. +func NewRestartApplicationParamsWithHTTPClient(client *http.Client) *RestartApplicationParams { + return &RestartApplicationParams{ + HTTPClient: client, + } +} + +/* +RestartApplicationParams contains all the parameters to send to the API endpoint + + for the restart application operation. + + Typically these are written to a http.Request. +*/ +type RestartApplicationParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the restart application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartApplicationParams) WithDefaults() *RestartApplicationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartApplicationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the restart application params +func (o *RestartApplicationParams) WithTimeout(timeout time.Duration) *RestartApplicationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restart application params +func (o *RestartApplicationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restart application params +func (o *RestartApplicationParams) WithContext(ctx context.Context) *RestartApplicationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restart application params +func (o *RestartApplicationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restart application params +func (o *RestartApplicationParams) WithHTTPClient(client *http.Client) *RestartApplicationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restart application params +func (o *RestartApplicationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the restart application params +func (o *RestartApplicationParams) WithImpersonateGroup(impersonateGroup []string) *RestartApplicationParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the restart application params +func (o *RestartApplicationParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the restart application params +func (o *RestartApplicationParams) WithImpersonateUser(impersonateUser *string) *RestartApplicationParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the restart application params +func (o *RestartApplicationParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the restart application params +func (o *RestartApplicationParams) WithAppName(appName string) *RestartApplicationParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the restart application params +func (o *RestartApplicationParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *RestartApplicationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRestartApplication binds the parameter Impersonate-Group +func (o *RestartApplicationParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/restart_application_responses.go b/generated-client/client/application/restart_application_responses.go new file mode 100644 index 0000000..20ec381 --- /dev/null +++ b/generated-client/client/application/restart_application_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RestartApplicationReader is a Reader for the RestartApplication structure. +type RestartApplicationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestartApplicationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRestartApplicationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewRestartApplicationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRestartApplicationNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/restart] restartApplication", response, response.Code()) + } +} + +// NewRestartApplicationOK creates a RestartApplicationOK with default headers values +func NewRestartApplicationOK() *RestartApplicationOK { + return &RestartApplicationOK{} +} + +/* +RestartApplicationOK describes a response with status code 200, with default header values. + +Application started ok +*/ +type RestartApplicationOK struct { +} + +// IsSuccess returns true when this restart application o k response has a 2xx status code +func (o *RestartApplicationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this restart application o k response has a 3xx status code +func (o *RestartApplicationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart application o k response has a 4xx status code +func (o *RestartApplicationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this restart application o k response has a 5xx status code +func (o *RestartApplicationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this restart application o k response a status code equal to that given +func (o *RestartApplicationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the restart application o k response +func (o *RestartApplicationOK) Code() int { + return 200 +} + +func (o *RestartApplicationOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/restart][%d] restartApplicationOK ", 200) +} + +func (o *RestartApplicationOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/restart][%d] restartApplicationOK ", 200) +} + +func (o *RestartApplicationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartApplicationUnauthorized creates a RestartApplicationUnauthorized with default headers values +func NewRestartApplicationUnauthorized() *RestartApplicationUnauthorized { + return &RestartApplicationUnauthorized{} +} + +/* +RestartApplicationUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RestartApplicationUnauthorized struct { +} + +// IsSuccess returns true when this restart application unauthorized response has a 2xx status code +func (o *RestartApplicationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart application unauthorized response has a 3xx status code +func (o *RestartApplicationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart application unauthorized response has a 4xx status code +func (o *RestartApplicationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart application unauthorized response has a 5xx status code +func (o *RestartApplicationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this restart application unauthorized response a status code equal to that given +func (o *RestartApplicationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the restart application unauthorized response +func (o *RestartApplicationUnauthorized) Code() int { + return 401 +} + +func (o *RestartApplicationUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/restart][%d] restartApplicationUnauthorized ", 401) +} + +func (o *RestartApplicationUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/restart][%d] restartApplicationUnauthorized ", 401) +} + +func (o *RestartApplicationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartApplicationNotFound creates a RestartApplicationNotFound with default headers values +func NewRestartApplicationNotFound() *RestartApplicationNotFound { + return &RestartApplicationNotFound{} +} + +/* +RestartApplicationNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RestartApplicationNotFound struct { +} + +// IsSuccess returns true when this restart application not found response has a 2xx status code +func (o *RestartApplicationNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart application not found response has a 3xx status code +func (o *RestartApplicationNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart application not found response has a 4xx status code +func (o *RestartApplicationNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart application not found response has a 5xx status code +func (o *RestartApplicationNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this restart application not found response a status code equal to that given +func (o *RestartApplicationNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the restart application not found response +func (o *RestartApplicationNotFound) Code() int { + return 404 +} + +func (o *RestartApplicationNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/restart][%d] restartApplicationNotFound ", 404) +} + +func (o *RestartApplicationNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/restart][%d] restartApplicationNotFound ", 404) +} + +func (o *RestartApplicationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/start_application_parameters.go b/generated-client/client/application/start_application_parameters.go new file mode 100644 index 0000000..4eabe6e --- /dev/null +++ b/generated-client/client/application/start_application_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStartApplicationParams creates a new StartApplicationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStartApplicationParams() *StartApplicationParams { + return &StartApplicationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStartApplicationParamsWithTimeout creates a new StartApplicationParams object +// with the ability to set a timeout on a request. +func NewStartApplicationParamsWithTimeout(timeout time.Duration) *StartApplicationParams { + return &StartApplicationParams{ + timeout: timeout, + } +} + +// NewStartApplicationParamsWithContext creates a new StartApplicationParams object +// with the ability to set a context for a request. +func NewStartApplicationParamsWithContext(ctx context.Context) *StartApplicationParams { + return &StartApplicationParams{ + Context: ctx, + } +} + +// NewStartApplicationParamsWithHTTPClient creates a new StartApplicationParams object +// with the ability to set a custom HTTPClient for a request. +func NewStartApplicationParamsWithHTTPClient(client *http.Client) *StartApplicationParams { + return &StartApplicationParams{ + HTTPClient: client, + } +} + +/* +StartApplicationParams contains all the parameters to send to the API endpoint + + for the start application operation. + + Typically these are written to a http.Request. +*/ +type StartApplicationParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the start application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartApplicationParams) WithDefaults() *StartApplicationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartApplicationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the start application params +func (o *StartApplicationParams) WithTimeout(timeout time.Duration) *StartApplicationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the start application params +func (o *StartApplicationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the start application params +func (o *StartApplicationParams) WithContext(ctx context.Context) *StartApplicationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the start application params +func (o *StartApplicationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the start application params +func (o *StartApplicationParams) WithHTTPClient(client *http.Client) *StartApplicationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the start application params +func (o *StartApplicationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the start application params +func (o *StartApplicationParams) WithImpersonateGroup(impersonateGroup []string) *StartApplicationParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the start application params +func (o *StartApplicationParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the start application params +func (o *StartApplicationParams) WithImpersonateUser(impersonateUser *string) *StartApplicationParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the start application params +func (o *StartApplicationParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the start application params +func (o *StartApplicationParams) WithAppName(appName string) *StartApplicationParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the start application params +func (o *StartApplicationParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *StartApplicationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStartApplication binds the parameter Impersonate-Group +func (o *StartApplicationParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/start_application_responses.go b/generated-client/client/application/start_application_responses.go new file mode 100644 index 0000000..9966269 --- /dev/null +++ b/generated-client/client/application/start_application_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StartApplicationReader is a Reader for the StartApplication structure. +type StartApplicationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StartApplicationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStartApplicationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewStartApplicationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStartApplicationNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/start] startApplication", response, response.Code()) + } +} + +// NewStartApplicationOK creates a StartApplicationOK with default headers values +func NewStartApplicationOK() *StartApplicationOK { + return &StartApplicationOK{} +} + +/* +StartApplicationOK describes a response with status code 200, with default header values. + +Application started ok +*/ +type StartApplicationOK struct { +} + +// IsSuccess returns true when this start application o k response has a 2xx status code +func (o *StartApplicationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this start application o k response has a 3xx status code +func (o *StartApplicationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start application o k response has a 4xx status code +func (o *StartApplicationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this start application o k response has a 5xx status code +func (o *StartApplicationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this start application o k response a status code equal to that given +func (o *StartApplicationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the start application o k response +func (o *StartApplicationOK) Code() int { + return 200 +} + +func (o *StartApplicationOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/start][%d] startApplicationOK ", 200) +} + +func (o *StartApplicationOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/start][%d] startApplicationOK ", 200) +} + +func (o *StartApplicationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStartApplicationUnauthorized creates a StartApplicationUnauthorized with default headers values +func NewStartApplicationUnauthorized() *StartApplicationUnauthorized { + return &StartApplicationUnauthorized{} +} + +/* +StartApplicationUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StartApplicationUnauthorized struct { +} + +// IsSuccess returns true when this start application unauthorized response has a 2xx status code +func (o *StartApplicationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this start application unauthorized response has a 3xx status code +func (o *StartApplicationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start application unauthorized response has a 4xx status code +func (o *StartApplicationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this start application unauthorized response has a 5xx status code +func (o *StartApplicationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this start application unauthorized response a status code equal to that given +func (o *StartApplicationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the start application unauthorized response +func (o *StartApplicationUnauthorized) Code() int { + return 401 +} + +func (o *StartApplicationUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/start][%d] startApplicationUnauthorized ", 401) +} + +func (o *StartApplicationUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/start][%d] startApplicationUnauthorized ", 401) +} + +func (o *StartApplicationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStartApplicationNotFound creates a StartApplicationNotFound with default headers values +func NewStartApplicationNotFound() *StartApplicationNotFound { + return &StartApplicationNotFound{} +} + +/* +StartApplicationNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StartApplicationNotFound struct { +} + +// IsSuccess returns true when this start application not found response has a 2xx status code +func (o *StartApplicationNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this start application not found response has a 3xx status code +func (o *StartApplicationNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start application not found response has a 4xx status code +func (o *StartApplicationNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this start application not found response has a 5xx status code +func (o *StartApplicationNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this start application not found response a status code equal to that given +func (o *StartApplicationNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the start application not found response +func (o *StartApplicationNotFound) Code() int { + return 404 +} + +func (o *StartApplicationNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/start][%d] startApplicationNotFound ", 404) +} + +func (o *StartApplicationNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/start][%d] startApplicationNotFound ", 404) +} + +func (o *StartApplicationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/stop_application_parameters.go b/generated-client/client/application/stop_application_parameters.go new file mode 100644 index 0000000..ef818fc --- /dev/null +++ b/generated-client/client/application/stop_application_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStopApplicationParams creates a new StopApplicationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStopApplicationParams() *StopApplicationParams { + return &StopApplicationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStopApplicationParamsWithTimeout creates a new StopApplicationParams object +// with the ability to set a timeout on a request. +func NewStopApplicationParamsWithTimeout(timeout time.Duration) *StopApplicationParams { + return &StopApplicationParams{ + timeout: timeout, + } +} + +// NewStopApplicationParamsWithContext creates a new StopApplicationParams object +// with the ability to set a context for a request. +func NewStopApplicationParamsWithContext(ctx context.Context) *StopApplicationParams { + return &StopApplicationParams{ + Context: ctx, + } +} + +// NewStopApplicationParamsWithHTTPClient creates a new StopApplicationParams object +// with the ability to set a custom HTTPClient for a request. +func NewStopApplicationParamsWithHTTPClient(client *http.Client) *StopApplicationParams { + return &StopApplicationParams{ + HTTPClient: client, + } +} + +/* +StopApplicationParams contains all the parameters to send to the API endpoint + + for the stop application operation. + + Typically these are written to a http.Request. +*/ +type StopApplicationParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stop application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopApplicationParams) WithDefaults() *StopApplicationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stop application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopApplicationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stop application params +func (o *StopApplicationParams) WithTimeout(timeout time.Duration) *StopApplicationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stop application params +func (o *StopApplicationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stop application params +func (o *StopApplicationParams) WithContext(ctx context.Context) *StopApplicationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stop application params +func (o *StopApplicationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stop application params +func (o *StopApplicationParams) WithHTTPClient(client *http.Client) *StopApplicationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stop application params +func (o *StopApplicationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the stop application params +func (o *StopApplicationParams) WithImpersonateGroup(impersonateGroup []string) *StopApplicationParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the stop application params +func (o *StopApplicationParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the stop application params +func (o *StopApplicationParams) WithImpersonateUser(impersonateUser *string) *StopApplicationParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the stop application params +func (o *StopApplicationParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the stop application params +func (o *StopApplicationParams) WithAppName(appName string) *StopApplicationParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the stop application params +func (o *StopApplicationParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *StopApplicationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStopApplication binds the parameter Impersonate-Group +func (o *StopApplicationParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/stop_application_responses.go b/generated-client/client/application/stop_application_responses.go new file mode 100644 index 0000000..3ef60b8 --- /dev/null +++ b/generated-client/client/application/stop_application_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StopApplicationReader is a Reader for the StopApplication structure. +type StopApplicationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StopApplicationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStopApplicationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewStopApplicationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStopApplicationNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/stop] stopApplication", response, response.Code()) + } +} + +// NewStopApplicationOK creates a StopApplicationOK with default headers values +func NewStopApplicationOK() *StopApplicationOK { + return &StopApplicationOK{} +} + +/* +StopApplicationOK describes a response with status code 200, with default header values. + +Application stopped ok +*/ +type StopApplicationOK struct { +} + +// IsSuccess returns true when this stop application o k response has a 2xx status code +func (o *StopApplicationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stop application o k response has a 3xx status code +func (o *StopApplicationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop application o k response has a 4xx status code +func (o *StopApplicationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this stop application o k response has a 5xx status code +func (o *StopApplicationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this stop application o k response a status code equal to that given +func (o *StopApplicationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the stop application o k response +func (o *StopApplicationOK) Code() int { + return 200 +} + +func (o *StopApplicationOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/stop][%d] stopApplicationOK ", 200) +} + +func (o *StopApplicationOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/stop][%d] stopApplicationOK ", 200) +} + +func (o *StopApplicationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopApplicationUnauthorized creates a StopApplicationUnauthorized with default headers values +func NewStopApplicationUnauthorized() *StopApplicationUnauthorized { + return &StopApplicationUnauthorized{} +} + +/* +StopApplicationUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StopApplicationUnauthorized struct { +} + +// IsSuccess returns true when this stop application unauthorized response has a 2xx status code +func (o *StopApplicationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop application unauthorized response has a 3xx status code +func (o *StopApplicationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop application unauthorized response has a 4xx status code +func (o *StopApplicationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop application unauthorized response has a 5xx status code +func (o *StopApplicationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this stop application unauthorized response a status code equal to that given +func (o *StopApplicationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the stop application unauthorized response +func (o *StopApplicationUnauthorized) Code() int { + return 401 +} + +func (o *StopApplicationUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/stop][%d] stopApplicationUnauthorized ", 401) +} + +func (o *StopApplicationUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/stop][%d] stopApplicationUnauthorized ", 401) +} + +func (o *StopApplicationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopApplicationNotFound creates a StopApplicationNotFound with default headers values +func NewStopApplicationNotFound() *StopApplicationNotFound { + return &StopApplicationNotFound{} +} + +/* +StopApplicationNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StopApplicationNotFound struct { +} + +// IsSuccess returns true when this stop application not found response has a 2xx status code +func (o *StopApplicationNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop application not found response has a 3xx status code +func (o *StopApplicationNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop application not found response has a 4xx status code +func (o *StopApplicationNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop application not found response has a 5xx status code +func (o *StopApplicationNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this stop application not found response a status code equal to that given +func (o *StopApplicationNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the stop application not found response +func (o *StopApplicationNotFound) Code() int { + return 404 +} + +func (o *StopApplicationNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/stop][%d] stopApplicationNotFound ", 404) +} + +func (o *StopApplicationNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/stop][%d] stopApplicationNotFound ", 404) +} + +func (o *StopApplicationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/trigger_pipeline_build_deploy_parameters.go b/generated-client/client/application/trigger_pipeline_build_deploy_parameters.go new file mode 100644 index 0000000..400f718 --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_build_deploy_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewTriggerPipelineBuildDeployParams creates a new TriggerPipelineBuildDeployParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTriggerPipelineBuildDeployParams() *TriggerPipelineBuildDeployParams { + return &TriggerPipelineBuildDeployParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTriggerPipelineBuildDeployParamsWithTimeout creates a new TriggerPipelineBuildDeployParams object +// with the ability to set a timeout on a request. +func NewTriggerPipelineBuildDeployParamsWithTimeout(timeout time.Duration) *TriggerPipelineBuildDeployParams { + return &TriggerPipelineBuildDeployParams{ + timeout: timeout, + } +} + +// NewTriggerPipelineBuildDeployParamsWithContext creates a new TriggerPipelineBuildDeployParams object +// with the ability to set a context for a request. +func NewTriggerPipelineBuildDeployParamsWithContext(ctx context.Context) *TriggerPipelineBuildDeployParams { + return &TriggerPipelineBuildDeployParams{ + Context: ctx, + } +} + +// NewTriggerPipelineBuildDeployParamsWithHTTPClient creates a new TriggerPipelineBuildDeployParams object +// with the ability to set a custom HTTPClient for a request. +func NewTriggerPipelineBuildDeployParamsWithHTTPClient(client *http.Client) *TriggerPipelineBuildDeployParams { + return &TriggerPipelineBuildDeployParams{ + HTTPClient: client, + } +} + +/* +TriggerPipelineBuildDeployParams contains all the parameters to send to the API endpoint + + for the trigger pipeline build deploy operation. + + Typically these are written to a http.Request. +*/ +type TriggerPipelineBuildDeployParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* PipelineParametersBuild. + + Pipeline parameters + */ + PipelineParametersBuild *models.PipelineParametersBuild + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the trigger pipeline build deploy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelineBuildDeployParams) WithDefaults() *TriggerPipelineBuildDeployParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the trigger pipeline build deploy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelineBuildDeployParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) WithTimeout(timeout time.Duration) *TriggerPipelineBuildDeployParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) WithContext(ctx context.Context) *TriggerPipelineBuildDeployParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) WithHTTPClient(client *http.Client) *TriggerPipelineBuildDeployParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) WithImpersonateGroup(impersonateGroup []string) *TriggerPipelineBuildDeployParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) WithImpersonateUser(impersonateUser *string) *TriggerPipelineBuildDeployParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithPipelineParametersBuild adds the pipelineParametersBuild to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) WithPipelineParametersBuild(pipelineParametersBuild *models.PipelineParametersBuild) *TriggerPipelineBuildDeployParams { + o.SetPipelineParametersBuild(pipelineParametersBuild) + return o +} + +// SetPipelineParametersBuild adds the pipelineParametersBuild to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) SetPipelineParametersBuild(pipelineParametersBuild *models.PipelineParametersBuild) { + o.PipelineParametersBuild = pipelineParametersBuild +} + +// WithAppName adds the appName to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) WithAppName(appName string) *TriggerPipelineBuildDeployParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the trigger pipeline build deploy params +func (o *TriggerPipelineBuildDeployParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *TriggerPipelineBuildDeployParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.PipelineParametersBuild != nil { + if err := r.SetBodyParam(o.PipelineParametersBuild); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamTriggerPipelineBuildDeploy binds the parameter Impersonate-Group +func (o *TriggerPipelineBuildDeployParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/trigger_pipeline_build_deploy_responses.go b/generated-client/client/application/trigger_pipeline_build_deploy_responses.go new file mode 100644 index 0000000..87b68ab --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_build_deploy_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// TriggerPipelineBuildDeployReader is a Reader for the TriggerPipelineBuildDeploy structure. +type TriggerPipelineBuildDeployReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TriggerPipelineBuildDeployReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTriggerPipelineBuildDeployOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewTriggerPipelineBuildDeployForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewTriggerPipelineBuildDeployNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/pipelines/build-deploy] triggerPipelineBuildDeploy", response, response.Code()) + } +} + +// NewTriggerPipelineBuildDeployOK creates a TriggerPipelineBuildDeployOK with default headers values +func NewTriggerPipelineBuildDeployOK() *TriggerPipelineBuildDeployOK { + return &TriggerPipelineBuildDeployOK{} +} + +/* +TriggerPipelineBuildDeployOK describes a response with status code 200, with default header values. + +Successful trigger pipeline +*/ +type TriggerPipelineBuildDeployOK struct { + Payload *models.JobSummary +} + +// IsSuccess returns true when this trigger pipeline build deploy o k response has a 2xx status code +func (o *TriggerPipelineBuildDeployOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this trigger pipeline build deploy o k response has a 3xx status code +func (o *TriggerPipelineBuildDeployOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline build deploy o k response has a 4xx status code +func (o *TriggerPipelineBuildDeployOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this trigger pipeline build deploy o k response has a 5xx status code +func (o *TriggerPipelineBuildDeployOK) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline build deploy o k response a status code equal to that given +func (o *TriggerPipelineBuildDeployOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the trigger pipeline build deploy o k response +func (o *TriggerPipelineBuildDeployOK) Code() int { + return 200 +} + +func (o *TriggerPipelineBuildDeployOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build-deploy][%d] triggerPipelineBuildDeployOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelineBuildDeployOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build-deploy][%d] triggerPipelineBuildDeployOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelineBuildDeployOK) GetPayload() *models.JobSummary { + return o.Payload +} + +func (o *TriggerPipelineBuildDeployOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JobSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTriggerPipelineBuildDeployForbidden creates a TriggerPipelineBuildDeployForbidden with default headers values +func NewTriggerPipelineBuildDeployForbidden() *TriggerPipelineBuildDeployForbidden { + return &TriggerPipelineBuildDeployForbidden{} +} + +/* +TriggerPipelineBuildDeployForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type TriggerPipelineBuildDeployForbidden struct { +} + +// IsSuccess returns true when this trigger pipeline build deploy forbidden response has a 2xx status code +func (o *TriggerPipelineBuildDeployForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this trigger pipeline build deploy forbidden response has a 3xx status code +func (o *TriggerPipelineBuildDeployForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline build deploy forbidden response has a 4xx status code +func (o *TriggerPipelineBuildDeployForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this trigger pipeline build deploy forbidden response has a 5xx status code +func (o *TriggerPipelineBuildDeployForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline build deploy forbidden response a status code equal to that given +func (o *TriggerPipelineBuildDeployForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the trigger pipeline build deploy forbidden response +func (o *TriggerPipelineBuildDeployForbidden) Code() int { + return 403 +} + +func (o *TriggerPipelineBuildDeployForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build-deploy][%d] triggerPipelineBuildDeployForbidden ", 403) +} + +func (o *TriggerPipelineBuildDeployForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build-deploy][%d] triggerPipelineBuildDeployForbidden ", 403) +} + +func (o *TriggerPipelineBuildDeployForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTriggerPipelineBuildDeployNotFound creates a TriggerPipelineBuildDeployNotFound with default headers values +func NewTriggerPipelineBuildDeployNotFound() *TriggerPipelineBuildDeployNotFound { + return &TriggerPipelineBuildDeployNotFound{} +} + +/* +TriggerPipelineBuildDeployNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type TriggerPipelineBuildDeployNotFound struct { +} + +// IsSuccess returns true when this trigger pipeline build deploy not found response has a 2xx status code +func (o *TriggerPipelineBuildDeployNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this trigger pipeline build deploy not found response has a 3xx status code +func (o *TriggerPipelineBuildDeployNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline build deploy not found response has a 4xx status code +func (o *TriggerPipelineBuildDeployNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this trigger pipeline build deploy not found response has a 5xx status code +func (o *TriggerPipelineBuildDeployNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline build deploy not found response a status code equal to that given +func (o *TriggerPipelineBuildDeployNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the trigger pipeline build deploy not found response +func (o *TriggerPipelineBuildDeployNotFound) Code() int { + return 404 +} + +func (o *TriggerPipelineBuildDeployNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build-deploy][%d] triggerPipelineBuildDeployNotFound ", 404) +} + +func (o *TriggerPipelineBuildDeployNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build-deploy][%d] triggerPipelineBuildDeployNotFound ", 404) +} + +func (o *TriggerPipelineBuildDeployNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/trigger_pipeline_build_parameters.go b/generated-client/client/application/trigger_pipeline_build_parameters.go new file mode 100644 index 0000000..89ae73e --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_build_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewTriggerPipelineBuildParams creates a new TriggerPipelineBuildParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTriggerPipelineBuildParams() *TriggerPipelineBuildParams { + return &TriggerPipelineBuildParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTriggerPipelineBuildParamsWithTimeout creates a new TriggerPipelineBuildParams object +// with the ability to set a timeout on a request. +func NewTriggerPipelineBuildParamsWithTimeout(timeout time.Duration) *TriggerPipelineBuildParams { + return &TriggerPipelineBuildParams{ + timeout: timeout, + } +} + +// NewTriggerPipelineBuildParamsWithContext creates a new TriggerPipelineBuildParams object +// with the ability to set a context for a request. +func NewTriggerPipelineBuildParamsWithContext(ctx context.Context) *TriggerPipelineBuildParams { + return &TriggerPipelineBuildParams{ + Context: ctx, + } +} + +// NewTriggerPipelineBuildParamsWithHTTPClient creates a new TriggerPipelineBuildParams object +// with the ability to set a custom HTTPClient for a request. +func NewTriggerPipelineBuildParamsWithHTTPClient(client *http.Client) *TriggerPipelineBuildParams { + return &TriggerPipelineBuildParams{ + HTTPClient: client, + } +} + +/* +TriggerPipelineBuildParams contains all the parameters to send to the API endpoint + + for the trigger pipeline build operation. + + Typically these are written to a http.Request. +*/ +type TriggerPipelineBuildParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* PipelineParametersBuild. + + Pipeline parameters + */ + PipelineParametersBuild *models.PipelineParametersBuild + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the trigger pipeline build params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelineBuildParams) WithDefaults() *TriggerPipelineBuildParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the trigger pipeline build params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelineBuildParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) WithTimeout(timeout time.Duration) *TriggerPipelineBuildParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) WithContext(ctx context.Context) *TriggerPipelineBuildParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) WithHTTPClient(client *http.Client) *TriggerPipelineBuildParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) WithImpersonateGroup(impersonateGroup []string) *TriggerPipelineBuildParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) WithImpersonateUser(impersonateUser *string) *TriggerPipelineBuildParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithPipelineParametersBuild adds the pipelineParametersBuild to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) WithPipelineParametersBuild(pipelineParametersBuild *models.PipelineParametersBuild) *TriggerPipelineBuildParams { + o.SetPipelineParametersBuild(pipelineParametersBuild) + return o +} + +// SetPipelineParametersBuild adds the pipelineParametersBuild to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) SetPipelineParametersBuild(pipelineParametersBuild *models.PipelineParametersBuild) { + o.PipelineParametersBuild = pipelineParametersBuild +} + +// WithAppName adds the appName to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) WithAppName(appName string) *TriggerPipelineBuildParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the trigger pipeline build params +func (o *TriggerPipelineBuildParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *TriggerPipelineBuildParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.PipelineParametersBuild != nil { + if err := r.SetBodyParam(o.PipelineParametersBuild); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamTriggerPipelineBuild binds the parameter Impersonate-Group +func (o *TriggerPipelineBuildParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/trigger_pipeline_build_responses.go b/generated-client/client/application/trigger_pipeline_build_responses.go new file mode 100644 index 0000000..62e319a --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_build_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// TriggerPipelineBuildReader is a Reader for the TriggerPipelineBuild structure. +type TriggerPipelineBuildReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TriggerPipelineBuildReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTriggerPipelineBuildOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewTriggerPipelineBuildForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewTriggerPipelineBuildNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/pipelines/build] triggerPipelineBuild", response, response.Code()) + } +} + +// NewTriggerPipelineBuildOK creates a TriggerPipelineBuildOK with default headers values +func NewTriggerPipelineBuildOK() *TriggerPipelineBuildOK { + return &TriggerPipelineBuildOK{} +} + +/* +TriggerPipelineBuildOK describes a response with status code 200, with default header values. + +Successful trigger pipeline +*/ +type TriggerPipelineBuildOK struct { + Payload *models.JobSummary +} + +// IsSuccess returns true when this trigger pipeline build o k response has a 2xx status code +func (o *TriggerPipelineBuildOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this trigger pipeline build o k response has a 3xx status code +func (o *TriggerPipelineBuildOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline build o k response has a 4xx status code +func (o *TriggerPipelineBuildOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this trigger pipeline build o k response has a 5xx status code +func (o *TriggerPipelineBuildOK) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline build o k response a status code equal to that given +func (o *TriggerPipelineBuildOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the trigger pipeline build o k response +func (o *TriggerPipelineBuildOK) Code() int { + return 200 +} + +func (o *TriggerPipelineBuildOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build][%d] triggerPipelineBuildOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelineBuildOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build][%d] triggerPipelineBuildOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelineBuildOK) GetPayload() *models.JobSummary { + return o.Payload +} + +func (o *TriggerPipelineBuildOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JobSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTriggerPipelineBuildForbidden creates a TriggerPipelineBuildForbidden with default headers values +func NewTriggerPipelineBuildForbidden() *TriggerPipelineBuildForbidden { + return &TriggerPipelineBuildForbidden{} +} + +/* +TriggerPipelineBuildForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type TriggerPipelineBuildForbidden struct { +} + +// IsSuccess returns true when this trigger pipeline build forbidden response has a 2xx status code +func (o *TriggerPipelineBuildForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this trigger pipeline build forbidden response has a 3xx status code +func (o *TriggerPipelineBuildForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline build forbidden response has a 4xx status code +func (o *TriggerPipelineBuildForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this trigger pipeline build forbidden response has a 5xx status code +func (o *TriggerPipelineBuildForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline build forbidden response a status code equal to that given +func (o *TriggerPipelineBuildForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the trigger pipeline build forbidden response +func (o *TriggerPipelineBuildForbidden) Code() int { + return 403 +} + +func (o *TriggerPipelineBuildForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build][%d] triggerPipelineBuildForbidden ", 403) +} + +func (o *TriggerPipelineBuildForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build][%d] triggerPipelineBuildForbidden ", 403) +} + +func (o *TriggerPipelineBuildForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTriggerPipelineBuildNotFound creates a TriggerPipelineBuildNotFound with default headers values +func NewTriggerPipelineBuildNotFound() *TriggerPipelineBuildNotFound { + return &TriggerPipelineBuildNotFound{} +} + +/* +TriggerPipelineBuildNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type TriggerPipelineBuildNotFound struct { +} + +// IsSuccess returns true when this trigger pipeline build not found response has a 2xx status code +func (o *TriggerPipelineBuildNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this trigger pipeline build not found response has a 3xx status code +func (o *TriggerPipelineBuildNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline build not found response has a 4xx status code +func (o *TriggerPipelineBuildNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this trigger pipeline build not found response has a 5xx status code +func (o *TriggerPipelineBuildNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline build not found response a status code equal to that given +func (o *TriggerPipelineBuildNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the trigger pipeline build not found response +func (o *TriggerPipelineBuildNotFound) Code() int { + return 404 +} + +func (o *TriggerPipelineBuildNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build][%d] triggerPipelineBuildNotFound ", 404) +} + +func (o *TriggerPipelineBuildNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/build][%d] triggerPipelineBuildNotFound ", 404) +} + +func (o *TriggerPipelineBuildNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/trigger_pipeline_deploy_parameters.go b/generated-client/client/application/trigger_pipeline_deploy_parameters.go new file mode 100644 index 0000000..51754ae --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_deploy_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewTriggerPipelineDeployParams creates a new TriggerPipelineDeployParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTriggerPipelineDeployParams() *TriggerPipelineDeployParams { + return &TriggerPipelineDeployParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTriggerPipelineDeployParamsWithTimeout creates a new TriggerPipelineDeployParams object +// with the ability to set a timeout on a request. +func NewTriggerPipelineDeployParamsWithTimeout(timeout time.Duration) *TriggerPipelineDeployParams { + return &TriggerPipelineDeployParams{ + timeout: timeout, + } +} + +// NewTriggerPipelineDeployParamsWithContext creates a new TriggerPipelineDeployParams object +// with the ability to set a context for a request. +func NewTriggerPipelineDeployParamsWithContext(ctx context.Context) *TriggerPipelineDeployParams { + return &TriggerPipelineDeployParams{ + Context: ctx, + } +} + +// NewTriggerPipelineDeployParamsWithHTTPClient creates a new TriggerPipelineDeployParams object +// with the ability to set a custom HTTPClient for a request. +func NewTriggerPipelineDeployParamsWithHTTPClient(client *http.Client) *TriggerPipelineDeployParams { + return &TriggerPipelineDeployParams{ + HTTPClient: client, + } +} + +/* +TriggerPipelineDeployParams contains all the parameters to send to the API endpoint + + for the trigger pipeline deploy operation. + + Typically these are written to a http.Request. +*/ +type TriggerPipelineDeployParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* PipelineParametersDeploy. + + Pipeline parameters + */ + PipelineParametersDeploy *models.PipelineParametersDeploy + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the trigger pipeline deploy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelineDeployParams) WithDefaults() *TriggerPipelineDeployParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the trigger pipeline deploy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelineDeployParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) WithTimeout(timeout time.Duration) *TriggerPipelineDeployParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) WithContext(ctx context.Context) *TriggerPipelineDeployParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) WithHTTPClient(client *http.Client) *TriggerPipelineDeployParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) WithImpersonateGroup(impersonateGroup []string) *TriggerPipelineDeployParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) WithImpersonateUser(impersonateUser *string) *TriggerPipelineDeployParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithPipelineParametersDeploy adds the pipelineParametersDeploy to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) WithPipelineParametersDeploy(pipelineParametersDeploy *models.PipelineParametersDeploy) *TriggerPipelineDeployParams { + o.SetPipelineParametersDeploy(pipelineParametersDeploy) + return o +} + +// SetPipelineParametersDeploy adds the pipelineParametersDeploy to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) SetPipelineParametersDeploy(pipelineParametersDeploy *models.PipelineParametersDeploy) { + o.PipelineParametersDeploy = pipelineParametersDeploy +} + +// WithAppName adds the appName to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) WithAppName(appName string) *TriggerPipelineDeployParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the trigger pipeline deploy params +func (o *TriggerPipelineDeployParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *TriggerPipelineDeployParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.PipelineParametersDeploy != nil { + if err := r.SetBodyParam(o.PipelineParametersDeploy); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamTriggerPipelineDeploy binds the parameter Impersonate-Group +func (o *TriggerPipelineDeployParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/trigger_pipeline_deploy_responses.go b/generated-client/client/application/trigger_pipeline_deploy_responses.go new file mode 100644 index 0000000..0723113 --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_deploy_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// TriggerPipelineDeployReader is a Reader for the TriggerPipelineDeploy structure. +type TriggerPipelineDeployReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TriggerPipelineDeployReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTriggerPipelineDeployOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewTriggerPipelineDeployForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewTriggerPipelineDeployNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/pipelines/deploy] triggerPipelineDeploy", response, response.Code()) + } +} + +// NewTriggerPipelineDeployOK creates a TriggerPipelineDeployOK with default headers values +func NewTriggerPipelineDeployOK() *TriggerPipelineDeployOK { + return &TriggerPipelineDeployOK{} +} + +/* +TriggerPipelineDeployOK describes a response with status code 200, with default header values. + +Successful trigger pipeline +*/ +type TriggerPipelineDeployOK struct { + Payload *models.JobSummary +} + +// IsSuccess returns true when this trigger pipeline deploy o k response has a 2xx status code +func (o *TriggerPipelineDeployOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this trigger pipeline deploy o k response has a 3xx status code +func (o *TriggerPipelineDeployOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline deploy o k response has a 4xx status code +func (o *TriggerPipelineDeployOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this trigger pipeline deploy o k response has a 5xx status code +func (o *TriggerPipelineDeployOK) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline deploy o k response a status code equal to that given +func (o *TriggerPipelineDeployOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the trigger pipeline deploy o k response +func (o *TriggerPipelineDeployOK) Code() int { + return 200 +} + +func (o *TriggerPipelineDeployOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/deploy][%d] triggerPipelineDeployOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelineDeployOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/deploy][%d] triggerPipelineDeployOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelineDeployOK) GetPayload() *models.JobSummary { + return o.Payload +} + +func (o *TriggerPipelineDeployOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JobSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTriggerPipelineDeployForbidden creates a TriggerPipelineDeployForbidden with default headers values +func NewTriggerPipelineDeployForbidden() *TriggerPipelineDeployForbidden { + return &TriggerPipelineDeployForbidden{} +} + +/* +TriggerPipelineDeployForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type TriggerPipelineDeployForbidden struct { +} + +// IsSuccess returns true when this trigger pipeline deploy forbidden response has a 2xx status code +func (o *TriggerPipelineDeployForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this trigger pipeline deploy forbidden response has a 3xx status code +func (o *TriggerPipelineDeployForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline deploy forbidden response has a 4xx status code +func (o *TriggerPipelineDeployForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this trigger pipeline deploy forbidden response has a 5xx status code +func (o *TriggerPipelineDeployForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline deploy forbidden response a status code equal to that given +func (o *TriggerPipelineDeployForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the trigger pipeline deploy forbidden response +func (o *TriggerPipelineDeployForbidden) Code() int { + return 403 +} + +func (o *TriggerPipelineDeployForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/deploy][%d] triggerPipelineDeployForbidden ", 403) +} + +func (o *TriggerPipelineDeployForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/deploy][%d] triggerPipelineDeployForbidden ", 403) +} + +func (o *TriggerPipelineDeployForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTriggerPipelineDeployNotFound creates a TriggerPipelineDeployNotFound with default headers values +func NewTriggerPipelineDeployNotFound() *TriggerPipelineDeployNotFound { + return &TriggerPipelineDeployNotFound{} +} + +/* +TriggerPipelineDeployNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type TriggerPipelineDeployNotFound struct { +} + +// IsSuccess returns true when this trigger pipeline deploy not found response has a 2xx status code +func (o *TriggerPipelineDeployNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this trigger pipeline deploy not found response has a 3xx status code +func (o *TriggerPipelineDeployNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline deploy not found response has a 4xx status code +func (o *TriggerPipelineDeployNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this trigger pipeline deploy not found response has a 5xx status code +func (o *TriggerPipelineDeployNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline deploy not found response a status code equal to that given +func (o *TriggerPipelineDeployNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the trigger pipeline deploy not found response +func (o *TriggerPipelineDeployNotFound) Code() int { + return 404 +} + +func (o *TriggerPipelineDeployNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/deploy][%d] triggerPipelineDeployNotFound ", 404) +} + +func (o *TriggerPipelineDeployNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/deploy][%d] triggerPipelineDeployNotFound ", 404) +} + +func (o *TriggerPipelineDeployNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/trigger_pipeline_promote_parameters.go b/generated-client/client/application/trigger_pipeline_promote_parameters.go new file mode 100644 index 0000000..7bd2684 --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_promote_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewTriggerPipelinePromoteParams creates a new TriggerPipelinePromoteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTriggerPipelinePromoteParams() *TriggerPipelinePromoteParams { + return &TriggerPipelinePromoteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTriggerPipelinePromoteParamsWithTimeout creates a new TriggerPipelinePromoteParams object +// with the ability to set a timeout on a request. +func NewTriggerPipelinePromoteParamsWithTimeout(timeout time.Duration) *TriggerPipelinePromoteParams { + return &TriggerPipelinePromoteParams{ + timeout: timeout, + } +} + +// NewTriggerPipelinePromoteParamsWithContext creates a new TriggerPipelinePromoteParams object +// with the ability to set a context for a request. +func NewTriggerPipelinePromoteParamsWithContext(ctx context.Context) *TriggerPipelinePromoteParams { + return &TriggerPipelinePromoteParams{ + Context: ctx, + } +} + +// NewTriggerPipelinePromoteParamsWithHTTPClient creates a new TriggerPipelinePromoteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTriggerPipelinePromoteParamsWithHTTPClient(client *http.Client) *TriggerPipelinePromoteParams { + return &TriggerPipelinePromoteParams{ + HTTPClient: client, + } +} + +/* +TriggerPipelinePromoteParams contains all the parameters to send to the API endpoint + + for the trigger pipeline promote operation. + + Typically these are written to a http.Request. +*/ +type TriggerPipelinePromoteParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* PipelineParametersPromote. + + Pipeline parameters + */ + PipelineParametersPromote *models.PipelineParametersPromote + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the trigger pipeline promote params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelinePromoteParams) WithDefaults() *TriggerPipelinePromoteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the trigger pipeline promote params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TriggerPipelinePromoteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) WithTimeout(timeout time.Duration) *TriggerPipelinePromoteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) WithContext(ctx context.Context) *TriggerPipelinePromoteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) WithHTTPClient(client *http.Client) *TriggerPipelinePromoteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) WithImpersonateGroup(impersonateGroup []string) *TriggerPipelinePromoteParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) WithImpersonateUser(impersonateUser *string) *TriggerPipelinePromoteParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithPipelineParametersPromote adds the pipelineParametersPromote to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) WithPipelineParametersPromote(pipelineParametersPromote *models.PipelineParametersPromote) *TriggerPipelinePromoteParams { + o.SetPipelineParametersPromote(pipelineParametersPromote) + return o +} + +// SetPipelineParametersPromote adds the pipelineParametersPromote to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) SetPipelineParametersPromote(pipelineParametersPromote *models.PipelineParametersPromote) { + o.PipelineParametersPromote = pipelineParametersPromote +} + +// WithAppName adds the appName to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) WithAppName(appName string) *TriggerPipelinePromoteParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the trigger pipeline promote params +func (o *TriggerPipelinePromoteParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *TriggerPipelinePromoteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.PipelineParametersPromote != nil { + if err := r.SetBodyParam(o.PipelineParametersPromote); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamTriggerPipelinePromote binds the parameter Impersonate-Group +func (o *TriggerPipelinePromoteParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/trigger_pipeline_promote_responses.go b/generated-client/client/application/trigger_pipeline_promote_responses.go new file mode 100644 index 0000000..c40e343 --- /dev/null +++ b/generated-client/client/application/trigger_pipeline_promote_responses.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// TriggerPipelinePromoteReader is a Reader for the TriggerPipelinePromote structure. +type TriggerPipelinePromoteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TriggerPipelinePromoteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTriggerPipelinePromoteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewTriggerPipelinePromoteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/pipelines/promote] triggerPipelinePromote", response, response.Code()) + } +} + +// NewTriggerPipelinePromoteOK creates a TriggerPipelinePromoteOK with default headers values +func NewTriggerPipelinePromoteOK() *TriggerPipelinePromoteOK { + return &TriggerPipelinePromoteOK{} +} + +/* +TriggerPipelinePromoteOK describes a response with status code 200, with default header values. + +Successful trigger pipeline +*/ +type TriggerPipelinePromoteOK struct { + Payload *models.JobSummary +} + +// IsSuccess returns true when this trigger pipeline promote o k response has a 2xx status code +func (o *TriggerPipelinePromoteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this trigger pipeline promote o k response has a 3xx status code +func (o *TriggerPipelinePromoteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline promote o k response has a 4xx status code +func (o *TriggerPipelinePromoteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this trigger pipeline promote o k response has a 5xx status code +func (o *TriggerPipelinePromoteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline promote o k response a status code equal to that given +func (o *TriggerPipelinePromoteOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the trigger pipeline promote o k response +func (o *TriggerPipelinePromoteOK) Code() int { + return 200 +} + +func (o *TriggerPipelinePromoteOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/promote][%d] triggerPipelinePromoteOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelinePromoteOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/promote][%d] triggerPipelinePromoteOK %+v", 200, o.Payload) +} + +func (o *TriggerPipelinePromoteOK) GetPayload() *models.JobSummary { + return o.Payload +} + +func (o *TriggerPipelinePromoteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JobSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTriggerPipelinePromoteNotFound creates a TriggerPipelinePromoteNotFound with default headers values +func NewTriggerPipelinePromoteNotFound() *TriggerPipelinePromoteNotFound { + return &TriggerPipelinePromoteNotFound{} +} + +/* +TriggerPipelinePromoteNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type TriggerPipelinePromoteNotFound struct { +} + +// IsSuccess returns true when this trigger pipeline promote not found response has a 2xx status code +func (o *TriggerPipelinePromoteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this trigger pipeline promote not found response has a 3xx status code +func (o *TriggerPipelinePromoteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this trigger pipeline promote not found response has a 4xx status code +func (o *TriggerPipelinePromoteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this trigger pipeline promote not found response has a 5xx status code +func (o *TriggerPipelinePromoteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this trigger pipeline promote not found response a status code equal to that given +func (o *TriggerPipelinePromoteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the trigger pipeline promote not found response +func (o *TriggerPipelinePromoteNotFound) Code() int { + return 404 +} + +func (o *TriggerPipelinePromoteNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/promote][%d] triggerPipelinePromoteNotFound ", 404) +} + +func (o *TriggerPipelinePromoteNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/pipelines/promote][%d] triggerPipelinePromoteNotFound ", 404) +} + +func (o *TriggerPipelinePromoteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/update_application_alerting_config_parameters.go b/generated-client/client/application/update_application_alerting_config_parameters.go new file mode 100644 index 0000000..33b5e47 --- /dev/null +++ b/generated-client/client/application/update_application_alerting_config_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewUpdateApplicationAlertingConfigParams creates a new UpdateApplicationAlertingConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateApplicationAlertingConfigParams() *UpdateApplicationAlertingConfigParams { + return &UpdateApplicationAlertingConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateApplicationAlertingConfigParamsWithTimeout creates a new UpdateApplicationAlertingConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateApplicationAlertingConfigParamsWithTimeout(timeout time.Duration) *UpdateApplicationAlertingConfigParams { + return &UpdateApplicationAlertingConfigParams{ + timeout: timeout, + } +} + +// NewUpdateApplicationAlertingConfigParamsWithContext creates a new UpdateApplicationAlertingConfigParams object +// with the ability to set a context for a request. +func NewUpdateApplicationAlertingConfigParamsWithContext(ctx context.Context) *UpdateApplicationAlertingConfigParams { + return &UpdateApplicationAlertingConfigParams{ + Context: ctx, + } +} + +// NewUpdateApplicationAlertingConfigParamsWithHTTPClient creates a new UpdateApplicationAlertingConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateApplicationAlertingConfigParamsWithHTTPClient(client *http.Client) *UpdateApplicationAlertingConfigParams { + return &UpdateApplicationAlertingConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateApplicationAlertingConfigParams contains all the parameters to send to the API endpoint + + for the update application alerting config operation. + + Typically these are written to a http.Request. +*/ +type UpdateApplicationAlertingConfigParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AlertsConfig. + + Alerts configuration + */ + AlertsConfig *models.UpdateAlertingConfig + + /* AppName. + + Name of application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update application alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateApplicationAlertingConfigParams) WithDefaults() *UpdateApplicationAlertingConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update application alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateApplicationAlertingConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) WithTimeout(timeout time.Duration) *UpdateApplicationAlertingConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) WithContext(ctx context.Context) *UpdateApplicationAlertingConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) WithHTTPClient(client *http.Client) *UpdateApplicationAlertingConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) WithImpersonateGroup(impersonateGroup []string) *UpdateApplicationAlertingConfigParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) WithImpersonateUser(impersonateUser *string) *UpdateApplicationAlertingConfigParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAlertsConfig adds the alertsConfig to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) WithAlertsConfig(alertsConfig *models.UpdateAlertingConfig) *UpdateApplicationAlertingConfigParams { + o.SetAlertsConfig(alertsConfig) + return o +} + +// SetAlertsConfig adds the alertsConfig to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) SetAlertsConfig(alertsConfig *models.UpdateAlertingConfig) { + o.AlertsConfig = alertsConfig +} + +// WithAppName adds the appName to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) WithAppName(appName string) *UpdateApplicationAlertingConfigParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the update application alerting config params +func (o *UpdateApplicationAlertingConfigParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateApplicationAlertingConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.AlertsConfig != nil { + if err := r.SetBodyParam(o.AlertsConfig); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamUpdateApplicationAlertingConfig binds the parameter Impersonate-Group +func (o *UpdateApplicationAlertingConfigParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/update_application_alerting_config_responses.go b/generated-client/client/application/update_application_alerting_config_responses.go new file mode 100644 index 0000000..2139e63 --- /dev/null +++ b/generated-client/client/application/update_application_alerting_config_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// UpdateApplicationAlertingConfigReader is a Reader for the UpdateApplicationAlertingConfig structure. +type UpdateApplicationAlertingConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateApplicationAlertingConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateApplicationAlertingConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateApplicationAlertingConfigBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateApplicationAlertingConfigUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateApplicationAlertingConfigForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateApplicationAlertingConfigNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateApplicationAlertingConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /applications/{appName}/alerting] updateApplicationAlertingConfig", response, response.Code()) + } +} + +// NewUpdateApplicationAlertingConfigOK creates a UpdateApplicationAlertingConfigOK with default headers values +func NewUpdateApplicationAlertingConfigOK() *UpdateApplicationAlertingConfigOK { + return &UpdateApplicationAlertingConfigOK{} +} + +/* +UpdateApplicationAlertingConfigOK describes a response with status code 200, with default header values. + +Successful alerts config update +*/ +type UpdateApplicationAlertingConfigOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this update application alerting config o k response has a 2xx status code +func (o *UpdateApplicationAlertingConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update application alerting config o k response has a 3xx status code +func (o *UpdateApplicationAlertingConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update application alerting config o k response has a 4xx status code +func (o *UpdateApplicationAlertingConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update application alerting config o k response has a 5xx status code +func (o *UpdateApplicationAlertingConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update application alerting config o k response a status code equal to that given +func (o *UpdateApplicationAlertingConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update application alerting config o k response +func (o *UpdateApplicationAlertingConfigOK) Code() int { + return 200 +} + +func (o *UpdateApplicationAlertingConfigOK) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateApplicationAlertingConfigOK) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateApplicationAlertingConfigOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *UpdateApplicationAlertingConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateApplicationAlertingConfigBadRequest creates a UpdateApplicationAlertingConfigBadRequest with default headers values +func NewUpdateApplicationAlertingConfigBadRequest() *UpdateApplicationAlertingConfigBadRequest { + return &UpdateApplicationAlertingConfigBadRequest{} +} + +/* +UpdateApplicationAlertingConfigBadRequest describes a response with status code 400, with default header values. + +Invalid configuration +*/ +type UpdateApplicationAlertingConfigBadRequest struct { +} + +// IsSuccess returns true when this update application alerting config bad request response has a 2xx status code +func (o *UpdateApplicationAlertingConfigBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update application alerting config bad request response has a 3xx status code +func (o *UpdateApplicationAlertingConfigBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update application alerting config bad request response has a 4xx status code +func (o *UpdateApplicationAlertingConfigBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update application alerting config bad request response has a 5xx status code +func (o *UpdateApplicationAlertingConfigBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update application alerting config bad request response a status code equal to that given +func (o *UpdateApplicationAlertingConfigBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update application alerting config bad request response +func (o *UpdateApplicationAlertingConfigBadRequest) Code() int { + return 400 +} + +func (o *UpdateApplicationAlertingConfigBadRequest) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigBadRequest ", 400) +} + +func (o *UpdateApplicationAlertingConfigBadRequest) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigBadRequest ", 400) +} + +func (o *UpdateApplicationAlertingConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateApplicationAlertingConfigUnauthorized creates a UpdateApplicationAlertingConfigUnauthorized with default headers values +func NewUpdateApplicationAlertingConfigUnauthorized() *UpdateApplicationAlertingConfigUnauthorized { + return &UpdateApplicationAlertingConfigUnauthorized{} +} + +/* +UpdateApplicationAlertingConfigUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type UpdateApplicationAlertingConfigUnauthorized struct { +} + +// IsSuccess returns true when this update application alerting config unauthorized response has a 2xx status code +func (o *UpdateApplicationAlertingConfigUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update application alerting config unauthorized response has a 3xx status code +func (o *UpdateApplicationAlertingConfigUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update application alerting config unauthorized response has a 4xx status code +func (o *UpdateApplicationAlertingConfigUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update application alerting config unauthorized response has a 5xx status code +func (o *UpdateApplicationAlertingConfigUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update application alerting config unauthorized response a status code equal to that given +func (o *UpdateApplicationAlertingConfigUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update application alerting config unauthorized response +func (o *UpdateApplicationAlertingConfigUnauthorized) Code() int { + return 401 +} + +func (o *UpdateApplicationAlertingConfigUnauthorized) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigUnauthorized ", 401) +} + +func (o *UpdateApplicationAlertingConfigUnauthorized) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigUnauthorized ", 401) +} + +func (o *UpdateApplicationAlertingConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateApplicationAlertingConfigForbidden creates a UpdateApplicationAlertingConfigForbidden with default headers values +func NewUpdateApplicationAlertingConfigForbidden() *UpdateApplicationAlertingConfigForbidden { + return &UpdateApplicationAlertingConfigForbidden{} +} + +/* +UpdateApplicationAlertingConfigForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type UpdateApplicationAlertingConfigForbidden struct { +} + +// IsSuccess returns true when this update application alerting config forbidden response has a 2xx status code +func (o *UpdateApplicationAlertingConfigForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update application alerting config forbidden response has a 3xx status code +func (o *UpdateApplicationAlertingConfigForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update application alerting config forbidden response has a 4xx status code +func (o *UpdateApplicationAlertingConfigForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update application alerting config forbidden response has a 5xx status code +func (o *UpdateApplicationAlertingConfigForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update application alerting config forbidden response a status code equal to that given +func (o *UpdateApplicationAlertingConfigForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update application alerting config forbidden response +func (o *UpdateApplicationAlertingConfigForbidden) Code() int { + return 403 +} + +func (o *UpdateApplicationAlertingConfigForbidden) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigForbidden ", 403) +} + +func (o *UpdateApplicationAlertingConfigForbidden) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigForbidden ", 403) +} + +func (o *UpdateApplicationAlertingConfigForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateApplicationAlertingConfigNotFound creates a UpdateApplicationAlertingConfigNotFound with default headers values +func NewUpdateApplicationAlertingConfigNotFound() *UpdateApplicationAlertingConfigNotFound { + return &UpdateApplicationAlertingConfigNotFound{} +} + +/* +UpdateApplicationAlertingConfigNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type UpdateApplicationAlertingConfigNotFound struct { +} + +// IsSuccess returns true when this update application alerting config not found response has a 2xx status code +func (o *UpdateApplicationAlertingConfigNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update application alerting config not found response has a 3xx status code +func (o *UpdateApplicationAlertingConfigNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update application alerting config not found response has a 4xx status code +func (o *UpdateApplicationAlertingConfigNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update application alerting config not found response has a 5xx status code +func (o *UpdateApplicationAlertingConfigNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update application alerting config not found response a status code equal to that given +func (o *UpdateApplicationAlertingConfigNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update application alerting config not found response +func (o *UpdateApplicationAlertingConfigNotFound) Code() int { + return 404 +} + +func (o *UpdateApplicationAlertingConfigNotFound) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigNotFound ", 404) +} + +func (o *UpdateApplicationAlertingConfigNotFound) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigNotFound ", 404) +} + +func (o *UpdateApplicationAlertingConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateApplicationAlertingConfigInternalServerError creates a UpdateApplicationAlertingConfigInternalServerError with default headers values +func NewUpdateApplicationAlertingConfigInternalServerError() *UpdateApplicationAlertingConfigInternalServerError { + return &UpdateApplicationAlertingConfigInternalServerError{} +} + +/* +UpdateApplicationAlertingConfigInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type UpdateApplicationAlertingConfigInternalServerError struct { +} + +// IsSuccess returns true when this update application alerting config internal server error response has a 2xx status code +func (o *UpdateApplicationAlertingConfigInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update application alerting config internal server error response has a 3xx status code +func (o *UpdateApplicationAlertingConfigInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update application alerting config internal server error response has a 4xx status code +func (o *UpdateApplicationAlertingConfigInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update application alerting config internal server error response has a 5xx status code +func (o *UpdateApplicationAlertingConfigInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update application alerting config internal server error response a status code equal to that given +func (o *UpdateApplicationAlertingConfigInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update application alerting config internal server error response +func (o *UpdateApplicationAlertingConfigInternalServerError) Code() int { + return 500 +} + +func (o *UpdateApplicationAlertingConfigInternalServerError) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigInternalServerError ", 500) +} + +func (o *UpdateApplicationAlertingConfigInternalServerError) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/alerting][%d] updateApplicationAlertingConfigInternalServerError ", 500) +} + +func (o *UpdateApplicationAlertingConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/update_build_secrets_secret_value_parameters.go b/generated-client/client/application/update_build_secrets_secret_value_parameters.go new file mode 100644 index 0000000..648ead8 --- /dev/null +++ b/generated-client/client/application/update_build_secrets_secret_value_parameters.go @@ -0,0 +1,270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewUpdateBuildSecretsSecretValueParams creates a new UpdateBuildSecretsSecretValueParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateBuildSecretsSecretValueParams() *UpdateBuildSecretsSecretValueParams { + return &UpdateBuildSecretsSecretValueParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateBuildSecretsSecretValueParamsWithTimeout creates a new UpdateBuildSecretsSecretValueParams object +// with the ability to set a timeout on a request. +func NewUpdateBuildSecretsSecretValueParamsWithTimeout(timeout time.Duration) *UpdateBuildSecretsSecretValueParams { + return &UpdateBuildSecretsSecretValueParams{ + timeout: timeout, + } +} + +// NewUpdateBuildSecretsSecretValueParamsWithContext creates a new UpdateBuildSecretsSecretValueParams object +// with the ability to set a context for a request. +func NewUpdateBuildSecretsSecretValueParamsWithContext(ctx context.Context) *UpdateBuildSecretsSecretValueParams { + return &UpdateBuildSecretsSecretValueParams{ + Context: ctx, + } +} + +// NewUpdateBuildSecretsSecretValueParamsWithHTTPClient creates a new UpdateBuildSecretsSecretValueParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateBuildSecretsSecretValueParamsWithHTTPClient(client *http.Client) *UpdateBuildSecretsSecretValueParams { + return &UpdateBuildSecretsSecretValueParams{ + HTTPClient: client, + } +} + +/* +UpdateBuildSecretsSecretValueParams contains all the parameters to send to the API endpoint + + for the update build secrets secret value operation. + + Typically these are written to a http.Request. +*/ +type UpdateBuildSecretsSecretValueParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* SecretName. + + name of secret + */ + SecretName string + + /* SecretValue. + + New secret value + */ + SecretValue *models.SecretParameters + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update build secrets secret value params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateBuildSecretsSecretValueParams) WithDefaults() *UpdateBuildSecretsSecretValueParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update build secrets secret value params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateBuildSecretsSecretValueParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithTimeout(timeout time.Duration) *UpdateBuildSecretsSecretValueParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithContext(ctx context.Context) *UpdateBuildSecretsSecretValueParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithHTTPClient(client *http.Client) *UpdateBuildSecretsSecretValueParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithImpersonateGroup(impersonateGroup []string) *UpdateBuildSecretsSecretValueParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithImpersonateUser(impersonateUser *string) *UpdateBuildSecretsSecretValueParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithAppName(appName string) *UpdateBuildSecretsSecretValueParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithSecretName adds the secretName to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithSecretName(secretName string) *UpdateBuildSecretsSecretValueParams { + o.SetSecretName(secretName) + return o +} + +// SetSecretName adds the secretName to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetSecretName(secretName string) { + o.SecretName = secretName +} + +// WithSecretValue adds the secretValue to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) WithSecretValue(secretValue *models.SecretParameters) *UpdateBuildSecretsSecretValueParams { + o.SetSecretValue(secretValue) + return o +} + +// SetSecretValue adds the secretValue to the update build secrets secret value params +func (o *UpdateBuildSecretsSecretValueParams) SetSecretValue(secretValue *models.SecretParameters) { + o.SecretValue = secretValue +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateBuildSecretsSecretValueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param secretName + if err := r.SetPathParam("secretName", o.SecretName); err != nil { + return err + } + if o.SecretValue != nil { + if err := r.SetBodyParam(o.SecretValue); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamUpdateBuildSecretsSecretValue binds the parameter Impersonate-Group +func (o *UpdateBuildSecretsSecretValueParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/update_build_secrets_secret_value_responses.go b/generated-client/client/application/update_build_secrets_secret_value_responses.go new file mode 100644 index 0000000..f71c434 --- /dev/null +++ b/generated-client/client/application/update_build_secrets_secret_value_responses.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateBuildSecretsSecretValueReader is a Reader for the UpdateBuildSecretsSecretValue structure. +type UpdateBuildSecretsSecretValueReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateBuildSecretsSecretValueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateBuildSecretsSecretValueOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateBuildSecretsSecretValueBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateBuildSecretsSecretValueUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateBuildSecretsSecretValueForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateBuildSecretsSecretValueNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateBuildSecretsSecretValueConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /applications/{appName}/buildsecrets/{secretName}] updateBuildSecretsSecretValue", response, response.Code()) + } +} + +// NewUpdateBuildSecretsSecretValueOK creates a UpdateBuildSecretsSecretValueOK with default headers values +func NewUpdateBuildSecretsSecretValueOK() *UpdateBuildSecretsSecretValueOK { + return &UpdateBuildSecretsSecretValueOK{} +} + +/* +UpdateBuildSecretsSecretValueOK describes a response with status code 200, with default header values. + +success +*/ +type UpdateBuildSecretsSecretValueOK struct { +} + +// IsSuccess returns true when this update build secrets secret value o k response has a 2xx status code +func (o *UpdateBuildSecretsSecretValueOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update build secrets secret value o k response has a 3xx status code +func (o *UpdateBuildSecretsSecretValueOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update build secrets secret value o k response has a 4xx status code +func (o *UpdateBuildSecretsSecretValueOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update build secrets secret value o k response has a 5xx status code +func (o *UpdateBuildSecretsSecretValueOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update build secrets secret value o k response a status code equal to that given +func (o *UpdateBuildSecretsSecretValueOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update build secrets secret value o k response +func (o *UpdateBuildSecretsSecretValueOK) Code() int { + return 200 +} + +func (o *UpdateBuildSecretsSecretValueOK) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueOK ", 200) +} + +func (o *UpdateBuildSecretsSecretValueOK) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueOK ", 200) +} + +func (o *UpdateBuildSecretsSecretValueOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBuildSecretsSecretValueBadRequest creates a UpdateBuildSecretsSecretValueBadRequest with default headers values +func NewUpdateBuildSecretsSecretValueBadRequest() *UpdateBuildSecretsSecretValueBadRequest { + return &UpdateBuildSecretsSecretValueBadRequest{} +} + +/* +UpdateBuildSecretsSecretValueBadRequest describes a response with status code 400, with default header values. + +Invalid application +*/ +type UpdateBuildSecretsSecretValueBadRequest struct { +} + +// IsSuccess returns true when this update build secrets secret value bad request response has a 2xx status code +func (o *UpdateBuildSecretsSecretValueBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update build secrets secret value bad request response has a 3xx status code +func (o *UpdateBuildSecretsSecretValueBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update build secrets secret value bad request response has a 4xx status code +func (o *UpdateBuildSecretsSecretValueBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update build secrets secret value bad request response has a 5xx status code +func (o *UpdateBuildSecretsSecretValueBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update build secrets secret value bad request response a status code equal to that given +func (o *UpdateBuildSecretsSecretValueBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update build secrets secret value bad request response +func (o *UpdateBuildSecretsSecretValueBadRequest) Code() int { + return 400 +} + +func (o *UpdateBuildSecretsSecretValueBadRequest) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueBadRequest ", 400) +} + +func (o *UpdateBuildSecretsSecretValueBadRequest) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueBadRequest ", 400) +} + +func (o *UpdateBuildSecretsSecretValueBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBuildSecretsSecretValueUnauthorized creates a UpdateBuildSecretsSecretValueUnauthorized with default headers values +func NewUpdateBuildSecretsSecretValueUnauthorized() *UpdateBuildSecretsSecretValueUnauthorized { + return &UpdateBuildSecretsSecretValueUnauthorized{} +} + +/* +UpdateBuildSecretsSecretValueUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type UpdateBuildSecretsSecretValueUnauthorized struct { +} + +// IsSuccess returns true when this update build secrets secret value unauthorized response has a 2xx status code +func (o *UpdateBuildSecretsSecretValueUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update build secrets secret value unauthorized response has a 3xx status code +func (o *UpdateBuildSecretsSecretValueUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update build secrets secret value unauthorized response has a 4xx status code +func (o *UpdateBuildSecretsSecretValueUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update build secrets secret value unauthorized response has a 5xx status code +func (o *UpdateBuildSecretsSecretValueUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update build secrets secret value unauthorized response a status code equal to that given +func (o *UpdateBuildSecretsSecretValueUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update build secrets secret value unauthorized response +func (o *UpdateBuildSecretsSecretValueUnauthorized) Code() int { + return 401 +} + +func (o *UpdateBuildSecretsSecretValueUnauthorized) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueUnauthorized ", 401) +} + +func (o *UpdateBuildSecretsSecretValueUnauthorized) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueUnauthorized ", 401) +} + +func (o *UpdateBuildSecretsSecretValueUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBuildSecretsSecretValueForbidden creates a UpdateBuildSecretsSecretValueForbidden with default headers values +func NewUpdateBuildSecretsSecretValueForbidden() *UpdateBuildSecretsSecretValueForbidden { + return &UpdateBuildSecretsSecretValueForbidden{} +} + +/* +UpdateBuildSecretsSecretValueForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type UpdateBuildSecretsSecretValueForbidden struct { +} + +// IsSuccess returns true when this update build secrets secret value forbidden response has a 2xx status code +func (o *UpdateBuildSecretsSecretValueForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update build secrets secret value forbidden response has a 3xx status code +func (o *UpdateBuildSecretsSecretValueForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update build secrets secret value forbidden response has a 4xx status code +func (o *UpdateBuildSecretsSecretValueForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update build secrets secret value forbidden response has a 5xx status code +func (o *UpdateBuildSecretsSecretValueForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update build secrets secret value forbidden response a status code equal to that given +func (o *UpdateBuildSecretsSecretValueForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update build secrets secret value forbidden response +func (o *UpdateBuildSecretsSecretValueForbidden) Code() int { + return 403 +} + +func (o *UpdateBuildSecretsSecretValueForbidden) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueForbidden ", 403) +} + +func (o *UpdateBuildSecretsSecretValueForbidden) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueForbidden ", 403) +} + +func (o *UpdateBuildSecretsSecretValueForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBuildSecretsSecretValueNotFound creates a UpdateBuildSecretsSecretValueNotFound with default headers values +func NewUpdateBuildSecretsSecretValueNotFound() *UpdateBuildSecretsSecretValueNotFound { + return &UpdateBuildSecretsSecretValueNotFound{} +} + +/* +UpdateBuildSecretsSecretValueNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type UpdateBuildSecretsSecretValueNotFound struct { +} + +// IsSuccess returns true when this update build secrets secret value not found response has a 2xx status code +func (o *UpdateBuildSecretsSecretValueNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update build secrets secret value not found response has a 3xx status code +func (o *UpdateBuildSecretsSecretValueNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update build secrets secret value not found response has a 4xx status code +func (o *UpdateBuildSecretsSecretValueNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update build secrets secret value not found response has a 5xx status code +func (o *UpdateBuildSecretsSecretValueNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update build secrets secret value not found response a status code equal to that given +func (o *UpdateBuildSecretsSecretValueNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update build secrets secret value not found response +func (o *UpdateBuildSecretsSecretValueNotFound) Code() int { + return 404 +} + +func (o *UpdateBuildSecretsSecretValueNotFound) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueNotFound ", 404) +} + +func (o *UpdateBuildSecretsSecretValueNotFound) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueNotFound ", 404) +} + +func (o *UpdateBuildSecretsSecretValueNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBuildSecretsSecretValueConflict creates a UpdateBuildSecretsSecretValueConflict with default headers values +func NewUpdateBuildSecretsSecretValueConflict() *UpdateBuildSecretsSecretValueConflict { + return &UpdateBuildSecretsSecretValueConflict{} +} + +/* +UpdateBuildSecretsSecretValueConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type UpdateBuildSecretsSecretValueConflict struct { +} + +// IsSuccess returns true when this update build secrets secret value conflict response has a 2xx status code +func (o *UpdateBuildSecretsSecretValueConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update build secrets secret value conflict response has a 3xx status code +func (o *UpdateBuildSecretsSecretValueConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update build secrets secret value conflict response has a 4xx status code +func (o *UpdateBuildSecretsSecretValueConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update build secrets secret value conflict response has a 5xx status code +func (o *UpdateBuildSecretsSecretValueConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update build secrets secret value conflict response a status code equal to that given +func (o *UpdateBuildSecretsSecretValueConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update build secrets secret value conflict response +func (o *UpdateBuildSecretsSecretValueConflict) Code() int { + return 409 +} + +func (o *UpdateBuildSecretsSecretValueConflict) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueConflict ", 409) +} + +func (o *UpdateBuildSecretsSecretValueConflict) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/buildsecrets/{secretName}][%d] updateBuildSecretsSecretValueConflict ", 409) +} + +func (o *UpdateBuildSecretsSecretValueConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/application/update_private_image_hubs_secret_value_parameters.go b/generated-client/client/application/update_private_image_hubs_secret_value_parameters.go new file mode 100644 index 0000000..da06bef --- /dev/null +++ b/generated-client/client/application/update_private_image_hubs_secret_value_parameters.go @@ -0,0 +1,270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewUpdatePrivateImageHubsSecretValueParams creates a new UpdatePrivateImageHubsSecretValueParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdatePrivateImageHubsSecretValueParams() *UpdatePrivateImageHubsSecretValueParams { + return &UpdatePrivateImageHubsSecretValueParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePrivateImageHubsSecretValueParamsWithTimeout creates a new UpdatePrivateImageHubsSecretValueParams object +// with the ability to set a timeout on a request. +func NewUpdatePrivateImageHubsSecretValueParamsWithTimeout(timeout time.Duration) *UpdatePrivateImageHubsSecretValueParams { + return &UpdatePrivateImageHubsSecretValueParams{ + timeout: timeout, + } +} + +// NewUpdatePrivateImageHubsSecretValueParamsWithContext creates a new UpdatePrivateImageHubsSecretValueParams object +// with the ability to set a context for a request. +func NewUpdatePrivateImageHubsSecretValueParamsWithContext(ctx context.Context) *UpdatePrivateImageHubsSecretValueParams { + return &UpdatePrivateImageHubsSecretValueParams{ + Context: ctx, + } +} + +// NewUpdatePrivateImageHubsSecretValueParamsWithHTTPClient creates a new UpdatePrivateImageHubsSecretValueParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePrivateImageHubsSecretValueParamsWithHTTPClient(client *http.Client) *UpdatePrivateImageHubsSecretValueParams { + return &UpdatePrivateImageHubsSecretValueParams{ + HTTPClient: client, + } +} + +/* +UpdatePrivateImageHubsSecretValueParams contains all the parameters to send to the API endpoint + + for the update private image hubs secret value operation. + + Typically these are written to a http.Request. +*/ +type UpdatePrivateImageHubsSecretValueParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ImageHubSecret. + + New secret value + */ + ImageHubSecret *models.SecretParameters + + /* ServerName. + + server name to update + */ + ServerName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update private image hubs secret value params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePrivateImageHubsSecretValueParams) WithDefaults() *UpdatePrivateImageHubsSecretValueParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update private image hubs secret value params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePrivateImageHubsSecretValueParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithTimeout(timeout time.Duration) *UpdatePrivateImageHubsSecretValueParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithContext(ctx context.Context) *UpdatePrivateImageHubsSecretValueParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithHTTPClient(client *http.Client) *UpdatePrivateImageHubsSecretValueParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithImpersonateGroup(impersonateGroup []string) *UpdatePrivateImageHubsSecretValueParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithImpersonateUser(impersonateUser *string) *UpdatePrivateImageHubsSecretValueParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithAppName(appName string) *UpdatePrivateImageHubsSecretValueParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithImageHubSecret adds the imageHubSecret to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithImageHubSecret(imageHubSecret *models.SecretParameters) *UpdatePrivateImageHubsSecretValueParams { + o.SetImageHubSecret(imageHubSecret) + return o +} + +// SetImageHubSecret adds the imageHubSecret to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetImageHubSecret(imageHubSecret *models.SecretParameters) { + o.ImageHubSecret = imageHubSecret +} + +// WithServerName adds the serverName to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) WithServerName(serverName string) *UpdatePrivateImageHubsSecretValueParams { + o.SetServerName(serverName) + return o +} + +// SetServerName adds the serverName to the update private image hubs secret value params +func (o *UpdatePrivateImageHubsSecretValueParams) SetServerName(serverName string) { + o.ServerName = serverName +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePrivateImageHubsSecretValueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + if o.ImageHubSecret != nil { + if err := r.SetBodyParam(o.ImageHubSecret); err != nil { + return err + } + } + + // path param serverName + if err := r.SetPathParam("serverName", o.ServerName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamUpdatePrivateImageHubsSecretValue binds the parameter Impersonate-Group +func (o *UpdatePrivateImageHubsSecretValueParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/application/update_private_image_hubs_secret_value_responses.go b/generated-client/client/application/update_private_image_hubs_secret_value_responses.go new file mode 100644 index 0000000..fcdf4b0 --- /dev/null +++ b/generated-client/client/application/update_private_image_hubs_secret_value_responses.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdatePrivateImageHubsSecretValueReader is a Reader for the UpdatePrivateImageHubsSecretValue structure. +type UpdatePrivateImageHubsSecretValueReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePrivateImageHubsSecretValueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePrivateImageHubsSecretValueOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdatePrivateImageHubsSecretValueBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdatePrivateImageHubsSecretValueUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdatePrivateImageHubsSecretValueForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdatePrivateImageHubsSecretValueNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdatePrivateImageHubsSecretValueConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /applications/{appName}/privateimagehubs/{serverName}] updatePrivateImageHubsSecretValue", response, response.Code()) + } +} + +// NewUpdatePrivateImageHubsSecretValueOK creates a UpdatePrivateImageHubsSecretValueOK with default headers values +func NewUpdatePrivateImageHubsSecretValueOK() *UpdatePrivateImageHubsSecretValueOK { + return &UpdatePrivateImageHubsSecretValueOK{} +} + +/* +UpdatePrivateImageHubsSecretValueOK describes a response with status code 200, with default header values. + +success +*/ +type UpdatePrivateImageHubsSecretValueOK struct { +} + +// IsSuccess returns true when this update private image hubs secret value o k response has a 2xx status code +func (o *UpdatePrivateImageHubsSecretValueOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update private image hubs secret value o k response has a 3xx status code +func (o *UpdatePrivateImageHubsSecretValueOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update private image hubs secret value o k response has a 4xx status code +func (o *UpdatePrivateImageHubsSecretValueOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update private image hubs secret value o k response has a 5xx status code +func (o *UpdatePrivateImageHubsSecretValueOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update private image hubs secret value o k response a status code equal to that given +func (o *UpdatePrivateImageHubsSecretValueOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update private image hubs secret value o k response +func (o *UpdatePrivateImageHubsSecretValueOK) Code() int { + return 200 +} + +func (o *UpdatePrivateImageHubsSecretValueOK) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueOK ", 200) +} + +func (o *UpdatePrivateImageHubsSecretValueOK) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueOK ", 200) +} + +func (o *UpdatePrivateImageHubsSecretValueOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdatePrivateImageHubsSecretValueBadRequest creates a UpdatePrivateImageHubsSecretValueBadRequest with default headers values +func NewUpdatePrivateImageHubsSecretValueBadRequest() *UpdatePrivateImageHubsSecretValueBadRequest { + return &UpdatePrivateImageHubsSecretValueBadRequest{} +} + +/* +UpdatePrivateImageHubsSecretValueBadRequest describes a response with status code 400, with default header values. + +Invalid application +*/ +type UpdatePrivateImageHubsSecretValueBadRequest struct { +} + +// IsSuccess returns true when this update private image hubs secret value bad request response has a 2xx status code +func (o *UpdatePrivateImageHubsSecretValueBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update private image hubs secret value bad request response has a 3xx status code +func (o *UpdatePrivateImageHubsSecretValueBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update private image hubs secret value bad request response has a 4xx status code +func (o *UpdatePrivateImageHubsSecretValueBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update private image hubs secret value bad request response has a 5xx status code +func (o *UpdatePrivateImageHubsSecretValueBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update private image hubs secret value bad request response a status code equal to that given +func (o *UpdatePrivateImageHubsSecretValueBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update private image hubs secret value bad request response +func (o *UpdatePrivateImageHubsSecretValueBadRequest) Code() int { + return 400 +} + +func (o *UpdatePrivateImageHubsSecretValueBadRequest) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueBadRequest ", 400) +} + +func (o *UpdatePrivateImageHubsSecretValueBadRequest) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueBadRequest ", 400) +} + +func (o *UpdatePrivateImageHubsSecretValueBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdatePrivateImageHubsSecretValueUnauthorized creates a UpdatePrivateImageHubsSecretValueUnauthorized with default headers values +func NewUpdatePrivateImageHubsSecretValueUnauthorized() *UpdatePrivateImageHubsSecretValueUnauthorized { + return &UpdatePrivateImageHubsSecretValueUnauthorized{} +} + +/* +UpdatePrivateImageHubsSecretValueUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type UpdatePrivateImageHubsSecretValueUnauthorized struct { +} + +// IsSuccess returns true when this update private image hubs secret value unauthorized response has a 2xx status code +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update private image hubs secret value unauthorized response has a 3xx status code +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update private image hubs secret value unauthorized response has a 4xx status code +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update private image hubs secret value unauthorized response has a 5xx status code +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update private image hubs secret value unauthorized response a status code equal to that given +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update private image hubs secret value unauthorized response +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) Code() int { + return 401 +} + +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueUnauthorized ", 401) +} + +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueUnauthorized ", 401) +} + +func (o *UpdatePrivateImageHubsSecretValueUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdatePrivateImageHubsSecretValueForbidden creates a UpdatePrivateImageHubsSecretValueForbidden with default headers values +func NewUpdatePrivateImageHubsSecretValueForbidden() *UpdatePrivateImageHubsSecretValueForbidden { + return &UpdatePrivateImageHubsSecretValueForbidden{} +} + +/* +UpdatePrivateImageHubsSecretValueForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type UpdatePrivateImageHubsSecretValueForbidden struct { +} + +// IsSuccess returns true when this update private image hubs secret value forbidden response has a 2xx status code +func (o *UpdatePrivateImageHubsSecretValueForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update private image hubs secret value forbidden response has a 3xx status code +func (o *UpdatePrivateImageHubsSecretValueForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update private image hubs secret value forbidden response has a 4xx status code +func (o *UpdatePrivateImageHubsSecretValueForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update private image hubs secret value forbidden response has a 5xx status code +func (o *UpdatePrivateImageHubsSecretValueForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update private image hubs secret value forbidden response a status code equal to that given +func (o *UpdatePrivateImageHubsSecretValueForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update private image hubs secret value forbidden response +func (o *UpdatePrivateImageHubsSecretValueForbidden) Code() int { + return 403 +} + +func (o *UpdatePrivateImageHubsSecretValueForbidden) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueForbidden ", 403) +} + +func (o *UpdatePrivateImageHubsSecretValueForbidden) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueForbidden ", 403) +} + +func (o *UpdatePrivateImageHubsSecretValueForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdatePrivateImageHubsSecretValueNotFound creates a UpdatePrivateImageHubsSecretValueNotFound with default headers values +func NewUpdatePrivateImageHubsSecretValueNotFound() *UpdatePrivateImageHubsSecretValueNotFound { + return &UpdatePrivateImageHubsSecretValueNotFound{} +} + +/* +UpdatePrivateImageHubsSecretValueNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type UpdatePrivateImageHubsSecretValueNotFound struct { +} + +// IsSuccess returns true when this update private image hubs secret value not found response has a 2xx status code +func (o *UpdatePrivateImageHubsSecretValueNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update private image hubs secret value not found response has a 3xx status code +func (o *UpdatePrivateImageHubsSecretValueNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update private image hubs secret value not found response has a 4xx status code +func (o *UpdatePrivateImageHubsSecretValueNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update private image hubs secret value not found response has a 5xx status code +func (o *UpdatePrivateImageHubsSecretValueNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update private image hubs secret value not found response a status code equal to that given +func (o *UpdatePrivateImageHubsSecretValueNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update private image hubs secret value not found response +func (o *UpdatePrivateImageHubsSecretValueNotFound) Code() int { + return 404 +} + +func (o *UpdatePrivateImageHubsSecretValueNotFound) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueNotFound ", 404) +} + +func (o *UpdatePrivateImageHubsSecretValueNotFound) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueNotFound ", 404) +} + +func (o *UpdatePrivateImageHubsSecretValueNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdatePrivateImageHubsSecretValueConflict creates a UpdatePrivateImageHubsSecretValueConflict with default headers values +func NewUpdatePrivateImageHubsSecretValueConflict() *UpdatePrivateImageHubsSecretValueConflict { + return &UpdatePrivateImageHubsSecretValueConflict{} +} + +/* +UpdatePrivateImageHubsSecretValueConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type UpdatePrivateImageHubsSecretValueConflict struct { +} + +// IsSuccess returns true when this update private image hubs secret value conflict response has a 2xx status code +func (o *UpdatePrivateImageHubsSecretValueConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update private image hubs secret value conflict response has a 3xx status code +func (o *UpdatePrivateImageHubsSecretValueConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update private image hubs secret value conflict response has a 4xx status code +func (o *UpdatePrivateImageHubsSecretValueConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update private image hubs secret value conflict response has a 5xx status code +func (o *UpdatePrivateImageHubsSecretValueConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update private image hubs secret value conflict response a status code equal to that given +func (o *UpdatePrivateImageHubsSecretValueConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update private image hubs secret value conflict response +func (o *UpdatePrivateImageHubsSecretValueConflict) Code() int { + return 409 +} + +func (o *UpdatePrivateImageHubsSecretValueConflict) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueConflict ", 409) +} + +func (o *UpdatePrivateImageHubsSecretValueConflict) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/privateimagehubs/{serverName}][%d] updatePrivateImageHubsSecretValueConflict ", 409) +} + +func (o *UpdatePrivateImageHubsSecretValueConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/buildstatus/buildstatus_client.go b/generated-client/client/buildstatus/buildstatus_client.go new file mode 100644 index 0000000..375fe05 --- /dev/null +++ b/generated-client/client/buildstatus/buildstatus_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package buildstatus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new buildstatus API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for buildstatus API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetBuildStatus(params *GetBuildStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBuildStatusOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetBuildStatus shows the application build status +*/ +func (a *Client) GetBuildStatus(params *GetBuildStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBuildStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBuildStatusParams() + } + op := &runtime.ClientOperation{ + ID: "getBuildStatus", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/buildstatus", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetBuildStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBuildStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBuildStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/buildstatus/get_build_status_parameters.go b/generated-client/client/buildstatus/get_build_status_parameters.go new file mode 100644 index 0000000..b946a62 --- /dev/null +++ b/generated-client/client/buildstatus/get_build_status_parameters.go @@ -0,0 +1,220 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package buildstatus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetBuildStatusParams creates a new GetBuildStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBuildStatusParams() *GetBuildStatusParams { + return &GetBuildStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBuildStatusParamsWithTimeout creates a new GetBuildStatusParams object +// with the ability to set a timeout on a request. +func NewGetBuildStatusParamsWithTimeout(timeout time.Duration) *GetBuildStatusParams { + return &GetBuildStatusParams{ + timeout: timeout, + } +} + +// NewGetBuildStatusParamsWithContext creates a new GetBuildStatusParams object +// with the ability to set a context for a request. +func NewGetBuildStatusParamsWithContext(ctx context.Context) *GetBuildStatusParams { + return &GetBuildStatusParams{ + Context: ctx, + } +} + +// NewGetBuildStatusParamsWithHTTPClient creates a new GetBuildStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBuildStatusParamsWithHTTPClient(client *http.Client) *GetBuildStatusParams { + return &GetBuildStatusParams{ + HTTPClient: client, + } +} + +/* +GetBuildStatusParams contains all the parameters to send to the API endpoint + + for the get build status operation. + + Typically these are written to a http.Request. +*/ +type GetBuildStatusParams struct { + + /* AppName. + + name of Radix application + */ + AppName string + + /* EnvName. + + name of the environment + */ + EnvName string + + /* Pipeline. + + Type of pipeline job to get status for. + + Default: "build-deploy" + */ + Pipeline *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get build status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBuildStatusParams) WithDefaults() *GetBuildStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get build status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBuildStatusParams) SetDefaults() { + var ( + pipelineDefault = string("build-deploy") + ) + + val := GetBuildStatusParams{ + Pipeline: &pipelineDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get build status params +func (o *GetBuildStatusParams) WithTimeout(timeout time.Duration) *GetBuildStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get build status params +func (o *GetBuildStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get build status params +func (o *GetBuildStatusParams) WithContext(ctx context.Context) *GetBuildStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get build status params +func (o *GetBuildStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get build status params +func (o *GetBuildStatusParams) WithHTTPClient(client *http.Client) *GetBuildStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get build status params +func (o *GetBuildStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAppName adds the appName to the get build status params +func (o *GetBuildStatusParams) WithAppName(appName string) *GetBuildStatusParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get build status params +func (o *GetBuildStatusParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get build status params +func (o *GetBuildStatusParams) WithEnvName(envName string) *GetBuildStatusParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get build status params +func (o *GetBuildStatusParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithPipeline adds the pipeline to the get build status params +func (o *GetBuildStatusParams) WithPipeline(pipeline *string) *GetBuildStatusParams { + o.SetPipeline(pipeline) + return o +} + +// SetPipeline adds the pipeline to the get build status params +func (o *GetBuildStatusParams) SetPipeline(pipeline *string) { + o.Pipeline = pipeline +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBuildStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if o.Pipeline != nil { + + // query param pipeline + var qrPipeline string + + if o.Pipeline != nil { + qrPipeline = *o.Pipeline + } + qPipeline := qrPipeline + if qPipeline != "" { + + if err := r.SetQueryParam("pipeline", qPipeline); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/generated-client/client/buildstatus/get_build_status_responses.go b/generated-client/client/buildstatus/get_build_status_responses.go new file mode 100644 index 0000000..09432ac --- /dev/null +++ b/generated-client/client/buildstatus/get_build_status_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package buildstatus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetBuildStatusReader is a Reader for the GetBuildStatus structure. +type GetBuildStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBuildStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBuildStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetBuildStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/buildstatus] getBuildStatus", response, response.Code()) + } +} + +// NewGetBuildStatusOK creates a GetBuildStatusOK with default headers values +func NewGetBuildStatusOK() *GetBuildStatusOK { + return &GetBuildStatusOK{} +} + +/* +GetBuildStatusOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetBuildStatusOK struct { +} + +// IsSuccess returns true when this get build status o k response has a 2xx status code +func (o *GetBuildStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get build status o k response has a 3xx status code +func (o *GetBuildStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get build status o k response has a 4xx status code +func (o *GetBuildStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get build status o k response has a 5xx status code +func (o *GetBuildStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get build status o k response a status code equal to that given +func (o *GetBuildStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get build status o k response +func (o *GetBuildStatusOK) Code() int { + return 200 +} + +func (o *GetBuildStatusOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/buildstatus][%d] getBuildStatusOK ", 200) +} + +func (o *GetBuildStatusOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/buildstatus][%d] getBuildStatusOK ", 200) +} + +func (o *GetBuildStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetBuildStatusInternalServerError creates a GetBuildStatusInternalServerError with default headers values +func NewGetBuildStatusInternalServerError() *GetBuildStatusInternalServerError { + return &GetBuildStatusInternalServerError{} +} + +/* +GetBuildStatusInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GetBuildStatusInternalServerError struct { +} + +// IsSuccess returns true when this get build status internal server error response has a 2xx status code +func (o *GetBuildStatusInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get build status internal server error response has a 3xx status code +func (o *GetBuildStatusInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get build status internal server error response has a 4xx status code +func (o *GetBuildStatusInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get build status internal server error response has a 5xx status code +func (o *GetBuildStatusInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get build status internal server error response a status code equal to that given +func (o *GetBuildStatusInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get build status internal server error response +func (o *GetBuildStatusInternalServerError) Code() int { + return 500 +} + +func (o *GetBuildStatusInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/buildstatus][%d] getBuildStatusInternalServerError ", 500) +} + +func (o *GetBuildStatusInternalServerError) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/buildstatus][%d] getBuildStatusInternalServerError ", 500) +} + +func (o *GetBuildStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/change_env_var_parameters.go b/generated-client/client/component/change_env_var_parameters.go new file mode 100644 index 0000000..1c36f43 --- /dev/null +++ b/generated-client/client/component/change_env_var_parameters.go @@ -0,0 +1,292 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewChangeEnvVarParams creates a new ChangeEnvVarParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewChangeEnvVarParams() *ChangeEnvVarParams { + return &ChangeEnvVarParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewChangeEnvVarParamsWithTimeout creates a new ChangeEnvVarParams object +// with the ability to set a timeout on a request. +func NewChangeEnvVarParamsWithTimeout(timeout time.Duration) *ChangeEnvVarParams { + return &ChangeEnvVarParams{ + timeout: timeout, + } +} + +// NewChangeEnvVarParamsWithContext creates a new ChangeEnvVarParams object +// with the ability to set a context for a request. +func NewChangeEnvVarParamsWithContext(ctx context.Context) *ChangeEnvVarParams { + return &ChangeEnvVarParams{ + Context: ctx, + } +} + +// NewChangeEnvVarParamsWithHTTPClient creates a new ChangeEnvVarParams object +// with the ability to set a custom HTTPClient for a request. +func NewChangeEnvVarParamsWithHTTPClient(client *http.Client) *ChangeEnvVarParams { + return &ChangeEnvVarParams{ + HTTPClient: client, + } +} + +/* +ChangeEnvVarParams contains all the parameters to send to the API endpoint + + for the change env var operation. + + Typically these are written to a http.Request. +*/ +type ChangeEnvVarParams struct { + + /* EnvVarParameter. + + Environment variables new values and metadata + */ + EnvVarParameter []*models.EnvVarParameter + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + environment component of Radix application + */ + ComponentName string + + /* EnvName. + + environment of Radix application + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the change env var params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeEnvVarParams) WithDefaults() *ChangeEnvVarParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change env var params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeEnvVarParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the change env var params +func (o *ChangeEnvVarParams) WithTimeout(timeout time.Duration) *ChangeEnvVarParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the change env var params +func (o *ChangeEnvVarParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the change env var params +func (o *ChangeEnvVarParams) WithContext(ctx context.Context) *ChangeEnvVarParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the change env var params +func (o *ChangeEnvVarParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the change env var params +func (o *ChangeEnvVarParams) WithHTTPClient(client *http.Client) *ChangeEnvVarParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the change env var params +func (o *ChangeEnvVarParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnvVarParameter adds the envVarParameter to the change env var params +func (o *ChangeEnvVarParams) WithEnvVarParameter(envVarParameter []*models.EnvVarParameter) *ChangeEnvVarParams { + o.SetEnvVarParameter(envVarParameter) + return o +} + +// SetEnvVarParameter adds the envVarParameter to the change env var params +func (o *ChangeEnvVarParams) SetEnvVarParameter(envVarParameter []*models.EnvVarParameter) { + o.EnvVarParameter = envVarParameter +} + +// WithImpersonateGroup adds the impersonateGroup to the change env var params +func (o *ChangeEnvVarParams) WithImpersonateGroup(impersonateGroup []string) *ChangeEnvVarParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the change env var params +func (o *ChangeEnvVarParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the change env var params +func (o *ChangeEnvVarParams) WithImpersonateUser(impersonateUser *string) *ChangeEnvVarParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the change env var params +func (o *ChangeEnvVarParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the change env var params +func (o *ChangeEnvVarParams) WithAppName(appName string) *ChangeEnvVarParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the change env var params +func (o *ChangeEnvVarParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the change env var params +func (o *ChangeEnvVarParams) WithComponentName(componentName string) *ChangeEnvVarParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the change env var params +func (o *ChangeEnvVarParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the change env var params +func (o *ChangeEnvVarParams) WithEnvName(envName string) *ChangeEnvVarParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the change env var params +func (o *ChangeEnvVarParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *ChangeEnvVarParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.EnvVarParameter != nil { + if err := r.SetBodyParam(o.EnvVarParameter); err != nil { + return err + } + } + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamChangeEnvVar binds the parameter Impersonate-Group +func (o *ChangeEnvVarParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/change_env_var_responses.go b/generated-client/client/component/change_env_var_responses.go new file mode 100644 index 0000000..6a44940 --- /dev/null +++ b/generated-client/client/component/change_env_var_responses.go @@ -0,0 +1,460 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ChangeEnvVarReader is a Reader for the ChangeEnvVar structure. +type ChangeEnvVarReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ChangeEnvVarReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewChangeEnvVarOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewChangeEnvVarBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewChangeEnvVarUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewChangeEnvVarForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewChangeEnvVarNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewChangeEnvVarConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewChangeEnvVarInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars] changeEnvVar", response, response.Code()) + } +} + +// NewChangeEnvVarOK creates a ChangeEnvVarOK with default headers values +func NewChangeEnvVarOK() *ChangeEnvVarOK { + return &ChangeEnvVarOK{} +} + +/* +ChangeEnvVarOK describes a response with status code 200, with default header values. + +success +*/ +type ChangeEnvVarOK struct { +} + +// IsSuccess returns true when this change env var o k response has a 2xx status code +func (o *ChangeEnvVarOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this change env var o k response has a 3xx status code +func (o *ChangeEnvVarOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change env var o k response has a 4xx status code +func (o *ChangeEnvVarOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this change env var o k response has a 5xx status code +func (o *ChangeEnvVarOK) IsServerError() bool { + return false +} + +// IsCode returns true when this change env var o k response a status code equal to that given +func (o *ChangeEnvVarOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the change env var o k response +func (o *ChangeEnvVarOK) Code() int { + return 200 +} + +func (o *ChangeEnvVarOK) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarOK ", 200) +} + +func (o *ChangeEnvVarOK) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarOK ", 200) +} + +func (o *ChangeEnvVarOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeEnvVarBadRequest creates a ChangeEnvVarBadRequest with default headers values +func NewChangeEnvVarBadRequest() *ChangeEnvVarBadRequest { + return &ChangeEnvVarBadRequest{} +} + +/* +ChangeEnvVarBadRequest describes a response with status code 400, with default header values. + +Invalid application +*/ +type ChangeEnvVarBadRequest struct { +} + +// IsSuccess returns true when this change env var bad request response has a 2xx status code +func (o *ChangeEnvVarBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change env var bad request response has a 3xx status code +func (o *ChangeEnvVarBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change env var bad request response has a 4xx status code +func (o *ChangeEnvVarBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this change env var bad request response has a 5xx status code +func (o *ChangeEnvVarBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this change env var bad request response a status code equal to that given +func (o *ChangeEnvVarBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the change env var bad request response +func (o *ChangeEnvVarBadRequest) Code() int { + return 400 +} + +func (o *ChangeEnvVarBadRequest) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarBadRequest ", 400) +} + +func (o *ChangeEnvVarBadRequest) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarBadRequest ", 400) +} + +func (o *ChangeEnvVarBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeEnvVarUnauthorized creates a ChangeEnvVarUnauthorized with default headers values +func NewChangeEnvVarUnauthorized() *ChangeEnvVarUnauthorized { + return &ChangeEnvVarUnauthorized{} +} + +/* +ChangeEnvVarUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type ChangeEnvVarUnauthorized struct { +} + +// IsSuccess returns true when this change env var unauthorized response has a 2xx status code +func (o *ChangeEnvVarUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change env var unauthorized response has a 3xx status code +func (o *ChangeEnvVarUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change env var unauthorized response has a 4xx status code +func (o *ChangeEnvVarUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this change env var unauthorized response has a 5xx status code +func (o *ChangeEnvVarUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this change env var unauthorized response a status code equal to that given +func (o *ChangeEnvVarUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the change env var unauthorized response +func (o *ChangeEnvVarUnauthorized) Code() int { + return 401 +} + +func (o *ChangeEnvVarUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarUnauthorized ", 401) +} + +func (o *ChangeEnvVarUnauthorized) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarUnauthorized ", 401) +} + +func (o *ChangeEnvVarUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeEnvVarForbidden creates a ChangeEnvVarForbidden with default headers values +func NewChangeEnvVarForbidden() *ChangeEnvVarForbidden { + return &ChangeEnvVarForbidden{} +} + +/* +ChangeEnvVarForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ChangeEnvVarForbidden struct { +} + +// IsSuccess returns true when this change env var forbidden response has a 2xx status code +func (o *ChangeEnvVarForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change env var forbidden response has a 3xx status code +func (o *ChangeEnvVarForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change env var forbidden response has a 4xx status code +func (o *ChangeEnvVarForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this change env var forbidden response has a 5xx status code +func (o *ChangeEnvVarForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this change env var forbidden response a status code equal to that given +func (o *ChangeEnvVarForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the change env var forbidden response +func (o *ChangeEnvVarForbidden) Code() int { + return 403 +} + +func (o *ChangeEnvVarForbidden) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarForbidden ", 403) +} + +func (o *ChangeEnvVarForbidden) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarForbidden ", 403) +} + +func (o *ChangeEnvVarForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeEnvVarNotFound creates a ChangeEnvVarNotFound with default headers values +func NewChangeEnvVarNotFound() *ChangeEnvVarNotFound { + return &ChangeEnvVarNotFound{} +} + +/* +ChangeEnvVarNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ChangeEnvVarNotFound struct { +} + +// IsSuccess returns true when this change env var not found response has a 2xx status code +func (o *ChangeEnvVarNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change env var not found response has a 3xx status code +func (o *ChangeEnvVarNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change env var not found response has a 4xx status code +func (o *ChangeEnvVarNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this change env var not found response has a 5xx status code +func (o *ChangeEnvVarNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this change env var not found response a status code equal to that given +func (o *ChangeEnvVarNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the change env var not found response +func (o *ChangeEnvVarNotFound) Code() int { + return 404 +} + +func (o *ChangeEnvVarNotFound) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarNotFound ", 404) +} + +func (o *ChangeEnvVarNotFound) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarNotFound ", 404) +} + +func (o *ChangeEnvVarNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeEnvVarConflict creates a ChangeEnvVarConflict with default headers values +func NewChangeEnvVarConflict() *ChangeEnvVarConflict { + return &ChangeEnvVarConflict{} +} + +/* +ChangeEnvVarConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type ChangeEnvVarConflict struct { +} + +// IsSuccess returns true when this change env var conflict response has a 2xx status code +func (o *ChangeEnvVarConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change env var conflict response has a 3xx status code +func (o *ChangeEnvVarConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change env var conflict response has a 4xx status code +func (o *ChangeEnvVarConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this change env var conflict response has a 5xx status code +func (o *ChangeEnvVarConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this change env var conflict response a status code equal to that given +func (o *ChangeEnvVarConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the change env var conflict response +func (o *ChangeEnvVarConflict) Code() int { + return 409 +} + +func (o *ChangeEnvVarConflict) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarConflict ", 409) +} + +func (o *ChangeEnvVarConflict) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarConflict ", 409) +} + +func (o *ChangeEnvVarConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeEnvVarInternalServerError creates a ChangeEnvVarInternalServerError with default headers values +func NewChangeEnvVarInternalServerError() *ChangeEnvVarInternalServerError { + return &ChangeEnvVarInternalServerError{} +} + +/* +ChangeEnvVarInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type ChangeEnvVarInternalServerError struct { +} + +// IsSuccess returns true when this change env var internal server error response has a 2xx status code +func (o *ChangeEnvVarInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change env var internal server error response has a 3xx status code +func (o *ChangeEnvVarInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change env var internal server error response has a 4xx status code +func (o *ChangeEnvVarInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this change env var internal server error response has a 5xx status code +func (o *ChangeEnvVarInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this change env var internal server error response a status code equal to that given +func (o *ChangeEnvVarInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the change env var internal server error response +func (o *ChangeEnvVarInternalServerError) Code() int { + return 500 +} + +func (o *ChangeEnvVarInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarInternalServerError ", 500) +} + +func (o *ChangeEnvVarInternalServerError) String() string { + return fmt.Sprintf("[PATCH /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] changeEnvVarInternalServerError ", 500) +} + +func (o *ChangeEnvVarInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/component_client.go b/generated-client/client/component/component_client.go new file mode 100644 index 0000000..d98fa2f --- /dev/null +++ b/generated-client/client/component/component_client.go @@ -0,0 +1,490 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new component API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for component API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ChangeEnvVar(params *ChangeEnvVarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeEnvVarOK, error) + + Components(params *ComponentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ComponentsOK, error) + + EnvVars(params *EnvVarsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnvVarsOK, error) + + GetOAuthPodLog(params *GetOAuthPodLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOAuthPodLogOK, error) + + Log(params *LogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LogOK, error) + + ReplicaLog(params *ReplicaLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplicaLogOK, error) + + RestartComponent(params *RestartComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartComponentOK, error) + + RestartOAuthAuxiliaryResource(params *RestartOAuthAuxiliaryResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartOAuthAuxiliaryResourceOK, error) + + ScaleComponent(params *ScaleComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ScaleComponentNoContent, error) + + StartComponent(params *StartComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartComponentOK, error) + + StopComponent(params *StopComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopComponentOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +ChangeEnvVar updates an environment variable +*/ +func (a *Client) ChangeEnvVar(params *ChangeEnvVarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeEnvVarOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewChangeEnvVarParams() + } + op := &runtime.ClientOperation{ + ID: "changeEnvVar", + Method: "PATCH", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/envvars", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ChangeEnvVarReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ChangeEnvVarOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for changeEnvVar: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Components gets components for a deployment +*/ +func (a *Client) Components(params *ComponentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ComponentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewComponentsParams() + } + op := &runtime.ClientOperation{ + ID: "components", + Method: "GET", + PathPattern: "/applications/{appName}/deployments/{deploymentName}/components", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ComponentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ComponentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for components: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +EnvVars gets environment variables for component +*/ +func (a *Client) EnvVars(params *EnvVarsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnvVarsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewEnvVarsParams() + } + op := &runtime.ClientOperation{ + ID: "envVars", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/envvars", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &EnvVarsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*EnvVarsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for envVars: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetOAuthPodLog gets logs for an oauth auxiliary resource pod +*/ +func (a *Client) GetOAuthPodLog(params *GetOAuthPodLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOAuthPodLogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOAuthPodLogParams() + } + op := &runtime.ClientOperation{ + ID: "getOAuthPodLog", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetOAuthPodLogReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetOAuthPodLogOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getOAuthPodLog: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Log gets logs from a deployed pod +*/ +func (a *Client) Log(params *LogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLogParams() + } + op := &runtime.ClientOperation{ + ID: "log", + Method: "GET", + PathPattern: "/applications/{appName}/deployments/{deploymentName}/components/{componentName}/replicas/{podName}/logs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &LogReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*LogOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for log: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReplicaLog gets logs from a deployed pod +*/ +func (a *Client) ReplicaLog(params *ReplicaLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplicaLogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReplicaLogParams() + } + op := &runtime.ClientOperation{ + ID: "replicaLog", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/replicas/{podName}/logs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ReplicaLogReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReplicaLogOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for replicaLog: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RestartComponent restarts a component stops running the component container pulls new image from image hub in radix configuration starts the container again using an up to date image +*/ +func (a *Client) RestartComponent(params *RestartComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartComponentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestartComponentParams() + } + op := &runtime.ClientOperation{ + ID: "restartComponent", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/restart", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RestartComponentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RestartComponentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for restartComponent: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RestartOAuthAuxiliaryResource restarts an auxiliary resource for a component +*/ +func (a *Client) RestartOAuthAuxiliaryResource(params *RestartOAuthAuxiliaryResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartOAuthAuxiliaryResourceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestartOAuthAuxiliaryResourceParams() + } + op := &runtime.ClientOperation{ + ID: "restartOAuthAuxiliaryResource", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RestartOAuthAuxiliaryResourceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RestartOAuthAuxiliaryResourceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for restartOAuthAuxiliaryResource: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ScaleComponent scales a component replicas +*/ +func (a *Client) ScaleComponent(params *ScaleComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ScaleComponentNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewScaleComponentParams() + } + op := &runtime.ClientOperation{ + ID: "scaleComponent", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ScaleComponentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ScaleComponentNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for scaleComponent: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StartComponent starts component +*/ +func (a *Client) StartComponent(params *StartComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartComponentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStartComponentParams() + } + op := &runtime.ClientOperation{ + ID: "startComponent", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/start", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StartComponentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StartComponentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for startComponent: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StopComponent stops component +*/ +func (a *Client) StopComponent(params *StopComponentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopComponentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStopComponentParams() + } + op := &runtime.ClientOperation{ + ID: "stopComponent", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StopComponentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StopComponentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stopComponent: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/component/components_parameters.go b/generated-client/client/component/components_parameters.go new file mode 100644 index 0000000..28e8fa3 --- /dev/null +++ b/generated-client/client/component/components_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewComponentsParams creates a new ComponentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewComponentsParams() *ComponentsParams { + return &ComponentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewComponentsParamsWithTimeout creates a new ComponentsParams object +// with the ability to set a timeout on a request. +func NewComponentsParamsWithTimeout(timeout time.Duration) *ComponentsParams { + return &ComponentsParams{ + timeout: timeout, + } +} + +// NewComponentsParamsWithContext creates a new ComponentsParams object +// with the ability to set a context for a request. +func NewComponentsParamsWithContext(ctx context.Context) *ComponentsParams { + return &ComponentsParams{ + Context: ctx, + } +} + +// NewComponentsParamsWithHTTPClient creates a new ComponentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewComponentsParamsWithHTTPClient(client *http.Client) *ComponentsParams { + return &ComponentsParams{ + HTTPClient: client, + } +} + +/* +ComponentsParams contains all the parameters to send to the API endpoint + + for the components operation. + + Typically these are written to a http.Request. +*/ +type ComponentsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* DeploymentName. + + Name of deployment + */ + DeploymentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ComponentsParams) WithDefaults() *ComponentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ComponentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the components params +func (o *ComponentsParams) WithTimeout(timeout time.Duration) *ComponentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the components params +func (o *ComponentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the components params +func (o *ComponentsParams) WithContext(ctx context.Context) *ComponentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the components params +func (o *ComponentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the components params +func (o *ComponentsParams) WithHTTPClient(client *http.Client) *ComponentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the components params +func (o *ComponentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the components params +func (o *ComponentsParams) WithImpersonateGroup(impersonateGroup []string) *ComponentsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the components params +func (o *ComponentsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the components params +func (o *ComponentsParams) WithImpersonateUser(impersonateUser *string) *ComponentsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the components params +func (o *ComponentsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the components params +func (o *ComponentsParams) WithAppName(appName string) *ComponentsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the components params +func (o *ComponentsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithDeploymentName adds the deploymentName to the components params +func (o *ComponentsParams) WithDeploymentName(deploymentName string) *ComponentsParams { + o.SetDeploymentName(deploymentName) + return o +} + +// SetDeploymentName adds the deploymentName to the components params +func (o *ComponentsParams) SetDeploymentName(deploymentName string) { + o.DeploymentName = deploymentName +} + +// WriteToRequest writes these params to a swagger request +func (o *ComponentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param deploymentName + if err := r.SetPathParam("deploymentName", o.DeploymentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamComponents binds the parameter Impersonate-Group +func (o *ComponentsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/components_responses.go b/generated-client/client/component/components_responses.go new file mode 100644 index 0000000..c0e53bf --- /dev/null +++ b/generated-client/client/component/components_responses.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// ComponentsReader is a Reader for the Components structure. +type ComponentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ComponentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewComponentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewComponentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/deployments/{deploymentName}/components] components", response, response.Code()) + } +} + +// NewComponentsOK creates a ComponentsOK with default headers values +func NewComponentsOK() *ComponentsOK { + return &ComponentsOK{} +} + +/* +ComponentsOK describes a response with status code 200, with default header values. + +pod log +*/ +type ComponentsOK struct { + Payload []*models.Component +} + +// IsSuccess returns true when this components o k response has a 2xx status code +func (o *ComponentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this components o k response has a 3xx status code +func (o *ComponentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this components o k response has a 4xx status code +func (o *ComponentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this components o k response has a 5xx status code +func (o *ComponentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this components o k response a status code equal to that given +func (o *ComponentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the components o k response +func (o *ComponentsOK) Code() int { + return 200 +} + +func (o *ComponentsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components][%d] componentsOK %+v", 200, o.Payload) +} + +func (o *ComponentsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components][%d] componentsOK %+v", 200, o.Payload) +} + +func (o *ComponentsOK) GetPayload() []*models.Component { + return o.Payload +} + +func (o *ComponentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewComponentsNotFound creates a ComponentsNotFound with default headers values +func NewComponentsNotFound() *ComponentsNotFound { + return &ComponentsNotFound{} +} + +/* +ComponentsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ComponentsNotFound struct { +} + +// IsSuccess returns true when this components not found response has a 2xx status code +func (o *ComponentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this components not found response has a 3xx status code +func (o *ComponentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this components not found response has a 4xx status code +func (o *ComponentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this components not found response has a 5xx status code +func (o *ComponentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this components not found response a status code equal to that given +func (o *ComponentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the components not found response +func (o *ComponentsNotFound) Code() int { + return 404 +} + +func (o *ComponentsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components][%d] componentsNotFound ", 404) +} + +func (o *ComponentsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components][%d] componentsNotFound ", 404) +} + +func (o *ComponentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/env_vars_parameters.go b/generated-client/client/component/env_vars_parameters.go new file mode 100644 index 0000000..1a3c90e --- /dev/null +++ b/generated-client/client/component/env_vars_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewEnvVarsParams creates a new EnvVarsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewEnvVarsParams() *EnvVarsParams { + return &EnvVarsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewEnvVarsParamsWithTimeout creates a new EnvVarsParams object +// with the ability to set a timeout on a request. +func NewEnvVarsParamsWithTimeout(timeout time.Duration) *EnvVarsParams { + return &EnvVarsParams{ + timeout: timeout, + } +} + +// NewEnvVarsParamsWithContext creates a new EnvVarsParams object +// with the ability to set a context for a request. +func NewEnvVarsParamsWithContext(ctx context.Context) *EnvVarsParams { + return &EnvVarsParams{ + Context: ctx, + } +} + +// NewEnvVarsParamsWithHTTPClient creates a new EnvVarsParams object +// with the ability to set a custom HTTPClient for a request. +func NewEnvVarsParamsWithHTTPClient(client *http.Client) *EnvVarsParams { + return &EnvVarsParams{ + HTTPClient: client, + } +} + +/* +EnvVarsParams contains all the parameters to send to the API endpoint + + for the env vars operation. + + Typically these are written to a http.Request. +*/ +type EnvVarsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the env vars params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnvVarsParams) WithDefaults() *EnvVarsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the env vars params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnvVarsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the env vars params +func (o *EnvVarsParams) WithTimeout(timeout time.Duration) *EnvVarsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the env vars params +func (o *EnvVarsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the env vars params +func (o *EnvVarsParams) WithContext(ctx context.Context) *EnvVarsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the env vars params +func (o *EnvVarsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the env vars params +func (o *EnvVarsParams) WithHTTPClient(client *http.Client) *EnvVarsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the env vars params +func (o *EnvVarsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the env vars params +func (o *EnvVarsParams) WithImpersonateGroup(impersonateGroup []string) *EnvVarsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the env vars params +func (o *EnvVarsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the env vars params +func (o *EnvVarsParams) WithImpersonateUser(impersonateUser *string) *EnvVarsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the env vars params +func (o *EnvVarsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the env vars params +func (o *EnvVarsParams) WithAppName(appName string) *EnvVarsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the env vars params +func (o *EnvVarsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the env vars params +func (o *EnvVarsParams) WithComponentName(componentName string) *EnvVarsParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the env vars params +func (o *EnvVarsParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the env vars params +func (o *EnvVarsParams) WithEnvName(envName string) *EnvVarsParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the env vars params +func (o *EnvVarsParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *EnvVarsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamEnvVars binds the parameter Impersonate-Group +func (o *EnvVarsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/env_vars_responses.go b/generated-client/client/component/env_vars_responses.go new file mode 100644 index 0000000..b50a7e9 --- /dev/null +++ b/generated-client/client/component/env_vars_responses.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// EnvVarsReader is a Reader for the EnvVars structure. +type EnvVarsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EnvVarsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewEnvVarsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewEnvVarsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/components/{componentName}/envvars] envVars", response, response.Code()) + } +} + +// NewEnvVarsOK creates a EnvVarsOK with default headers values +func NewEnvVarsOK() *EnvVarsOK { + return &EnvVarsOK{} +} + +/* +EnvVarsOK describes a response with status code 200, with default header values. + +environment variables +*/ +type EnvVarsOK struct { + Payload []*models.EnvVar +} + +// IsSuccess returns true when this env vars o k response has a 2xx status code +func (o *EnvVarsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this env vars o k response has a 3xx status code +func (o *EnvVarsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this env vars o k response has a 4xx status code +func (o *EnvVarsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this env vars o k response has a 5xx status code +func (o *EnvVarsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this env vars o k response a status code equal to that given +func (o *EnvVarsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the env vars o k response +func (o *EnvVarsOK) Code() int { + return 200 +} + +func (o *EnvVarsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] envVarsOK %+v", 200, o.Payload) +} + +func (o *EnvVarsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] envVarsOK %+v", 200, o.Payload) +} + +func (o *EnvVarsOK) GetPayload() []*models.EnvVar { + return o.Payload +} + +func (o *EnvVarsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewEnvVarsNotFound creates a EnvVarsNotFound with default headers values +func NewEnvVarsNotFound() *EnvVarsNotFound { + return &EnvVarsNotFound{} +} + +/* +EnvVarsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type EnvVarsNotFound struct { +} + +// IsSuccess returns true when this env vars not found response has a 2xx status code +func (o *EnvVarsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this env vars not found response has a 3xx status code +func (o *EnvVarsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this env vars not found response has a 4xx status code +func (o *EnvVarsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this env vars not found response has a 5xx status code +func (o *EnvVarsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this env vars not found response a status code equal to that given +func (o *EnvVarsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the env vars not found response +func (o *EnvVarsNotFound) Code() int { + return 404 +} + +func (o *EnvVarsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] envVarsNotFound ", 404) +} + +func (o *EnvVarsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/envvars][%d] envVarsNotFound ", 404) +} + +func (o *EnvVarsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/get_o_auth_pod_log_parameters.go b/generated-client/client/component/get_o_auth_pod_log_parameters.go new file mode 100644 index 0000000..13182ff --- /dev/null +++ b/generated-client/client/component/get_o_auth_pod_log_parameters.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetOAuthPodLogParams creates a new GetOAuthPodLogParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetOAuthPodLogParams() *GetOAuthPodLogParams { + return &GetOAuthPodLogParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetOAuthPodLogParamsWithTimeout creates a new GetOAuthPodLogParams object +// with the ability to set a timeout on a request. +func NewGetOAuthPodLogParamsWithTimeout(timeout time.Duration) *GetOAuthPodLogParams { + return &GetOAuthPodLogParams{ + timeout: timeout, + } +} + +// NewGetOAuthPodLogParamsWithContext creates a new GetOAuthPodLogParams object +// with the ability to set a context for a request. +func NewGetOAuthPodLogParamsWithContext(ctx context.Context) *GetOAuthPodLogParams { + return &GetOAuthPodLogParams{ + Context: ctx, + } +} + +// NewGetOAuthPodLogParamsWithHTTPClient creates a new GetOAuthPodLogParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetOAuthPodLogParamsWithHTTPClient(client *http.Client) *GetOAuthPodLogParams { + return &GetOAuthPodLogParams{ + HTTPClient: client, + } +} + +/* +GetOAuthPodLogParams contains all the parameters to send to the API endpoint + + for the get o auth pod log operation. + + Typically these are written to a http.Request. +*/ +type GetOAuthPodLogParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* File. + + Get log as a file if true + + Format: boolean + */ + File *string + + /* Lines. + + Get log lines (example 1000) + + Format: number + */ + Lines *string + + /* PodName. + + Name of pod + */ + PodName string + + /* SinceTime. + + Get log only from sinceTime (example 2020-03-18T07:20:41+00:00) + + Format: date-time + */ + SinceTime *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get o auth pod log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOAuthPodLogParams) WithDefaults() *GetOAuthPodLogParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get o auth pod log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOAuthPodLogParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithTimeout(timeout time.Duration) *GetOAuthPodLogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithContext(ctx context.Context) *GetOAuthPodLogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithHTTPClient(client *http.Client) *GetOAuthPodLogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithImpersonateGroup(impersonateGroup []string) *GetOAuthPodLogParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithImpersonateUser(impersonateUser *string) *GetOAuthPodLogParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithAppName(appName string) *GetOAuthPodLogParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithComponentName(componentName string) *GetOAuthPodLogParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithEnvName(envName string) *GetOAuthPodLogParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithFile adds the file to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithFile(file *string) *GetOAuthPodLogParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetFile(file *string) { + o.File = file +} + +// WithLines adds the lines to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithLines(lines *string) *GetOAuthPodLogParams { + o.SetLines(lines) + return o +} + +// SetLines adds the lines to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetLines(lines *string) { + o.Lines = lines +} + +// WithPodName adds the podName to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithPodName(podName string) *GetOAuthPodLogParams { + o.SetPodName(podName) + return o +} + +// SetPodName adds the podName to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetPodName(podName string) { + o.PodName = podName +} + +// WithSinceTime adds the sinceTime to the get o auth pod log params +func (o *GetOAuthPodLogParams) WithSinceTime(sinceTime *strfmt.DateTime) *GetOAuthPodLogParams { + o.SetSinceTime(sinceTime) + return o +} + +// SetSinceTime adds the sinceTime to the get o auth pod log params +func (o *GetOAuthPodLogParams) SetSinceTime(sinceTime *strfmt.DateTime) { + o.SinceTime = sinceTime +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOAuthPodLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if o.File != nil { + + // query param file + var qrFile string + + if o.File != nil { + qrFile = *o.File + } + qFile := qrFile + if qFile != "" { + + if err := r.SetQueryParam("file", qFile); err != nil { + return err + } + } + } + + if o.Lines != nil { + + // query param lines + var qrLines string + + if o.Lines != nil { + qrLines = *o.Lines + } + qLines := qrLines + if qLines != "" { + + if err := r.SetQueryParam("lines", qLines); err != nil { + return err + } + } + } + + // path param podName + if err := r.SetPathParam("podName", o.PodName); err != nil { + return err + } + + if o.SinceTime != nil { + + // query param sinceTime + var qrSinceTime strfmt.DateTime + + if o.SinceTime != nil { + qrSinceTime = *o.SinceTime + } + qSinceTime := qrSinceTime.String() + if qSinceTime != "" { + + if err := r.SetQueryParam("sinceTime", qSinceTime); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetOAuthPodLog binds the parameter Impersonate-Group +func (o *GetOAuthPodLogParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/get_o_auth_pod_log_responses.go b/generated-client/client/component/get_o_auth_pod_log_responses.go new file mode 100644 index 0000000..a710251 --- /dev/null +++ b/generated-client/client/component/get_o_auth_pod_log_responses.go @@ -0,0 +1,347 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetOAuthPodLogReader is a Reader for the GetOAuthPodLog structure. +type GetOAuthPodLogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOAuthPodLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOAuthPodLogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetOAuthPodLogUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetOAuthPodLogForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetOAuthPodLogNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetOAuthPodLogInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs] getOAuthPodLog", response, response.Code()) + } +} + +// NewGetOAuthPodLogOK creates a GetOAuthPodLogOK with default headers values +func NewGetOAuthPodLogOK() *GetOAuthPodLogOK { + return &GetOAuthPodLogOK{} +} + +/* +GetOAuthPodLogOK describes a response with status code 200, with default header values. + +pod log +*/ +type GetOAuthPodLogOK struct { + Payload string +} + +// IsSuccess returns true when this get o auth pod log o k response has a 2xx status code +func (o *GetOAuthPodLogOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get o auth pod log o k response has a 3xx status code +func (o *GetOAuthPodLogOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get o auth pod log o k response has a 4xx status code +func (o *GetOAuthPodLogOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get o auth pod log o k response has a 5xx status code +func (o *GetOAuthPodLogOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get o auth pod log o k response a status code equal to that given +func (o *GetOAuthPodLogOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get o auth pod log o k response +func (o *GetOAuthPodLogOK) Code() int { + return 200 +} + +func (o *GetOAuthPodLogOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogOK %+v", 200, o.Payload) +} + +func (o *GetOAuthPodLogOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogOK %+v", 200, o.Payload) +} + +func (o *GetOAuthPodLogOK) GetPayload() string { + return o.Payload +} + +func (o *GetOAuthPodLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOAuthPodLogUnauthorized creates a GetOAuthPodLogUnauthorized with default headers values +func NewGetOAuthPodLogUnauthorized() *GetOAuthPodLogUnauthorized { + return &GetOAuthPodLogUnauthorized{} +} + +/* +GetOAuthPodLogUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetOAuthPodLogUnauthorized struct { +} + +// IsSuccess returns true when this get o auth pod log unauthorized response has a 2xx status code +func (o *GetOAuthPodLogUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get o auth pod log unauthorized response has a 3xx status code +func (o *GetOAuthPodLogUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get o auth pod log unauthorized response has a 4xx status code +func (o *GetOAuthPodLogUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get o auth pod log unauthorized response has a 5xx status code +func (o *GetOAuthPodLogUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get o auth pod log unauthorized response a status code equal to that given +func (o *GetOAuthPodLogUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get o auth pod log unauthorized response +func (o *GetOAuthPodLogUnauthorized) Code() int { + return 401 +} + +func (o *GetOAuthPodLogUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogUnauthorized ", 401) +} + +func (o *GetOAuthPodLogUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogUnauthorized ", 401) +} + +func (o *GetOAuthPodLogUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetOAuthPodLogForbidden creates a GetOAuthPodLogForbidden with default headers values +func NewGetOAuthPodLogForbidden() *GetOAuthPodLogForbidden { + return &GetOAuthPodLogForbidden{} +} + +/* +GetOAuthPodLogForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetOAuthPodLogForbidden struct { +} + +// IsSuccess returns true when this get o auth pod log forbidden response has a 2xx status code +func (o *GetOAuthPodLogForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get o auth pod log forbidden response has a 3xx status code +func (o *GetOAuthPodLogForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get o auth pod log forbidden response has a 4xx status code +func (o *GetOAuthPodLogForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get o auth pod log forbidden response has a 5xx status code +func (o *GetOAuthPodLogForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get o auth pod log forbidden response a status code equal to that given +func (o *GetOAuthPodLogForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get o auth pod log forbidden response +func (o *GetOAuthPodLogForbidden) Code() int { + return 403 +} + +func (o *GetOAuthPodLogForbidden) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogForbidden ", 403) +} + +func (o *GetOAuthPodLogForbidden) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogForbidden ", 403) +} + +func (o *GetOAuthPodLogForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetOAuthPodLogNotFound creates a GetOAuthPodLogNotFound with default headers values +func NewGetOAuthPodLogNotFound() *GetOAuthPodLogNotFound { + return &GetOAuthPodLogNotFound{} +} + +/* +GetOAuthPodLogNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetOAuthPodLogNotFound struct { +} + +// IsSuccess returns true when this get o auth pod log not found response has a 2xx status code +func (o *GetOAuthPodLogNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get o auth pod log not found response has a 3xx status code +func (o *GetOAuthPodLogNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get o auth pod log not found response has a 4xx status code +func (o *GetOAuthPodLogNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get o auth pod log not found response has a 5xx status code +func (o *GetOAuthPodLogNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get o auth pod log not found response a status code equal to that given +func (o *GetOAuthPodLogNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get o auth pod log not found response +func (o *GetOAuthPodLogNotFound) Code() int { + return 404 +} + +func (o *GetOAuthPodLogNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogNotFound ", 404) +} + +func (o *GetOAuthPodLogNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogNotFound ", 404) +} + +func (o *GetOAuthPodLogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetOAuthPodLogInternalServerError creates a GetOAuthPodLogInternalServerError with default headers values +func NewGetOAuthPodLogInternalServerError() *GetOAuthPodLogInternalServerError { + return &GetOAuthPodLogInternalServerError{} +} + +/* +GetOAuthPodLogInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetOAuthPodLogInternalServerError struct { +} + +// IsSuccess returns true when this get o auth pod log internal server error response has a 2xx status code +func (o *GetOAuthPodLogInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get o auth pod log internal server error response has a 3xx status code +func (o *GetOAuthPodLogInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get o auth pod log internal server error response has a 4xx status code +func (o *GetOAuthPodLogInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get o auth pod log internal server error response has a 5xx status code +func (o *GetOAuthPodLogInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get o auth pod log internal server error response a status code equal to that given +func (o *GetOAuthPodLogInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get o auth pod log internal server error response +func (o *GetOAuthPodLogInternalServerError) Code() int { + return 500 +} + +func (o *GetOAuthPodLogInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogInternalServerError ", 500) +} + +func (o *GetOAuthPodLogInternalServerError) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/replicas/{podName}/logs][%d] getOAuthPodLogInternalServerError ", 500) +} + +func (o *GetOAuthPodLogInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/log_parameters.go b/generated-client/client/component/log_parameters.go new file mode 100644 index 0000000..13038ff --- /dev/null +++ b/generated-client/client/component/log_parameters.go @@ -0,0 +1,434 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewLogParams creates a new LogParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewLogParams() *LogParams { + return &LogParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewLogParamsWithTimeout creates a new LogParams object +// with the ability to set a timeout on a request. +func NewLogParamsWithTimeout(timeout time.Duration) *LogParams { + return &LogParams{ + timeout: timeout, + } +} + +// NewLogParamsWithContext creates a new LogParams object +// with the ability to set a context for a request. +func NewLogParamsWithContext(ctx context.Context) *LogParams { + return &LogParams{ + Context: ctx, + } +} + +// NewLogParamsWithHTTPClient creates a new LogParams object +// with the ability to set a custom HTTPClient for a request. +func NewLogParamsWithHTTPClient(client *http.Client) *LogParams { + return &LogParams{ + HTTPClient: client, + } +} + +/* +LogParams contains all the parameters to send to the API endpoint + + for the log operation. + + Typically these are written to a http.Request. +*/ +type LogParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* DeploymentName. + + Name of deployment + */ + DeploymentName string + + /* File. + + Get log as a file if true + + Format: boolean + */ + File *string + + /* Lines. + + Get log lines (example 1000) + + Format: number + */ + Lines *string + + /* PodName. + + Name of pod + */ + PodName string + + /* Previous. + + Get previous container log if true + + Format: boolean + */ + Previous *string + + /* SinceTime. + + Get log only from sinceTime (example 2020-03-18T07:20:41+00:00) + + Format: date-time + */ + SinceTime *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LogParams) WithDefaults() *LogParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LogParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the log params +func (o *LogParams) WithTimeout(timeout time.Duration) *LogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the log params +func (o *LogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the log params +func (o *LogParams) WithContext(ctx context.Context) *LogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the log params +func (o *LogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the log params +func (o *LogParams) WithHTTPClient(client *http.Client) *LogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the log params +func (o *LogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the log params +func (o *LogParams) WithImpersonateGroup(impersonateGroup []string) *LogParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the log params +func (o *LogParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the log params +func (o *LogParams) WithImpersonateUser(impersonateUser *string) *LogParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the log params +func (o *LogParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the log params +func (o *LogParams) WithAppName(appName string) *LogParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the log params +func (o *LogParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the log params +func (o *LogParams) WithComponentName(componentName string) *LogParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the log params +func (o *LogParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithDeploymentName adds the deploymentName to the log params +func (o *LogParams) WithDeploymentName(deploymentName string) *LogParams { + o.SetDeploymentName(deploymentName) + return o +} + +// SetDeploymentName adds the deploymentName to the log params +func (o *LogParams) SetDeploymentName(deploymentName string) { + o.DeploymentName = deploymentName +} + +// WithFile adds the file to the log params +func (o *LogParams) WithFile(file *string) *LogParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the log params +func (o *LogParams) SetFile(file *string) { + o.File = file +} + +// WithLines adds the lines to the log params +func (o *LogParams) WithLines(lines *string) *LogParams { + o.SetLines(lines) + return o +} + +// SetLines adds the lines to the log params +func (o *LogParams) SetLines(lines *string) { + o.Lines = lines +} + +// WithPodName adds the podName to the log params +func (o *LogParams) WithPodName(podName string) *LogParams { + o.SetPodName(podName) + return o +} + +// SetPodName adds the podName to the log params +func (o *LogParams) SetPodName(podName string) { + o.PodName = podName +} + +// WithPrevious adds the previous to the log params +func (o *LogParams) WithPrevious(previous *string) *LogParams { + o.SetPrevious(previous) + return o +} + +// SetPrevious adds the previous to the log params +func (o *LogParams) SetPrevious(previous *string) { + o.Previous = previous +} + +// WithSinceTime adds the sinceTime to the log params +func (o *LogParams) WithSinceTime(sinceTime *strfmt.DateTime) *LogParams { + o.SetSinceTime(sinceTime) + return o +} + +// SetSinceTime adds the sinceTime to the log params +func (o *LogParams) SetSinceTime(sinceTime *strfmt.DateTime) { + o.SinceTime = sinceTime +} + +// WriteToRequest writes these params to a swagger request +func (o *LogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param deploymentName + if err := r.SetPathParam("deploymentName", o.DeploymentName); err != nil { + return err + } + + if o.File != nil { + + // query param file + var qrFile string + + if o.File != nil { + qrFile = *o.File + } + qFile := qrFile + if qFile != "" { + + if err := r.SetQueryParam("file", qFile); err != nil { + return err + } + } + } + + if o.Lines != nil { + + // query param lines + var qrLines string + + if o.Lines != nil { + qrLines = *o.Lines + } + qLines := qrLines + if qLines != "" { + + if err := r.SetQueryParam("lines", qLines); err != nil { + return err + } + } + } + + // path param podName + if err := r.SetPathParam("podName", o.PodName); err != nil { + return err + } + + if o.Previous != nil { + + // query param previous + var qrPrevious string + + if o.Previous != nil { + qrPrevious = *o.Previous + } + qPrevious := qrPrevious + if qPrevious != "" { + + if err := r.SetQueryParam("previous", qPrevious); err != nil { + return err + } + } + } + + if o.SinceTime != nil { + + // query param sinceTime + var qrSinceTime strfmt.DateTime + + if o.SinceTime != nil { + qrSinceTime = *o.SinceTime + } + qSinceTime := qrSinceTime.String() + if qSinceTime != "" { + + if err := r.SetQueryParam("sinceTime", qSinceTime); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamLog binds the parameter Impersonate-Group +func (o *LogParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/log_responses.go b/generated-client/client/component/log_responses.go new file mode 100644 index 0000000..cab50f7 --- /dev/null +++ b/generated-client/client/component/log_responses.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// LogReader is a Reader for the Log structure. +type LogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewLogNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/deployments/{deploymentName}/components/{componentName}/replicas/{podName}/logs] log", response, response.Code()) + } +} + +// NewLogOK creates a LogOK with default headers values +func NewLogOK() *LogOK { + return &LogOK{} +} + +/* +LogOK describes a response with status code 200, with default header values. + +pod log +*/ +type LogOK struct { + Payload string +} + +// IsSuccess returns true when this log o k response has a 2xx status code +func (o *LogOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this log o k response has a 3xx status code +func (o *LogOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this log o k response has a 4xx status code +func (o *LogOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this log o k response has a 5xx status code +func (o *LogOK) IsServerError() bool { + return false +} + +// IsCode returns true when this log o k response a status code equal to that given +func (o *LogOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the log o k response +func (o *LogOK) Code() int { + return 200 +} + +func (o *LogOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components/{componentName}/replicas/{podName}/logs][%d] logOK %+v", 200, o.Payload) +} + +func (o *LogOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components/{componentName}/replicas/{podName}/logs][%d] logOK %+v", 200, o.Payload) +} + +func (o *LogOK) GetPayload() string { + return o.Payload +} + +func (o *LogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewLogNotFound creates a LogNotFound with default headers values +func NewLogNotFound() *LogNotFound { + return &LogNotFound{} +} + +/* +LogNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type LogNotFound struct { +} + +// IsSuccess returns true when this log not found response has a 2xx status code +func (o *LogNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this log not found response has a 3xx status code +func (o *LogNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this log not found response has a 4xx status code +func (o *LogNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this log not found response has a 5xx status code +func (o *LogNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this log not found response a status code equal to that given +func (o *LogNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the log not found response +func (o *LogNotFound) Code() int { + return 404 +} + +func (o *LogNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components/{componentName}/replicas/{podName}/logs][%d] logNotFound ", 404) +} + +func (o *LogNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}/components/{componentName}/replicas/{podName}/logs][%d] logNotFound ", 404) +} + +func (o *LogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/replica_log_parameters.go b/generated-client/client/component/replica_log_parameters.go new file mode 100644 index 0000000..2610431 --- /dev/null +++ b/generated-client/client/component/replica_log_parameters.go @@ -0,0 +1,434 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewReplicaLogParams creates a new ReplicaLogParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReplicaLogParams() *ReplicaLogParams { + return &ReplicaLogParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReplicaLogParamsWithTimeout creates a new ReplicaLogParams object +// with the ability to set a timeout on a request. +func NewReplicaLogParamsWithTimeout(timeout time.Duration) *ReplicaLogParams { + return &ReplicaLogParams{ + timeout: timeout, + } +} + +// NewReplicaLogParamsWithContext creates a new ReplicaLogParams object +// with the ability to set a context for a request. +func NewReplicaLogParamsWithContext(ctx context.Context) *ReplicaLogParams { + return &ReplicaLogParams{ + Context: ctx, + } +} + +// NewReplicaLogParamsWithHTTPClient creates a new ReplicaLogParams object +// with the ability to set a custom HTTPClient for a request. +func NewReplicaLogParamsWithHTTPClient(client *http.Client) *ReplicaLogParams { + return &ReplicaLogParams{ + HTTPClient: client, + } +} + +/* +ReplicaLogParams contains all the parameters to send to the API endpoint + + for the replica log operation. + + Typically these are written to a http.Request. +*/ +type ReplicaLogParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* File. + + Get log as a file if true + + Format: boolean + */ + File *string + + /* Lines. + + Get log lines (example 1000) + + Format: number + */ + Lines *string + + /* PodName. + + Name of pod + */ + PodName string + + /* Previous. + + Get previous container log if true + + Format: boolean + */ + Previous *string + + /* SinceTime. + + Get log only from sinceTime (example 2020-03-18T07:20:41+00:00) + + Format: date-time + */ + SinceTime *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the replica log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplicaLogParams) WithDefaults() *ReplicaLogParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the replica log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplicaLogParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the replica log params +func (o *ReplicaLogParams) WithTimeout(timeout time.Duration) *ReplicaLogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the replica log params +func (o *ReplicaLogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the replica log params +func (o *ReplicaLogParams) WithContext(ctx context.Context) *ReplicaLogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the replica log params +func (o *ReplicaLogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the replica log params +func (o *ReplicaLogParams) WithHTTPClient(client *http.Client) *ReplicaLogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the replica log params +func (o *ReplicaLogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the replica log params +func (o *ReplicaLogParams) WithImpersonateGroup(impersonateGroup []string) *ReplicaLogParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the replica log params +func (o *ReplicaLogParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the replica log params +func (o *ReplicaLogParams) WithImpersonateUser(impersonateUser *string) *ReplicaLogParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the replica log params +func (o *ReplicaLogParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the replica log params +func (o *ReplicaLogParams) WithAppName(appName string) *ReplicaLogParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the replica log params +func (o *ReplicaLogParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the replica log params +func (o *ReplicaLogParams) WithComponentName(componentName string) *ReplicaLogParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the replica log params +func (o *ReplicaLogParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the replica log params +func (o *ReplicaLogParams) WithEnvName(envName string) *ReplicaLogParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the replica log params +func (o *ReplicaLogParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithFile adds the file to the replica log params +func (o *ReplicaLogParams) WithFile(file *string) *ReplicaLogParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the replica log params +func (o *ReplicaLogParams) SetFile(file *string) { + o.File = file +} + +// WithLines adds the lines to the replica log params +func (o *ReplicaLogParams) WithLines(lines *string) *ReplicaLogParams { + o.SetLines(lines) + return o +} + +// SetLines adds the lines to the replica log params +func (o *ReplicaLogParams) SetLines(lines *string) { + o.Lines = lines +} + +// WithPodName adds the podName to the replica log params +func (o *ReplicaLogParams) WithPodName(podName string) *ReplicaLogParams { + o.SetPodName(podName) + return o +} + +// SetPodName adds the podName to the replica log params +func (o *ReplicaLogParams) SetPodName(podName string) { + o.PodName = podName +} + +// WithPrevious adds the previous to the replica log params +func (o *ReplicaLogParams) WithPrevious(previous *string) *ReplicaLogParams { + o.SetPrevious(previous) + return o +} + +// SetPrevious adds the previous to the replica log params +func (o *ReplicaLogParams) SetPrevious(previous *string) { + o.Previous = previous +} + +// WithSinceTime adds the sinceTime to the replica log params +func (o *ReplicaLogParams) WithSinceTime(sinceTime *strfmt.DateTime) *ReplicaLogParams { + o.SetSinceTime(sinceTime) + return o +} + +// SetSinceTime adds the sinceTime to the replica log params +func (o *ReplicaLogParams) SetSinceTime(sinceTime *strfmt.DateTime) { + o.SinceTime = sinceTime +} + +// WriteToRequest writes these params to a swagger request +func (o *ReplicaLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if o.File != nil { + + // query param file + var qrFile string + + if o.File != nil { + qrFile = *o.File + } + qFile := qrFile + if qFile != "" { + + if err := r.SetQueryParam("file", qFile); err != nil { + return err + } + } + } + + if o.Lines != nil { + + // query param lines + var qrLines string + + if o.Lines != nil { + qrLines = *o.Lines + } + qLines := qrLines + if qLines != "" { + + if err := r.SetQueryParam("lines", qLines); err != nil { + return err + } + } + } + + // path param podName + if err := r.SetPathParam("podName", o.PodName); err != nil { + return err + } + + if o.Previous != nil { + + // query param previous + var qrPrevious string + + if o.Previous != nil { + qrPrevious = *o.Previous + } + qPrevious := qrPrevious + if qPrevious != "" { + + if err := r.SetQueryParam("previous", qPrevious); err != nil { + return err + } + } + } + + if o.SinceTime != nil { + + // query param sinceTime + var qrSinceTime strfmt.DateTime + + if o.SinceTime != nil { + qrSinceTime = *o.SinceTime + } + qSinceTime := qrSinceTime.String() + if qSinceTime != "" { + + if err := r.SetQueryParam("sinceTime", qSinceTime); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamReplicaLog binds the parameter Impersonate-Group +func (o *ReplicaLogParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/replica_log_responses.go b/generated-client/client/component/replica_log_responses.go new file mode 100644 index 0000000..fa62f60 --- /dev/null +++ b/generated-client/client/component/replica_log_responses.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ReplicaLogReader is a Reader for the ReplicaLog structure. +type ReplicaLogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReplicaLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReplicaLogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewReplicaLogNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/components/{componentName}/replicas/{podName}/logs] replicaLog", response, response.Code()) + } +} + +// NewReplicaLogOK creates a ReplicaLogOK with default headers values +func NewReplicaLogOK() *ReplicaLogOK { + return &ReplicaLogOK{} +} + +/* +ReplicaLogOK describes a response with status code 200, with default header values. + +pod log +*/ +type ReplicaLogOK struct { + Payload string +} + +// IsSuccess returns true when this replica log o k response has a 2xx status code +func (o *ReplicaLogOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this replica log o k response has a 3xx status code +func (o *ReplicaLogOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this replica log o k response has a 4xx status code +func (o *ReplicaLogOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this replica log o k response has a 5xx status code +func (o *ReplicaLogOK) IsServerError() bool { + return false +} + +// IsCode returns true when this replica log o k response a status code equal to that given +func (o *ReplicaLogOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the replica log o k response +func (o *ReplicaLogOK) Code() int { + return 200 +} + +func (o *ReplicaLogOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/replicas/{podName}/logs][%d] replicaLogOK %+v", 200, o.Payload) +} + +func (o *ReplicaLogOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/replicas/{podName}/logs][%d] replicaLogOK %+v", 200, o.Payload) +} + +func (o *ReplicaLogOK) GetPayload() string { + return o.Payload +} + +func (o *ReplicaLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReplicaLogNotFound creates a ReplicaLogNotFound with default headers values +func NewReplicaLogNotFound() *ReplicaLogNotFound { + return &ReplicaLogNotFound{} +} + +/* +ReplicaLogNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ReplicaLogNotFound struct { +} + +// IsSuccess returns true when this replica log not found response has a 2xx status code +func (o *ReplicaLogNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this replica log not found response has a 3xx status code +func (o *ReplicaLogNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this replica log not found response has a 4xx status code +func (o *ReplicaLogNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this replica log not found response has a 5xx status code +func (o *ReplicaLogNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this replica log not found response a status code equal to that given +func (o *ReplicaLogNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the replica log not found response +func (o *ReplicaLogNotFound) Code() int { + return 404 +} + +func (o *ReplicaLogNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/replicas/{podName}/logs][%d] replicaLogNotFound ", 404) +} + +func (o *ReplicaLogNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/replicas/{podName}/logs][%d] replicaLogNotFound ", 404) +} + +func (o *ReplicaLogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/restart_component_parameters.go b/generated-client/client/component/restart_component_parameters.go new file mode 100644 index 0000000..239125f --- /dev/null +++ b/generated-client/client/component/restart_component_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRestartComponentParams creates a new RestartComponentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRestartComponentParams() *RestartComponentParams { + return &RestartComponentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRestartComponentParamsWithTimeout creates a new RestartComponentParams object +// with the ability to set a timeout on a request. +func NewRestartComponentParamsWithTimeout(timeout time.Duration) *RestartComponentParams { + return &RestartComponentParams{ + timeout: timeout, + } +} + +// NewRestartComponentParamsWithContext creates a new RestartComponentParams object +// with the ability to set a context for a request. +func NewRestartComponentParamsWithContext(ctx context.Context) *RestartComponentParams { + return &RestartComponentParams{ + Context: ctx, + } +} + +// NewRestartComponentParamsWithHTTPClient creates a new RestartComponentParams object +// with the ability to set a custom HTTPClient for a request. +func NewRestartComponentParamsWithHTTPClient(client *http.Client) *RestartComponentParams { + return &RestartComponentParams{ + HTTPClient: client, + } +} + +/* +RestartComponentParams contains all the parameters to send to the API endpoint + + for the restart component operation. + + Typically these are written to a http.Request. +*/ +type RestartComponentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the restart component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartComponentParams) WithDefaults() *RestartComponentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartComponentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the restart component params +func (o *RestartComponentParams) WithTimeout(timeout time.Duration) *RestartComponentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restart component params +func (o *RestartComponentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restart component params +func (o *RestartComponentParams) WithContext(ctx context.Context) *RestartComponentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restart component params +func (o *RestartComponentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restart component params +func (o *RestartComponentParams) WithHTTPClient(client *http.Client) *RestartComponentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restart component params +func (o *RestartComponentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the restart component params +func (o *RestartComponentParams) WithImpersonateGroup(impersonateGroup []string) *RestartComponentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the restart component params +func (o *RestartComponentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the restart component params +func (o *RestartComponentParams) WithImpersonateUser(impersonateUser *string) *RestartComponentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the restart component params +func (o *RestartComponentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the restart component params +func (o *RestartComponentParams) WithAppName(appName string) *RestartComponentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the restart component params +func (o *RestartComponentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the restart component params +func (o *RestartComponentParams) WithComponentName(componentName string) *RestartComponentParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the restart component params +func (o *RestartComponentParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the restart component params +func (o *RestartComponentParams) WithEnvName(envName string) *RestartComponentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the restart component params +func (o *RestartComponentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *RestartComponentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRestartComponent binds the parameter Impersonate-Group +func (o *RestartComponentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/restart_component_responses.go b/generated-client/client/component/restart_component_responses.go new file mode 100644 index 0000000..78f75bd --- /dev/null +++ b/generated-client/client/component/restart_component_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RestartComponentReader is a Reader for the RestartComponent structure. +type RestartComponentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestartComponentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRestartComponentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewRestartComponentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRestartComponentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/components/{componentName}/restart] restartComponent", response, response.Code()) + } +} + +// NewRestartComponentOK creates a RestartComponentOK with default headers values +func NewRestartComponentOK() *RestartComponentOK { + return &RestartComponentOK{} +} + +/* +RestartComponentOK describes a response with status code 200, with default header values. + +Component started ok +*/ +type RestartComponentOK struct { +} + +// IsSuccess returns true when this restart component o k response has a 2xx status code +func (o *RestartComponentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this restart component o k response has a 3xx status code +func (o *RestartComponentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart component o k response has a 4xx status code +func (o *RestartComponentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this restart component o k response has a 5xx status code +func (o *RestartComponentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this restart component o k response a status code equal to that given +func (o *RestartComponentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the restart component o k response +func (o *RestartComponentOK) Code() int { + return 200 +} + +func (o *RestartComponentOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/restart][%d] restartComponentOK ", 200) +} + +func (o *RestartComponentOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/restart][%d] restartComponentOK ", 200) +} + +func (o *RestartComponentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartComponentUnauthorized creates a RestartComponentUnauthorized with default headers values +func NewRestartComponentUnauthorized() *RestartComponentUnauthorized { + return &RestartComponentUnauthorized{} +} + +/* +RestartComponentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RestartComponentUnauthorized struct { +} + +// IsSuccess returns true when this restart component unauthorized response has a 2xx status code +func (o *RestartComponentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart component unauthorized response has a 3xx status code +func (o *RestartComponentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart component unauthorized response has a 4xx status code +func (o *RestartComponentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart component unauthorized response has a 5xx status code +func (o *RestartComponentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this restart component unauthorized response a status code equal to that given +func (o *RestartComponentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the restart component unauthorized response +func (o *RestartComponentUnauthorized) Code() int { + return 401 +} + +func (o *RestartComponentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/restart][%d] restartComponentUnauthorized ", 401) +} + +func (o *RestartComponentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/restart][%d] restartComponentUnauthorized ", 401) +} + +func (o *RestartComponentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartComponentNotFound creates a RestartComponentNotFound with default headers values +func NewRestartComponentNotFound() *RestartComponentNotFound { + return &RestartComponentNotFound{} +} + +/* +RestartComponentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RestartComponentNotFound struct { +} + +// IsSuccess returns true when this restart component not found response has a 2xx status code +func (o *RestartComponentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart component not found response has a 3xx status code +func (o *RestartComponentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart component not found response has a 4xx status code +func (o *RestartComponentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart component not found response has a 5xx status code +func (o *RestartComponentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this restart component not found response a status code equal to that given +func (o *RestartComponentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the restart component not found response +func (o *RestartComponentNotFound) Code() int { + return 404 +} + +func (o *RestartComponentNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/restart][%d] restartComponentNotFound ", 404) +} + +func (o *RestartComponentNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/restart][%d] restartComponentNotFound ", 404) +} + +func (o *RestartComponentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/restart_o_auth_auxiliary_resource_parameters.go b/generated-client/client/component/restart_o_auth_auxiliary_resource_parameters.go new file mode 100644 index 0000000..c99d5d0 --- /dev/null +++ b/generated-client/client/component/restart_o_auth_auxiliary_resource_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRestartOAuthAuxiliaryResourceParams creates a new RestartOAuthAuxiliaryResourceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRestartOAuthAuxiliaryResourceParams() *RestartOAuthAuxiliaryResourceParams { + return &RestartOAuthAuxiliaryResourceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRestartOAuthAuxiliaryResourceParamsWithTimeout creates a new RestartOAuthAuxiliaryResourceParams object +// with the ability to set a timeout on a request. +func NewRestartOAuthAuxiliaryResourceParamsWithTimeout(timeout time.Duration) *RestartOAuthAuxiliaryResourceParams { + return &RestartOAuthAuxiliaryResourceParams{ + timeout: timeout, + } +} + +// NewRestartOAuthAuxiliaryResourceParamsWithContext creates a new RestartOAuthAuxiliaryResourceParams object +// with the ability to set a context for a request. +func NewRestartOAuthAuxiliaryResourceParamsWithContext(ctx context.Context) *RestartOAuthAuxiliaryResourceParams { + return &RestartOAuthAuxiliaryResourceParams{ + Context: ctx, + } +} + +// NewRestartOAuthAuxiliaryResourceParamsWithHTTPClient creates a new RestartOAuthAuxiliaryResourceParams object +// with the ability to set a custom HTTPClient for a request. +func NewRestartOAuthAuxiliaryResourceParamsWithHTTPClient(client *http.Client) *RestartOAuthAuxiliaryResourceParams { + return &RestartOAuthAuxiliaryResourceParams{ + HTTPClient: client, + } +} + +/* +RestartOAuthAuxiliaryResourceParams contains all the parameters to send to the API endpoint + + for the restart o auth auxiliary resource operation. + + Typically these are written to a http.Request. +*/ +type RestartOAuthAuxiliaryResourceParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the restart o auth auxiliary resource params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartOAuthAuxiliaryResourceParams) WithDefaults() *RestartOAuthAuxiliaryResourceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart o auth auxiliary resource params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartOAuthAuxiliaryResourceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithTimeout(timeout time.Duration) *RestartOAuthAuxiliaryResourceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithContext(ctx context.Context) *RestartOAuthAuxiliaryResourceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithHTTPClient(client *http.Client) *RestartOAuthAuxiliaryResourceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithImpersonateGroup(impersonateGroup []string) *RestartOAuthAuxiliaryResourceParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithImpersonateUser(impersonateUser *string) *RestartOAuthAuxiliaryResourceParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithAppName(appName string) *RestartOAuthAuxiliaryResourceParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithComponentName(componentName string) *RestartOAuthAuxiliaryResourceParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) WithEnvName(envName string) *RestartOAuthAuxiliaryResourceParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the restart o auth auxiliary resource params +func (o *RestartOAuthAuxiliaryResourceParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *RestartOAuthAuxiliaryResourceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRestartOAuthAuxiliaryResource binds the parameter Impersonate-Group +func (o *RestartOAuthAuxiliaryResourceParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/restart_o_auth_auxiliary_resource_responses.go b/generated-client/client/component/restart_o_auth_auxiliary_resource_responses.go new file mode 100644 index 0000000..c1862cb --- /dev/null +++ b/generated-client/client/component/restart_o_auth_auxiliary_resource_responses.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RestartOAuthAuxiliaryResourceReader is a Reader for the RestartOAuthAuxiliaryResource structure. +type RestartOAuthAuxiliaryResourceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestartOAuthAuxiliaryResourceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRestartOAuthAuxiliaryResourceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewRestartOAuthAuxiliaryResourceUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewRestartOAuthAuxiliaryResourceForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRestartOAuthAuxiliaryResourceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewRestartOAuthAuxiliaryResourceConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewRestartOAuthAuxiliaryResourceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart] restartOAuthAuxiliaryResource", response, response.Code()) + } +} + +// NewRestartOAuthAuxiliaryResourceOK creates a RestartOAuthAuxiliaryResourceOK with default headers values +func NewRestartOAuthAuxiliaryResourceOK() *RestartOAuthAuxiliaryResourceOK { + return &RestartOAuthAuxiliaryResourceOK{} +} + +/* +RestartOAuthAuxiliaryResourceOK describes a response with status code 200, with default header values. + +Auxiliary resource restarted ok +*/ +type RestartOAuthAuxiliaryResourceOK struct { +} + +// IsSuccess returns true when this restart o auth auxiliary resource o k response has a 2xx status code +func (o *RestartOAuthAuxiliaryResourceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this restart o auth auxiliary resource o k response has a 3xx status code +func (o *RestartOAuthAuxiliaryResourceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart o auth auxiliary resource o k response has a 4xx status code +func (o *RestartOAuthAuxiliaryResourceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this restart o auth auxiliary resource o k response has a 5xx status code +func (o *RestartOAuthAuxiliaryResourceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this restart o auth auxiliary resource o k response a status code equal to that given +func (o *RestartOAuthAuxiliaryResourceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the restart o auth auxiliary resource o k response +func (o *RestartOAuthAuxiliaryResourceOK) Code() int { + return 200 +} + +func (o *RestartOAuthAuxiliaryResourceOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceOK ", 200) +} + +func (o *RestartOAuthAuxiliaryResourceOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceOK ", 200) +} + +func (o *RestartOAuthAuxiliaryResourceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartOAuthAuxiliaryResourceUnauthorized creates a RestartOAuthAuxiliaryResourceUnauthorized with default headers values +func NewRestartOAuthAuxiliaryResourceUnauthorized() *RestartOAuthAuxiliaryResourceUnauthorized { + return &RestartOAuthAuxiliaryResourceUnauthorized{} +} + +/* +RestartOAuthAuxiliaryResourceUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RestartOAuthAuxiliaryResourceUnauthorized struct { +} + +// IsSuccess returns true when this restart o auth auxiliary resource unauthorized response has a 2xx status code +func (o *RestartOAuthAuxiliaryResourceUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart o auth auxiliary resource unauthorized response has a 3xx status code +func (o *RestartOAuthAuxiliaryResourceUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart o auth auxiliary resource unauthorized response has a 4xx status code +func (o *RestartOAuthAuxiliaryResourceUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart o auth auxiliary resource unauthorized response has a 5xx status code +func (o *RestartOAuthAuxiliaryResourceUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this restart o auth auxiliary resource unauthorized response a status code equal to that given +func (o *RestartOAuthAuxiliaryResourceUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the restart o auth auxiliary resource unauthorized response +func (o *RestartOAuthAuxiliaryResourceUnauthorized) Code() int { + return 401 +} + +func (o *RestartOAuthAuxiliaryResourceUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceUnauthorized ", 401) +} + +func (o *RestartOAuthAuxiliaryResourceUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceUnauthorized ", 401) +} + +func (o *RestartOAuthAuxiliaryResourceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartOAuthAuxiliaryResourceForbidden creates a RestartOAuthAuxiliaryResourceForbidden with default headers values +func NewRestartOAuthAuxiliaryResourceForbidden() *RestartOAuthAuxiliaryResourceForbidden { + return &RestartOAuthAuxiliaryResourceForbidden{} +} + +/* +RestartOAuthAuxiliaryResourceForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type RestartOAuthAuxiliaryResourceForbidden struct { +} + +// IsSuccess returns true when this restart o auth auxiliary resource forbidden response has a 2xx status code +func (o *RestartOAuthAuxiliaryResourceForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart o auth auxiliary resource forbidden response has a 3xx status code +func (o *RestartOAuthAuxiliaryResourceForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart o auth auxiliary resource forbidden response has a 4xx status code +func (o *RestartOAuthAuxiliaryResourceForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart o auth auxiliary resource forbidden response has a 5xx status code +func (o *RestartOAuthAuxiliaryResourceForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this restart o auth auxiliary resource forbidden response a status code equal to that given +func (o *RestartOAuthAuxiliaryResourceForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the restart o auth auxiliary resource forbidden response +func (o *RestartOAuthAuxiliaryResourceForbidden) Code() int { + return 403 +} + +func (o *RestartOAuthAuxiliaryResourceForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceForbidden ", 403) +} + +func (o *RestartOAuthAuxiliaryResourceForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceForbidden ", 403) +} + +func (o *RestartOAuthAuxiliaryResourceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartOAuthAuxiliaryResourceNotFound creates a RestartOAuthAuxiliaryResourceNotFound with default headers values +func NewRestartOAuthAuxiliaryResourceNotFound() *RestartOAuthAuxiliaryResourceNotFound { + return &RestartOAuthAuxiliaryResourceNotFound{} +} + +/* +RestartOAuthAuxiliaryResourceNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RestartOAuthAuxiliaryResourceNotFound struct { +} + +// IsSuccess returns true when this restart o auth auxiliary resource not found response has a 2xx status code +func (o *RestartOAuthAuxiliaryResourceNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart o auth auxiliary resource not found response has a 3xx status code +func (o *RestartOAuthAuxiliaryResourceNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart o auth auxiliary resource not found response has a 4xx status code +func (o *RestartOAuthAuxiliaryResourceNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart o auth auxiliary resource not found response has a 5xx status code +func (o *RestartOAuthAuxiliaryResourceNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this restart o auth auxiliary resource not found response a status code equal to that given +func (o *RestartOAuthAuxiliaryResourceNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the restart o auth auxiliary resource not found response +func (o *RestartOAuthAuxiliaryResourceNotFound) Code() int { + return 404 +} + +func (o *RestartOAuthAuxiliaryResourceNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceNotFound ", 404) +} + +func (o *RestartOAuthAuxiliaryResourceNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceNotFound ", 404) +} + +func (o *RestartOAuthAuxiliaryResourceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartOAuthAuxiliaryResourceConflict creates a RestartOAuthAuxiliaryResourceConflict with default headers values +func NewRestartOAuthAuxiliaryResourceConflict() *RestartOAuthAuxiliaryResourceConflict { + return &RestartOAuthAuxiliaryResourceConflict{} +} + +/* +RestartOAuthAuxiliaryResourceConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type RestartOAuthAuxiliaryResourceConflict struct { +} + +// IsSuccess returns true when this restart o auth auxiliary resource conflict response has a 2xx status code +func (o *RestartOAuthAuxiliaryResourceConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart o auth auxiliary resource conflict response has a 3xx status code +func (o *RestartOAuthAuxiliaryResourceConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart o auth auxiliary resource conflict response has a 4xx status code +func (o *RestartOAuthAuxiliaryResourceConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart o auth auxiliary resource conflict response has a 5xx status code +func (o *RestartOAuthAuxiliaryResourceConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this restart o auth auxiliary resource conflict response a status code equal to that given +func (o *RestartOAuthAuxiliaryResourceConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the restart o auth auxiliary resource conflict response +func (o *RestartOAuthAuxiliaryResourceConflict) Code() int { + return 409 +} + +func (o *RestartOAuthAuxiliaryResourceConflict) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceConflict ", 409) +} + +func (o *RestartOAuthAuxiliaryResourceConflict) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceConflict ", 409) +} + +func (o *RestartOAuthAuxiliaryResourceConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartOAuthAuxiliaryResourceInternalServerError creates a RestartOAuthAuxiliaryResourceInternalServerError with default headers values +func NewRestartOAuthAuxiliaryResourceInternalServerError() *RestartOAuthAuxiliaryResourceInternalServerError { + return &RestartOAuthAuxiliaryResourceInternalServerError{} +} + +/* +RestartOAuthAuxiliaryResourceInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type RestartOAuthAuxiliaryResourceInternalServerError struct { +} + +// IsSuccess returns true when this restart o auth auxiliary resource internal server error response has a 2xx status code +func (o *RestartOAuthAuxiliaryResourceInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart o auth auxiliary resource internal server error response has a 3xx status code +func (o *RestartOAuthAuxiliaryResourceInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart o auth auxiliary resource internal server error response has a 4xx status code +func (o *RestartOAuthAuxiliaryResourceInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this restart o auth auxiliary resource internal server error response has a 5xx status code +func (o *RestartOAuthAuxiliaryResourceInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this restart o auth auxiliary resource internal server error response a status code equal to that given +func (o *RestartOAuthAuxiliaryResourceInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the restart o auth auxiliary resource internal server error response +func (o *RestartOAuthAuxiliaryResourceInternalServerError) Code() int { + return 500 +} + +func (o *RestartOAuthAuxiliaryResourceInternalServerError) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceInternalServerError ", 500) +} + +func (o *RestartOAuthAuxiliaryResourceInternalServerError) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/aux/oauth/restart][%d] restartOAuthAuxiliaryResourceInternalServerError ", 500) +} + +func (o *RestartOAuthAuxiliaryResourceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/scale_component_parameters.go b/generated-client/client/component/scale_component_parameters.go new file mode 100644 index 0000000..bdc42b5 --- /dev/null +++ b/generated-client/client/component/scale_component_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewScaleComponentParams creates a new ScaleComponentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewScaleComponentParams() *ScaleComponentParams { + return &ScaleComponentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewScaleComponentParamsWithTimeout creates a new ScaleComponentParams object +// with the ability to set a timeout on a request. +func NewScaleComponentParamsWithTimeout(timeout time.Duration) *ScaleComponentParams { + return &ScaleComponentParams{ + timeout: timeout, + } +} + +// NewScaleComponentParamsWithContext creates a new ScaleComponentParams object +// with the ability to set a context for a request. +func NewScaleComponentParamsWithContext(ctx context.Context) *ScaleComponentParams { + return &ScaleComponentParams{ + Context: ctx, + } +} + +// NewScaleComponentParamsWithHTTPClient creates a new ScaleComponentParams object +// with the ability to set a custom HTTPClient for a request. +func NewScaleComponentParamsWithHTTPClient(client *http.Client) *ScaleComponentParams { + return &ScaleComponentParams{ + HTTPClient: client, + } +} + +/* +ScaleComponentParams contains all the parameters to send to the API endpoint + + for the scale component operation. + + Typically these are written to a http.Request. +*/ +type ScaleComponentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* Replicas. + + New desired number of replicas + */ + Replicas string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the scale component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScaleComponentParams) WithDefaults() *ScaleComponentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the scale component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScaleComponentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the scale component params +func (o *ScaleComponentParams) WithTimeout(timeout time.Duration) *ScaleComponentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the scale component params +func (o *ScaleComponentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the scale component params +func (o *ScaleComponentParams) WithContext(ctx context.Context) *ScaleComponentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the scale component params +func (o *ScaleComponentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the scale component params +func (o *ScaleComponentParams) WithHTTPClient(client *http.Client) *ScaleComponentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the scale component params +func (o *ScaleComponentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the scale component params +func (o *ScaleComponentParams) WithImpersonateGroup(impersonateGroup []string) *ScaleComponentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the scale component params +func (o *ScaleComponentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the scale component params +func (o *ScaleComponentParams) WithImpersonateUser(impersonateUser *string) *ScaleComponentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the scale component params +func (o *ScaleComponentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the scale component params +func (o *ScaleComponentParams) WithAppName(appName string) *ScaleComponentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the scale component params +func (o *ScaleComponentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the scale component params +func (o *ScaleComponentParams) WithComponentName(componentName string) *ScaleComponentParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the scale component params +func (o *ScaleComponentParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the scale component params +func (o *ScaleComponentParams) WithEnvName(envName string) *ScaleComponentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the scale component params +func (o *ScaleComponentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithReplicas adds the replicas to the scale component params +func (o *ScaleComponentParams) WithReplicas(replicas string) *ScaleComponentParams { + o.SetReplicas(replicas) + return o +} + +// SetReplicas adds the replicas to the scale component params +func (o *ScaleComponentParams) SetReplicas(replicas string) { + o.Replicas = replicas +} + +// WriteToRequest writes these params to a swagger request +func (o *ScaleComponentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param replicas + if err := r.SetPathParam("replicas", o.Replicas); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamScaleComponent binds the parameter Impersonate-Group +func (o *ScaleComponentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/scale_component_responses.go b/generated-client/client/component/scale_component_responses.go new file mode 100644 index 0000000..a62e438 --- /dev/null +++ b/generated-client/client/component/scale_component_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ScaleComponentReader is a Reader for the ScaleComponent structure. +type ScaleComponentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ScaleComponentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewScaleComponentNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewScaleComponentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewScaleComponentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewScaleComponentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewScaleComponentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}] scaleComponent", response, response.Code()) + } +} + +// NewScaleComponentNoContent creates a ScaleComponentNoContent with default headers values +func NewScaleComponentNoContent() *ScaleComponentNoContent { + return &ScaleComponentNoContent{} +} + +/* +ScaleComponentNoContent describes a response with status code 204, with default header values. + +Success +*/ +type ScaleComponentNoContent struct { +} + +// IsSuccess returns true when this scale component no content response has a 2xx status code +func (o *ScaleComponentNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this scale component no content response has a 3xx status code +func (o *ScaleComponentNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this scale component no content response has a 4xx status code +func (o *ScaleComponentNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this scale component no content response has a 5xx status code +func (o *ScaleComponentNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this scale component no content response a status code equal to that given +func (o *ScaleComponentNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the scale component no content response +func (o *ScaleComponentNoContent) Code() int { + return 204 +} + +func (o *ScaleComponentNoContent) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentNoContent ", 204) +} + +func (o *ScaleComponentNoContent) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentNoContent ", 204) +} + +func (o *ScaleComponentNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewScaleComponentBadRequest creates a ScaleComponentBadRequest with default headers values +func NewScaleComponentBadRequest() *ScaleComponentBadRequest { + return &ScaleComponentBadRequest{} +} + +/* +ScaleComponentBadRequest describes a response with status code 400, with default header values. + +Invalid component +*/ +type ScaleComponentBadRequest struct { +} + +// IsSuccess returns true when this scale component bad request response has a 2xx status code +func (o *ScaleComponentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this scale component bad request response has a 3xx status code +func (o *ScaleComponentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this scale component bad request response has a 4xx status code +func (o *ScaleComponentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this scale component bad request response has a 5xx status code +func (o *ScaleComponentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this scale component bad request response a status code equal to that given +func (o *ScaleComponentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the scale component bad request response +func (o *ScaleComponentBadRequest) Code() int { + return 400 +} + +func (o *ScaleComponentBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentBadRequest ", 400) +} + +func (o *ScaleComponentBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentBadRequest ", 400) +} + +func (o *ScaleComponentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewScaleComponentUnauthorized creates a ScaleComponentUnauthorized with default headers values +func NewScaleComponentUnauthorized() *ScaleComponentUnauthorized { + return &ScaleComponentUnauthorized{} +} + +/* +ScaleComponentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type ScaleComponentUnauthorized struct { +} + +// IsSuccess returns true when this scale component unauthorized response has a 2xx status code +func (o *ScaleComponentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this scale component unauthorized response has a 3xx status code +func (o *ScaleComponentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this scale component unauthorized response has a 4xx status code +func (o *ScaleComponentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this scale component unauthorized response has a 5xx status code +func (o *ScaleComponentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this scale component unauthorized response a status code equal to that given +func (o *ScaleComponentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the scale component unauthorized response +func (o *ScaleComponentUnauthorized) Code() int { + return 401 +} + +func (o *ScaleComponentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentUnauthorized ", 401) +} + +func (o *ScaleComponentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentUnauthorized ", 401) +} + +func (o *ScaleComponentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewScaleComponentForbidden creates a ScaleComponentForbidden with default headers values +func NewScaleComponentForbidden() *ScaleComponentForbidden { + return &ScaleComponentForbidden{} +} + +/* +ScaleComponentForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ScaleComponentForbidden struct { +} + +// IsSuccess returns true when this scale component forbidden response has a 2xx status code +func (o *ScaleComponentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this scale component forbidden response has a 3xx status code +func (o *ScaleComponentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this scale component forbidden response has a 4xx status code +func (o *ScaleComponentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this scale component forbidden response has a 5xx status code +func (o *ScaleComponentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this scale component forbidden response a status code equal to that given +func (o *ScaleComponentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the scale component forbidden response +func (o *ScaleComponentForbidden) Code() int { + return 403 +} + +func (o *ScaleComponentForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentForbidden ", 403) +} + +func (o *ScaleComponentForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentForbidden ", 403) +} + +func (o *ScaleComponentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewScaleComponentNotFound creates a ScaleComponentNotFound with default headers values +func NewScaleComponentNotFound() *ScaleComponentNotFound { + return &ScaleComponentNotFound{} +} + +/* +ScaleComponentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ScaleComponentNotFound struct { +} + +// IsSuccess returns true when this scale component not found response has a 2xx status code +func (o *ScaleComponentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this scale component not found response has a 3xx status code +func (o *ScaleComponentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this scale component not found response has a 4xx status code +func (o *ScaleComponentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this scale component not found response has a 5xx status code +func (o *ScaleComponentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this scale component not found response a status code equal to that given +func (o *ScaleComponentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the scale component not found response +func (o *ScaleComponentNotFound) Code() int { + return 404 +} + +func (o *ScaleComponentNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentNotFound ", 404) +} + +func (o *ScaleComponentNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/scale/{replicas}][%d] scaleComponentNotFound ", 404) +} + +func (o *ScaleComponentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/start_component_parameters.go b/generated-client/client/component/start_component_parameters.go new file mode 100644 index 0000000..87388ba --- /dev/null +++ b/generated-client/client/component/start_component_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStartComponentParams creates a new StartComponentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStartComponentParams() *StartComponentParams { + return &StartComponentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStartComponentParamsWithTimeout creates a new StartComponentParams object +// with the ability to set a timeout on a request. +func NewStartComponentParamsWithTimeout(timeout time.Duration) *StartComponentParams { + return &StartComponentParams{ + timeout: timeout, + } +} + +// NewStartComponentParamsWithContext creates a new StartComponentParams object +// with the ability to set a context for a request. +func NewStartComponentParamsWithContext(ctx context.Context) *StartComponentParams { + return &StartComponentParams{ + Context: ctx, + } +} + +// NewStartComponentParamsWithHTTPClient creates a new StartComponentParams object +// with the ability to set a custom HTTPClient for a request. +func NewStartComponentParamsWithHTTPClient(client *http.Client) *StartComponentParams { + return &StartComponentParams{ + HTTPClient: client, + } +} + +/* +StartComponentParams contains all the parameters to send to the API endpoint + + for the start component operation. + + Typically these are written to a http.Request. +*/ +type StartComponentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the start component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartComponentParams) WithDefaults() *StartComponentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartComponentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the start component params +func (o *StartComponentParams) WithTimeout(timeout time.Duration) *StartComponentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the start component params +func (o *StartComponentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the start component params +func (o *StartComponentParams) WithContext(ctx context.Context) *StartComponentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the start component params +func (o *StartComponentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the start component params +func (o *StartComponentParams) WithHTTPClient(client *http.Client) *StartComponentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the start component params +func (o *StartComponentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the start component params +func (o *StartComponentParams) WithImpersonateGroup(impersonateGroup []string) *StartComponentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the start component params +func (o *StartComponentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the start component params +func (o *StartComponentParams) WithImpersonateUser(impersonateUser *string) *StartComponentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the start component params +func (o *StartComponentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the start component params +func (o *StartComponentParams) WithAppName(appName string) *StartComponentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the start component params +func (o *StartComponentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the start component params +func (o *StartComponentParams) WithComponentName(componentName string) *StartComponentParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the start component params +func (o *StartComponentParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the start component params +func (o *StartComponentParams) WithEnvName(envName string) *StartComponentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the start component params +func (o *StartComponentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *StartComponentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStartComponent binds the parameter Impersonate-Group +func (o *StartComponentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/start_component_responses.go b/generated-client/client/component/start_component_responses.go new file mode 100644 index 0000000..204dba0 --- /dev/null +++ b/generated-client/client/component/start_component_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StartComponentReader is a Reader for the StartComponent structure. +type StartComponentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StartComponentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStartComponentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewStartComponentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStartComponentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/components/{componentName}/start] startComponent", response, response.Code()) + } +} + +// NewStartComponentOK creates a StartComponentOK with default headers values +func NewStartComponentOK() *StartComponentOK { + return &StartComponentOK{} +} + +/* +StartComponentOK describes a response with status code 200, with default header values. + +Component started ok +*/ +type StartComponentOK struct { +} + +// IsSuccess returns true when this start component o k response has a 2xx status code +func (o *StartComponentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this start component o k response has a 3xx status code +func (o *StartComponentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start component o k response has a 4xx status code +func (o *StartComponentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this start component o k response has a 5xx status code +func (o *StartComponentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this start component o k response a status code equal to that given +func (o *StartComponentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the start component o k response +func (o *StartComponentOK) Code() int { + return 200 +} + +func (o *StartComponentOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/start][%d] startComponentOK ", 200) +} + +func (o *StartComponentOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/start][%d] startComponentOK ", 200) +} + +func (o *StartComponentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStartComponentUnauthorized creates a StartComponentUnauthorized with default headers values +func NewStartComponentUnauthorized() *StartComponentUnauthorized { + return &StartComponentUnauthorized{} +} + +/* +StartComponentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StartComponentUnauthorized struct { +} + +// IsSuccess returns true when this start component unauthorized response has a 2xx status code +func (o *StartComponentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this start component unauthorized response has a 3xx status code +func (o *StartComponentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start component unauthorized response has a 4xx status code +func (o *StartComponentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this start component unauthorized response has a 5xx status code +func (o *StartComponentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this start component unauthorized response a status code equal to that given +func (o *StartComponentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the start component unauthorized response +func (o *StartComponentUnauthorized) Code() int { + return 401 +} + +func (o *StartComponentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/start][%d] startComponentUnauthorized ", 401) +} + +func (o *StartComponentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/start][%d] startComponentUnauthorized ", 401) +} + +func (o *StartComponentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStartComponentNotFound creates a StartComponentNotFound with default headers values +func NewStartComponentNotFound() *StartComponentNotFound { + return &StartComponentNotFound{} +} + +/* +StartComponentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StartComponentNotFound struct { +} + +// IsSuccess returns true when this start component not found response has a 2xx status code +func (o *StartComponentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this start component not found response has a 3xx status code +func (o *StartComponentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start component not found response has a 4xx status code +func (o *StartComponentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this start component not found response has a 5xx status code +func (o *StartComponentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this start component not found response a status code equal to that given +func (o *StartComponentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the start component not found response +func (o *StartComponentNotFound) Code() int { + return 404 +} + +func (o *StartComponentNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/start][%d] startComponentNotFound ", 404) +} + +func (o *StartComponentNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/start][%d] startComponentNotFound ", 404) +} + +func (o *StartComponentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/component/stop_component_parameters.go b/generated-client/client/component/stop_component_parameters.go new file mode 100644 index 0000000..8c19062 --- /dev/null +++ b/generated-client/client/component/stop_component_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStopComponentParams creates a new StopComponentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStopComponentParams() *StopComponentParams { + return &StopComponentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStopComponentParamsWithTimeout creates a new StopComponentParams object +// with the ability to set a timeout on a request. +func NewStopComponentParamsWithTimeout(timeout time.Duration) *StopComponentParams { + return &StopComponentParams{ + timeout: timeout, + } +} + +// NewStopComponentParamsWithContext creates a new StopComponentParams object +// with the ability to set a context for a request. +func NewStopComponentParamsWithContext(ctx context.Context) *StopComponentParams { + return &StopComponentParams{ + Context: ctx, + } +} + +// NewStopComponentParamsWithHTTPClient creates a new StopComponentParams object +// with the ability to set a custom HTTPClient for a request. +func NewStopComponentParamsWithHTTPClient(client *http.Client) *StopComponentParams { + return &StopComponentParams{ + HTTPClient: client, + } +} + +/* +StopComponentParams contains all the parameters to send to the API endpoint + + for the stop component operation. + + Typically these are written to a http.Request. +*/ +type StopComponentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + Name of component + */ + ComponentName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stop component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopComponentParams) WithDefaults() *StopComponentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stop component params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopComponentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stop component params +func (o *StopComponentParams) WithTimeout(timeout time.Duration) *StopComponentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stop component params +func (o *StopComponentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stop component params +func (o *StopComponentParams) WithContext(ctx context.Context) *StopComponentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stop component params +func (o *StopComponentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stop component params +func (o *StopComponentParams) WithHTTPClient(client *http.Client) *StopComponentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stop component params +func (o *StopComponentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the stop component params +func (o *StopComponentParams) WithImpersonateGroup(impersonateGroup []string) *StopComponentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the stop component params +func (o *StopComponentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the stop component params +func (o *StopComponentParams) WithImpersonateUser(impersonateUser *string) *StopComponentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the stop component params +func (o *StopComponentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the stop component params +func (o *StopComponentParams) WithAppName(appName string) *StopComponentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the stop component params +func (o *StopComponentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the stop component params +func (o *StopComponentParams) WithComponentName(componentName string) *StopComponentParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the stop component params +func (o *StopComponentParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the stop component params +func (o *StopComponentParams) WithEnvName(envName string) *StopComponentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the stop component params +func (o *StopComponentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *StopComponentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStopComponent binds the parameter Impersonate-Group +func (o *StopComponentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/component/stop_component_responses.go b/generated-client/client/component/stop_component_responses.go new file mode 100644 index 0000000..3285259 --- /dev/null +++ b/generated-client/client/component/stop_component_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package component + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StopComponentReader is a Reader for the StopComponent structure. +type StopComponentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StopComponentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStopComponentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewStopComponentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStopComponentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/components/{componentName}/stop] stopComponent", response, response.Code()) + } +} + +// NewStopComponentOK creates a StopComponentOK with default headers values +func NewStopComponentOK() *StopComponentOK { + return &StopComponentOK{} +} + +/* +StopComponentOK describes a response with status code 200, with default header values. + +Component stopped ok +*/ +type StopComponentOK struct { +} + +// IsSuccess returns true when this stop component o k response has a 2xx status code +func (o *StopComponentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stop component o k response has a 3xx status code +func (o *StopComponentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop component o k response has a 4xx status code +func (o *StopComponentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this stop component o k response has a 5xx status code +func (o *StopComponentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this stop component o k response a status code equal to that given +func (o *StopComponentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the stop component o k response +func (o *StopComponentOK) Code() int { + return 200 +} + +func (o *StopComponentOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/stop][%d] stopComponentOK ", 200) +} + +func (o *StopComponentOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/stop][%d] stopComponentOK ", 200) +} + +func (o *StopComponentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopComponentUnauthorized creates a StopComponentUnauthorized with default headers values +func NewStopComponentUnauthorized() *StopComponentUnauthorized { + return &StopComponentUnauthorized{} +} + +/* +StopComponentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StopComponentUnauthorized struct { +} + +// IsSuccess returns true when this stop component unauthorized response has a 2xx status code +func (o *StopComponentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop component unauthorized response has a 3xx status code +func (o *StopComponentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop component unauthorized response has a 4xx status code +func (o *StopComponentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop component unauthorized response has a 5xx status code +func (o *StopComponentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this stop component unauthorized response a status code equal to that given +func (o *StopComponentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the stop component unauthorized response +func (o *StopComponentUnauthorized) Code() int { + return 401 +} + +func (o *StopComponentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/stop][%d] stopComponentUnauthorized ", 401) +} + +func (o *StopComponentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/stop][%d] stopComponentUnauthorized ", 401) +} + +func (o *StopComponentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopComponentNotFound creates a StopComponentNotFound with default headers values +func NewStopComponentNotFound() *StopComponentNotFound { + return &StopComponentNotFound{} +} + +/* +StopComponentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StopComponentNotFound struct { +} + +// IsSuccess returns true when this stop component not found response has a 2xx status code +func (o *StopComponentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop component not found response has a 3xx status code +func (o *StopComponentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop component not found response has a 4xx status code +func (o *StopComponentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop component not found response has a 5xx status code +func (o *StopComponentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this stop component not found response a status code equal to that given +func (o *StopComponentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the stop component not found response +func (o *StopComponentNotFound) Code() int { + return 404 +} + +func (o *StopComponentNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/stop][%d] stopComponentNotFound ", 404) +} + +func (o *StopComponentNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/components/{componentName}/stop][%d] stopComponentNotFound ", 404) +} + +func (o *StopComponentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/deployment/deployment_client.go b/generated-client/client/deployment/deployment_client.go new file mode 100644 index 0000000..12748c2 --- /dev/null +++ b/generated-client/client/deployment/deployment_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package deployment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new deployment API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for deployment API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetDeployment(params *GetDeploymentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetDeployment gets deployment details +*/ +func (a *Client) GetDeployment(params *GetDeploymentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDeploymentParams() + } + op := &runtime.ClientOperation{ + ID: "getDeployment", + Method: "GET", + PathPattern: "/applications/{appName}/deployments/{deploymentName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetDeploymentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetDeploymentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getDeployment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/deployment/get_deployment_parameters.go b/generated-client/client/deployment/get_deployment_parameters.go new file mode 100644 index 0000000..0697525 --- /dev/null +++ b/generated-client/client/deployment/get_deployment_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package deployment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDeploymentParams creates a new GetDeploymentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDeploymentParams() *GetDeploymentParams { + return &GetDeploymentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDeploymentParamsWithTimeout creates a new GetDeploymentParams object +// with the ability to set a timeout on a request. +func NewGetDeploymentParamsWithTimeout(timeout time.Duration) *GetDeploymentParams { + return &GetDeploymentParams{ + timeout: timeout, + } +} + +// NewGetDeploymentParamsWithContext creates a new GetDeploymentParams object +// with the ability to set a context for a request. +func NewGetDeploymentParamsWithContext(ctx context.Context) *GetDeploymentParams { + return &GetDeploymentParams{ + Context: ctx, + } +} + +// NewGetDeploymentParamsWithHTTPClient creates a new GetDeploymentParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDeploymentParamsWithHTTPClient(client *http.Client) *GetDeploymentParams { + return &GetDeploymentParams{ + HTTPClient: client, + } +} + +/* +GetDeploymentParams contains all the parameters to send to the API endpoint + + for the get deployment operation. + + Typically these are written to a http.Request. +*/ +type GetDeploymentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* DeploymentName. + + name of deployment + */ + DeploymentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentParams) WithDefaults() *GetDeploymentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get deployment params +func (o *GetDeploymentParams) WithTimeout(timeout time.Duration) *GetDeploymentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get deployment params +func (o *GetDeploymentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get deployment params +func (o *GetDeploymentParams) WithContext(ctx context.Context) *GetDeploymentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get deployment params +func (o *GetDeploymentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get deployment params +func (o *GetDeploymentParams) WithHTTPClient(client *http.Client) *GetDeploymentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get deployment params +func (o *GetDeploymentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get deployment params +func (o *GetDeploymentParams) WithImpersonateGroup(impersonateGroup []string) *GetDeploymentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get deployment params +func (o *GetDeploymentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get deployment params +func (o *GetDeploymentParams) WithImpersonateUser(impersonateUser *string) *GetDeploymentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get deployment params +func (o *GetDeploymentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get deployment params +func (o *GetDeploymentParams) WithAppName(appName string) *GetDeploymentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get deployment params +func (o *GetDeploymentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithDeploymentName adds the deploymentName to the get deployment params +func (o *GetDeploymentParams) WithDeploymentName(deploymentName string) *GetDeploymentParams { + o.SetDeploymentName(deploymentName) + return o +} + +// SetDeploymentName adds the deploymentName to the get deployment params +func (o *GetDeploymentParams) SetDeploymentName(deploymentName string) { + o.DeploymentName = deploymentName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDeploymentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param deploymentName + if err := r.SetPathParam("deploymentName", o.DeploymentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetDeployment binds the parameter Impersonate-Group +func (o *GetDeploymentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/deployment/get_deployment_responses.go b/generated-client/client/deployment/get_deployment_responses.go new file mode 100644 index 0000000..f3b1ade --- /dev/null +++ b/generated-client/client/deployment/get_deployment_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package deployment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetDeploymentReader is a Reader for the GetDeployment structure. +type GetDeploymentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDeploymentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDeploymentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDeploymentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDeploymentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/deployments/{deploymentName}] getDeployment", response, response.Code()) + } +} + +// NewGetDeploymentOK creates a GetDeploymentOK with default headers values +func NewGetDeploymentOK() *GetDeploymentOK { + return &GetDeploymentOK{} +} + +/* +GetDeploymentOK describes a response with status code 200, with default header values. + +Successful get deployment +*/ +type GetDeploymentOK struct { + Payload *models.Deployment +} + +// IsSuccess returns true when this get deployment o k response has a 2xx status code +func (o *GetDeploymentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get deployment o k response has a 3xx status code +func (o *GetDeploymentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployment o k response has a 4xx status code +func (o *GetDeploymentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get deployment o k response has a 5xx status code +func (o *GetDeploymentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployment o k response a status code equal to that given +func (o *GetDeploymentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get deployment o k response +func (o *GetDeploymentOK) Code() int { + return 200 +} + +func (o *GetDeploymentOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}][%d] getDeploymentOK %+v", 200, o.Payload) +} + +func (o *GetDeploymentOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}][%d] getDeploymentOK %+v", 200, o.Payload) +} + +func (o *GetDeploymentOK) GetPayload() *models.Deployment { + return o.Payload +} + +func (o *GetDeploymentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Deployment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDeploymentUnauthorized creates a GetDeploymentUnauthorized with default headers values +func NewGetDeploymentUnauthorized() *GetDeploymentUnauthorized { + return &GetDeploymentUnauthorized{} +} + +/* +GetDeploymentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetDeploymentUnauthorized struct { +} + +// IsSuccess returns true when this get deployment unauthorized response has a 2xx status code +func (o *GetDeploymentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deployment unauthorized response has a 3xx status code +func (o *GetDeploymentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployment unauthorized response has a 4xx status code +func (o *GetDeploymentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get deployment unauthorized response has a 5xx status code +func (o *GetDeploymentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployment unauthorized response a status code equal to that given +func (o *GetDeploymentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get deployment unauthorized response +func (o *GetDeploymentUnauthorized) Code() int { + return 401 +} + +func (o *GetDeploymentUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}][%d] getDeploymentUnauthorized ", 401) +} + +func (o *GetDeploymentUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}][%d] getDeploymentUnauthorized ", 401) +} + +func (o *GetDeploymentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetDeploymentNotFound creates a GetDeploymentNotFound with default headers values +func NewGetDeploymentNotFound() *GetDeploymentNotFound { + return &GetDeploymentNotFound{} +} + +/* +GetDeploymentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetDeploymentNotFound struct { +} + +// IsSuccess returns true when this get deployment not found response has a 2xx status code +func (o *GetDeploymentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deployment not found response has a 3xx status code +func (o *GetDeploymentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployment not found response has a 4xx status code +func (o *GetDeploymentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get deployment not found response has a 5xx status code +func (o *GetDeploymentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployment not found response a status code equal to that given +func (o *GetDeploymentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get deployment not found response +func (o *GetDeploymentNotFound) Code() int { + return 404 +} + +func (o *GetDeploymentNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}][%d] getDeploymentNotFound ", 404) +} + +func (o *GetDeploymentNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/deployments/{deploymentName}][%d] getDeploymentNotFound ", 404) +} + +func (o *GetDeploymentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/change_component_secret_parameters.go b/generated-client/client/environment/change_component_secret_parameters.go new file mode 100644 index 0000000..546235b --- /dev/null +++ b/generated-client/client/environment/change_component_secret_parameters.go @@ -0,0 +1,314 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewChangeComponentSecretParams creates a new ChangeComponentSecretParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewChangeComponentSecretParams() *ChangeComponentSecretParams { + return &ChangeComponentSecretParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewChangeComponentSecretParamsWithTimeout creates a new ChangeComponentSecretParams object +// with the ability to set a timeout on a request. +func NewChangeComponentSecretParamsWithTimeout(timeout time.Duration) *ChangeComponentSecretParams { + return &ChangeComponentSecretParams{ + timeout: timeout, + } +} + +// NewChangeComponentSecretParamsWithContext creates a new ChangeComponentSecretParams object +// with the ability to set a context for a request. +func NewChangeComponentSecretParamsWithContext(ctx context.Context) *ChangeComponentSecretParams { + return &ChangeComponentSecretParams{ + Context: ctx, + } +} + +// NewChangeComponentSecretParamsWithHTTPClient creates a new ChangeComponentSecretParams object +// with the ability to set a custom HTTPClient for a request. +func NewChangeComponentSecretParamsWithHTTPClient(client *http.Client) *ChangeComponentSecretParams { + return &ChangeComponentSecretParams{ + HTTPClient: client, + } +} + +/* +ChangeComponentSecretParams contains all the parameters to send to the API endpoint + + for the change component secret operation. + + Typically these are written to a http.Request. +*/ +type ChangeComponentSecretParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* ComponentName. + + secret component of Radix application + */ + ComponentName string + + /* ComponentSecret. + + New secret value + */ + ComponentSecret *models.SecretParameters + + /* EnvName. + + secret of Radix application + */ + EnvName string + + /* SecretName. + + environment component secret name to be updated + */ + SecretName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the change component secret params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeComponentSecretParams) WithDefaults() *ChangeComponentSecretParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change component secret params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeComponentSecretParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the change component secret params +func (o *ChangeComponentSecretParams) WithTimeout(timeout time.Duration) *ChangeComponentSecretParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the change component secret params +func (o *ChangeComponentSecretParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the change component secret params +func (o *ChangeComponentSecretParams) WithContext(ctx context.Context) *ChangeComponentSecretParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the change component secret params +func (o *ChangeComponentSecretParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the change component secret params +func (o *ChangeComponentSecretParams) WithHTTPClient(client *http.Client) *ChangeComponentSecretParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the change component secret params +func (o *ChangeComponentSecretParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the change component secret params +func (o *ChangeComponentSecretParams) WithImpersonateGroup(impersonateGroup []string) *ChangeComponentSecretParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the change component secret params +func (o *ChangeComponentSecretParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the change component secret params +func (o *ChangeComponentSecretParams) WithImpersonateUser(impersonateUser *string) *ChangeComponentSecretParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the change component secret params +func (o *ChangeComponentSecretParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the change component secret params +func (o *ChangeComponentSecretParams) WithAppName(appName string) *ChangeComponentSecretParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the change component secret params +func (o *ChangeComponentSecretParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithComponentName adds the componentName to the change component secret params +func (o *ChangeComponentSecretParams) WithComponentName(componentName string) *ChangeComponentSecretParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the change component secret params +func (o *ChangeComponentSecretParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithComponentSecret adds the componentSecret to the change component secret params +func (o *ChangeComponentSecretParams) WithComponentSecret(componentSecret *models.SecretParameters) *ChangeComponentSecretParams { + o.SetComponentSecret(componentSecret) + return o +} + +// SetComponentSecret adds the componentSecret to the change component secret params +func (o *ChangeComponentSecretParams) SetComponentSecret(componentSecret *models.SecretParameters) { + o.ComponentSecret = componentSecret +} + +// WithEnvName adds the envName to the change component secret params +func (o *ChangeComponentSecretParams) WithEnvName(envName string) *ChangeComponentSecretParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the change component secret params +func (o *ChangeComponentSecretParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithSecretName adds the secretName to the change component secret params +func (o *ChangeComponentSecretParams) WithSecretName(secretName string) *ChangeComponentSecretParams { + o.SetSecretName(secretName) + return o +} + +// SetSecretName adds the secretName to the change component secret params +func (o *ChangeComponentSecretParams) SetSecretName(secretName string) { + o.SecretName = secretName +} + +// WriteToRequest writes these params to a swagger request +func (o *ChangeComponentSecretParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + if o.ComponentSecret != nil { + if err := r.SetBodyParam(o.ComponentSecret); err != nil { + return err + } + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param secretName + if err := r.SetPathParam("secretName", o.SecretName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamChangeComponentSecret binds the parameter Impersonate-Group +func (o *ChangeComponentSecretParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/change_component_secret_responses.go b/generated-client/client/environment/change_component_secret_responses.go new file mode 100644 index 0000000..406c66a --- /dev/null +++ b/generated-client/client/environment/change_component_secret_responses.go @@ -0,0 +1,460 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ChangeComponentSecretReader is a Reader for the ChangeComponentSecret structure. +type ChangeComponentSecretReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ChangeComponentSecretReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewChangeComponentSecretOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewChangeComponentSecretBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewChangeComponentSecretUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewChangeComponentSecretForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewChangeComponentSecretNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewChangeComponentSecretConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewChangeComponentSecretInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}] changeComponentSecret", response, response.Code()) + } +} + +// NewChangeComponentSecretOK creates a ChangeComponentSecretOK with default headers values +func NewChangeComponentSecretOK() *ChangeComponentSecretOK { + return &ChangeComponentSecretOK{} +} + +/* +ChangeComponentSecretOK describes a response with status code 200, with default header values. + +success +*/ +type ChangeComponentSecretOK struct { +} + +// IsSuccess returns true when this change component secret o k response has a 2xx status code +func (o *ChangeComponentSecretOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this change component secret o k response has a 3xx status code +func (o *ChangeComponentSecretOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change component secret o k response has a 4xx status code +func (o *ChangeComponentSecretOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this change component secret o k response has a 5xx status code +func (o *ChangeComponentSecretOK) IsServerError() bool { + return false +} + +// IsCode returns true when this change component secret o k response a status code equal to that given +func (o *ChangeComponentSecretOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the change component secret o k response +func (o *ChangeComponentSecretOK) Code() int { + return 200 +} + +func (o *ChangeComponentSecretOK) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretOK ", 200) +} + +func (o *ChangeComponentSecretOK) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretOK ", 200) +} + +func (o *ChangeComponentSecretOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeComponentSecretBadRequest creates a ChangeComponentSecretBadRequest with default headers values +func NewChangeComponentSecretBadRequest() *ChangeComponentSecretBadRequest { + return &ChangeComponentSecretBadRequest{} +} + +/* +ChangeComponentSecretBadRequest describes a response with status code 400, with default header values. + +Invalid application +*/ +type ChangeComponentSecretBadRequest struct { +} + +// IsSuccess returns true when this change component secret bad request response has a 2xx status code +func (o *ChangeComponentSecretBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change component secret bad request response has a 3xx status code +func (o *ChangeComponentSecretBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change component secret bad request response has a 4xx status code +func (o *ChangeComponentSecretBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this change component secret bad request response has a 5xx status code +func (o *ChangeComponentSecretBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this change component secret bad request response a status code equal to that given +func (o *ChangeComponentSecretBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the change component secret bad request response +func (o *ChangeComponentSecretBadRequest) Code() int { + return 400 +} + +func (o *ChangeComponentSecretBadRequest) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretBadRequest ", 400) +} + +func (o *ChangeComponentSecretBadRequest) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretBadRequest ", 400) +} + +func (o *ChangeComponentSecretBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeComponentSecretUnauthorized creates a ChangeComponentSecretUnauthorized with default headers values +func NewChangeComponentSecretUnauthorized() *ChangeComponentSecretUnauthorized { + return &ChangeComponentSecretUnauthorized{} +} + +/* +ChangeComponentSecretUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type ChangeComponentSecretUnauthorized struct { +} + +// IsSuccess returns true when this change component secret unauthorized response has a 2xx status code +func (o *ChangeComponentSecretUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change component secret unauthorized response has a 3xx status code +func (o *ChangeComponentSecretUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change component secret unauthorized response has a 4xx status code +func (o *ChangeComponentSecretUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this change component secret unauthorized response has a 5xx status code +func (o *ChangeComponentSecretUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this change component secret unauthorized response a status code equal to that given +func (o *ChangeComponentSecretUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the change component secret unauthorized response +func (o *ChangeComponentSecretUnauthorized) Code() int { + return 401 +} + +func (o *ChangeComponentSecretUnauthorized) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretUnauthorized ", 401) +} + +func (o *ChangeComponentSecretUnauthorized) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretUnauthorized ", 401) +} + +func (o *ChangeComponentSecretUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeComponentSecretForbidden creates a ChangeComponentSecretForbidden with default headers values +func NewChangeComponentSecretForbidden() *ChangeComponentSecretForbidden { + return &ChangeComponentSecretForbidden{} +} + +/* +ChangeComponentSecretForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ChangeComponentSecretForbidden struct { +} + +// IsSuccess returns true when this change component secret forbidden response has a 2xx status code +func (o *ChangeComponentSecretForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change component secret forbidden response has a 3xx status code +func (o *ChangeComponentSecretForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change component secret forbidden response has a 4xx status code +func (o *ChangeComponentSecretForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this change component secret forbidden response has a 5xx status code +func (o *ChangeComponentSecretForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this change component secret forbidden response a status code equal to that given +func (o *ChangeComponentSecretForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the change component secret forbidden response +func (o *ChangeComponentSecretForbidden) Code() int { + return 403 +} + +func (o *ChangeComponentSecretForbidden) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretForbidden ", 403) +} + +func (o *ChangeComponentSecretForbidden) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretForbidden ", 403) +} + +func (o *ChangeComponentSecretForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeComponentSecretNotFound creates a ChangeComponentSecretNotFound with default headers values +func NewChangeComponentSecretNotFound() *ChangeComponentSecretNotFound { + return &ChangeComponentSecretNotFound{} +} + +/* +ChangeComponentSecretNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ChangeComponentSecretNotFound struct { +} + +// IsSuccess returns true when this change component secret not found response has a 2xx status code +func (o *ChangeComponentSecretNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change component secret not found response has a 3xx status code +func (o *ChangeComponentSecretNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change component secret not found response has a 4xx status code +func (o *ChangeComponentSecretNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this change component secret not found response has a 5xx status code +func (o *ChangeComponentSecretNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this change component secret not found response a status code equal to that given +func (o *ChangeComponentSecretNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the change component secret not found response +func (o *ChangeComponentSecretNotFound) Code() int { + return 404 +} + +func (o *ChangeComponentSecretNotFound) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretNotFound ", 404) +} + +func (o *ChangeComponentSecretNotFound) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretNotFound ", 404) +} + +func (o *ChangeComponentSecretNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeComponentSecretConflict creates a ChangeComponentSecretConflict with default headers values +func NewChangeComponentSecretConflict() *ChangeComponentSecretConflict { + return &ChangeComponentSecretConflict{} +} + +/* +ChangeComponentSecretConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type ChangeComponentSecretConflict struct { +} + +// IsSuccess returns true when this change component secret conflict response has a 2xx status code +func (o *ChangeComponentSecretConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change component secret conflict response has a 3xx status code +func (o *ChangeComponentSecretConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change component secret conflict response has a 4xx status code +func (o *ChangeComponentSecretConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this change component secret conflict response has a 5xx status code +func (o *ChangeComponentSecretConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this change component secret conflict response a status code equal to that given +func (o *ChangeComponentSecretConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the change component secret conflict response +func (o *ChangeComponentSecretConflict) Code() int { + return 409 +} + +func (o *ChangeComponentSecretConflict) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretConflict ", 409) +} + +func (o *ChangeComponentSecretConflict) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretConflict ", 409) +} + +func (o *ChangeComponentSecretConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeComponentSecretInternalServerError creates a ChangeComponentSecretInternalServerError with default headers values +func NewChangeComponentSecretInternalServerError() *ChangeComponentSecretInternalServerError { + return &ChangeComponentSecretInternalServerError{} +} + +/* +ChangeComponentSecretInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type ChangeComponentSecretInternalServerError struct { +} + +// IsSuccess returns true when this change component secret internal server error response has a 2xx status code +func (o *ChangeComponentSecretInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change component secret internal server error response has a 3xx status code +func (o *ChangeComponentSecretInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change component secret internal server error response has a 4xx status code +func (o *ChangeComponentSecretInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this change component secret internal server error response has a 5xx status code +func (o *ChangeComponentSecretInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this change component secret internal server error response a status code equal to that given +func (o *ChangeComponentSecretInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the change component secret internal server error response +func (o *ChangeComponentSecretInternalServerError) Code() int { + return 500 +} + +func (o *ChangeComponentSecretInternalServerError) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretInternalServerError ", 500) +} + +func (o *ChangeComponentSecretInternalServerError) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}][%d] changeComponentSecretInternalServerError ", 500) +} + +func (o *ChangeComponentSecretInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/create_environment_parameters.go b/generated-client/client/environment/create_environment_parameters.go new file mode 100644 index 0000000..e9c6ca2 --- /dev/null +++ b/generated-client/client/environment/create_environment_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateEnvironmentParams creates a new CreateEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateEnvironmentParams() *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateEnvironmentParamsWithTimeout creates a new CreateEnvironmentParams object +// with the ability to set a timeout on a request. +func NewCreateEnvironmentParamsWithTimeout(timeout time.Duration) *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + timeout: timeout, + } +} + +// NewCreateEnvironmentParamsWithContext creates a new CreateEnvironmentParams object +// with the ability to set a context for a request. +func NewCreateEnvironmentParamsWithContext(ctx context.Context) *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + Context: ctx, + } +} + +// NewCreateEnvironmentParamsWithHTTPClient creates a new CreateEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateEnvironmentParamsWithHTTPClient(client *http.Client) *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + HTTPClient: client, + } +} + +/* +CreateEnvironmentParams contains all the parameters to send to the API endpoint + + for the create environment operation. + + Typically these are written to a http.Request. +*/ +type CreateEnvironmentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* EnvName. + + name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEnvironmentParams) WithDefaults() *CreateEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create environment params +func (o *CreateEnvironmentParams) WithTimeout(timeout time.Duration) *CreateEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create environment params +func (o *CreateEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create environment params +func (o *CreateEnvironmentParams) WithContext(ctx context.Context) *CreateEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create environment params +func (o *CreateEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create environment params +func (o *CreateEnvironmentParams) WithHTTPClient(client *http.Client) *CreateEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create environment params +func (o *CreateEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the create environment params +func (o *CreateEnvironmentParams) WithImpersonateGroup(impersonateGroup []string) *CreateEnvironmentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the create environment params +func (o *CreateEnvironmentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the create environment params +func (o *CreateEnvironmentParams) WithImpersonateUser(impersonateUser *string) *CreateEnvironmentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the create environment params +func (o *CreateEnvironmentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the create environment params +func (o *CreateEnvironmentParams) WithAppName(appName string) *CreateEnvironmentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the create environment params +func (o *CreateEnvironmentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the create environment params +func (o *CreateEnvironmentParams) WithEnvName(envName string) *CreateEnvironmentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the create environment params +func (o *CreateEnvironmentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamCreateEnvironment binds the parameter Impersonate-Group +func (o *CreateEnvironmentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/create_environment_responses.go b/generated-client/client/environment/create_environment_responses.go new file mode 100644 index 0000000..05f0cc0 --- /dev/null +++ b/generated-client/client/environment/create_environment_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateEnvironmentReader is a Reader for the CreateEnvironment structure. +type CreateEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewCreateEnvironmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}] createEnvironment", response, response.Code()) + } +} + +// NewCreateEnvironmentOK creates a CreateEnvironmentOK with default headers values +func NewCreateEnvironmentOK() *CreateEnvironmentOK { + return &CreateEnvironmentOK{} +} + +/* +CreateEnvironmentOK describes a response with status code 200, with default header values. + +Environment created ok +*/ +type CreateEnvironmentOK struct { +} + +// IsSuccess returns true when this create environment o k response has a 2xx status code +func (o *CreateEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create environment o k response has a 3xx status code +func (o *CreateEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create environment o k response has a 4xx status code +func (o *CreateEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create environment o k response has a 5xx status code +func (o *CreateEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create environment o k response a status code equal to that given +func (o *CreateEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create environment o k response +func (o *CreateEnvironmentOK) Code() int { + return 200 +} + +func (o *CreateEnvironmentOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}][%d] createEnvironmentOK ", 200) +} + +func (o *CreateEnvironmentOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}][%d] createEnvironmentOK ", 200) +} + +func (o *CreateEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateEnvironmentUnauthorized creates a CreateEnvironmentUnauthorized with default headers values +func NewCreateEnvironmentUnauthorized() *CreateEnvironmentUnauthorized { + return &CreateEnvironmentUnauthorized{} +} + +/* +CreateEnvironmentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type CreateEnvironmentUnauthorized struct { +} + +// IsSuccess returns true when this create environment unauthorized response has a 2xx status code +func (o *CreateEnvironmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create environment unauthorized response has a 3xx status code +func (o *CreateEnvironmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create environment unauthorized response has a 4xx status code +func (o *CreateEnvironmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create environment unauthorized response has a 5xx status code +func (o *CreateEnvironmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create environment unauthorized response a status code equal to that given +func (o *CreateEnvironmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create environment unauthorized response +func (o *CreateEnvironmentUnauthorized) Code() int { + return 401 +} + +func (o *CreateEnvironmentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}][%d] createEnvironmentUnauthorized ", 401) +} + +func (o *CreateEnvironmentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}][%d] createEnvironmentUnauthorized ", 401) +} + +func (o *CreateEnvironmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/delete_environment_parameters.go b/generated-client/client/environment/delete_environment_parameters.go new file mode 100644 index 0000000..015e652 --- /dev/null +++ b/generated-client/client/environment/delete_environment_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteEnvironmentParams creates a new DeleteEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteEnvironmentParams() *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteEnvironmentParamsWithTimeout creates a new DeleteEnvironmentParams object +// with the ability to set a timeout on a request. +func NewDeleteEnvironmentParamsWithTimeout(timeout time.Duration) *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + timeout: timeout, + } +} + +// NewDeleteEnvironmentParamsWithContext creates a new DeleteEnvironmentParams object +// with the ability to set a context for a request. +func NewDeleteEnvironmentParamsWithContext(ctx context.Context) *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + Context: ctx, + } +} + +// NewDeleteEnvironmentParamsWithHTTPClient creates a new DeleteEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteEnvironmentParamsWithHTTPClient(client *http.Client) *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + HTTPClient: client, + } +} + +/* +DeleteEnvironmentParams contains all the parameters to send to the API endpoint + + for the delete environment operation. + + Typically these are written to a http.Request. +*/ +type DeleteEnvironmentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* EnvName. + + name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEnvironmentParams) WithDefaults() *DeleteEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete environment params +func (o *DeleteEnvironmentParams) WithTimeout(timeout time.Duration) *DeleteEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete environment params +func (o *DeleteEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete environment params +func (o *DeleteEnvironmentParams) WithContext(ctx context.Context) *DeleteEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete environment params +func (o *DeleteEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete environment params +func (o *DeleteEnvironmentParams) WithHTTPClient(client *http.Client) *DeleteEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete environment params +func (o *DeleteEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the delete environment params +func (o *DeleteEnvironmentParams) WithImpersonateGroup(impersonateGroup []string) *DeleteEnvironmentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the delete environment params +func (o *DeleteEnvironmentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the delete environment params +func (o *DeleteEnvironmentParams) WithImpersonateUser(impersonateUser *string) *DeleteEnvironmentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the delete environment params +func (o *DeleteEnvironmentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the delete environment params +func (o *DeleteEnvironmentParams) WithAppName(appName string) *DeleteEnvironmentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the delete environment params +func (o *DeleteEnvironmentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the delete environment params +func (o *DeleteEnvironmentParams) WithEnvName(envName string) *DeleteEnvironmentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the delete environment params +func (o *DeleteEnvironmentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDeleteEnvironment binds the parameter Impersonate-Group +func (o *DeleteEnvironmentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/delete_environment_responses.go b/generated-client/client/environment/delete_environment_responses.go new file mode 100644 index 0000000..1b3eb84 --- /dev/null +++ b/generated-client/client/environment/delete_environment_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteEnvironmentReader is a Reader for the DeleteEnvironment structure. +type DeleteEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteEnvironmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteEnvironmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /applications/{appName}/environments/{envName}] deleteEnvironment", response, response.Code()) + } +} + +// NewDeleteEnvironmentOK creates a DeleteEnvironmentOK with default headers values +func NewDeleteEnvironmentOK() *DeleteEnvironmentOK { + return &DeleteEnvironmentOK{} +} + +/* +DeleteEnvironmentOK describes a response with status code 200, with default header values. + +Environment deleted ok +*/ +type DeleteEnvironmentOK struct { +} + +// IsSuccess returns true when this delete environment o k response has a 2xx status code +func (o *DeleteEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete environment o k response has a 3xx status code +func (o *DeleteEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete environment o k response has a 4xx status code +func (o *DeleteEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete environment o k response has a 5xx status code +func (o *DeleteEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete environment o k response a status code equal to that given +func (o *DeleteEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete environment o k response +func (o *DeleteEnvironmentOK) Code() int { + return 200 +} + +func (o *DeleteEnvironmentOK) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}][%d] deleteEnvironmentOK ", 200) +} + +func (o *DeleteEnvironmentOK) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}][%d] deleteEnvironmentOK ", 200) +} + +func (o *DeleteEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteEnvironmentUnauthorized creates a DeleteEnvironmentUnauthorized with default headers values +func NewDeleteEnvironmentUnauthorized() *DeleteEnvironmentUnauthorized { + return &DeleteEnvironmentUnauthorized{} +} + +/* +DeleteEnvironmentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type DeleteEnvironmentUnauthorized struct { +} + +// IsSuccess returns true when this delete environment unauthorized response has a 2xx status code +func (o *DeleteEnvironmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete environment unauthorized response has a 3xx status code +func (o *DeleteEnvironmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete environment unauthorized response has a 4xx status code +func (o *DeleteEnvironmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete environment unauthorized response has a 5xx status code +func (o *DeleteEnvironmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this delete environment unauthorized response a status code equal to that given +func (o *DeleteEnvironmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the delete environment unauthorized response +func (o *DeleteEnvironmentUnauthorized) Code() int { + return 401 +} + +func (o *DeleteEnvironmentUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}][%d] deleteEnvironmentUnauthorized ", 401) +} + +func (o *DeleteEnvironmentUnauthorized) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}][%d] deleteEnvironmentUnauthorized ", 401) +} + +func (o *DeleteEnvironmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteEnvironmentNotFound creates a DeleteEnvironmentNotFound with default headers values +func NewDeleteEnvironmentNotFound() *DeleteEnvironmentNotFound { + return &DeleteEnvironmentNotFound{} +} + +/* +DeleteEnvironmentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type DeleteEnvironmentNotFound struct { +} + +// IsSuccess returns true when this delete environment not found response has a 2xx status code +func (o *DeleteEnvironmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete environment not found response has a 3xx status code +func (o *DeleteEnvironmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete environment not found response has a 4xx status code +func (o *DeleteEnvironmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete environment not found response has a 5xx status code +func (o *DeleteEnvironmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete environment not found response a status code equal to that given +func (o *DeleteEnvironmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete environment not found response +func (o *DeleteEnvironmentNotFound) Code() int { + return 404 +} + +func (o *DeleteEnvironmentNotFound) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}][%d] deleteEnvironmentNotFound ", 404) +} + +func (o *DeleteEnvironmentNotFound) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}][%d] deleteEnvironmentNotFound ", 404) +} + +func (o *DeleteEnvironmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/disable_environment_alerting_parameters.go b/generated-client/client/environment/disable_environment_alerting_parameters.go new file mode 100644 index 0000000..3a75962 --- /dev/null +++ b/generated-client/client/environment/disable_environment_alerting_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDisableEnvironmentAlertingParams creates a new DisableEnvironmentAlertingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDisableEnvironmentAlertingParams() *DisableEnvironmentAlertingParams { + return &DisableEnvironmentAlertingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDisableEnvironmentAlertingParamsWithTimeout creates a new DisableEnvironmentAlertingParams object +// with the ability to set a timeout on a request. +func NewDisableEnvironmentAlertingParamsWithTimeout(timeout time.Duration) *DisableEnvironmentAlertingParams { + return &DisableEnvironmentAlertingParams{ + timeout: timeout, + } +} + +// NewDisableEnvironmentAlertingParamsWithContext creates a new DisableEnvironmentAlertingParams object +// with the ability to set a context for a request. +func NewDisableEnvironmentAlertingParamsWithContext(ctx context.Context) *DisableEnvironmentAlertingParams { + return &DisableEnvironmentAlertingParams{ + Context: ctx, + } +} + +// NewDisableEnvironmentAlertingParamsWithHTTPClient creates a new DisableEnvironmentAlertingParams object +// with the ability to set a custom HTTPClient for a request. +func NewDisableEnvironmentAlertingParamsWithHTTPClient(client *http.Client) *DisableEnvironmentAlertingParams { + return &DisableEnvironmentAlertingParams{ + HTTPClient: client, + } +} + +/* +DisableEnvironmentAlertingParams contains all the parameters to send to the API endpoint + + for the disable environment alerting operation. + + Typically these are written to a http.Request. +*/ +type DisableEnvironmentAlertingParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the disable environment alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DisableEnvironmentAlertingParams) WithDefaults() *DisableEnvironmentAlertingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the disable environment alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DisableEnvironmentAlertingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) WithTimeout(timeout time.Duration) *DisableEnvironmentAlertingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) WithContext(ctx context.Context) *DisableEnvironmentAlertingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) WithHTTPClient(client *http.Client) *DisableEnvironmentAlertingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) WithImpersonateGroup(impersonateGroup []string) *DisableEnvironmentAlertingParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) WithImpersonateUser(impersonateUser *string) *DisableEnvironmentAlertingParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) WithAppName(appName string) *DisableEnvironmentAlertingParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) WithEnvName(envName string) *DisableEnvironmentAlertingParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the disable environment alerting params +func (o *DisableEnvironmentAlertingParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *DisableEnvironmentAlertingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDisableEnvironmentAlerting binds the parameter Impersonate-Group +func (o *DisableEnvironmentAlertingParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/disable_environment_alerting_responses.go b/generated-client/client/environment/disable_environment_alerting_responses.go new file mode 100644 index 0000000..dd5828f --- /dev/null +++ b/generated-client/client/environment/disable_environment_alerting_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// DisableEnvironmentAlertingReader is a Reader for the DisableEnvironmentAlerting structure. +type DisableEnvironmentAlertingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DisableEnvironmentAlertingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDisableEnvironmentAlertingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDisableEnvironmentAlertingBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewDisableEnvironmentAlertingUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDisableEnvironmentAlertingForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDisableEnvironmentAlertingNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDisableEnvironmentAlertingInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/alerting/disable] disableEnvironmentAlerting", response, response.Code()) + } +} + +// NewDisableEnvironmentAlertingOK creates a DisableEnvironmentAlertingOK with default headers values +func NewDisableEnvironmentAlertingOK() *DisableEnvironmentAlertingOK { + return &DisableEnvironmentAlertingOK{} +} + +/* +DisableEnvironmentAlertingOK describes a response with status code 200, with default header values. + +Successful disable alerting +*/ +type DisableEnvironmentAlertingOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this disable environment alerting o k response has a 2xx status code +func (o *DisableEnvironmentAlertingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this disable environment alerting o k response has a 3xx status code +func (o *DisableEnvironmentAlertingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable environment alerting o k response has a 4xx status code +func (o *DisableEnvironmentAlertingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this disable environment alerting o k response has a 5xx status code +func (o *DisableEnvironmentAlertingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this disable environment alerting o k response a status code equal to that given +func (o *DisableEnvironmentAlertingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the disable environment alerting o k response +func (o *DisableEnvironmentAlertingOK) Code() int { + return 200 +} + +func (o *DisableEnvironmentAlertingOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingOK %+v", 200, o.Payload) +} + +func (o *DisableEnvironmentAlertingOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingOK %+v", 200, o.Payload) +} + +func (o *DisableEnvironmentAlertingOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *DisableEnvironmentAlertingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDisableEnvironmentAlertingBadRequest creates a DisableEnvironmentAlertingBadRequest with default headers values +func NewDisableEnvironmentAlertingBadRequest() *DisableEnvironmentAlertingBadRequest { + return &DisableEnvironmentAlertingBadRequest{} +} + +/* +DisableEnvironmentAlertingBadRequest describes a response with status code 400, with default header values. + +Alerting already enabled +*/ +type DisableEnvironmentAlertingBadRequest struct { +} + +// IsSuccess returns true when this disable environment alerting bad request response has a 2xx status code +func (o *DisableEnvironmentAlertingBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable environment alerting bad request response has a 3xx status code +func (o *DisableEnvironmentAlertingBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable environment alerting bad request response has a 4xx status code +func (o *DisableEnvironmentAlertingBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable environment alerting bad request response has a 5xx status code +func (o *DisableEnvironmentAlertingBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this disable environment alerting bad request response a status code equal to that given +func (o *DisableEnvironmentAlertingBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the disable environment alerting bad request response +func (o *DisableEnvironmentAlertingBadRequest) Code() int { + return 400 +} + +func (o *DisableEnvironmentAlertingBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingBadRequest ", 400) +} + +func (o *DisableEnvironmentAlertingBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingBadRequest ", 400) +} + +func (o *DisableEnvironmentAlertingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableEnvironmentAlertingUnauthorized creates a DisableEnvironmentAlertingUnauthorized with default headers values +func NewDisableEnvironmentAlertingUnauthorized() *DisableEnvironmentAlertingUnauthorized { + return &DisableEnvironmentAlertingUnauthorized{} +} + +/* +DisableEnvironmentAlertingUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type DisableEnvironmentAlertingUnauthorized struct { +} + +// IsSuccess returns true when this disable environment alerting unauthorized response has a 2xx status code +func (o *DisableEnvironmentAlertingUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable environment alerting unauthorized response has a 3xx status code +func (o *DisableEnvironmentAlertingUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable environment alerting unauthorized response has a 4xx status code +func (o *DisableEnvironmentAlertingUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable environment alerting unauthorized response has a 5xx status code +func (o *DisableEnvironmentAlertingUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this disable environment alerting unauthorized response a status code equal to that given +func (o *DisableEnvironmentAlertingUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the disable environment alerting unauthorized response +func (o *DisableEnvironmentAlertingUnauthorized) Code() int { + return 401 +} + +func (o *DisableEnvironmentAlertingUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingUnauthorized ", 401) +} + +func (o *DisableEnvironmentAlertingUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingUnauthorized ", 401) +} + +func (o *DisableEnvironmentAlertingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableEnvironmentAlertingForbidden creates a DisableEnvironmentAlertingForbidden with default headers values +func NewDisableEnvironmentAlertingForbidden() *DisableEnvironmentAlertingForbidden { + return &DisableEnvironmentAlertingForbidden{} +} + +/* +DisableEnvironmentAlertingForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DisableEnvironmentAlertingForbidden struct { +} + +// IsSuccess returns true when this disable environment alerting forbidden response has a 2xx status code +func (o *DisableEnvironmentAlertingForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable environment alerting forbidden response has a 3xx status code +func (o *DisableEnvironmentAlertingForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable environment alerting forbidden response has a 4xx status code +func (o *DisableEnvironmentAlertingForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable environment alerting forbidden response has a 5xx status code +func (o *DisableEnvironmentAlertingForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this disable environment alerting forbidden response a status code equal to that given +func (o *DisableEnvironmentAlertingForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the disable environment alerting forbidden response +func (o *DisableEnvironmentAlertingForbidden) Code() int { + return 403 +} + +func (o *DisableEnvironmentAlertingForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingForbidden ", 403) +} + +func (o *DisableEnvironmentAlertingForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingForbidden ", 403) +} + +func (o *DisableEnvironmentAlertingForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableEnvironmentAlertingNotFound creates a DisableEnvironmentAlertingNotFound with default headers values +func NewDisableEnvironmentAlertingNotFound() *DisableEnvironmentAlertingNotFound { + return &DisableEnvironmentAlertingNotFound{} +} + +/* +DisableEnvironmentAlertingNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type DisableEnvironmentAlertingNotFound struct { +} + +// IsSuccess returns true when this disable environment alerting not found response has a 2xx status code +func (o *DisableEnvironmentAlertingNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable environment alerting not found response has a 3xx status code +func (o *DisableEnvironmentAlertingNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable environment alerting not found response has a 4xx status code +func (o *DisableEnvironmentAlertingNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this disable environment alerting not found response has a 5xx status code +func (o *DisableEnvironmentAlertingNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this disable environment alerting not found response a status code equal to that given +func (o *DisableEnvironmentAlertingNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the disable environment alerting not found response +func (o *DisableEnvironmentAlertingNotFound) Code() int { + return 404 +} + +func (o *DisableEnvironmentAlertingNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingNotFound ", 404) +} + +func (o *DisableEnvironmentAlertingNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingNotFound ", 404) +} + +func (o *DisableEnvironmentAlertingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDisableEnvironmentAlertingInternalServerError creates a DisableEnvironmentAlertingInternalServerError with default headers values +func NewDisableEnvironmentAlertingInternalServerError() *DisableEnvironmentAlertingInternalServerError { + return &DisableEnvironmentAlertingInternalServerError{} +} + +/* +DisableEnvironmentAlertingInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type DisableEnvironmentAlertingInternalServerError struct { +} + +// IsSuccess returns true when this disable environment alerting internal server error response has a 2xx status code +func (o *DisableEnvironmentAlertingInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this disable environment alerting internal server error response has a 3xx status code +func (o *DisableEnvironmentAlertingInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this disable environment alerting internal server error response has a 4xx status code +func (o *DisableEnvironmentAlertingInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this disable environment alerting internal server error response has a 5xx status code +func (o *DisableEnvironmentAlertingInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this disable environment alerting internal server error response a status code equal to that given +func (o *DisableEnvironmentAlertingInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the disable environment alerting internal server error response +func (o *DisableEnvironmentAlertingInternalServerError) Code() int { + return 500 +} + +func (o *DisableEnvironmentAlertingInternalServerError) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingInternalServerError ", 500) +} + +func (o *DisableEnvironmentAlertingInternalServerError) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/disable][%d] disableEnvironmentAlertingInternalServerError ", 500) +} + +func (o *DisableEnvironmentAlertingInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/enable_environment_alerting_parameters.go b/generated-client/client/environment/enable_environment_alerting_parameters.go new file mode 100644 index 0000000..0ff9323 --- /dev/null +++ b/generated-client/client/environment/enable_environment_alerting_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewEnableEnvironmentAlertingParams creates a new EnableEnvironmentAlertingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewEnableEnvironmentAlertingParams() *EnableEnvironmentAlertingParams { + return &EnableEnvironmentAlertingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewEnableEnvironmentAlertingParamsWithTimeout creates a new EnableEnvironmentAlertingParams object +// with the ability to set a timeout on a request. +func NewEnableEnvironmentAlertingParamsWithTimeout(timeout time.Duration) *EnableEnvironmentAlertingParams { + return &EnableEnvironmentAlertingParams{ + timeout: timeout, + } +} + +// NewEnableEnvironmentAlertingParamsWithContext creates a new EnableEnvironmentAlertingParams object +// with the ability to set a context for a request. +func NewEnableEnvironmentAlertingParamsWithContext(ctx context.Context) *EnableEnvironmentAlertingParams { + return &EnableEnvironmentAlertingParams{ + Context: ctx, + } +} + +// NewEnableEnvironmentAlertingParamsWithHTTPClient creates a new EnableEnvironmentAlertingParams object +// with the ability to set a custom HTTPClient for a request. +func NewEnableEnvironmentAlertingParamsWithHTTPClient(client *http.Client) *EnableEnvironmentAlertingParams { + return &EnableEnvironmentAlertingParams{ + HTTPClient: client, + } +} + +/* +EnableEnvironmentAlertingParams contains all the parameters to send to the API endpoint + + for the enable environment alerting operation. + + Typically these are written to a http.Request. +*/ +type EnableEnvironmentAlertingParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the enable environment alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnableEnvironmentAlertingParams) WithDefaults() *EnableEnvironmentAlertingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the enable environment alerting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EnableEnvironmentAlertingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) WithTimeout(timeout time.Duration) *EnableEnvironmentAlertingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) WithContext(ctx context.Context) *EnableEnvironmentAlertingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) WithHTTPClient(client *http.Client) *EnableEnvironmentAlertingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) WithImpersonateGroup(impersonateGroup []string) *EnableEnvironmentAlertingParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) WithImpersonateUser(impersonateUser *string) *EnableEnvironmentAlertingParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) WithAppName(appName string) *EnableEnvironmentAlertingParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) WithEnvName(envName string) *EnableEnvironmentAlertingParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the enable environment alerting params +func (o *EnableEnvironmentAlertingParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *EnableEnvironmentAlertingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamEnableEnvironmentAlerting binds the parameter Impersonate-Group +func (o *EnableEnvironmentAlertingParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/enable_environment_alerting_responses.go b/generated-client/client/environment/enable_environment_alerting_responses.go new file mode 100644 index 0000000..bca9f3a --- /dev/null +++ b/generated-client/client/environment/enable_environment_alerting_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// EnableEnvironmentAlertingReader is a Reader for the EnableEnvironmentAlerting structure. +type EnableEnvironmentAlertingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EnableEnvironmentAlertingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewEnableEnvironmentAlertingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewEnableEnvironmentAlertingBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewEnableEnvironmentAlertingUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewEnableEnvironmentAlertingForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewEnableEnvironmentAlertingNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewEnableEnvironmentAlertingInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/alerting/enable] enableEnvironmentAlerting", response, response.Code()) + } +} + +// NewEnableEnvironmentAlertingOK creates a EnableEnvironmentAlertingOK with default headers values +func NewEnableEnvironmentAlertingOK() *EnableEnvironmentAlertingOK { + return &EnableEnvironmentAlertingOK{} +} + +/* +EnableEnvironmentAlertingOK describes a response with status code 200, with default header values. + +Successful enable alerting +*/ +type EnableEnvironmentAlertingOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this enable environment alerting o k response has a 2xx status code +func (o *EnableEnvironmentAlertingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this enable environment alerting o k response has a 3xx status code +func (o *EnableEnvironmentAlertingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable environment alerting o k response has a 4xx status code +func (o *EnableEnvironmentAlertingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this enable environment alerting o k response has a 5xx status code +func (o *EnableEnvironmentAlertingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this enable environment alerting o k response a status code equal to that given +func (o *EnableEnvironmentAlertingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the enable environment alerting o k response +func (o *EnableEnvironmentAlertingOK) Code() int { + return 200 +} + +func (o *EnableEnvironmentAlertingOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingOK %+v", 200, o.Payload) +} + +func (o *EnableEnvironmentAlertingOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingOK %+v", 200, o.Payload) +} + +func (o *EnableEnvironmentAlertingOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *EnableEnvironmentAlertingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewEnableEnvironmentAlertingBadRequest creates a EnableEnvironmentAlertingBadRequest with default headers values +func NewEnableEnvironmentAlertingBadRequest() *EnableEnvironmentAlertingBadRequest { + return &EnableEnvironmentAlertingBadRequest{} +} + +/* +EnableEnvironmentAlertingBadRequest describes a response with status code 400, with default header values. + +Alerting already enabled +*/ +type EnableEnvironmentAlertingBadRequest struct { +} + +// IsSuccess returns true when this enable environment alerting bad request response has a 2xx status code +func (o *EnableEnvironmentAlertingBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable environment alerting bad request response has a 3xx status code +func (o *EnableEnvironmentAlertingBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable environment alerting bad request response has a 4xx status code +func (o *EnableEnvironmentAlertingBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable environment alerting bad request response has a 5xx status code +func (o *EnableEnvironmentAlertingBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this enable environment alerting bad request response a status code equal to that given +func (o *EnableEnvironmentAlertingBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the enable environment alerting bad request response +func (o *EnableEnvironmentAlertingBadRequest) Code() int { + return 400 +} + +func (o *EnableEnvironmentAlertingBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingBadRequest ", 400) +} + +func (o *EnableEnvironmentAlertingBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingBadRequest ", 400) +} + +func (o *EnableEnvironmentAlertingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableEnvironmentAlertingUnauthorized creates a EnableEnvironmentAlertingUnauthorized with default headers values +func NewEnableEnvironmentAlertingUnauthorized() *EnableEnvironmentAlertingUnauthorized { + return &EnableEnvironmentAlertingUnauthorized{} +} + +/* +EnableEnvironmentAlertingUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type EnableEnvironmentAlertingUnauthorized struct { +} + +// IsSuccess returns true when this enable environment alerting unauthorized response has a 2xx status code +func (o *EnableEnvironmentAlertingUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable environment alerting unauthorized response has a 3xx status code +func (o *EnableEnvironmentAlertingUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable environment alerting unauthorized response has a 4xx status code +func (o *EnableEnvironmentAlertingUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable environment alerting unauthorized response has a 5xx status code +func (o *EnableEnvironmentAlertingUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this enable environment alerting unauthorized response a status code equal to that given +func (o *EnableEnvironmentAlertingUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the enable environment alerting unauthorized response +func (o *EnableEnvironmentAlertingUnauthorized) Code() int { + return 401 +} + +func (o *EnableEnvironmentAlertingUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingUnauthorized ", 401) +} + +func (o *EnableEnvironmentAlertingUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingUnauthorized ", 401) +} + +func (o *EnableEnvironmentAlertingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableEnvironmentAlertingForbidden creates a EnableEnvironmentAlertingForbidden with default headers values +func NewEnableEnvironmentAlertingForbidden() *EnableEnvironmentAlertingForbidden { + return &EnableEnvironmentAlertingForbidden{} +} + +/* +EnableEnvironmentAlertingForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type EnableEnvironmentAlertingForbidden struct { +} + +// IsSuccess returns true when this enable environment alerting forbidden response has a 2xx status code +func (o *EnableEnvironmentAlertingForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable environment alerting forbidden response has a 3xx status code +func (o *EnableEnvironmentAlertingForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable environment alerting forbidden response has a 4xx status code +func (o *EnableEnvironmentAlertingForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable environment alerting forbidden response has a 5xx status code +func (o *EnableEnvironmentAlertingForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this enable environment alerting forbidden response a status code equal to that given +func (o *EnableEnvironmentAlertingForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the enable environment alerting forbidden response +func (o *EnableEnvironmentAlertingForbidden) Code() int { + return 403 +} + +func (o *EnableEnvironmentAlertingForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingForbidden ", 403) +} + +func (o *EnableEnvironmentAlertingForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingForbidden ", 403) +} + +func (o *EnableEnvironmentAlertingForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableEnvironmentAlertingNotFound creates a EnableEnvironmentAlertingNotFound with default headers values +func NewEnableEnvironmentAlertingNotFound() *EnableEnvironmentAlertingNotFound { + return &EnableEnvironmentAlertingNotFound{} +} + +/* +EnableEnvironmentAlertingNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type EnableEnvironmentAlertingNotFound struct { +} + +// IsSuccess returns true when this enable environment alerting not found response has a 2xx status code +func (o *EnableEnvironmentAlertingNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable environment alerting not found response has a 3xx status code +func (o *EnableEnvironmentAlertingNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable environment alerting not found response has a 4xx status code +func (o *EnableEnvironmentAlertingNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this enable environment alerting not found response has a 5xx status code +func (o *EnableEnvironmentAlertingNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this enable environment alerting not found response a status code equal to that given +func (o *EnableEnvironmentAlertingNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the enable environment alerting not found response +func (o *EnableEnvironmentAlertingNotFound) Code() int { + return 404 +} + +func (o *EnableEnvironmentAlertingNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingNotFound ", 404) +} + +func (o *EnableEnvironmentAlertingNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingNotFound ", 404) +} + +func (o *EnableEnvironmentAlertingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewEnableEnvironmentAlertingInternalServerError creates a EnableEnvironmentAlertingInternalServerError with default headers values +func NewEnableEnvironmentAlertingInternalServerError() *EnableEnvironmentAlertingInternalServerError { + return &EnableEnvironmentAlertingInternalServerError{} +} + +/* +EnableEnvironmentAlertingInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type EnableEnvironmentAlertingInternalServerError struct { +} + +// IsSuccess returns true when this enable environment alerting internal server error response has a 2xx status code +func (o *EnableEnvironmentAlertingInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this enable environment alerting internal server error response has a 3xx status code +func (o *EnableEnvironmentAlertingInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this enable environment alerting internal server error response has a 4xx status code +func (o *EnableEnvironmentAlertingInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this enable environment alerting internal server error response has a 5xx status code +func (o *EnableEnvironmentAlertingInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this enable environment alerting internal server error response a status code equal to that given +func (o *EnableEnvironmentAlertingInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the enable environment alerting internal server error response +func (o *EnableEnvironmentAlertingInternalServerError) Code() int { + return 500 +} + +func (o *EnableEnvironmentAlertingInternalServerError) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingInternalServerError ", 500) +} + +func (o *EnableEnvironmentAlertingInternalServerError) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/alerting/enable][%d] enableEnvironmentAlertingInternalServerError ", 500) +} + +func (o *EnableEnvironmentAlertingInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/environment_client.go b/generated-client/client/environment/environment_client.go new file mode 100644 index 0000000..326ee8b --- /dev/null +++ b/generated-client/client/environment/environment_client.go @@ -0,0 +1,654 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new environment API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for environment API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ChangeComponentSecret(params *ChangeComponentSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeComponentSecretOK, error) + + CreateEnvironment(params *CreateEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEnvironmentOK, error) + + DeleteEnvironment(params *DeleteEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnvironmentOK, error) + + DisableEnvironmentAlerting(params *DisableEnvironmentAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableEnvironmentAlertingOK, error) + + EnableEnvironmentAlerting(params *EnableEnvironmentAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableEnvironmentAlertingOK, error) + + GetApplicationEnvironmentDeployments(params *GetApplicationEnvironmentDeploymentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationEnvironmentDeploymentsOK, error) + + GetAzureKeyVaultSecretVersions(params *GetAzureKeyVaultSecretVersionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAzureKeyVaultSecretVersionsOK, error) + + GetEnvironment(params *GetEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentOK, error) + + GetEnvironmentAlertingConfig(params *GetEnvironmentAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentAlertingConfigOK, error) + + GetEnvironmentEvents(params *GetEnvironmentEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentEventsOK, error) + + GetEnvironmentSummary(params *GetEnvironmentSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentSummaryOK, error) + + RestartEnvironment(params *RestartEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartEnvironmentOK, error) + + StartEnvironment(params *StartEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartEnvironmentOK, error) + + StopEnvironment(params *StopEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopEnvironmentOK, error) + + UpdateEnvironmentAlertingConfig(params *UpdateEnvironmentAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEnvironmentAlertingConfigOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +ChangeComponentSecret updates an application environment component secret +*/ +func (a *Client) ChangeComponentSecret(params *ChangeComponentSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeComponentSecretOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewChangeComponentSecretParams() + } + op := &runtime.ClientOperation{ + ID: "changeComponentSecret", + Method: "PUT", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/secrets/{secretName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ChangeComponentSecretReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ChangeComponentSecretOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for changeComponentSecret: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateEnvironment creates application environment +*/ +func (a *Client) CreateEnvironment(params *CreateEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "createEnvironment", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createEnvironment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteEnvironment deletes application environment +*/ +func (a *Client) DeleteEnvironment(params *DeleteEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "deleteEnvironment", + Method: "DELETE", + PathPattern: "/applications/{appName}/environments/{envName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteEnvironment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DisableEnvironmentAlerting disables alerting for an environment +*/ +func (a *Client) DisableEnvironmentAlerting(params *DisableEnvironmentAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableEnvironmentAlertingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDisableEnvironmentAlertingParams() + } + op := &runtime.ClientOperation{ + ID: "disableEnvironmentAlerting", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/alerting/disable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DisableEnvironmentAlertingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DisableEnvironmentAlertingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for disableEnvironmentAlerting: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +EnableEnvironmentAlerting enables alerting for an environment +*/ +func (a *Client) EnableEnvironmentAlerting(params *EnableEnvironmentAlertingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableEnvironmentAlertingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewEnableEnvironmentAlertingParams() + } + op := &runtime.ClientOperation{ + ID: "enableEnvironmentAlerting", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/alerting/enable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &EnableEnvironmentAlertingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*EnableEnvironmentAlertingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for enableEnvironmentAlerting: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetApplicationEnvironmentDeployments lists the application environment deployments +*/ +func (a *Client) GetApplicationEnvironmentDeployments(params *GetApplicationEnvironmentDeploymentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationEnvironmentDeploymentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetApplicationEnvironmentDeploymentsParams() + } + op := &runtime.ClientOperation{ + ID: "getApplicationEnvironmentDeployments", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/deployments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetApplicationEnvironmentDeploymentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetApplicationEnvironmentDeploymentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getApplicationEnvironmentDeployments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetAzureKeyVaultSecretVersions gets azure key vault secret versions for a component +*/ +func (a *Client) GetAzureKeyVaultSecretVersions(params *GetAzureKeyVaultSecretVersionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAzureKeyVaultSecretVersionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAzureKeyVaultSecretVersionsParams() + } + op := &runtime.ClientOperation{ + ID: "getAzureKeyVaultSecretVersions", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetAzureKeyVaultSecretVersionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetAzureKeyVaultSecretVersionsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getAzureKeyVaultSecretVersions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetEnvironment gets details for an application environment +*/ +func (a *Client) GetEnvironment(params *GetEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "getEnvironment", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getEnvironment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetEnvironmentAlertingConfig gets alerts configuration for an environment +*/ +func (a *Client) GetEnvironmentAlertingConfig(params *GetEnvironmentAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentAlertingConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEnvironmentAlertingConfigParams() + } + op := &runtime.ClientOperation{ + ID: "getEnvironmentAlertingConfig", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/alerting", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetEnvironmentAlertingConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetEnvironmentAlertingConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getEnvironmentAlertingConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetEnvironmentEvents lists events for an application environment +*/ +func (a *Client) GetEnvironmentEvents(params *GetEnvironmentEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentEventsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEnvironmentEventsParams() + } + op := &runtime.ClientOperation{ + ID: "getEnvironmentEvents", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/events", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetEnvironmentEventsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetEnvironmentEventsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getEnvironmentEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetEnvironmentSummary lists the environments for an application +*/ +func (a *Client) GetEnvironmentSummary(params *GetEnvironmentSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentSummaryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEnvironmentSummaryParams() + } + op := &runtime.ClientOperation{ + ID: "getEnvironmentSummary", + Method: "GET", + PathPattern: "/applications/{appName}/environments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetEnvironmentSummaryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetEnvironmentSummaryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getEnvironmentSummary: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RestartEnvironment restarts all components in the environment stops all running components in the environment pulls new images from image hub in radix configuration starts all components in the environment again using up to date image +*/ +func (a *Client) RestartEnvironment(params *RestartEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestartEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "restartEnvironment", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/restart", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RestartEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RestartEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for restartEnvironment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StartEnvironment starts all components in the environment +*/ +func (a *Client) StartEnvironment(params *StartEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStartEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "startEnvironment", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/start", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StartEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StartEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for startEnvironment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StopEnvironment stops all components in the environment +*/ +func (a *Client) StopEnvironment(params *StopEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStopEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "stopEnvironment", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StopEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StopEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stopEnvironment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateEnvironmentAlertingConfig updates alerts configuration for an environment +*/ +func (a *Client) UpdateEnvironmentAlertingConfig(params *UpdateEnvironmentAlertingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEnvironmentAlertingConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateEnvironmentAlertingConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateEnvironmentAlertingConfig", + Method: "PUT", + PathPattern: "/applications/{appName}/environments/{envName}/alerting", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateEnvironmentAlertingConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateEnvironmentAlertingConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateEnvironmentAlertingConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/environment/get_application_environment_deployments_parameters.go b/generated-client/client/environment/get_application_environment_deployments_parameters.go new file mode 100644 index 0000000..4585d6c --- /dev/null +++ b/generated-client/client/environment/get_application_environment_deployments_parameters.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetApplicationEnvironmentDeploymentsParams creates a new GetApplicationEnvironmentDeploymentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetApplicationEnvironmentDeploymentsParams() *GetApplicationEnvironmentDeploymentsParams { + return &GetApplicationEnvironmentDeploymentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetApplicationEnvironmentDeploymentsParamsWithTimeout creates a new GetApplicationEnvironmentDeploymentsParams object +// with the ability to set a timeout on a request. +func NewGetApplicationEnvironmentDeploymentsParamsWithTimeout(timeout time.Duration) *GetApplicationEnvironmentDeploymentsParams { + return &GetApplicationEnvironmentDeploymentsParams{ + timeout: timeout, + } +} + +// NewGetApplicationEnvironmentDeploymentsParamsWithContext creates a new GetApplicationEnvironmentDeploymentsParams object +// with the ability to set a context for a request. +func NewGetApplicationEnvironmentDeploymentsParamsWithContext(ctx context.Context) *GetApplicationEnvironmentDeploymentsParams { + return &GetApplicationEnvironmentDeploymentsParams{ + Context: ctx, + } +} + +// NewGetApplicationEnvironmentDeploymentsParamsWithHTTPClient creates a new GetApplicationEnvironmentDeploymentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetApplicationEnvironmentDeploymentsParamsWithHTTPClient(client *http.Client) *GetApplicationEnvironmentDeploymentsParams { + return &GetApplicationEnvironmentDeploymentsParams{ + HTTPClient: client, + } +} + +/* +GetApplicationEnvironmentDeploymentsParams contains all the parameters to send to the API endpoint + + for the get application environment deployments operation. + + Typically these are written to a http.Request. +*/ +type GetApplicationEnvironmentDeploymentsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* EnvName. + + environment of Radix application + */ + EnvName string + + /* Latest. + + indicator to allow only listing the latest + */ + Latest *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get application environment deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationEnvironmentDeploymentsParams) WithDefaults() *GetApplicationEnvironmentDeploymentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get application environment deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationEnvironmentDeploymentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithTimeout(timeout time.Duration) *GetApplicationEnvironmentDeploymentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithContext(ctx context.Context) *GetApplicationEnvironmentDeploymentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithHTTPClient(client *http.Client) *GetApplicationEnvironmentDeploymentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithImpersonateGroup(impersonateGroup []string) *GetApplicationEnvironmentDeploymentsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithImpersonateUser(impersonateUser *string) *GetApplicationEnvironmentDeploymentsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithAppName(appName string) *GetApplicationEnvironmentDeploymentsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithEnvName(envName string) *GetApplicationEnvironmentDeploymentsParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithLatest adds the latest to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) WithLatest(latest *bool) *GetApplicationEnvironmentDeploymentsParams { + o.SetLatest(latest) + return o +} + +// SetLatest adds the latest to the get application environment deployments params +func (o *GetApplicationEnvironmentDeploymentsParams) SetLatest(latest *bool) { + o.Latest = latest +} + +// WriteToRequest writes these params to a swagger request +func (o *GetApplicationEnvironmentDeploymentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if o.Latest != nil { + + // query param latest + var qrLatest bool + + if o.Latest != nil { + qrLatest = *o.Latest + } + qLatest := swag.FormatBool(qrLatest) + if qLatest != "" { + + if err := r.SetQueryParam("latest", qLatest); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetApplicationEnvironmentDeployments binds the parameter Impersonate-Group +func (o *GetApplicationEnvironmentDeploymentsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/get_application_environment_deployments_responses.go b/generated-client/client/environment/get_application_environment_deployments_responses.go new file mode 100644 index 0000000..38861d4 --- /dev/null +++ b/generated-client/client/environment/get_application_environment_deployments_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetApplicationEnvironmentDeploymentsReader is a Reader for the GetApplicationEnvironmentDeployments structure. +type GetApplicationEnvironmentDeploymentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetApplicationEnvironmentDeploymentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetApplicationEnvironmentDeploymentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetApplicationEnvironmentDeploymentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetApplicationEnvironmentDeploymentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/deployments] getApplicationEnvironmentDeployments", response, response.Code()) + } +} + +// NewGetApplicationEnvironmentDeploymentsOK creates a GetApplicationEnvironmentDeploymentsOK with default headers values +func NewGetApplicationEnvironmentDeploymentsOK() *GetApplicationEnvironmentDeploymentsOK { + return &GetApplicationEnvironmentDeploymentsOK{} +} + +/* +GetApplicationEnvironmentDeploymentsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetApplicationEnvironmentDeploymentsOK struct { + Payload []*models.DeploymentSummary +} + +// IsSuccess returns true when this get application environment deployments o k response has a 2xx status code +func (o *GetApplicationEnvironmentDeploymentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get application environment deployments o k response has a 3xx status code +func (o *GetApplicationEnvironmentDeploymentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application environment deployments o k response has a 4xx status code +func (o *GetApplicationEnvironmentDeploymentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get application environment deployments o k response has a 5xx status code +func (o *GetApplicationEnvironmentDeploymentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get application environment deployments o k response a status code equal to that given +func (o *GetApplicationEnvironmentDeploymentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get application environment deployments o k response +func (o *GetApplicationEnvironmentDeploymentsOK) Code() int { + return 200 +} + +func (o *GetApplicationEnvironmentDeploymentsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/deployments][%d] getApplicationEnvironmentDeploymentsOK %+v", 200, o.Payload) +} + +func (o *GetApplicationEnvironmentDeploymentsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/deployments][%d] getApplicationEnvironmentDeploymentsOK %+v", 200, o.Payload) +} + +func (o *GetApplicationEnvironmentDeploymentsOK) GetPayload() []*models.DeploymentSummary { + return o.Payload +} + +func (o *GetApplicationEnvironmentDeploymentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetApplicationEnvironmentDeploymentsUnauthorized creates a GetApplicationEnvironmentDeploymentsUnauthorized with default headers values +func NewGetApplicationEnvironmentDeploymentsUnauthorized() *GetApplicationEnvironmentDeploymentsUnauthorized { + return &GetApplicationEnvironmentDeploymentsUnauthorized{} +} + +/* +GetApplicationEnvironmentDeploymentsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetApplicationEnvironmentDeploymentsUnauthorized struct { +} + +// IsSuccess returns true when this get application environment deployments unauthorized response has a 2xx status code +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application environment deployments unauthorized response has a 3xx status code +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application environment deployments unauthorized response has a 4xx status code +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application environment deployments unauthorized response has a 5xx status code +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get application environment deployments unauthorized response a status code equal to that given +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get application environment deployments unauthorized response +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) Code() int { + return 401 +} + +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/deployments][%d] getApplicationEnvironmentDeploymentsUnauthorized ", 401) +} + +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/deployments][%d] getApplicationEnvironmentDeploymentsUnauthorized ", 401) +} + +func (o *GetApplicationEnvironmentDeploymentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationEnvironmentDeploymentsNotFound creates a GetApplicationEnvironmentDeploymentsNotFound with default headers values +func NewGetApplicationEnvironmentDeploymentsNotFound() *GetApplicationEnvironmentDeploymentsNotFound { + return &GetApplicationEnvironmentDeploymentsNotFound{} +} + +/* +GetApplicationEnvironmentDeploymentsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetApplicationEnvironmentDeploymentsNotFound struct { +} + +// IsSuccess returns true when this get application environment deployments not found response has a 2xx status code +func (o *GetApplicationEnvironmentDeploymentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application environment deployments not found response has a 3xx status code +func (o *GetApplicationEnvironmentDeploymentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application environment deployments not found response has a 4xx status code +func (o *GetApplicationEnvironmentDeploymentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application environment deployments not found response has a 5xx status code +func (o *GetApplicationEnvironmentDeploymentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get application environment deployments not found response a status code equal to that given +func (o *GetApplicationEnvironmentDeploymentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get application environment deployments not found response +func (o *GetApplicationEnvironmentDeploymentsNotFound) Code() int { + return 404 +} + +func (o *GetApplicationEnvironmentDeploymentsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/deployments][%d] getApplicationEnvironmentDeploymentsNotFound ", 404) +} + +func (o *GetApplicationEnvironmentDeploymentsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/deployments][%d] getApplicationEnvironmentDeploymentsNotFound ", 404) +} + +func (o *GetApplicationEnvironmentDeploymentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/get_azure_key_vault_secret_versions_parameters.go b/generated-client/client/environment/get_azure_key_vault_secret_versions_parameters.go new file mode 100644 index 0000000..17107be --- /dev/null +++ b/generated-client/client/environment/get_azure_key_vault_secret_versions_parameters.go @@ -0,0 +1,324 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetAzureKeyVaultSecretVersionsParams creates a new GetAzureKeyVaultSecretVersionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAzureKeyVaultSecretVersionsParams() *GetAzureKeyVaultSecretVersionsParams { + return &GetAzureKeyVaultSecretVersionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAzureKeyVaultSecretVersionsParamsWithTimeout creates a new GetAzureKeyVaultSecretVersionsParams object +// with the ability to set a timeout on a request. +func NewGetAzureKeyVaultSecretVersionsParamsWithTimeout(timeout time.Duration) *GetAzureKeyVaultSecretVersionsParams { + return &GetAzureKeyVaultSecretVersionsParams{ + timeout: timeout, + } +} + +// NewGetAzureKeyVaultSecretVersionsParamsWithContext creates a new GetAzureKeyVaultSecretVersionsParams object +// with the ability to set a context for a request. +func NewGetAzureKeyVaultSecretVersionsParamsWithContext(ctx context.Context) *GetAzureKeyVaultSecretVersionsParams { + return &GetAzureKeyVaultSecretVersionsParams{ + Context: ctx, + } +} + +// NewGetAzureKeyVaultSecretVersionsParamsWithHTTPClient creates a new GetAzureKeyVaultSecretVersionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAzureKeyVaultSecretVersionsParamsWithHTTPClient(client *http.Client) *GetAzureKeyVaultSecretVersionsParams { + return &GetAzureKeyVaultSecretVersionsParams{ + HTTPClient: client, + } +} + +/* +GetAzureKeyVaultSecretVersionsParams contains all the parameters to send to the API endpoint + + for the get azure key vault secret versions operation. + + Typically these are written to a http.Request. +*/ +type GetAzureKeyVaultSecretVersionsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* AzureKeyVaultName. + + Azure Key vault name + */ + AzureKeyVaultName string + + /* ComponentName. + + secret component of Radix application + */ + ComponentName string + + /* EnvName. + + secret of Radix application + */ + EnvName string + + /* SecretName. + + secret (or key, cert) name in Azure Key vault + */ + SecretName *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get azure key vault secret versions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureKeyVaultSecretVersionsParams) WithDefaults() *GetAzureKeyVaultSecretVersionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get azure key vault secret versions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureKeyVaultSecretVersionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithTimeout(timeout time.Duration) *GetAzureKeyVaultSecretVersionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithContext(ctx context.Context) *GetAzureKeyVaultSecretVersionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithHTTPClient(client *http.Client) *GetAzureKeyVaultSecretVersionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithImpersonateGroup(impersonateGroup []string) *GetAzureKeyVaultSecretVersionsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithImpersonateUser(impersonateUser *string) *GetAzureKeyVaultSecretVersionsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithAppName(appName string) *GetAzureKeyVaultSecretVersionsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithAzureKeyVaultName adds the azureKeyVaultName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithAzureKeyVaultName(azureKeyVaultName string) *GetAzureKeyVaultSecretVersionsParams { + o.SetAzureKeyVaultName(azureKeyVaultName) + return o +} + +// SetAzureKeyVaultName adds the azureKeyVaultName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetAzureKeyVaultName(azureKeyVaultName string) { + o.AzureKeyVaultName = azureKeyVaultName +} + +// WithComponentName adds the componentName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithComponentName(componentName string) *GetAzureKeyVaultSecretVersionsParams { + o.SetComponentName(componentName) + return o +} + +// SetComponentName adds the componentName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetComponentName(componentName string) { + o.ComponentName = componentName +} + +// WithEnvName adds the envName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithEnvName(envName string) *GetAzureKeyVaultSecretVersionsParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithSecretName adds the secretName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) WithSecretName(secretName *string) *GetAzureKeyVaultSecretVersionsParams { + o.SetSecretName(secretName) + return o +} + +// SetSecretName adds the secretName to the get azure key vault secret versions params +func (o *GetAzureKeyVaultSecretVersionsParams) SetSecretName(secretName *string) { + o.SecretName = secretName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAzureKeyVaultSecretVersionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param azureKeyVaultName + if err := r.SetPathParam("azureKeyVaultName", o.AzureKeyVaultName); err != nil { + return err + } + + // path param componentName + if err := r.SetPathParam("componentName", o.ComponentName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if o.SecretName != nil { + + // query param secretName + var qrSecretName string + + if o.SecretName != nil { + qrSecretName = *o.SecretName + } + qSecretName := qrSecretName + if qSecretName != "" { + + if err := r.SetQueryParam("secretName", qSecretName); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetAzureKeyVaultSecretVersions binds the parameter Impersonate-Group +func (o *GetAzureKeyVaultSecretVersionsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/get_azure_key_vault_secret_versions_responses.go b/generated-client/client/environment/get_azure_key_vault_secret_versions_responses.go new file mode 100644 index 0000000..32259bf --- /dev/null +++ b/generated-client/client/environment/get_azure_key_vault_secret_versions_responses.go @@ -0,0 +1,473 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetAzureKeyVaultSecretVersionsReader is a Reader for the GetAzureKeyVaultSecretVersions structure. +type GetAzureKeyVaultSecretVersionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAzureKeyVaultSecretVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAzureKeyVaultSecretVersionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetAzureKeyVaultSecretVersionsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewGetAzureKeyVaultSecretVersionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAzureKeyVaultSecretVersionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAzureKeyVaultSecretVersionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewGetAzureKeyVaultSecretVersionsConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAzureKeyVaultSecretVersionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}] getAzureKeyVaultSecretVersions", response, response.Code()) + } +} + +// NewGetAzureKeyVaultSecretVersionsOK creates a GetAzureKeyVaultSecretVersionsOK with default headers values +func NewGetAzureKeyVaultSecretVersionsOK() *GetAzureKeyVaultSecretVersionsOK { + return &GetAzureKeyVaultSecretVersionsOK{} +} + +/* +GetAzureKeyVaultSecretVersionsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetAzureKeyVaultSecretVersionsOK struct { + Payload []*models.AzureKeyVaultSecretVersion +} + +// IsSuccess returns true when this get azure key vault secret versions o k response has a 2xx status code +func (o *GetAzureKeyVaultSecretVersionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get azure key vault secret versions o k response has a 3xx status code +func (o *GetAzureKeyVaultSecretVersionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure key vault secret versions o k response has a 4xx status code +func (o *GetAzureKeyVaultSecretVersionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get azure key vault secret versions o k response has a 5xx status code +func (o *GetAzureKeyVaultSecretVersionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get azure key vault secret versions o k response a status code equal to that given +func (o *GetAzureKeyVaultSecretVersionsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get azure key vault secret versions o k response +func (o *GetAzureKeyVaultSecretVersionsOK) Code() int { + return 200 +} + +func (o *GetAzureKeyVaultSecretVersionsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsOK %+v", 200, o.Payload) +} + +func (o *GetAzureKeyVaultSecretVersionsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsOK %+v", 200, o.Payload) +} + +func (o *GetAzureKeyVaultSecretVersionsOK) GetPayload() []*models.AzureKeyVaultSecretVersion { + return o.Payload +} + +func (o *GetAzureKeyVaultSecretVersionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAzureKeyVaultSecretVersionsBadRequest creates a GetAzureKeyVaultSecretVersionsBadRequest with default headers values +func NewGetAzureKeyVaultSecretVersionsBadRequest() *GetAzureKeyVaultSecretVersionsBadRequest { + return &GetAzureKeyVaultSecretVersionsBadRequest{} +} + +/* +GetAzureKeyVaultSecretVersionsBadRequest describes a response with status code 400, with default header values. + +Invalid application +*/ +type GetAzureKeyVaultSecretVersionsBadRequest struct { +} + +// IsSuccess returns true when this get azure key vault secret versions bad request response has a 2xx status code +func (o *GetAzureKeyVaultSecretVersionsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get azure key vault secret versions bad request response has a 3xx status code +func (o *GetAzureKeyVaultSecretVersionsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure key vault secret versions bad request response has a 4xx status code +func (o *GetAzureKeyVaultSecretVersionsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get azure key vault secret versions bad request response has a 5xx status code +func (o *GetAzureKeyVaultSecretVersionsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get azure key vault secret versions bad request response a status code equal to that given +func (o *GetAzureKeyVaultSecretVersionsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get azure key vault secret versions bad request response +func (o *GetAzureKeyVaultSecretVersionsBadRequest) Code() int { + return 400 +} + +func (o *GetAzureKeyVaultSecretVersionsBadRequest) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsBadRequest ", 400) +} + +func (o *GetAzureKeyVaultSecretVersionsBadRequest) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsBadRequest ", 400) +} + +func (o *GetAzureKeyVaultSecretVersionsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAzureKeyVaultSecretVersionsUnauthorized creates a GetAzureKeyVaultSecretVersionsUnauthorized with default headers values +func NewGetAzureKeyVaultSecretVersionsUnauthorized() *GetAzureKeyVaultSecretVersionsUnauthorized { + return &GetAzureKeyVaultSecretVersionsUnauthorized{} +} + +/* +GetAzureKeyVaultSecretVersionsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetAzureKeyVaultSecretVersionsUnauthorized struct { +} + +// IsSuccess returns true when this get azure key vault secret versions unauthorized response has a 2xx status code +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get azure key vault secret versions unauthorized response has a 3xx status code +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure key vault secret versions unauthorized response has a 4xx status code +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get azure key vault secret versions unauthorized response has a 5xx status code +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get azure key vault secret versions unauthorized response a status code equal to that given +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get azure key vault secret versions unauthorized response +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) Code() int { + return 401 +} + +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsUnauthorized ", 401) +} + +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsUnauthorized ", 401) +} + +func (o *GetAzureKeyVaultSecretVersionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAzureKeyVaultSecretVersionsForbidden creates a GetAzureKeyVaultSecretVersionsForbidden with default headers values +func NewGetAzureKeyVaultSecretVersionsForbidden() *GetAzureKeyVaultSecretVersionsForbidden { + return &GetAzureKeyVaultSecretVersionsForbidden{} +} + +/* +GetAzureKeyVaultSecretVersionsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetAzureKeyVaultSecretVersionsForbidden struct { +} + +// IsSuccess returns true when this get azure key vault secret versions forbidden response has a 2xx status code +func (o *GetAzureKeyVaultSecretVersionsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get azure key vault secret versions forbidden response has a 3xx status code +func (o *GetAzureKeyVaultSecretVersionsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure key vault secret versions forbidden response has a 4xx status code +func (o *GetAzureKeyVaultSecretVersionsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get azure key vault secret versions forbidden response has a 5xx status code +func (o *GetAzureKeyVaultSecretVersionsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get azure key vault secret versions forbidden response a status code equal to that given +func (o *GetAzureKeyVaultSecretVersionsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get azure key vault secret versions forbidden response +func (o *GetAzureKeyVaultSecretVersionsForbidden) Code() int { + return 403 +} + +func (o *GetAzureKeyVaultSecretVersionsForbidden) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsForbidden ", 403) +} + +func (o *GetAzureKeyVaultSecretVersionsForbidden) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsForbidden ", 403) +} + +func (o *GetAzureKeyVaultSecretVersionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAzureKeyVaultSecretVersionsNotFound creates a GetAzureKeyVaultSecretVersionsNotFound with default headers values +func NewGetAzureKeyVaultSecretVersionsNotFound() *GetAzureKeyVaultSecretVersionsNotFound { + return &GetAzureKeyVaultSecretVersionsNotFound{} +} + +/* +GetAzureKeyVaultSecretVersionsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetAzureKeyVaultSecretVersionsNotFound struct { +} + +// IsSuccess returns true when this get azure key vault secret versions not found response has a 2xx status code +func (o *GetAzureKeyVaultSecretVersionsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get azure key vault secret versions not found response has a 3xx status code +func (o *GetAzureKeyVaultSecretVersionsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure key vault secret versions not found response has a 4xx status code +func (o *GetAzureKeyVaultSecretVersionsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get azure key vault secret versions not found response has a 5xx status code +func (o *GetAzureKeyVaultSecretVersionsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get azure key vault secret versions not found response a status code equal to that given +func (o *GetAzureKeyVaultSecretVersionsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get azure key vault secret versions not found response +func (o *GetAzureKeyVaultSecretVersionsNotFound) Code() int { + return 404 +} + +func (o *GetAzureKeyVaultSecretVersionsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsNotFound ", 404) +} + +func (o *GetAzureKeyVaultSecretVersionsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsNotFound ", 404) +} + +func (o *GetAzureKeyVaultSecretVersionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAzureKeyVaultSecretVersionsConflict creates a GetAzureKeyVaultSecretVersionsConflict with default headers values +func NewGetAzureKeyVaultSecretVersionsConflict() *GetAzureKeyVaultSecretVersionsConflict { + return &GetAzureKeyVaultSecretVersionsConflict{} +} + +/* +GetAzureKeyVaultSecretVersionsConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type GetAzureKeyVaultSecretVersionsConflict struct { +} + +// IsSuccess returns true when this get azure key vault secret versions conflict response has a 2xx status code +func (o *GetAzureKeyVaultSecretVersionsConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get azure key vault secret versions conflict response has a 3xx status code +func (o *GetAzureKeyVaultSecretVersionsConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure key vault secret versions conflict response has a 4xx status code +func (o *GetAzureKeyVaultSecretVersionsConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this get azure key vault secret versions conflict response has a 5xx status code +func (o *GetAzureKeyVaultSecretVersionsConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this get azure key vault secret versions conflict response a status code equal to that given +func (o *GetAzureKeyVaultSecretVersionsConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the get azure key vault secret versions conflict response +func (o *GetAzureKeyVaultSecretVersionsConflict) Code() int { + return 409 +} + +func (o *GetAzureKeyVaultSecretVersionsConflict) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsConflict ", 409) +} + +func (o *GetAzureKeyVaultSecretVersionsConflict) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsConflict ", 409) +} + +func (o *GetAzureKeyVaultSecretVersionsConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAzureKeyVaultSecretVersionsInternalServerError creates a GetAzureKeyVaultSecretVersionsInternalServerError with default headers values +func NewGetAzureKeyVaultSecretVersionsInternalServerError() *GetAzureKeyVaultSecretVersionsInternalServerError { + return &GetAzureKeyVaultSecretVersionsInternalServerError{} +} + +/* +GetAzureKeyVaultSecretVersionsInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetAzureKeyVaultSecretVersionsInternalServerError struct { +} + +// IsSuccess returns true when this get azure key vault secret versions internal server error response has a 2xx status code +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get azure key vault secret versions internal server error response has a 3xx status code +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure key vault secret versions internal server error response has a 4xx status code +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get azure key vault secret versions internal server error response has a 5xx status code +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get azure key vault secret versions internal server error response a status code equal to that given +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get azure key vault secret versions internal server error response +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) Code() int { + return 500 +} + +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsInternalServerError ", 500) +} + +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/components/{componentName}/secrets/azure/keyvault/{azureKeyVaultName}][%d] getAzureKeyVaultSecretVersionsInternalServerError ", 500) +} + +func (o *GetAzureKeyVaultSecretVersionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/get_environment_alerting_config_parameters.go b/generated-client/client/environment/get_environment_alerting_config_parameters.go new file mode 100644 index 0000000..e36677a --- /dev/null +++ b/generated-client/client/environment/get_environment_alerting_config_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetEnvironmentAlertingConfigParams creates a new GetEnvironmentAlertingConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetEnvironmentAlertingConfigParams() *GetEnvironmentAlertingConfigParams { + return &GetEnvironmentAlertingConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetEnvironmentAlertingConfigParamsWithTimeout creates a new GetEnvironmentAlertingConfigParams object +// with the ability to set a timeout on a request. +func NewGetEnvironmentAlertingConfigParamsWithTimeout(timeout time.Duration) *GetEnvironmentAlertingConfigParams { + return &GetEnvironmentAlertingConfigParams{ + timeout: timeout, + } +} + +// NewGetEnvironmentAlertingConfigParamsWithContext creates a new GetEnvironmentAlertingConfigParams object +// with the ability to set a context for a request. +func NewGetEnvironmentAlertingConfigParamsWithContext(ctx context.Context) *GetEnvironmentAlertingConfigParams { + return &GetEnvironmentAlertingConfigParams{ + Context: ctx, + } +} + +// NewGetEnvironmentAlertingConfigParamsWithHTTPClient creates a new GetEnvironmentAlertingConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetEnvironmentAlertingConfigParamsWithHTTPClient(client *http.Client) *GetEnvironmentAlertingConfigParams { + return &GetEnvironmentAlertingConfigParams{ + HTTPClient: client, + } +} + +/* +GetEnvironmentAlertingConfigParams contains all the parameters to send to the API endpoint + + for the get environment alerting config operation. + + Typically these are written to a http.Request. +*/ +type GetEnvironmentAlertingConfigParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get environment alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentAlertingConfigParams) WithDefaults() *GetEnvironmentAlertingConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get environment alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentAlertingConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) WithTimeout(timeout time.Duration) *GetEnvironmentAlertingConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) WithContext(ctx context.Context) *GetEnvironmentAlertingConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) WithHTTPClient(client *http.Client) *GetEnvironmentAlertingConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) WithImpersonateGroup(impersonateGroup []string) *GetEnvironmentAlertingConfigParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) WithImpersonateUser(impersonateUser *string) *GetEnvironmentAlertingConfigParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) WithAppName(appName string) *GetEnvironmentAlertingConfigParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) WithEnvName(envName string) *GetEnvironmentAlertingConfigParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get environment alerting config params +func (o *GetEnvironmentAlertingConfigParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEnvironmentAlertingConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetEnvironmentAlertingConfig binds the parameter Impersonate-Group +func (o *GetEnvironmentAlertingConfigParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/get_environment_alerting_config_responses.go b/generated-client/client/environment/get_environment_alerting_config_responses.go new file mode 100644 index 0000000..7b7cf9a --- /dev/null +++ b/generated-client/client/environment/get_environment_alerting_config_responses.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetEnvironmentAlertingConfigReader is a Reader for the GetEnvironmentAlertingConfig structure. +type GetEnvironmentAlertingConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEnvironmentAlertingConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEnvironmentAlertingConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetEnvironmentAlertingConfigUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetEnvironmentAlertingConfigForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetEnvironmentAlertingConfigNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetEnvironmentAlertingConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/alerting] getEnvironmentAlertingConfig", response, response.Code()) + } +} + +// NewGetEnvironmentAlertingConfigOK creates a GetEnvironmentAlertingConfigOK with default headers values +func NewGetEnvironmentAlertingConfigOK() *GetEnvironmentAlertingConfigOK { + return &GetEnvironmentAlertingConfigOK{} +} + +/* +GetEnvironmentAlertingConfigOK describes a response with status code 200, with default header values. + +Successful get alerts config +*/ +type GetEnvironmentAlertingConfigOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this get environment alerting config o k response has a 2xx status code +func (o *GetEnvironmentAlertingConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get environment alerting config o k response has a 3xx status code +func (o *GetEnvironmentAlertingConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment alerting config o k response has a 4xx status code +func (o *GetEnvironmentAlertingConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get environment alerting config o k response has a 5xx status code +func (o *GetEnvironmentAlertingConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment alerting config o k response a status code equal to that given +func (o *GetEnvironmentAlertingConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get environment alerting config o k response +func (o *GetEnvironmentAlertingConfigOK) Code() int { + return 200 +} + +func (o *GetEnvironmentAlertingConfigOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentAlertingConfigOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentAlertingConfigOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *GetEnvironmentAlertingConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEnvironmentAlertingConfigUnauthorized creates a GetEnvironmentAlertingConfigUnauthorized with default headers values +func NewGetEnvironmentAlertingConfigUnauthorized() *GetEnvironmentAlertingConfigUnauthorized { + return &GetEnvironmentAlertingConfigUnauthorized{} +} + +/* +GetEnvironmentAlertingConfigUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetEnvironmentAlertingConfigUnauthorized struct { +} + +// IsSuccess returns true when this get environment alerting config unauthorized response has a 2xx status code +func (o *GetEnvironmentAlertingConfigUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment alerting config unauthorized response has a 3xx status code +func (o *GetEnvironmentAlertingConfigUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment alerting config unauthorized response has a 4xx status code +func (o *GetEnvironmentAlertingConfigUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment alerting config unauthorized response has a 5xx status code +func (o *GetEnvironmentAlertingConfigUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment alerting config unauthorized response a status code equal to that given +func (o *GetEnvironmentAlertingConfigUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get environment alerting config unauthorized response +func (o *GetEnvironmentAlertingConfigUnauthorized) Code() int { + return 401 +} + +func (o *GetEnvironmentAlertingConfigUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigUnauthorized ", 401) +} + +func (o *GetEnvironmentAlertingConfigUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigUnauthorized ", 401) +} + +func (o *GetEnvironmentAlertingConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetEnvironmentAlertingConfigForbidden creates a GetEnvironmentAlertingConfigForbidden with default headers values +func NewGetEnvironmentAlertingConfigForbidden() *GetEnvironmentAlertingConfigForbidden { + return &GetEnvironmentAlertingConfigForbidden{} +} + +/* +GetEnvironmentAlertingConfigForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetEnvironmentAlertingConfigForbidden struct { +} + +// IsSuccess returns true when this get environment alerting config forbidden response has a 2xx status code +func (o *GetEnvironmentAlertingConfigForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment alerting config forbidden response has a 3xx status code +func (o *GetEnvironmentAlertingConfigForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment alerting config forbidden response has a 4xx status code +func (o *GetEnvironmentAlertingConfigForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment alerting config forbidden response has a 5xx status code +func (o *GetEnvironmentAlertingConfigForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment alerting config forbidden response a status code equal to that given +func (o *GetEnvironmentAlertingConfigForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get environment alerting config forbidden response +func (o *GetEnvironmentAlertingConfigForbidden) Code() int { + return 403 +} + +func (o *GetEnvironmentAlertingConfigForbidden) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigForbidden ", 403) +} + +func (o *GetEnvironmentAlertingConfigForbidden) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigForbidden ", 403) +} + +func (o *GetEnvironmentAlertingConfigForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetEnvironmentAlertingConfigNotFound creates a GetEnvironmentAlertingConfigNotFound with default headers values +func NewGetEnvironmentAlertingConfigNotFound() *GetEnvironmentAlertingConfigNotFound { + return &GetEnvironmentAlertingConfigNotFound{} +} + +/* +GetEnvironmentAlertingConfigNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetEnvironmentAlertingConfigNotFound struct { +} + +// IsSuccess returns true when this get environment alerting config not found response has a 2xx status code +func (o *GetEnvironmentAlertingConfigNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment alerting config not found response has a 3xx status code +func (o *GetEnvironmentAlertingConfigNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment alerting config not found response has a 4xx status code +func (o *GetEnvironmentAlertingConfigNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment alerting config not found response has a 5xx status code +func (o *GetEnvironmentAlertingConfigNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment alerting config not found response a status code equal to that given +func (o *GetEnvironmentAlertingConfigNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get environment alerting config not found response +func (o *GetEnvironmentAlertingConfigNotFound) Code() int { + return 404 +} + +func (o *GetEnvironmentAlertingConfigNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigNotFound ", 404) +} + +func (o *GetEnvironmentAlertingConfigNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigNotFound ", 404) +} + +func (o *GetEnvironmentAlertingConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetEnvironmentAlertingConfigInternalServerError creates a GetEnvironmentAlertingConfigInternalServerError with default headers values +func NewGetEnvironmentAlertingConfigInternalServerError() *GetEnvironmentAlertingConfigInternalServerError { + return &GetEnvironmentAlertingConfigInternalServerError{} +} + +/* +GetEnvironmentAlertingConfigInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetEnvironmentAlertingConfigInternalServerError struct { +} + +// IsSuccess returns true when this get environment alerting config internal server error response has a 2xx status code +func (o *GetEnvironmentAlertingConfigInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment alerting config internal server error response has a 3xx status code +func (o *GetEnvironmentAlertingConfigInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment alerting config internal server error response has a 4xx status code +func (o *GetEnvironmentAlertingConfigInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get environment alerting config internal server error response has a 5xx status code +func (o *GetEnvironmentAlertingConfigInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get environment alerting config internal server error response a status code equal to that given +func (o *GetEnvironmentAlertingConfigInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get environment alerting config internal server error response +func (o *GetEnvironmentAlertingConfigInternalServerError) Code() int { + return 500 +} + +func (o *GetEnvironmentAlertingConfigInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigInternalServerError ", 500) +} + +func (o *GetEnvironmentAlertingConfigInternalServerError) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/alerting][%d] getEnvironmentAlertingConfigInternalServerError ", 500) +} + +func (o *GetEnvironmentAlertingConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/get_environment_events_parameters.go b/generated-client/client/environment/get_environment_events_parameters.go new file mode 100644 index 0000000..50f6f18 --- /dev/null +++ b/generated-client/client/environment/get_environment_events_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetEnvironmentEventsParams creates a new GetEnvironmentEventsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetEnvironmentEventsParams() *GetEnvironmentEventsParams { + return &GetEnvironmentEventsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetEnvironmentEventsParamsWithTimeout creates a new GetEnvironmentEventsParams object +// with the ability to set a timeout on a request. +func NewGetEnvironmentEventsParamsWithTimeout(timeout time.Duration) *GetEnvironmentEventsParams { + return &GetEnvironmentEventsParams{ + timeout: timeout, + } +} + +// NewGetEnvironmentEventsParamsWithContext creates a new GetEnvironmentEventsParams object +// with the ability to set a context for a request. +func NewGetEnvironmentEventsParamsWithContext(ctx context.Context) *GetEnvironmentEventsParams { + return &GetEnvironmentEventsParams{ + Context: ctx, + } +} + +// NewGetEnvironmentEventsParamsWithHTTPClient creates a new GetEnvironmentEventsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetEnvironmentEventsParamsWithHTTPClient(client *http.Client) *GetEnvironmentEventsParams { + return &GetEnvironmentEventsParams{ + HTTPClient: client, + } +} + +/* +GetEnvironmentEventsParams contains all the parameters to send to the API endpoint + + for the get environment events operation. + + Typically these are written to a http.Request. +*/ +type GetEnvironmentEventsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* EnvName. + + name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get environment events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentEventsParams) WithDefaults() *GetEnvironmentEventsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get environment events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentEventsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get environment events params +func (o *GetEnvironmentEventsParams) WithTimeout(timeout time.Duration) *GetEnvironmentEventsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get environment events params +func (o *GetEnvironmentEventsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get environment events params +func (o *GetEnvironmentEventsParams) WithContext(ctx context.Context) *GetEnvironmentEventsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get environment events params +func (o *GetEnvironmentEventsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get environment events params +func (o *GetEnvironmentEventsParams) WithHTTPClient(client *http.Client) *GetEnvironmentEventsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get environment events params +func (o *GetEnvironmentEventsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get environment events params +func (o *GetEnvironmentEventsParams) WithImpersonateGroup(impersonateGroup []string) *GetEnvironmentEventsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get environment events params +func (o *GetEnvironmentEventsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get environment events params +func (o *GetEnvironmentEventsParams) WithImpersonateUser(impersonateUser *string) *GetEnvironmentEventsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get environment events params +func (o *GetEnvironmentEventsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get environment events params +func (o *GetEnvironmentEventsParams) WithAppName(appName string) *GetEnvironmentEventsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get environment events params +func (o *GetEnvironmentEventsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get environment events params +func (o *GetEnvironmentEventsParams) WithEnvName(envName string) *GetEnvironmentEventsParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get environment events params +func (o *GetEnvironmentEventsParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEnvironmentEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetEnvironmentEvents binds the parameter Impersonate-Group +func (o *GetEnvironmentEventsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/get_environment_events_responses.go b/generated-client/client/environment/get_environment_events_responses.go new file mode 100644 index 0000000..3176a46 --- /dev/null +++ b/generated-client/client/environment/get_environment_events_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetEnvironmentEventsReader is a Reader for the GetEnvironmentEvents structure. +type GetEnvironmentEventsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEnvironmentEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEnvironmentEventsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetEnvironmentEventsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetEnvironmentEventsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/events] getEnvironmentEvents", response, response.Code()) + } +} + +// NewGetEnvironmentEventsOK creates a GetEnvironmentEventsOK with default headers values +func NewGetEnvironmentEventsOK() *GetEnvironmentEventsOK { + return &GetEnvironmentEventsOK{} +} + +/* +GetEnvironmentEventsOK describes a response with status code 200, with default header values. + +Successful get environment events +*/ +type GetEnvironmentEventsOK struct { + Payload *models.Event +} + +// IsSuccess returns true when this get environment events o k response has a 2xx status code +func (o *GetEnvironmentEventsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get environment events o k response has a 3xx status code +func (o *GetEnvironmentEventsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment events o k response has a 4xx status code +func (o *GetEnvironmentEventsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get environment events o k response has a 5xx status code +func (o *GetEnvironmentEventsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment events o k response a status code equal to that given +func (o *GetEnvironmentEventsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get environment events o k response +func (o *GetEnvironmentEventsOK) Code() int { + return 200 +} + +func (o *GetEnvironmentEventsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/events][%d] getEnvironmentEventsOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentEventsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/events][%d] getEnvironmentEventsOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentEventsOK) GetPayload() *models.Event { + return o.Payload +} + +func (o *GetEnvironmentEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Event) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEnvironmentEventsUnauthorized creates a GetEnvironmentEventsUnauthorized with default headers values +func NewGetEnvironmentEventsUnauthorized() *GetEnvironmentEventsUnauthorized { + return &GetEnvironmentEventsUnauthorized{} +} + +/* +GetEnvironmentEventsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetEnvironmentEventsUnauthorized struct { +} + +// IsSuccess returns true when this get environment events unauthorized response has a 2xx status code +func (o *GetEnvironmentEventsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment events unauthorized response has a 3xx status code +func (o *GetEnvironmentEventsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment events unauthorized response has a 4xx status code +func (o *GetEnvironmentEventsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment events unauthorized response has a 5xx status code +func (o *GetEnvironmentEventsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment events unauthorized response a status code equal to that given +func (o *GetEnvironmentEventsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get environment events unauthorized response +func (o *GetEnvironmentEventsUnauthorized) Code() int { + return 401 +} + +func (o *GetEnvironmentEventsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/events][%d] getEnvironmentEventsUnauthorized ", 401) +} + +func (o *GetEnvironmentEventsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/events][%d] getEnvironmentEventsUnauthorized ", 401) +} + +func (o *GetEnvironmentEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetEnvironmentEventsNotFound creates a GetEnvironmentEventsNotFound with default headers values +func NewGetEnvironmentEventsNotFound() *GetEnvironmentEventsNotFound { + return &GetEnvironmentEventsNotFound{} +} + +/* +GetEnvironmentEventsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetEnvironmentEventsNotFound struct { +} + +// IsSuccess returns true when this get environment events not found response has a 2xx status code +func (o *GetEnvironmentEventsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment events not found response has a 3xx status code +func (o *GetEnvironmentEventsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment events not found response has a 4xx status code +func (o *GetEnvironmentEventsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment events not found response has a 5xx status code +func (o *GetEnvironmentEventsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment events not found response a status code equal to that given +func (o *GetEnvironmentEventsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get environment events not found response +func (o *GetEnvironmentEventsNotFound) Code() int { + return 404 +} + +func (o *GetEnvironmentEventsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/events][%d] getEnvironmentEventsNotFound ", 404) +} + +func (o *GetEnvironmentEventsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/events][%d] getEnvironmentEventsNotFound ", 404) +} + +func (o *GetEnvironmentEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/get_environment_parameters.go b/generated-client/client/environment/get_environment_parameters.go new file mode 100644 index 0000000..54ccbc3 --- /dev/null +++ b/generated-client/client/environment/get_environment_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetEnvironmentParams creates a new GetEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetEnvironmentParams() *GetEnvironmentParams { + return &GetEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetEnvironmentParamsWithTimeout creates a new GetEnvironmentParams object +// with the ability to set a timeout on a request. +func NewGetEnvironmentParamsWithTimeout(timeout time.Duration) *GetEnvironmentParams { + return &GetEnvironmentParams{ + timeout: timeout, + } +} + +// NewGetEnvironmentParamsWithContext creates a new GetEnvironmentParams object +// with the ability to set a context for a request. +func NewGetEnvironmentParamsWithContext(ctx context.Context) *GetEnvironmentParams { + return &GetEnvironmentParams{ + Context: ctx, + } +} + +// NewGetEnvironmentParamsWithHTTPClient creates a new GetEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetEnvironmentParamsWithHTTPClient(client *http.Client) *GetEnvironmentParams { + return &GetEnvironmentParams{ + HTTPClient: client, + } +} + +/* +GetEnvironmentParams contains all the parameters to send to the API endpoint + + for the get environment operation. + + Typically these are written to a http.Request. +*/ +type GetEnvironmentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* EnvName. + + name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentParams) WithDefaults() *GetEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get environment params +func (o *GetEnvironmentParams) WithTimeout(timeout time.Duration) *GetEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get environment params +func (o *GetEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get environment params +func (o *GetEnvironmentParams) WithContext(ctx context.Context) *GetEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get environment params +func (o *GetEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get environment params +func (o *GetEnvironmentParams) WithHTTPClient(client *http.Client) *GetEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get environment params +func (o *GetEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get environment params +func (o *GetEnvironmentParams) WithImpersonateGroup(impersonateGroup []string) *GetEnvironmentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get environment params +func (o *GetEnvironmentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get environment params +func (o *GetEnvironmentParams) WithImpersonateUser(impersonateUser *string) *GetEnvironmentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get environment params +func (o *GetEnvironmentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get environment params +func (o *GetEnvironmentParams) WithAppName(appName string) *GetEnvironmentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get environment params +func (o *GetEnvironmentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get environment params +func (o *GetEnvironmentParams) WithEnvName(envName string) *GetEnvironmentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get environment params +func (o *GetEnvironmentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetEnvironment binds the parameter Impersonate-Group +func (o *GetEnvironmentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/get_environment_responses.go b/generated-client/client/environment/get_environment_responses.go new file mode 100644 index 0000000..22c4402 --- /dev/null +++ b/generated-client/client/environment/get_environment_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetEnvironmentReader is a Reader for the GetEnvironment structure. +type GetEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetEnvironmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetEnvironmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}] getEnvironment", response, response.Code()) + } +} + +// NewGetEnvironmentOK creates a GetEnvironmentOK with default headers values +func NewGetEnvironmentOK() *GetEnvironmentOK { + return &GetEnvironmentOK{} +} + +/* +GetEnvironmentOK describes a response with status code 200, with default header values. + +Successful get environment +*/ +type GetEnvironmentOK struct { + Payload *models.Environment +} + +// IsSuccess returns true when this get environment o k response has a 2xx status code +func (o *GetEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get environment o k response has a 3xx status code +func (o *GetEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment o k response has a 4xx status code +func (o *GetEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get environment o k response has a 5xx status code +func (o *GetEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment o k response a status code equal to that given +func (o *GetEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get environment o k response +func (o *GetEnvironmentOK) Code() int { + return 200 +} + +func (o *GetEnvironmentOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}][%d] getEnvironmentOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}][%d] getEnvironmentOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentOK) GetPayload() *models.Environment { + return o.Payload +} + +func (o *GetEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Environment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEnvironmentUnauthorized creates a GetEnvironmentUnauthorized with default headers values +func NewGetEnvironmentUnauthorized() *GetEnvironmentUnauthorized { + return &GetEnvironmentUnauthorized{} +} + +/* +GetEnvironmentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetEnvironmentUnauthorized struct { +} + +// IsSuccess returns true when this get environment unauthorized response has a 2xx status code +func (o *GetEnvironmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment unauthorized response has a 3xx status code +func (o *GetEnvironmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment unauthorized response has a 4xx status code +func (o *GetEnvironmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment unauthorized response has a 5xx status code +func (o *GetEnvironmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment unauthorized response a status code equal to that given +func (o *GetEnvironmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get environment unauthorized response +func (o *GetEnvironmentUnauthorized) Code() int { + return 401 +} + +func (o *GetEnvironmentUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}][%d] getEnvironmentUnauthorized ", 401) +} + +func (o *GetEnvironmentUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}][%d] getEnvironmentUnauthorized ", 401) +} + +func (o *GetEnvironmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetEnvironmentNotFound creates a GetEnvironmentNotFound with default headers values +func NewGetEnvironmentNotFound() *GetEnvironmentNotFound { + return &GetEnvironmentNotFound{} +} + +/* +GetEnvironmentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetEnvironmentNotFound struct { +} + +// IsSuccess returns true when this get environment not found response has a 2xx status code +func (o *GetEnvironmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment not found response has a 3xx status code +func (o *GetEnvironmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment not found response has a 4xx status code +func (o *GetEnvironmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment not found response has a 5xx status code +func (o *GetEnvironmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment not found response a status code equal to that given +func (o *GetEnvironmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get environment not found response +func (o *GetEnvironmentNotFound) Code() int { + return 404 +} + +func (o *GetEnvironmentNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}][%d] getEnvironmentNotFound ", 404) +} + +func (o *GetEnvironmentNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}][%d] getEnvironmentNotFound ", 404) +} + +func (o *GetEnvironmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/get_environment_summary_parameters.go b/generated-client/client/environment/get_environment_summary_parameters.go new file mode 100644 index 0000000..75c9caa --- /dev/null +++ b/generated-client/client/environment/get_environment_summary_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetEnvironmentSummaryParams creates a new GetEnvironmentSummaryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetEnvironmentSummaryParams() *GetEnvironmentSummaryParams { + return &GetEnvironmentSummaryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetEnvironmentSummaryParamsWithTimeout creates a new GetEnvironmentSummaryParams object +// with the ability to set a timeout on a request. +func NewGetEnvironmentSummaryParamsWithTimeout(timeout time.Duration) *GetEnvironmentSummaryParams { + return &GetEnvironmentSummaryParams{ + timeout: timeout, + } +} + +// NewGetEnvironmentSummaryParamsWithContext creates a new GetEnvironmentSummaryParams object +// with the ability to set a context for a request. +func NewGetEnvironmentSummaryParamsWithContext(ctx context.Context) *GetEnvironmentSummaryParams { + return &GetEnvironmentSummaryParams{ + Context: ctx, + } +} + +// NewGetEnvironmentSummaryParamsWithHTTPClient creates a new GetEnvironmentSummaryParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetEnvironmentSummaryParamsWithHTTPClient(client *http.Client) *GetEnvironmentSummaryParams { + return &GetEnvironmentSummaryParams{ + HTTPClient: client, + } +} + +/* +GetEnvironmentSummaryParams contains all the parameters to send to the API endpoint + + for the get environment summary operation. + + Typically these are written to a http.Request. +*/ +type GetEnvironmentSummaryParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get environment summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentSummaryParams) WithDefaults() *GetEnvironmentSummaryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get environment summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentSummaryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get environment summary params +func (o *GetEnvironmentSummaryParams) WithTimeout(timeout time.Duration) *GetEnvironmentSummaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get environment summary params +func (o *GetEnvironmentSummaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get environment summary params +func (o *GetEnvironmentSummaryParams) WithContext(ctx context.Context) *GetEnvironmentSummaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get environment summary params +func (o *GetEnvironmentSummaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get environment summary params +func (o *GetEnvironmentSummaryParams) WithHTTPClient(client *http.Client) *GetEnvironmentSummaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get environment summary params +func (o *GetEnvironmentSummaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get environment summary params +func (o *GetEnvironmentSummaryParams) WithImpersonateGroup(impersonateGroup []string) *GetEnvironmentSummaryParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get environment summary params +func (o *GetEnvironmentSummaryParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get environment summary params +func (o *GetEnvironmentSummaryParams) WithImpersonateUser(impersonateUser *string) *GetEnvironmentSummaryParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get environment summary params +func (o *GetEnvironmentSummaryParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get environment summary params +func (o *GetEnvironmentSummaryParams) WithAppName(appName string) *GetEnvironmentSummaryParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get environment summary params +func (o *GetEnvironmentSummaryParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEnvironmentSummaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetEnvironmentSummary binds the parameter Impersonate-Group +func (o *GetEnvironmentSummaryParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/get_environment_summary_responses.go b/generated-client/client/environment/get_environment_summary_responses.go new file mode 100644 index 0000000..0eb006c --- /dev/null +++ b/generated-client/client/environment/get_environment_summary_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetEnvironmentSummaryReader is a Reader for the GetEnvironmentSummary structure. +type GetEnvironmentSummaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEnvironmentSummaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEnvironmentSummaryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetEnvironmentSummaryUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetEnvironmentSummaryNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments] getEnvironmentSummary", response, response.Code()) + } +} + +// NewGetEnvironmentSummaryOK creates a GetEnvironmentSummaryOK with default headers values +func NewGetEnvironmentSummaryOK() *GetEnvironmentSummaryOK { + return &GetEnvironmentSummaryOK{} +} + +/* +GetEnvironmentSummaryOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetEnvironmentSummaryOK struct { + Payload []*models.EnvironmentSummary +} + +// IsSuccess returns true when this get environment summary o k response has a 2xx status code +func (o *GetEnvironmentSummaryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get environment summary o k response has a 3xx status code +func (o *GetEnvironmentSummaryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment summary o k response has a 4xx status code +func (o *GetEnvironmentSummaryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get environment summary o k response has a 5xx status code +func (o *GetEnvironmentSummaryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment summary o k response a status code equal to that given +func (o *GetEnvironmentSummaryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get environment summary o k response +func (o *GetEnvironmentSummaryOK) Code() int { + return 200 +} + +func (o *GetEnvironmentSummaryOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments][%d] getEnvironmentSummaryOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentSummaryOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments][%d] getEnvironmentSummaryOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentSummaryOK) GetPayload() []*models.EnvironmentSummary { + return o.Payload +} + +func (o *GetEnvironmentSummaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEnvironmentSummaryUnauthorized creates a GetEnvironmentSummaryUnauthorized with default headers values +func NewGetEnvironmentSummaryUnauthorized() *GetEnvironmentSummaryUnauthorized { + return &GetEnvironmentSummaryUnauthorized{} +} + +/* +GetEnvironmentSummaryUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetEnvironmentSummaryUnauthorized struct { +} + +// IsSuccess returns true when this get environment summary unauthorized response has a 2xx status code +func (o *GetEnvironmentSummaryUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment summary unauthorized response has a 3xx status code +func (o *GetEnvironmentSummaryUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment summary unauthorized response has a 4xx status code +func (o *GetEnvironmentSummaryUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment summary unauthorized response has a 5xx status code +func (o *GetEnvironmentSummaryUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment summary unauthorized response a status code equal to that given +func (o *GetEnvironmentSummaryUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get environment summary unauthorized response +func (o *GetEnvironmentSummaryUnauthorized) Code() int { + return 401 +} + +func (o *GetEnvironmentSummaryUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments][%d] getEnvironmentSummaryUnauthorized ", 401) +} + +func (o *GetEnvironmentSummaryUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments][%d] getEnvironmentSummaryUnauthorized ", 401) +} + +func (o *GetEnvironmentSummaryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetEnvironmentSummaryNotFound creates a GetEnvironmentSummaryNotFound with default headers values +func NewGetEnvironmentSummaryNotFound() *GetEnvironmentSummaryNotFound { + return &GetEnvironmentSummaryNotFound{} +} + +/* +GetEnvironmentSummaryNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetEnvironmentSummaryNotFound struct { +} + +// IsSuccess returns true when this get environment summary not found response has a 2xx status code +func (o *GetEnvironmentSummaryNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get environment summary not found response has a 3xx status code +func (o *GetEnvironmentSummaryNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment summary not found response has a 4xx status code +func (o *GetEnvironmentSummaryNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get environment summary not found response has a 5xx status code +func (o *GetEnvironmentSummaryNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment summary not found response a status code equal to that given +func (o *GetEnvironmentSummaryNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get environment summary not found response +func (o *GetEnvironmentSummaryNotFound) Code() int { + return 404 +} + +func (o *GetEnvironmentSummaryNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments][%d] getEnvironmentSummaryNotFound ", 404) +} + +func (o *GetEnvironmentSummaryNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments][%d] getEnvironmentSummaryNotFound ", 404) +} + +func (o *GetEnvironmentSummaryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/restart_environment_parameters.go b/generated-client/client/environment/restart_environment_parameters.go new file mode 100644 index 0000000..bf77112 --- /dev/null +++ b/generated-client/client/environment/restart_environment_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRestartEnvironmentParams creates a new RestartEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRestartEnvironmentParams() *RestartEnvironmentParams { + return &RestartEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRestartEnvironmentParamsWithTimeout creates a new RestartEnvironmentParams object +// with the ability to set a timeout on a request. +func NewRestartEnvironmentParamsWithTimeout(timeout time.Duration) *RestartEnvironmentParams { + return &RestartEnvironmentParams{ + timeout: timeout, + } +} + +// NewRestartEnvironmentParamsWithContext creates a new RestartEnvironmentParams object +// with the ability to set a context for a request. +func NewRestartEnvironmentParamsWithContext(ctx context.Context) *RestartEnvironmentParams { + return &RestartEnvironmentParams{ + Context: ctx, + } +} + +// NewRestartEnvironmentParamsWithHTTPClient creates a new RestartEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewRestartEnvironmentParamsWithHTTPClient(client *http.Client) *RestartEnvironmentParams { + return &RestartEnvironmentParams{ + HTTPClient: client, + } +} + +/* +RestartEnvironmentParams contains all the parameters to send to the API endpoint + + for the restart environment operation. + + Typically these are written to a http.Request. +*/ +type RestartEnvironmentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the restart environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartEnvironmentParams) WithDefaults() *RestartEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the restart environment params +func (o *RestartEnvironmentParams) WithTimeout(timeout time.Duration) *RestartEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restart environment params +func (o *RestartEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restart environment params +func (o *RestartEnvironmentParams) WithContext(ctx context.Context) *RestartEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restart environment params +func (o *RestartEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restart environment params +func (o *RestartEnvironmentParams) WithHTTPClient(client *http.Client) *RestartEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restart environment params +func (o *RestartEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the restart environment params +func (o *RestartEnvironmentParams) WithImpersonateGroup(impersonateGroup []string) *RestartEnvironmentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the restart environment params +func (o *RestartEnvironmentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the restart environment params +func (o *RestartEnvironmentParams) WithImpersonateUser(impersonateUser *string) *RestartEnvironmentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the restart environment params +func (o *RestartEnvironmentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the restart environment params +func (o *RestartEnvironmentParams) WithAppName(appName string) *RestartEnvironmentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the restart environment params +func (o *RestartEnvironmentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the restart environment params +func (o *RestartEnvironmentParams) WithEnvName(envName string) *RestartEnvironmentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the restart environment params +func (o *RestartEnvironmentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *RestartEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRestartEnvironment binds the parameter Impersonate-Group +func (o *RestartEnvironmentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/restart_environment_responses.go b/generated-client/client/environment/restart_environment_responses.go new file mode 100644 index 0000000..451e218 --- /dev/null +++ b/generated-client/client/environment/restart_environment_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RestartEnvironmentReader is a Reader for the RestartEnvironment structure. +type RestartEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestartEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRestartEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewRestartEnvironmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewRestartEnvironmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRestartEnvironmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/restart] restartEnvironment", response, response.Code()) + } +} + +// NewRestartEnvironmentOK creates a RestartEnvironmentOK with default headers values +func NewRestartEnvironmentOK() *RestartEnvironmentOK { + return &RestartEnvironmentOK{} +} + +/* +RestartEnvironmentOK describes a response with status code 200, with default header values. + +Environment started ok +*/ +type RestartEnvironmentOK struct { +} + +// IsSuccess returns true when this restart environment o k response has a 2xx status code +func (o *RestartEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this restart environment o k response has a 3xx status code +func (o *RestartEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart environment o k response has a 4xx status code +func (o *RestartEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this restart environment o k response has a 5xx status code +func (o *RestartEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this restart environment o k response a status code equal to that given +func (o *RestartEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the restart environment o k response +func (o *RestartEnvironmentOK) Code() int { + return 200 +} + +func (o *RestartEnvironmentOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentOK ", 200) +} + +func (o *RestartEnvironmentOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentOK ", 200) +} + +func (o *RestartEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartEnvironmentUnauthorized creates a RestartEnvironmentUnauthorized with default headers values +func NewRestartEnvironmentUnauthorized() *RestartEnvironmentUnauthorized { + return &RestartEnvironmentUnauthorized{} +} + +/* +RestartEnvironmentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RestartEnvironmentUnauthorized struct { +} + +// IsSuccess returns true when this restart environment unauthorized response has a 2xx status code +func (o *RestartEnvironmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart environment unauthorized response has a 3xx status code +func (o *RestartEnvironmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart environment unauthorized response has a 4xx status code +func (o *RestartEnvironmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart environment unauthorized response has a 5xx status code +func (o *RestartEnvironmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this restart environment unauthorized response a status code equal to that given +func (o *RestartEnvironmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the restart environment unauthorized response +func (o *RestartEnvironmentUnauthorized) Code() int { + return 401 +} + +func (o *RestartEnvironmentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentUnauthorized ", 401) +} + +func (o *RestartEnvironmentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentUnauthorized ", 401) +} + +func (o *RestartEnvironmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartEnvironmentForbidden creates a RestartEnvironmentForbidden with default headers values +func NewRestartEnvironmentForbidden() *RestartEnvironmentForbidden { + return &RestartEnvironmentForbidden{} +} + +/* +RestartEnvironmentForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type RestartEnvironmentForbidden struct { +} + +// IsSuccess returns true when this restart environment forbidden response has a 2xx status code +func (o *RestartEnvironmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart environment forbidden response has a 3xx status code +func (o *RestartEnvironmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart environment forbidden response has a 4xx status code +func (o *RestartEnvironmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart environment forbidden response has a 5xx status code +func (o *RestartEnvironmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this restart environment forbidden response a status code equal to that given +func (o *RestartEnvironmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the restart environment forbidden response +func (o *RestartEnvironmentForbidden) Code() int { + return 403 +} + +func (o *RestartEnvironmentForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentForbidden ", 403) +} + +func (o *RestartEnvironmentForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentForbidden ", 403) +} + +func (o *RestartEnvironmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartEnvironmentNotFound creates a RestartEnvironmentNotFound with default headers values +func NewRestartEnvironmentNotFound() *RestartEnvironmentNotFound { + return &RestartEnvironmentNotFound{} +} + +/* +RestartEnvironmentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RestartEnvironmentNotFound struct { +} + +// IsSuccess returns true when this restart environment not found response has a 2xx status code +func (o *RestartEnvironmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart environment not found response has a 3xx status code +func (o *RestartEnvironmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart environment not found response has a 4xx status code +func (o *RestartEnvironmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart environment not found response has a 5xx status code +func (o *RestartEnvironmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this restart environment not found response a status code equal to that given +func (o *RestartEnvironmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the restart environment not found response +func (o *RestartEnvironmentNotFound) Code() int { + return 404 +} + +func (o *RestartEnvironmentNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentNotFound ", 404) +} + +func (o *RestartEnvironmentNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/restart][%d] restartEnvironmentNotFound ", 404) +} + +func (o *RestartEnvironmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/start_environment_parameters.go b/generated-client/client/environment/start_environment_parameters.go new file mode 100644 index 0000000..60f71eb --- /dev/null +++ b/generated-client/client/environment/start_environment_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStartEnvironmentParams creates a new StartEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStartEnvironmentParams() *StartEnvironmentParams { + return &StartEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStartEnvironmentParamsWithTimeout creates a new StartEnvironmentParams object +// with the ability to set a timeout on a request. +func NewStartEnvironmentParamsWithTimeout(timeout time.Duration) *StartEnvironmentParams { + return &StartEnvironmentParams{ + timeout: timeout, + } +} + +// NewStartEnvironmentParamsWithContext creates a new StartEnvironmentParams object +// with the ability to set a context for a request. +func NewStartEnvironmentParamsWithContext(ctx context.Context) *StartEnvironmentParams { + return &StartEnvironmentParams{ + Context: ctx, + } +} + +// NewStartEnvironmentParamsWithHTTPClient creates a new StartEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewStartEnvironmentParamsWithHTTPClient(client *http.Client) *StartEnvironmentParams { + return &StartEnvironmentParams{ + HTTPClient: client, + } +} + +/* +StartEnvironmentParams contains all the parameters to send to the API endpoint + + for the start environment operation. + + Typically these are written to a http.Request. +*/ +type StartEnvironmentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the start environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartEnvironmentParams) WithDefaults() *StartEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the start environment params +func (o *StartEnvironmentParams) WithTimeout(timeout time.Duration) *StartEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the start environment params +func (o *StartEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the start environment params +func (o *StartEnvironmentParams) WithContext(ctx context.Context) *StartEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the start environment params +func (o *StartEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the start environment params +func (o *StartEnvironmentParams) WithHTTPClient(client *http.Client) *StartEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the start environment params +func (o *StartEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the start environment params +func (o *StartEnvironmentParams) WithImpersonateGroup(impersonateGroup []string) *StartEnvironmentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the start environment params +func (o *StartEnvironmentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the start environment params +func (o *StartEnvironmentParams) WithImpersonateUser(impersonateUser *string) *StartEnvironmentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the start environment params +func (o *StartEnvironmentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the start environment params +func (o *StartEnvironmentParams) WithAppName(appName string) *StartEnvironmentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the start environment params +func (o *StartEnvironmentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the start environment params +func (o *StartEnvironmentParams) WithEnvName(envName string) *StartEnvironmentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the start environment params +func (o *StartEnvironmentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *StartEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStartEnvironment binds the parameter Impersonate-Group +func (o *StartEnvironmentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/start_environment_responses.go b/generated-client/client/environment/start_environment_responses.go new file mode 100644 index 0000000..a44a6bb --- /dev/null +++ b/generated-client/client/environment/start_environment_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StartEnvironmentReader is a Reader for the StartEnvironment structure. +type StartEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StartEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStartEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewStartEnvironmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStartEnvironmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/start] startEnvironment", response, response.Code()) + } +} + +// NewStartEnvironmentOK creates a StartEnvironmentOK with default headers values +func NewStartEnvironmentOK() *StartEnvironmentOK { + return &StartEnvironmentOK{} +} + +/* +StartEnvironmentOK describes a response with status code 200, with default header values. + +Environment started ok +*/ +type StartEnvironmentOK struct { +} + +// IsSuccess returns true when this start environment o k response has a 2xx status code +func (o *StartEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this start environment o k response has a 3xx status code +func (o *StartEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start environment o k response has a 4xx status code +func (o *StartEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this start environment o k response has a 5xx status code +func (o *StartEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this start environment o k response a status code equal to that given +func (o *StartEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the start environment o k response +func (o *StartEnvironmentOK) Code() int { + return 200 +} + +func (o *StartEnvironmentOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/start][%d] startEnvironmentOK ", 200) +} + +func (o *StartEnvironmentOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/start][%d] startEnvironmentOK ", 200) +} + +func (o *StartEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStartEnvironmentUnauthorized creates a StartEnvironmentUnauthorized with default headers values +func NewStartEnvironmentUnauthorized() *StartEnvironmentUnauthorized { + return &StartEnvironmentUnauthorized{} +} + +/* +StartEnvironmentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StartEnvironmentUnauthorized struct { +} + +// IsSuccess returns true when this start environment unauthorized response has a 2xx status code +func (o *StartEnvironmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this start environment unauthorized response has a 3xx status code +func (o *StartEnvironmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start environment unauthorized response has a 4xx status code +func (o *StartEnvironmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this start environment unauthorized response has a 5xx status code +func (o *StartEnvironmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this start environment unauthorized response a status code equal to that given +func (o *StartEnvironmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the start environment unauthorized response +func (o *StartEnvironmentUnauthorized) Code() int { + return 401 +} + +func (o *StartEnvironmentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/start][%d] startEnvironmentUnauthorized ", 401) +} + +func (o *StartEnvironmentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/start][%d] startEnvironmentUnauthorized ", 401) +} + +func (o *StartEnvironmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStartEnvironmentNotFound creates a StartEnvironmentNotFound with default headers values +func NewStartEnvironmentNotFound() *StartEnvironmentNotFound { + return &StartEnvironmentNotFound{} +} + +/* +StartEnvironmentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StartEnvironmentNotFound struct { +} + +// IsSuccess returns true when this start environment not found response has a 2xx status code +func (o *StartEnvironmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this start environment not found response has a 3xx status code +func (o *StartEnvironmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this start environment not found response has a 4xx status code +func (o *StartEnvironmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this start environment not found response has a 5xx status code +func (o *StartEnvironmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this start environment not found response a status code equal to that given +func (o *StartEnvironmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the start environment not found response +func (o *StartEnvironmentNotFound) Code() int { + return 404 +} + +func (o *StartEnvironmentNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/start][%d] startEnvironmentNotFound ", 404) +} + +func (o *StartEnvironmentNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/start][%d] startEnvironmentNotFound ", 404) +} + +func (o *StartEnvironmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/stop_environment_parameters.go b/generated-client/client/environment/stop_environment_parameters.go new file mode 100644 index 0000000..3cd7561 --- /dev/null +++ b/generated-client/client/environment/stop_environment_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStopEnvironmentParams creates a new StopEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStopEnvironmentParams() *StopEnvironmentParams { + return &StopEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStopEnvironmentParamsWithTimeout creates a new StopEnvironmentParams object +// with the ability to set a timeout on a request. +func NewStopEnvironmentParamsWithTimeout(timeout time.Duration) *StopEnvironmentParams { + return &StopEnvironmentParams{ + timeout: timeout, + } +} + +// NewStopEnvironmentParamsWithContext creates a new StopEnvironmentParams object +// with the ability to set a context for a request. +func NewStopEnvironmentParamsWithContext(ctx context.Context) *StopEnvironmentParams { + return &StopEnvironmentParams{ + Context: ctx, + } +} + +// NewStopEnvironmentParamsWithHTTPClient creates a new StopEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewStopEnvironmentParamsWithHTTPClient(client *http.Client) *StopEnvironmentParams { + return &StopEnvironmentParams{ + HTTPClient: client, + } +} + +/* +StopEnvironmentParams contains all the parameters to send to the API endpoint + + for the stop environment operation. + + Typically these are written to a http.Request. +*/ +type StopEnvironmentParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stop environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopEnvironmentParams) WithDefaults() *StopEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stop environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stop environment params +func (o *StopEnvironmentParams) WithTimeout(timeout time.Duration) *StopEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stop environment params +func (o *StopEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stop environment params +func (o *StopEnvironmentParams) WithContext(ctx context.Context) *StopEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stop environment params +func (o *StopEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stop environment params +func (o *StopEnvironmentParams) WithHTTPClient(client *http.Client) *StopEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stop environment params +func (o *StopEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the stop environment params +func (o *StopEnvironmentParams) WithImpersonateGroup(impersonateGroup []string) *StopEnvironmentParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the stop environment params +func (o *StopEnvironmentParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the stop environment params +func (o *StopEnvironmentParams) WithImpersonateUser(impersonateUser *string) *StopEnvironmentParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the stop environment params +func (o *StopEnvironmentParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the stop environment params +func (o *StopEnvironmentParams) WithAppName(appName string) *StopEnvironmentParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the stop environment params +func (o *StopEnvironmentParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the stop environment params +func (o *StopEnvironmentParams) WithEnvName(envName string) *StopEnvironmentParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the stop environment params +func (o *StopEnvironmentParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *StopEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStopEnvironment binds the parameter Impersonate-Group +func (o *StopEnvironmentParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/stop_environment_responses.go b/generated-client/client/environment/stop_environment_responses.go new file mode 100644 index 0000000..312dc8a --- /dev/null +++ b/generated-client/client/environment/stop_environment_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StopEnvironmentReader is a Reader for the StopEnvironment structure. +type StopEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StopEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStopEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewStopEnvironmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStopEnvironmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/stop] stopEnvironment", response, response.Code()) + } +} + +// NewStopEnvironmentOK creates a StopEnvironmentOK with default headers values +func NewStopEnvironmentOK() *StopEnvironmentOK { + return &StopEnvironmentOK{} +} + +/* +StopEnvironmentOK describes a response with status code 200, with default header values. + +Environment stopped ok +*/ +type StopEnvironmentOK struct { +} + +// IsSuccess returns true when this stop environment o k response has a 2xx status code +func (o *StopEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stop environment o k response has a 3xx status code +func (o *StopEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop environment o k response has a 4xx status code +func (o *StopEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this stop environment o k response has a 5xx status code +func (o *StopEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this stop environment o k response a status code equal to that given +func (o *StopEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the stop environment o k response +func (o *StopEnvironmentOK) Code() int { + return 200 +} + +func (o *StopEnvironmentOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/stop][%d] stopEnvironmentOK ", 200) +} + +func (o *StopEnvironmentOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/stop][%d] stopEnvironmentOK ", 200) +} + +func (o *StopEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopEnvironmentUnauthorized creates a StopEnvironmentUnauthorized with default headers values +func NewStopEnvironmentUnauthorized() *StopEnvironmentUnauthorized { + return &StopEnvironmentUnauthorized{} +} + +/* +StopEnvironmentUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StopEnvironmentUnauthorized struct { +} + +// IsSuccess returns true when this stop environment unauthorized response has a 2xx status code +func (o *StopEnvironmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop environment unauthorized response has a 3xx status code +func (o *StopEnvironmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop environment unauthorized response has a 4xx status code +func (o *StopEnvironmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop environment unauthorized response has a 5xx status code +func (o *StopEnvironmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this stop environment unauthorized response a status code equal to that given +func (o *StopEnvironmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the stop environment unauthorized response +func (o *StopEnvironmentUnauthorized) Code() int { + return 401 +} + +func (o *StopEnvironmentUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/stop][%d] stopEnvironmentUnauthorized ", 401) +} + +func (o *StopEnvironmentUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/stop][%d] stopEnvironmentUnauthorized ", 401) +} + +func (o *StopEnvironmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopEnvironmentNotFound creates a StopEnvironmentNotFound with default headers values +func NewStopEnvironmentNotFound() *StopEnvironmentNotFound { + return &StopEnvironmentNotFound{} +} + +/* +StopEnvironmentNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StopEnvironmentNotFound struct { +} + +// IsSuccess returns true when this stop environment not found response has a 2xx status code +func (o *StopEnvironmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop environment not found response has a 3xx status code +func (o *StopEnvironmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop environment not found response has a 4xx status code +func (o *StopEnvironmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop environment not found response has a 5xx status code +func (o *StopEnvironmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this stop environment not found response a status code equal to that given +func (o *StopEnvironmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the stop environment not found response +func (o *StopEnvironmentNotFound) Code() int { + return 404 +} + +func (o *StopEnvironmentNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/stop][%d] stopEnvironmentNotFound ", 404) +} + +func (o *StopEnvironmentNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/stop][%d] stopEnvironmentNotFound ", 404) +} + +func (o *StopEnvironmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/environment/update_environment_alerting_config_parameters.go b/generated-client/client/environment/update_environment_alerting_config_parameters.go new file mode 100644 index 0000000..00d9230 --- /dev/null +++ b/generated-client/client/environment/update_environment_alerting_config_parameters.go @@ -0,0 +1,270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewUpdateEnvironmentAlertingConfigParams creates a new UpdateEnvironmentAlertingConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateEnvironmentAlertingConfigParams() *UpdateEnvironmentAlertingConfigParams { + return &UpdateEnvironmentAlertingConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateEnvironmentAlertingConfigParamsWithTimeout creates a new UpdateEnvironmentAlertingConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateEnvironmentAlertingConfigParamsWithTimeout(timeout time.Duration) *UpdateEnvironmentAlertingConfigParams { + return &UpdateEnvironmentAlertingConfigParams{ + timeout: timeout, + } +} + +// NewUpdateEnvironmentAlertingConfigParamsWithContext creates a new UpdateEnvironmentAlertingConfigParams object +// with the ability to set a context for a request. +func NewUpdateEnvironmentAlertingConfigParamsWithContext(ctx context.Context) *UpdateEnvironmentAlertingConfigParams { + return &UpdateEnvironmentAlertingConfigParams{ + Context: ctx, + } +} + +// NewUpdateEnvironmentAlertingConfigParamsWithHTTPClient creates a new UpdateEnvironmentAlertingConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateEnvironmentAlertingConfigParamsWithHTTPClient(client *http.Client) *UpdateEnvironmentAlertingConfigParams { + return &UpdateEnvironmentAlertingConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateEnvironmentAlertingConfigParams contains all the parameters to send to the API endpoint + + for the update environment alerting config operation. + + Typically these are written to a http.Request. +*/ +type UpdateEnvironmentAlertingConfigParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AlertsConfig. + + Alerts configuration + */ + AlertsConfig *models.UpdateAlertingConfig + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update environment alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateEnvironmentAlertingConfigParams) WithDefaults() *UpdateEnvironmentAlertingConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update environment alerting config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateEnvironmentAlertingConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithTimeout(timeout time.Duration) *UpdateEnvironmentAlertingConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithContext(ctx context.Context) *UpdateEnvironmentAlertingConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithHTTPClient(client *http.Client) *UpdateEnvironmentAlertingConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithImpersonateGroup(impersonateGroup []string) *UpdateEnvironmentAlertingConfigParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithImpersonateUser(impersonateUser *string) *UpdateEnvironmentAlertingConfigParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAlertsConfig adds the alertsConfig to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithAlertsConfig(alertsConfig *models.UpdateAlertingConfig) *UpdateEnvironmentAlertingConfigParams { + o.SetAlertsConfig(alertsConfig) + return o +} + +// SetAlertsConfig adds the alertsConfig to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetAlertsConfig(alertsConfig *models.UpdateAlertingConfig) { + o.AlertsConfig = alertsConfig +} + +// WithAppName adds the appName to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithAppName(appName string) *UpdateEnvironmentAlertingConfigParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) WithEnvName(envName string) *UpdateEnvironmentAlertingConfigParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the update environment alerting config params +func (o *UpdateEnvironmentAlertingConfigParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateEnvironmentAlertingConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.AlertsConfig != nil { + if err := r.SetBodyParam(o.AlertsConfig); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamUpdateEnvironmentAlertingConfig binds the parameter Impersonate-Group +func (o *UpdateEnvironmentAlertingConfigParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/environment/update_environment_alerting_config_responses.go b/generated-client/client/environment/update_environment_alerting_config_responses.go new file mode 100644 index 0000000..6a0c04c --- /dev/null +++ b/generated-client/client/environment/update_environment_alerting_config_responses.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package environment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// UpdateEnvironmentAlertingConfigReader is a Reader for the UpdateEnvironmentAlertingConfig structure. +type UpdateEnvironmentAlertingConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateEnvironmentAlertingConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateEnvironmentAlertingConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateEnvironmentAlertingConfigBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateEnvironmentAlertingConfigUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateEnvironmentAlertingConfigForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateEnvironmentAlertingConfigNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateEnvironmentAlertingConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /applications/{appName}/environments/{envName}/alerting] updateEnvironmentAlertingConfig", response, response.Code()) + } +} + +// NewUpdateEnvironmentAlertingConfigOK creates a UpdateEnvironmentAlertingConfigOK with default headers values +func NewUpdateEnvironmentAlertingConfigOK() *UpdateEnvironmentAlertingConfigOK { + return &UpdateEnvironmentAlertingConfigOK{} +} + +/* +UpdateEnvironmentAlertingConfigOK describes a response with status code 200, with default header values. + +Successful alerts config update +*/ +type UpdateEnvironmentAlertingConfigOK struct { + Payload *models.AlertingConfig +} + +// IsSuccess returns true when this update environment alerting config o k response has a 2xx status code +func (o *UpdateEnvironmentAlertingConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update environment alerting config o k response has a 3xx status code +func (o *UpdateEnvironmentAlertingConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update environment alerting config o k response has a 4xx status code +func (o *UpdateEnvironmentAlertingConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update environment alerting config o k response has a 5xx status code +func (o *UpdateEnvironmentAlertingConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update environment alerting config o k response a status code equal to that given +func (o *UpdateEnvironmentAlertingConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update environment alerting config o k response +func (o *UpdateEnvironmentAlertingConfigOK) Code() int { + return 200 +} + +func (o *UpdateEnvironmentAlertingConfigOK) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateEnvironmentAlertingConfigOK) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateEnvironmentAlertingConfigOK) GetPayload() *models.AlertingConfig { + return o.Payload +} + +func (o *UpdateEnvironmentAlertingConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertingConfig) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateEnvironmentAlertingConfigBadRequest creates a UpdateEnvironmentAlertingConfigBadRequest with default headers values +func NewUpdateEnvironmentAlertingConfigBadRequest() *UpdateEnvironmentAlertingConfigBadRequest { + return &UpdateEnvironmentAlertingConfigBadRequest{} +} + +/* +UpdateEnvironmentAlertingConfigBadRequest describes a response with status code 400, with default header values. + +Invalid configuration +*/ +type UpdateEnvironmentAlertingConfigBadRequest struct { +} + +// IsSuccess returns true when this update environment alerting config bad request response has a 2xx status code +func (o *UpdateEnvironmentAlertingConfigBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update environment alerting config bad request response has a 3xx status code +func (o *UpdateEnvironmentAlertingConfigBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update environment alerting config bad request response has a 4xx status code +func (o *UpdateEnvironmentAlertingConfigBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update environment alerting config bad request response has a 5xx status code +func (o *UpdateEnvironmentAlertingConfigBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update environment alerting config bad request response a status code equal to that given +func (o *UpdateEnvironmentAlertingConfigBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update environment alerting config bad request response +func (o *UpdateEnvironmentAlertingConfigBadRequest) Code() int { + return 400 +} + +func (o *UpdateEnvironmentAlertingConfigBadRequest) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigBadRequest ", 400) +} + +func (o *UpdateEnvironmentAlertingConfigBadRequest) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigBadRequest ", 400) +} + +func (o *UpdateEnvironmentAlertingConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateEnvironmentAlertingConfigUnauthorized creates a UpdateEnvironmentAlertingConfigUnauthorized with default headers values +func NewUpdateEnvironmentAlertingConfigUnauthorized() *UpdateEnvironmentAlertingConfigUnauthorized { + return &UpdateEnvironmentAlertingConfigUnauthorized{} +} + +/* +UpdateEnvironmentAlertingConfigUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type UpdateEnvironmentAlertingConfigUnauthorized struct { +} + +// IsSuccess returns true when this update environment alerting config unauthorized response has a 2xx status code +func (o *UpdateEnvironmentAlertingConfigUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update environment alerting config unauthorized response has a 3xx status code +func (o *UpdateEnvironmentAlertingConfigUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update environment alerting config unauthorized response has a 4xx status code +func (o *UpdateEnvironmentAlertingConfigUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update environment alerting config unauthorized response has a 5xx status code +func (o *UpdateEnvironmentAlertingConfigUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update environment alerting config unauthorized response a status code equal to that given +func (o *UpdateEnvironmentAlertingConfigUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update environment alerting config unauthorized response +func (o *UpdateEnvironmentAlertingConfigUnauthorized) Code() int { + return 401 +} + +func (o *UpdateEnvironmentAlertingConfigUnauthorized) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigUnauthorized ", 401) +} + +func (o *UpdateEnvironmentAlertingConfigUnauthorized) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigUnauthorized ", 401) +} + +func (o *UpdateEnvironmentAlertingConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateEnvironmentAlertingConfigForbidden creates a UpdateEnvironmentAlertingConfigForbidden with default headers values +func NewUpdateEnvironmentAlertingConfigForbidden() *UpdateEnvironmentAlertingConfigForbidden { + return &UpdateEnvironmentAlertingConfigForbidden{} +} + +/* +UpdateEnvironmentAlertingConfigForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type UpdateEnvironmentAlertingConfigForbidden struct { +} + +// IsSuccess returns true when this update environment alerting config forbidden response has a 2xx status code +func (o *UpdateEnvironmentAlertingConfigForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update environment alerting config forbidden response has a 3xx status code +func (o *UpdateEnvironmentAlertingConfigForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update environment alerting config forbidden response has a 4xx status code +func (o *UpdateEnvironmentAlertingConfigForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update environment alerting config forbidden response has a 5xx status code +func (o *UpdateEnvironmentAlertingConfigForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update environment alerting config forbidden response a status code equal to that given +func (o *UpdateEnvironmentAlertingConfigForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update environment alerting config forbidden response +func (o *UpdateEnvironmentAlertingConfigForbidden) Code() int { + return 403 +} + +func (o *UpdateEnvironmentAlertingConfigForbidden) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigForbidden ", 403) +} + +func (o *UpdateEnvironmentAlertingConfigForbidden) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigForbidden ", 403) +} + +func (o *UpdateEnvironmentAlertingConfigForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateEnvironmentAlertingConfigNotFound creates a UpdateEnvironmentAlertingConfigNotFound with default headers values +func NewUpdateEnvironmentAlertingConfigNotFound() *UpdateEnvironmentAlertingConfigNotFound { + return &UpdateEnvironmentAlertingConfigNotFound{} +} + +/* +UpdateEnvironmentAlertingConfigNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type UpdateEnvironmentAlertingConfigNotFound struct { +} + +// IsSuccess returns true when this update environment alerting config not found response has a 2xx status code +func (o *UpdateEnvironmentAlertingConfigNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update environment alerting config not found response has a 3xx status code +func (o *UpdateEnvironmentAlertingConfigNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update environment alerting config not found response has a 4xx status code +func (o *UpdateEnvironmentAlertingConfigNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update environment alerting config not found response has a 5xx status code +func (o *UpdateEnvironmentAlertingConfigNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update environment alerting config not found response a status code equal to that given +func (o *UpdateEnvironmentAlertingConfigNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update environment alerting config not found response +func (o *UpdateEnvironmentAlertingConfigNotFound) Code() int { + return 404 +} + +func (o *UpdateEnvironmentAlertingConfigNotFound) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigNotFound ", 404) +} + +func (o *UpdateEnvironmentAlertingConfigNotFound) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigNotFound ", 404) +} + +func (o *UpdateEnvironmentAlertingConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateEnvironmentAlertingConfigInternalServerError creates a UpdateEnvironmentAlertingConfigInternalServerError with default headers values +func NewUpdateEnvironmentAlertingConfigInternalServerError() *UpdateEnvironmentAlertingConfigInternalServerError { + return &UpdateEnvironmentAlertingConfigInternalServerError{} +} + +/* +UpdateEnvironmentAlertingConfigInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type UpdateEnvironmentAlertingConfigInternalServerError struct { +} + +// IsSuccess returns true when this update environment alerting config internal server error response has a 2xx status code +func (o *UpdateEnvironmentAlertingConfigInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update environment alerting config internal server error response has a 3xx status code +func (o *UpdateEnvironmentAlertingConfigInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update environment alerting config internal server error response has a 4xx status code +func (o *UpdateEnvironmentAlertingConfigInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update environment alerting config internal server error response has a 5xx status code +func (o *UpdateEnvironmentAlertingConfigInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update environment alerting config internal server error response a status code equal to that given +func (o *UpdateEnvironmentAlertingConfigInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update environment alerting config internal server error response +func (o *UpdateEnvironmentAlertingConfigInternalServerError) Code() int { + return 500 +} + +func (o *UpdateEnvironmentAlertingConfigInternalServerError) Error() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigInternalServerError ", 500) +} + +func (o *UpdateEnvironmentAlertingConfigInternalServerError) String() string { + return fmt.Sprintf("[PUT /applications/{appName}/environments/{envName}/alerting][%d] updateEnvironmentAlertingConfigInternalServerError ", 500) +} + +func (o *UpdateEnvironmentAlertingConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/copy_batch_parameters.go b/generated-client/client/job/copy_batch_parameters.go new file mode 100644 index 0000000..9fd4c72 --- /dev/null +++ b/generated-client/client/job/copy_batch_parameters.go @@ -0,0 +1,314 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewCopyBatchParams creates a new CopyBatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCopyBatchParams() *CopyBatchParams { + return &CopyBatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCopyBatchParamsWithTimeout creates a new CopyBatchParams object +// with the ability to set a timeout on a request. +func NewCopyBatchParamsWithTimeout(timeout time.Duration) *CopyBatchParams { + return &CopyBatchParams{ + timeout: timeout, + } +} + +// NewCopyBatchParamsWithContext creates a new CopyBatchParams object +// with the ability to set a context for a request. +func NewCopyBatchParamsWithContext(ctx context.Context) *CopyBatchParams { + return &CopyBatchParams{ + Context: ctx, + } +} + +// NewCopyBatchParamsWithHTTPClient creates a new CopyBatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewCopyBatchParamsWithHTTPClient(client *http.Client) *CopyBatchParams { + return &CopyBatchParams{ + HTTPClient: client, + } +} + +/* +CopyBatchParams contains all the parameters to send to the API endpoint + + for the copy batch operation. + + Typically these are written to a http.Request. +*/ +type CopyBatchParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* BatchName. + + Name of batch to be copied + */ + BatchName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* ScheduledBatchRequest. + + Request for creating a scheduled batch + */ + ScheduledBatchRequest *models.ScheduledBatchRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the copy batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CopyBatchParams) WithDefaults() *CopyBatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the copy batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CopyBatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the copy batch params +func (o *CopyBatchParams) WithTimeout(timeout time.Duration) *CopyBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the copy batch params +func (o *CopyBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the copy batch params +func (o *CopyBatchParams) WithContext(ctx context.Context) *CopyBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the copy batch params +func (o *CopyBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the copy batch params +func (o *CopyBatchParams) WithHTTPClient(client *http.Client) *CopyBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the copy batch params +func (o *CopyBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the copy batch params +func (o *CopyBatchParams) WithImpersonateGroup(impersonateGroup []string) *CopyBatchParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the copy batch params +func (o *CopyBatchParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the copy batch params +func (o *CopyBatchParams) WithImpersonateUser(impersonateUser *string) *CopyBatchParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the copy batch params +func (o *CopyBatchParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the copy batch params +func (o *CopyBatchParams) WithAppName(appName string) *CopyBatchParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the copy batch params +func (o *CopyBatchParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithBatchName adds the batchName to the copy batch params +func (o *CopyBatchParams) WithBatchName(batchName string) *CopyBatchParams { + o.SetBatchName(batchName) + return o +} + +// SetBatchName adds the batchName to the copy batch params +func (o *CopyBatchParams) SetBatchName(batchName string) { + o.BatchName = batchName +} + +// WithEnvName adds the envName to the copy batch params +func (o *CopyBatchParams) WithEnvName(envName string) *CopyBatchParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the copy batch params +func (o *CopyBatchParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the copy batch params +func (o *CopyBatchParams) WithJobComponentName(jobComponentName string) *CopyBatchParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the copy batch params +func (o *CopyBatchParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithScheduledBatchRequest adds the scheduledBatchRequest to the copy batch params +func (o *CopyBatchParams) WithScheduledBatchRequest(scheduledBatchRequest *models.ScheduledBatchRequest) *CopyBatchParams { + o.SetScheduledBatchRequest(scheduledBatchRequest) + return o +} + +// SetScheduledBatchRequest adds the scheduledBatchRequest to the copy batch params +func (o *CopyBatchParams) SetScheduledBatchRequest(scheduledBatchRequest *models.ScheduledBatchRequest) { + o.ScheduledBatchRequest = scheduledBatchRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *CopyBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param batchName + if err := r.SetPathParam("batchName", o.BatchName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + if o.ScheduledBatchRequest != nil { + if err := r.SetBodyParam(o.ScheduledBatchRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamCopyBatch binds the parameter Impersonate-Group +func (o *CopyBatchParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/copy_batch_responses.go b/generated-client/client/job/copy_batch_responses.go new file mode 100644 index 0000000..4cc4eb6 --- /dev/null +++ b/generated-client/client/job/copy_batch_responses.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// CopyBatchReader is a Reader for the CopyBatch structure. +type CopyBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CopyBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCopyBatchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCopyBatchBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCopyBatchUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCopyBatchForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCopyBatchNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy] copyBatch", response, response.Code()) + } +} + +// NewCopyBatchOK creates a CopyBatchOK with default headers values +func NewCopyBatchOK() *CopyBatchOK { + return &CopyBatchOK{} +} + +/* +CopyBatchOK describes a response with status code 200, with default header values. + +Success +*/ +type CopyBatchOK struct { + Payload *models.ScheduledBatchSummary +} + +// IsSuccess returns true when this copy batch o k response has a 2xx status code +func (o *CopyBatchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this copy batch o k response has a 3xx status code +func (o *CopyBatchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy batch o k response has a 4xx status code +func (o *CopyBatchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this copy batch o k response has a 5xx status code +func (o *CopyBatchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this copy batch o k response a status code equal to that given +func (o *CopyBatchOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the copy batch o k response +func (o *CopyBatchOK) Code() int { + return 200 +} + +func (o *CopyBatchOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchOK %+v", 200, o.Payload) +} + +func (o *CopyBatchOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchOK %+v", 200, o.Payload) +} + +func (o *CopyBatchOK) GetPayload() *models.ScheduledBatchSummary { + return o.Payload +} + +func (o *CopyBatchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledBatchSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCopyBatchBadRequest creates a CopyBatchBadRequest with default headers values +func NewCopyBatchBadRequest() *CopyBatchBadRequest { + return &CopyBatchBadRequest{} +} + +/* +CopyBatchBadRequest describes a response with status code 400, with default header values. + +Invalid batch +*/ +type CopyBatchBadRequest struct { +} + +// IsSuccess returns true when this copy batch bad request response has a 2xx status code +func (o *CopyBatchBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy batch bad request response has a 3xx status code +func (o *CopyBatchBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy batch bad request response has a 4xx status code +func (o *CopyBatchBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy batch bad request response has a 5xx status code +func (o *CopyBatchBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this copy batch bad request response a status code equal to that given +func (o *CopyBatchBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the copy batch bad request response +func (o *CopyBatchBadRequest) Code() int { + return 400 +} + +func (o *CopyBatchBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchBadRequest ", 400) +} + +func (o *CopyBatchBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchBadRequest ", 400) +} + +func (o *CopyBatchBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCopyBatchUnauthorized creates a CopyBatchUnauthorized with default headers values +func NewCopyBatchUnauthorized() *CopyBatchUnauthorized { + return &CopyBatchUnauthorized{} +} + +/* +CopyBatchUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type CopyBatchUnauthorized struct { +} + +// IsSuccess returns true when this copy batch unauthorized response has a 2xx status code +func (o *CopyBatchUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy batch unauthorized response has a 3xx status code +func (o *CopyBatchUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy batch unauthorized response has a 4xx status code +func (o *CopyBatchUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy batch unauthorized response has a 5xx status code +func (o *CopyBatchUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this copy batch unauthorized response a status code equal to that given +func (o *CopyBatchUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the copy batch unauthorized response +func (o *CopyBatchUnauthorized) Code() int { + return 401 +} + +func (o *CopyBatchUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchUnauthorized ", 401) +} + +func (o *CopyBatchUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchUnauthorized ", 401) +} + +func (o *CopyBatchUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCopyBatchForbidden creates a CopyBatchForbidden with default headers values +func NewCopyBatchForbidden() *CopyBatchForbidden { + return &CopyBatchForbidden{} +} + +/* +CopyBatchForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type CopyBatchForbidden struct { +} + +// IsSuccess returns true when this copy batch forbidden response has a 2xx status code +func (o *CopyBatchForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy batch forbidden response has a 3xx status code +func (o *CopyBatchForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy batch forbidden response has a 4xx status code +func (o *CopyBatchForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy batch forbidden response has a 5xx status code +func (o *CopyBatchForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this copy batch forbidden response a status code equal to that given +func (o *CopyBatchForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the copy batch forbidden response +func (o *CopyBatchForbidden) Code() int { + return 403 +} + +func (o *CopyBatchForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchForbidden ", 403) +} + +func (o *CopyBatchForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchForbidden ", 403) +} + +func (o *CopyBatchForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCopyBatchNotFound creates a CopyBatchNotFound with default headers values +func NewCopyBatchNotFound() *CopyBatchNotFound { + return &CopyBatchNotFound{} +} + +/* +CopyBatchNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type CopyBatchNotFound struct { +} + +// IsSuccess returns true when this copy batch not found response has a 2xx status code +func (o *CopyBatchNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy batch not found response has a 3xx status code +func (o *CopyBatchNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy batch not found response has a 4xx status code +func (o *CopyBatchNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy batch not found response has a 5xx status code +func (o *CopyBatchNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this copy batch not found response a status code equal to that given +func (o *CopyBatchNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the copy batch not found response +func (o *CopyBatchNotFound) Code() int { + return 404 +} + +func (o *CopyBatchNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchNotFound ", 404) +} + +func (o *CopyBatchNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy][%d] copyBatchNotFound ", 404) +} + +func (o *CopyBatchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/copy_job_parameters.go b/generated-client/client/job/copy_job_parameters.go new file mode 100644 index 0000000..bac2e27 --- /dev/null +++ b/generated-client/client/job/copy_job_parameters.go @@ -0,0 +1,314 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewCopyJobParams creates a new CopyJobParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCopyJobParams() *CopyJobParams { + return &CopyJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCopyJobParamsWithTimeout creates a new CopyJobParams object +// with the ability to set a timeout on a request. +func NewCopyJobParamsWithTimeout(timeout time.Duration) *CopyJobParams { + return &CopyJobParams{ + timeout: timeout, + } +} + +// NewCopyJobParamsWithContext creates a new CopyJobParams object +// with the ability to set a context for a request. +func NewCopyJobParamsWithContext(ctx context.Context) *CopyJobParams { + return &CopyJobParams{ + Context: ctx, + } +} + +// NewCopyJobParamsWithHTTPClient creates a new CopyJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewCopyJobParamsWithHTTPClient(client *http.Client) *CopyJobParams { + return &CopyJobParams{ + HTTPClient: client, + } +} + +/* +CopyJobParams contains all the parameters to send to the API endpoint + + for the copy job operation. + + Typically these are written to a http.Request. +*/ +type CopyJobParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* JobName. + + Name of job to be copied + */ + JobName string + + /* ScheduledJobRequest. + + Request for creating a scheduled job + */ + ScheduledJobRequest *models.ScheduledJobRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the copy job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CopyJobParams) WithDefaults() *CopyJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the copy job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CopyJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the copy job params +func (o *CopyJobParams) WithTimeout(timeout time.Duration) *CopyJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the copy job params +func (o *CopyJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the copy job params +func (o *CopyJobParams) WithContext(ctx context.Context) *CopyJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the copy job params +func (o *CopyJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the copy job params +func (o *CopyJobParams) WithHTTPClient(client *http.Client) *CopyJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the copy job params +func (o *CopyJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the copy job params +func (o *CopyJobParams) WithImpersonateGroup(impersonateGroup []string) *CopyJobParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the copy job params +func (o *CopyJobParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the copy job params +func (o *CopyJobParams) WithImpersonateUser(impersonateUser *string) *CopyJobParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the copy job params +func (o *CopyJobParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the copy job params +func (o *CopyJobParams) WithAppName(appName string) *CopyJobParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the copy job params +func (o *CopyJobParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the copy job params +func (o *CopyJobParams) WithEnvName(envName string) *CopyJobParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the copy job params +func (o *CopyJobParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the copy job params +func (o *CopyJobParams) WithJobComponentName(jobComponentName string) *CopyJobParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the copy job params +func (o *CopyJobParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithJobName adds the jobName to the copy job params +func (o *CopyJobParams) WithJobName(jobName string) *CopyJobParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the copy job params +func (o *CopyJobParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WithScheduledJobRequest adds the scheduledJobRequest to the copy job params +func (o *CopyJobParams) WithScheduledJobRequest(scheduledJobRequest *models.ScheduledJobRequest) *CopyJobParams { + o.SetScheduledJobRequest(scheduledJobRequest) + return o +} + +// SetScheduledJobRequest adds the scheduledJobRequest to the copy job params +func (o *CopyJobParams) SetScheduledJobRequest(scheduledJobRequest *models.ScheduledJobRequest) { + o.ScheduledJobRequest = scheduledJobRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *CopyJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + if o.ScheduledJobRequest != nil { + if err := r.SetBodyParam(o.ScheduledJobRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamCopyJob binds the parameter Impersonate-Group +func (o *CopyJobParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/copy_job_responses.go b/generated-client/client/job/copy_job_responses.go new file mode 100644 index 0000000..8d30a9f --- /dev/null +++ b/generated-client/client/job/copy_job_responses.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// CopyJobReader is a Reader for the CopyJob structure. +type CopyJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CopyJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCopyJobOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCopyJobBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCopyJobUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCopyJobForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCopyJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy] copyJob", response, response.Code()) + } +} + +// NewCopyJobOK creates a CopyJobOK with default headers values +func NewCopyJobOK() *CopyJobOK { + return &CopyJobOK{} +} + +/* +CopyJobOK describes a response with status code 200, with default header values. + +Success +*/ +type CopyJobOK struct { + Payload *models.ScheduledJobSummary +} + +// IsSuccess returns true when this copy job o k response has a 2xx status code +func (o *CopyJobOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this copy job o k response has a 3xx status code +func (o *CopyJobOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy job o k response has a 4xx status code +func (o *CopyJobOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this copy job o k response has a 5xx status code +func (o *CopyJobOK) IsServerError() bool { + return false +} + +// IsCode returns true when this copy job o k response a status code equal to that given +func (o *CopyJobOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the copy job o k response +func (o *CopyJobOK) Code() int { + return 200 +} + +func (o *CopyJobOK) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobOK %+v", 200, o.Payload) +} + +func (o *CopyJobOK) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobOK %+v", 200, o.Payload) +} + +func (o *CopyJobOK) GetPayload() *models.ScheduledJobSummary { + return o.Payload +} + +func (o *CopyJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledJobSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCopyJobBadRequest creates a CopyJobBadRequest with default headers values +func NewCopyJobBadRequest() *CopyJobBadRequest { + return &CopyJobBadRequest{} +} + +/* +CopyJobBadRequest describes a response with status code 400, with default header values. + +Invalid batch +*/ +type CopyJobBadRequest struct { +} + +// IsSuccess returns true when this copy job bad request response has a 2xx status code +func (o *CopyJobBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy job bad request response has a 3xx status code +func (o *CopyJobBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy job bad request response has a 4xx status code +func (o *CopyJobBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy job bad request response has a 5xx status code +func (o *CopyJobBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this copy job bad request response a status code equal to that given +func (o *CopyJobBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the copy job bad request response +func (o *CopyJobBadRequest) Code() int { + return 400 +} + +func (o *CopyJobBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobBadRequest ", 400) +} + +func (o *CopyJobBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobBadRequest ", 400) +} + +func (o *CopyJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCopyJobUnauthorized creates a CopyJobUnauthorized with default headers values +func NewCopyJobUnauthorized() *CopyJobUnauthorized { + return &CopyJobUnauthorized{} +} + +/* +CopyJobUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type CopyJobUnauthorized struct { +} + +// IsSuccess returns true when this copy job unauthorized response has a 2xx status code +func (o *CopyJobUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy job unauthorized response has a 3xx status code +func (o *CopyJobUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy job unauthorized response has a 4xx status code +func (o *CopyJobUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy job unauthorized response has a 5xx status code +func (o *CopyJobUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this copy job unauthorized response a status code equal to that given +func (o *CopyJobUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the copy job unauthorized response +func (o *CopyJobUnauthorized) Code() int { + return 401 +} + +func (o *CopyJobUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobUnauthorized ", 401) +} + +func (o *CopyJobUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobUnauthorized ", 401) +} + +func (o *CopyJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCopyJobForbidden creates a CopyJobForbidden with default headers values +func NewCopyJobForbidden() *CopyJobForbidden { + return &CopyJobForbidden{} +} + +/* +CopyJobForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type CopyJobForbidden struct { +} + +// IsSuccess returns true when this copy job forbidden response has a 2xx status code +func (o *CopyJobForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy job forbidden response has a 3xx status code +func (o *CopyJobForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy job forbidden response has a 4xx status code +func (o *CopyJobForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy job forbidden response has a 5xx status code +func (o *CopyJobForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this copy job forbidden response a status code equal to that given +func (o *CopyJobForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the copy job forbidden response +func (o *CopyJobForbidden) Code() int { + return 403 +} + +func (o *CopyJobForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobForbidden ", 403) +} + +func (o *CopyJobForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobForbidden ", 403) +} + +func (o *CopyJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCopyJobNotFound creates a CopyJobNotFound with default headers values +func NewCopyJobNotFound() *CopyJobNotFound { + return &CopyJobNotFound{} +} + +/* +CopyJobNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type CopyJobNotFound struct { +} + +// IsSuccess returns true when this copy job not found response has a 2xx status code +func (o *CopyJobNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this copy job not found response has a 3xx status code +func (o *CopyJobNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this copy job not found response has a 4xx status code +func (o *CopyJobNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this copy job not found response has a 5xx status code +func (o *CopyJobNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this copy job not found response a status code equal to that given +func (o *CopyJobNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the copy job not found response +func (o *CopyJobNotFound) Code() int { + return 404 +} + +func (o *CopyJobNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobNotFound ", 404) +} + +func (o *CopyJobNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy][%d] copyJobNotFound ", 404) +} + +func (o *CopyJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/delete_batch_parameters.go b/generated-client/client/job/delete_batch_parameters.go new file mode 100644 index 0000000..b50acba --- /dev/null +++ b/generated-client/client/job/delete_batch_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteBatchParams creates a new DeleteBatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteBatchParams() *DeleteBatchParams { + return &DeleteBatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteBatchParamsWithTimeout creates a new DeleteBatchParams object +// with the ability to set a timeout on a request. +func NewDeleteBatchParamsWithTimeout(timeout time.Duration) *DeleteBatchParams { + return &DeleteBatchParams{ + timeout: timeout, + } +} + +// NewDeleteBatchParamsWithContext creates a new DeleteBatchParams object +// with the ability to set a context for a request. +func NewDeleteBatchParamsWithContext(ctx context.Context) *DeleteBatchParams { + return &DeleteBatchParams{ + Context: ctx, + } +} + +// NewDeleteBatchParamsWithHTTPClient creates a new DeleteBatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteBatchParamsWithHTTPClient(client *http.Client) *DeleteBatchParams { + return &DeleteBatchParams{ + HTTPClient: client, + } +} + +/* +DeleteBatchParams contains all the parameters to send to the API endpoint + + for the delete batch operation. + + Typically these are written to a http.Request. +*/ +type DeleteBatchParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* BatchName. + + Name of batch + */ + BatchName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBatchParams) WithDefaults() *DeleteBatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteBatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete batch params +func (o *DeleteBatchParams) WithTimeout(timeout time.Duration) *DeleteBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete batch params +func (o *DeleteBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete batch params +func (o *DeleteBatchParams) WithContext(ctx context.Context) *DeleteBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete batch params +func (o *DeleteBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete batch params +func (o *DeleteBatchParams) WithHTTPClient(client *http.Client) *DeleteBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete batch params +func (o *DeleteBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the delete batch params +func (o *DeleteBatchParams) WithImpersonateGroup(impersonateGroup []string) *DeleteBatchParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the delete batch params +func (o *DeleteBatchParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the delete batch params +func (o *DeleteBatchParams) WithImpersonateUser(impersonateUser *string) *DeleteBatchParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the delete batch params +func (o *DeleteBatchParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the delete batch params +func (o *DeleteBatchParams) WithAppName(appName string) *DeleteBatchParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the delete batch params +func (o *DeleteBatchParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithBatchName adds the batchName to the delete batch params +func (o *DeleteBatchParams) WithBatchName(batchName string) *DeleteBatchParams { + o.SetBatchName(batchName) + return o +} + +// SetBatchName adds the batchName to the delete batch params +func (o *DeleteBatchParams) SetBatchName(batchName string) { + o.BatchName = batchName +} + +// WithEnvName adds the envName to the delete batch params +func (o *DeleteBatchParams) WithEnvName(envName string) *DeleteBatchParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the delete batch params +func (o *DeleteBatchParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the delete batch params +func (o *DeleteBatchParams) WithJobComponentName(jobComponentName string) *DeleteBatchParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the delete batch params +func (o *DeleteBatchParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param batchName + if err := r.SetPathParam("batchName", o.BatchName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDeleteBatch binds the parameter Impersonate-Group +func (o *DeleteBatchParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/delete_batch_responses.go b/generated-client/client/job/delete_batch_responses.go new file mode 100644 index 0000000..47ca803 --- /dev/null +++ b/generated-client/client/job/delete_batch_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteBatchReader is a Reader for the DeleteBatch structure. +type DeleteBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteBatchNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteBatchBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewDeleteBatchUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteBatchForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteBatchNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}] deleteBatch", response, response.Code()) + } +} + +// NewDeleteBatchNoContent creates a DeleteBatchNoContent with default headers values +func NewDeleteBatchNoContent() *DeleteBatchNoContent { + return &DeleteBatchNoContent{} +} + +/* +DeleteBatchNoContent describes a response with status code 204, with default header values. + +Success +*/ +type DeleteBatchNoContent struct { +} + +// IsSuccess returns true when this delete batch no content response has a 2xx status code +func (o *DeleteBatchNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete batch no content response has a 3xx status code +func (o *DeleteBatchNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete batch no content response has a 4xx status code +func (o *DeleteBatchNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete batch no content response has a 5xx status code +func (o *DeleteBatchNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete batch no content response a status code equal to that given +func (o *DeleteBatchNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the delete batch no content response +func (o *DeleteBatchNoContent) Code() int { + return 204 +} + +func (o *DeleteBatchNoContent) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchNoContent ", 204) +} + +func (o *DeleteBatchNoContent) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchNoContent ", 204) +} + +func (o *DeleteBatchNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteBatchBadRequest creates a DeleteBatchBadRequest with default headers values +func NewDeleteBatchBadRequest() *DeleteBatchBadRequest { + return &DeleteBatchBadRequest{} +} + +/* +DeleteBatchBadRequest describes a response with status code 400, with default header values. + +Invalid batch +*/ +type DeleteBatchBadRequest struct { +} + +// IsSuccess returns true when this delete batch bad request response has a 2xx status code +func (o *DeleteBatchBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete batch bad request response has a 3xx status code +func (o *DeleteBatchBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete batch bad request response has a 4xx status code +func (o *DeleteBatchBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete batch bad request response has a 5xx status code +func (o *DeleteBatchBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete batch bad request response a status code equal to that given +func (o *DeleteBatchBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the delete batch bad request response +func (o *DeleteBatchBadRequest) Code() int { + return 400 +} + +func (o *DeleteBatchBadRequest) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchBadRequest ", 400) +} + +func (o *DeleteBatchBadRequest) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchBadRequest ", 400) +} + +func (o *DeleteBatchBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteBatchUnauthorized creates a DeleteBatchUnauthorized with default headers values +func NewDeleteBatchUnauthorized() *DeleteBatchUnauthorized { + return &DeleteBatchUnauthorized{} +} + +/* +DeleteBatchUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type DeleteBatchUnauthorized struct { +} + +// IsSuccess returns true when this delete batch unauthorized response has a 2xx status code +func (o *DeleteBatchUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete batch unauthorized response has a 3xx status code +func (o *DeleteBatchUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete batch unauthorized response has a 4xx status code +func (o *DeleteBatchUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete batch unauthorized response has a 5xx status code +func (o *DeleteBatchUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this delete batch unauthorized response a status code equal to that given +func (o *DeleteBatchUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the delete batch unauthorized response +func (o *DeleteBatchUnauthorized) Code() int { + return 401 +} + +func (o *DeleteBatchUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchUnauthorized ", 401) +} + +func (o *DeleteBatchUnauthorized) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchUnauthorized ", 401) +} + +func (o *DeleteBatchUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteBatchForbidden creates a DeleteBatchForbidden with default headers values +func NewDeleteBatchForbidden() *DeleteBatchForbidden { + return &DeleteBatchForbidden{} +} + +/* +DeleteBatchForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DeleteBatchForbidden struct { +} + +// IsSuccess returns true when this delete batch forbidden response has a 2xx status code +func (o *DeleteBatchForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete batch forbidden response has a 3xx status code +func (o *DeleteBatchForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete batch forbidden response has a 4xx status code +func (o *DeleteBatchForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete batch forbidden response has a 5xx status code +func (o *DeleteBatchForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this delete batch forbidden response a status code equal to that given +func (o *DeleteBatchForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the delete batch forbidden response +func (o *DeleteBatchForbidden) Code() int { + return 403 +} + +func (o *DeleteBatchForbidden) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchForbidden ", 403) +} + +func (o *DeleteBatchForbidden) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchForbidden ", 403) +} + +func (o *DeleteBatchForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteBatchNotFound creates a DeleteBatchNotFound with default headers values +func NewDeleteBatchNotFound() *DeleteBatchNotFound { + return &DeleteBatchNotFound{} +} + +/* +DeleteBatchNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type DeleteBatchNotFound struct { +} + +// IsSuccess returns true when this delete batch not found response has a 2xx status code +func (o *DeleteBatchNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete batch not found response has a 3xx status code +func (o *DeleteBatchNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete batch not found response has a 4xx status code +func (o *DeleteBatchNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete batch not found response has a 5xx status code +func (o *DeleteBatchNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete batch not found response a status code equal to that given +func (o *DeleteBatchNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete batch not found response +func (o *DeleteBatchNotFound) Code() int { + return 404 +} + +func (o *DeleteBatchNotFound) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchNotFound ", 404) +} + +func (o *DeleteBatchNotFound) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] deleteBatchNotFound ", 404) +} + +func (o *DeleteBatchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/delete_job_parameters.go b/generated-client/client/job/delete_job_parameters.go new file mode 100644 index 0000000..5ecc2f5 --- /dev/null +++ b/generated-client/client/job/delete_job_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteJobParams creates a new DeleteJobParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteJobParams() *DeleteJobParams { + return &DeleteJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteJobParamsWithTimeout creates a new DeleteJobParams object +// with the ability to set a timeout on a request. +func NewDeleteJobParamsWithTimeout(timeout time.Duration) *DeleteJobParams { + return &DeleteJobParams{ + timeout: timeout, + } +} + +// NewDeleteJobParamsWithContext creates a new DeleteJobParams object +// with the ability to set a context for a request. +func NewDeleteJobParamsWithContext(ctx context.Context) *DeleteJobParams { + return &DeleteJobParams{ + Context: ctx, + } +} + +// NewDeleteJobParamsWithHTTPClient creates a new DeleteJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteJobParamsWithHTTPClient(client *http.Client) *DeleteJobParams { + return &DeleteJobParams{ + HTTPClient: client, + } +} + +/* +DeleteJobParams contains all the parameters to send to the API endpoint + + for the delete job operation. + + Typically these are written to a http.Request. +*/ +type DeleteJobParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* JobName. + + Name of job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteJobParams) WithDefaults() *DeleteJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete job params +func (o *DeleteJobParams) WithTimeout(timeout time.Duration) *DeleteJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete job params +func (o *DeleteJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete job params +func (o *DeleteJobParams) WithContext(ctx context.Context) *DeleteJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete job params +func (o *DeleteJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete job params +func (o *DeleteJobParams) WithHTTPClient(client *http.Client) *DeleteJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete job params +func (o *DeleteJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the delete job params +func (o *DeleteJobParams) WithImpersonateGroup(impersonateGroup []string) *DeleteJobParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the delete job params +func (o *DeleteJobParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the delete job params +func (o *DeleteJobParams) WithImpersonateUser(impersonateUser *string) *DeleteJobParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the delete job params +func (o *DeleteJobParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the delete job params +func (o *DeleteJobParams) WithAppName(appName string) *DeleteJobParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the delete job params +func (o *DeleteJobParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the delete job params +func (o *DeleteJobParams) WithEnvName(envName string) *DeleteJobParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the delete job params +func (o *DeleteJobParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the delete job params +func (o *DeleteJobParams) WithJobComponentName(jobComponentName string) *DeleteJobParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the delete job params +func (o *DeleteJobParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithJobName adds the jobName to the delete job params +func (o *DeleteJobParams) WithJobName(jobName string) *DeleteJobParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the delete job params +func (o *DeleteJobParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDeleteJob binds the parameter Impersonate-Group +func (o *DeleteJobParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/delete_job_responses.go b/generated-client/client/job/delete_job_responses.go new file mode 100644 index 0000000..99ef435 --- /dev/null +++ b/generated-client/client/job/delete_job_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteJobReader is a Reader for the DeleteJob structure. +type DeleteJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteJobNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteJobBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewDeleteJobUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteJobForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}] deleteJob", response, response.Code()) + } +} + +// NewDeleteJobNoContent creates a DeleteJobNoContent with default headers values +func NewDeleteJobNoContent() *DeleteJobNoContent { + return &DeleteJobNoContent{} +} + +/* +DeleteJobNoContent describes a response with status code 204, with default header values. + +Success +*/ +type DeleteJobNoContent struct { +} + +// IsSuccess returns true when this delete job no content response has a 2xx status code +func (o *DeleteJobNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete job no content response has a 3xx status code +func (o *DeleteJobNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete job no content response has a 4xx status code +func (o *DeleteJobNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete job no content response has a 5xx status code +func (o *DeleteJobNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete job no content response a status code equal to that given +func (o *DeleteJobNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the delete job no content response +func (o *DeleteJobNoContent) Code() int { + return 204 +} + +func (o *DeleteJobNoContent) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobNoContent ", 204) +} + +func (o *DeleteJobNoContent) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobNoContent ", 204) +} + +func (o *DeleteJobNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteJobBadRequest creates a DeleteJobBadRequest with default headers values +func NewDeleteJobBadRequest() *DeleteJobBadRequest { + return &DeleteJobBadRequest{} +} + +/* +DeleteJobBadRequest describes a response with status code 400, with default header values. + +Invalid job +*/ +type DeleteJobBadRequest struct { +} + +// IsSuccess returns true when this delete job bad request response has a 2xx status code +func (o *DeleteJobBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete job bad request response has a 3xx status code +func (o *DeleteJobBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete job bad request response has a 4xx status code +func (o *DeleteJobBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete job bad request response has a 5xx status code +func (o *DeleteJobBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete job bad request response a status code equal to that given +func (o *DeleteJobBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the delete job bad request response +func (o *DeleteJobBadRequest) Code() int { + return 400 +} + +func (o *DeleteJobBadRequest) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobBadRequest ", 400) +} + +func (o *DeleteJobBadRequest) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobBadRequest ", 400) +} + +func (o *DeleteJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteJobUnauthorized creates a DeleteJobUnauthorized with default headers values +func NewDeleteJobUnauthorized() *DeleteJobUnauthorized { + return &DeleteJobUnauthorized{} +} + +/* +DeleteJobUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type DeleteJobUnauthorized struct { +} + +// IsSuccess returns true when this delete job unauthorized response has a 2xx status code +func (o *DeleteJobUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete job unauthorized response has a 3xx status code +func (o *DeleteJobUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete job unauthorized response has a 4xx status code +func (o *DeleteJobUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete job unauthorized response has a 5xx status code +func (o *DeleteJobUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this delete job unauthorized response a status code equal to that given +func (o *DeleteJobUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the delete job unauthorized response +func (o *DeleteJobUnauthorized) Code() int { + return 401 +} + +func (o *DeleteJobUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobUnauthorized ", 401) +} + +func (o *DeleteJobUnauthorized) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobUnauthorized ", 401) +} + +func (o *DeleteJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteJobForbidden creates a DeleteJobForbidden with default headers values +func NewDeleteJobForbidden() *DeleteJobForbidden { + return &DeleteJobForbidden{} +} + +/* +DeleteJobForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DeleteJobForbidden struct { +} + +// IsSuccess returns true when this delete job forbidden response has a 2xx status code +func (o *DeleteJobForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete job forbidden response has a 3xx status code +func (o *DeleteJobForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete job forbidden response has a 4xx status code +func (o *DeleteJobForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete job forbidden response has a 5xx status code +func (o *DeleteJobForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this delete job forbidden response a status code equal to that given +func (o *DeleteJobForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the delete job forbidden response +func (o *DeleteJobForbidden) Code() int { + return 403 +} + +func (o *DeleteJobForbidden) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobForbidden ", 403) +} + +func (o *DeleteJobForbidden) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobForbidden ", 403) +} + +func (o *DeleteJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteJobNotFound creates a DeleteJobNotFound with default headers values +func NewDeleteJobNotFound() *DeleteJobNotFound { + return &DeleteJobNotFound{} +} + +/* +DeleteJobNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type DeleteJobNotFound struct { +} + +// IsSuccess returns true when this delete job not found response has a 2xx status code +func (o *DeleteJobNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete job not found response has a 3xx status code +func (o *DeleteJobNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete job not found response has a 4xx status code +func (o *DeleteJobNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete job not found response has a 5xx status code +func (o *DeleteJobNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete job not found response a status code equal to that given +func (o *DeleteJobNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete job not found response +func (o *DeleteJobNotFound) Code() int { + return 404 +} + +func (o *DeleteJobNotFound) Error() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobNotFound ", 404) +} + +func (o *DeleteJobNotFound) String() string { + return fmt.Sprintf("[DELETE /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] deleteJobNotFound ", 404) +} + +func (o *DeleteJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/get_batch_parameters.go b/generated-client/client/job/get_batch_parameters.go new file mode 100644 index 0000000..b35cf1b --- /dev/null +++ b/generated-client/client/job/get_batch_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetBatchParams creates a new GetBatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBatchParams() *GetBatchParams { + return &GetBatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBatchParamsWithTimeout creates a new GetBatchParams object +// with the ability to set a timeout on a request. +func NewGetBatchParamsWithTimeout(timeout time.Duration) *GetBatchParams { + return &GetBatchParams{ + timeout: timeout, + } +} + +// NewGetBatchParamsWithContext creates a new GetBatchParams object +// with the ability to set a context for a request. +func NewGetBatchParamsWithContext(ctx context.Context) *GetBatchParams { + return &GetBatchParams{ + Context: ctx, + } +} + +// NewGetBatchParamsWithHTTPClient creates a new GetBatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBatchParamsWithHTTPClient(client *http.Client) *GetBatchParams { + return &GetBatchParams{ + HTTPClient: client, + } +} + +/* +GetBatchParams contains all the parameters to send to the API endpoint + + for the get batch operation. + + Typically these are written to a http.Request. +*/ +type GetBatchParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* BatchName. + + Name of batch + */ + BatchName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBatchParams) WithDefaults() *GetBatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get batch params +func (o *GetBatchParams) WithTimeout(timeout time.Duration) *GetBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get batch params +func (o *GetBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get batch params +func (o *GetBatchParams) WithContext(ctx context.Context) *GetBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get batch params +func (o *GetBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get batch params +func (o *GetBatchParams) WithHTTPClient(client *http.Client) *GetBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get batch params +func (o *GetBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get batch params +func (o *GetBatchParams) WithImpersonateGroup(impersonateGroup []string) *GetBatchParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get batch params +func (o *GetBatchParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get batch params +func (o *GetBatchParams) WithImpersonateUser(impersonateUser *string) *GetBatchParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get batch params +func (o *GetBatchParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get batch params +func (o *GetBatchParams) WithAppName(appName string) *GetBatchParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get batch params +func (o *GetBatchParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithBatchName adds the batchName to the get batch params +func (o *GetBatchParams) WithBatchName(batchName string) *GetBatchParams { + o.SetBatchName(batchName) + return o +} + +// SetBatchName adds the batchName to the get batch params +func (o *GetBatchParams) SetBatchName(batchName string) { + o.BatchName = batchName +} + +// WithEnvName adds the envName to the get batch params +func (o *GetBatchParams) WithEnvName(envName string) *GetBatchParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get batch params +func (o *GetBatchParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the get batch params +func (o *GetBatchParams) WithJobComponentName(jobComponentName string) *GetBatchParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the get batch params +func (o *GetBatchParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param batchName + if err := r.SetPathParam("batchName", o.BatchName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetBatch binds the parameter Impersonate-Group +func (o *GetBatchParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/get_batch_responses.go b/generated-client/client/job/get_batch_responses.go new file mode 100644 index 0000000..4a2ef8b --- /dev/null +++ b/generated-client/client/job/get_batch_responses.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetBatchReader is a Reader for the GetBatch structure. +type GetBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBatchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetBatchNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}] getBatch", response, response.Code()) + } +} + +// NewGetBatchOK creates a GetBatchOK with default headers values +func NewGetBatchOK() *GetBatchOK { + return &GetBatchOK{} +} + +/* +GetBatchOK describes a response with status code 200, with default header values. + +scheduled batch +*/ +type GetBatchOK struct { + Payload *models.ScheduledBatchSummary +} + +// IsSuccess returns true when this get batch o k response has a 2xx status code +func (o *GetBatchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get batch o k response has a 3xx status code +func (o *GetBatchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get batch o k response has a 4xx status code +func (o *GetBatchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get batch o k response has a 5xx status code +func (o *GetBatchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get batch o k response a status code equal to that given +func (o *GetBatchOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get batch o k response +func (o *GetBatchOK) Code() int { + return 200 +} + +func (o *GetBatchOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] getBatchOK %+v", 200, o.Payload) +} + +func (o *GetBatchOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] getBatchOK %+v", 200, o.Payload) +} + +func (o *GetBatchOK) GetPayload() *models.ScheduledBatchSummary { + return o.Payload +} + +func (o *GetBatchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledBatchSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBatchNotFound creates a GetBatchNotFound with default headers values +func NewGetBatchNotFound() *GetBatchNotFound { + return &GetBatchNotFound{} +} + +/* +GetBatchNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetBatchNotFound struct { +} + +// IsSuccess returns true when this get batch not found response has a 2xx status code +func (o *GetBatchNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get batch not found response has a 3xx status code +func (o *GetBatchNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get batch not found response has a 4xx status code +func (o *GetBatchNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get batch not found response has a 5xx status code +func (o *GetBatchNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get batch not found response a status code equal to that given +func (o *GetBatchNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get batch not found response +func (o *GetBatchNotFound) Code() int { + return 404 +} + +func (o *GetBatchNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] getBatchNotFound ", 404) +} + +func (o *GetBatchNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}][%d] getBatchNotFound ", 404) +} + +func (o *GetBatchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/get_batches_parameters.go b/generated-client/client/job/get_batches_parameters.go new file mode 100644 index 0000000..6c932fc --- /dev/null +++ b/generated-client/client/job/get_batches_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetBatchesParams creates a new GetBatchesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBatchesParams() *GetBatchesParams { + return &GetBatchesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBatchesParamsWithTimeout creates a new GetBatchesParams object +// with the ability to set a timeout on a request. +func NewGetBatchesParamsWithTimeout(timeout time.Duration) *GetBatchesParams { + return &GetBatchesParams{ + timeout: timeout, + } +} + +// NewGetBatchesParamsWithContext creates a new GetBatchesParams object +// with the ability to set a context for a request. +func NewGetBatchesParamsWithContext(ctx context.Context) *GetBatchesParams { + return &GetBatchesParams{ + Context: ctx, + } +} + +// NewGetBatchesParamsWithHTTPClient creates a new GetBatchesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBatchesParamsWithHTTPClient(client *http.Client) *GetBatchesParams { + return &GetBatchesParams{ + HTTPClient: client, + } +} + +/* +GetBatchesParams contains all the parameters to send to the API endpoint + + for the get batches operation. + + Typically these are written to a http.Request. +*/ +type GetBatchesParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get batches params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBatchesParams) WithDefaults() *GetBatchesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get batches params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBatchesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get batches params +func (o *GetBatchesParams) WithTimeout(timeout time.Duration) *GetBatchesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get batches params +func (o *GetBatchesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get batches params +func (o *GetBatchesParams) WithContext(ctx context.Context) *GetBatchesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get batches params +func (o *GetBatchesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get batches params +func (o *GetBatchesParams) WithHTTPClient(client *http.Client) *GetBatchesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get batches params +func (o *GetBatchesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get batches params +func (o *GetBatchesParams) WithImpersonateGroup(impersonateGroup []string) *GetBatchesParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get batches params +func (o *GetBatchesParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get batches params +func (o *GetBatchesParams) WithImpersonateUser(impersonateUser *string) *GetBatchesParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get batches params +func (o *GetBatchesParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get batches params +func (o *GetBatchesParams) WithAppName(appName string) *GetBatchesParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get batches params +func (o *GetBatchesParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get batches params +func (o *GetBatchesParams) WithEnvName(envName string) *GetBatchesParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get batches params +func (o *GetBatchesParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the get batches params +func (o *GetBatchesParams) WithJobComponentName(jobComponentName string) *GetBatchesParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the get batches params +func (o *GetBatchesParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBatchesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetBatches binds the parameter Impersonate-Group +func (o *GetBatchesParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/get_batches_responses.go b/generated-client/client/job/get_batches_responses.go new file mode 100644 index 0000000..5478aa6 --- /dev/null +++ b/generated-client/client/job/get_batches_responses.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetBatchesReader is a Reader for the GetBatches structure. +type GetBatchesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBatchesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBatchesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetBatchesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches] getBatches", response, response.Code()) + } +} + +// NewGetBatchesOK creates a GetBatchesOK with default headers values +func NewGetBatchesOK() *GetBatchesOK { + return &GetBatchesOK{} +} + +/* +GetBatchesOK describes a response with status code 200, with default header values. + +scheduled batches +*/ +type GetBatchesOK struct { + Payload []*models.ScheduledBatchSummary +} + +// IsSuccess returns true when this get batches o k response has a 2xx status code +func (o *GetBatchesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get batches o k response has a 3xx status code +func (o *GetBatchesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get batches o k response has a 4xx status code +func (o *GetBatchesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get batches o k response has a 5xx status code +func (o *GetBatchesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get batches o k response a status code equal to that given +func (o *GetBatchesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get batches o k response +func (o *GetBatchesOK) Code() int { + return 200 +} + +func (o *GetBatchesOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches][%d] getBatchesOK %+v", 200, o.Payload) +} + +func (o *GetBatchesOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches][%d] getBatchesOK %+v", 200, o.Payload) +} + +func (o *GetBatchesOK) GetPayload() []*models.ScheduledBatchSummary { + return o.Payload +} + +func (o *GetBatchesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBatchesNotFound creates a GetBatchesNotFound with default headers values +func NewGetBatchesNotFound() *GetBatchesNotFound { + return &GetBatchesNotFound{} +} + +/* +GetBatchesNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetBatchesNotFound struct { +} + +// IsSuccess returns true when this get batches not found response has a 2xx status code +func (o *GetBatchesNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get batches not found response has a 3xx status code +func (o *GetBatchesNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get batches not found response has a 4xx status code +func (o *GetBatchesNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get batches not found response has a 5xx status code +func (o *GetBatchesNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get batches not found response a status code equal to that given +func (o *GetBatchesNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get batches not found response +func (o *GetBatchesNotFound) Code() int { + return 404 +} + +func (o *GetBatchesNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches][%d] getBatchesNotFound ", 404) +} + +func (o *GetBatchesNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches][%d] getBatchesNotFound ", 404) +} + +func (o *GetBatchesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/get_job_component_deployments_parameters.go b/generated-client/client/job/get_job_component_deployments_parameters.go new file mode 100644 index 0000000..1f1e452 --- /dev/null +++ b/generated-client/client/job/get_job_component_deployments_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetJobComponentDeploymentsParams creates a new GetJobComponentDeploymentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetJobComponentDeploymentsParams() *GetJobComponentDeploymentsParams { + return &GetJobComponentDeploymentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobComponentDeploymentsParamsWithTimeout creates a new GetJobComponentDeploymentsParams object +// with the ability to set a timeout on a request. +func NewGetJobComponentDeploymentsParamsWithTimeout(timeout time.Duration) *GetJobComponentDeploymentsParams { + return &GetJobComponentDeploymentsParams{ + timeout: timeout, + } +} + +// NewGetJobComponentDeploymentsParamsWithContext creates a new GetJobComponentDeploymentsParams object +// with the ability to set a context for a request. +func NewGetJobComponentDeploymentsParamsWithContext(ctx context.Context) *GetJobComponentDeploymentsParams { + return &GetJobComponentDeploymentsParams{ + Context: ctx, + } +} + +// NewGetJobComponentDeploymentsParamsWithHTTPClient creates a new GetJobComponentDeploymentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetJobComponentDeploymentsParamsWithHTTPClient(client *http.Client) *GetJobComponentDeploymentsParams { + return &GetJobComponentDeploymentsParams{ + HTTPClient: client, + } +} + +/* +GetJobComponentDeploymentsParams contains all the parameters to send to the API endpoint + + for the get job component deployments operation. + + Typically these are written to a http.Request. +*/ +type GetJobComponentDeploymentsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get job component deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobComponentDeploymentsParams) WithDefaults() *GetJobComponentDeploymentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get job component deployments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobComponentDeploymentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithTimeout(timeout time.Duration) *GetJobComponentDeploymentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithContext(ctx context.Context) *GetJobComponentDeploymentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithHTTPClient(client *http.Client) *GetJobComponentDeploymentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithImpersonateGroup(impersonateGroup []string) *GetJobComponentDeploymentsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithImpersonateUser(impersonateUser *string) *GetJobComponentDeploymentsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithAppName(appName string) *GetJobComponentDeploymentsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithEnvName(envName string) *GetJobComponentDeploymentsParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) WithJobComponentName(jobComponentName string) *GetJobComponentDeploymentsParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the get job component deployments params +func (o *GetJobComponentDeploymentsParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJobComponentDeploymentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetJobComponentDeployments binds the parameter Impersonate-Group +func (o *GetJobComponentDeploymentsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/get_job_component_deployments_responses.go b/generated-client/client/job/get_job_component_deployments_responses.go new file mode 100644 index 0000000..0e5856d --- /dev/null +++ b/generated-client/client/job/get_job_component_deployments_responses.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetJobComponentDeploymentsReader is a Reader for the GetJobComponentDeployments structure. +type GetJobComponentDeploymentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJobComponentDeploymentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJobComponentDeploymentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetJobComponentDeploymentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/deployments] GetJobComponentDeployments", response, response.Code()) + } +} + +// NewGetJobComponentDeploymentsOK creates a GetJobComponentDeploymentsOK with default headers values +func NewGetJobComponentDeploymentsOK() *GetJobComponentDeploymentsOK { + return &GetJobComponentDeploymentsOK{} +} + +/* +GetJobComponentDeploymentsOK describes a response with status code 200, with default header values. + +Radix deployments +*/ +type GetJobComponentDeploymentsOK struct { + Payload []*models.DeploymentItem +} + +// IsSuccess returns true when this get job component deployments o k response has a 2xx status code +func (o *GetJobComponentDeploymentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get job component deployments o k response has a 3xx status code +func (o *GetJobComponentDeploymentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get job component deployments o k response has a 4xx status code +func (o *GetJobComponentDeploymentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get job component deployments o k response has a 5xx status code +func (o *GetJobComponentDeploymentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get job component deployments o k response a status code equal to that given +func (o *GetJobComponentDeploymentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get job component deployments o k response +func (o *GetJobComponentDeploymentsOK) Code() int { + return 200 +} + +func (o *GetJobComponentDeploymentsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/deployments][%d] getJobComponentDeploymentsOK %+v", 200, o.Payload) +} + +func (o *GetJobComponentDeploymentsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/deployments][%d] getJobComponentDeploymentsOK %+v", 200, o.Payload) +} + +func (o *GetJobComponentDeploymentsOK) GetPayload() []*models.DeploymentItem { + return o.Payload +} + +func (o *GetJobComponentDeploymentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobComponentDeploymentsNotFound creates a GetJobComponentDeploymentsNotFound with default headers values +func NewGetJobComponentDeploymentsNotFound() *GetJobComponentDeploymentsNotFound { + return &GetJobComponentDeploymentsNotFound{} +} + +/* +GetJobComponentDeploymentsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetJobComponentDeploymentsNotFound struct { +} + +// IsSuccess returns true when this get job component deployments not found response has a 2xx status code +func (o *GetJobComponentDeploymentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get job component deployments not found response has a 3xx status code +func (o *GetJobComponentDeploymentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get job component deployments not found response has a 4xx status code +func (o *GetJobComponentDeploymentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get job component deployments not found response has a 5xx status code +func (o *GetJobComponentDeploymentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get job component deployments not found response a status code equal to that given +func (o *GetJobComponentDeploymentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get job component deployments not found response +func (o *GetJobComponentDeploymentsNotFound) Code() int { + return 404 +} + +func (o *GetJobComponentDeploymentsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/deployments][%d] getJobComponentDeploymentsNotFound ", 404) +} + +func (o *GetJobComponentDeploymentsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/deployments][%d] getJobComponentDeploymentsNotFound ", 404) +} + +func (o *GetJobComponentDeploymentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/get_job_parameters.go b/generated-client/client/job/get_job_parameters.go new file mode 100644 index 0000000..aea0087 --- /dev/null +++ b/generated-client/client/job/get_job_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetJobParams creates a new GetJobParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetJobParams() *GetJobParams { + return &GetJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobParamsWithTimeout creates a new GetJobParams object +// with the ability to set a timeout on a request. +func NewGetJobParamsWithTimeout(timeout time.Duration) *GetJobParams { + return &GetJobParams{ + timeout: timeout, + } +} + +// NewGetJobParamsWithContext creates a new GetJobParams object +// with the ability to set a context for a request. +func NewGetJobParamsWithContext(ctx context.Context) *GetJobParams { + return &GetJobParams{ + Context: ctx, + } +} + +// NewGetJobParamsWithHTTPClient creates a new GetJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetJobParamsWithHTTPClient(client *http.Client) *GetJobParams { + return &GetJobParams{ + HTTPClient: client, + } +} + +/* +GetJobParams contains all the parameters to send to the API endpoint + + for the get job operation. + + Typically these are written to a http.Request. +*/ +type GetJobParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* JobName. + + Name of job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobParams) WithDefaults() *GetJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get job params +func (o *GetJobParams) WithTimeout(timeout time.Duration) *GetJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get job params +func (o *GetJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get job params +func (o *GetJobParams) WithContext(ctx context.Context) *GetJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get job params +func (o *GetJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get job params +func (o *GetJobParams) WithHTTPClient(client *http.Client) *GetJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get job params +func (o *GetJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get job params +func (o *GetJobParams) WithImpersonateGroup(impersonateGroup []string) *GetJobParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get job params +func (o *GetJobParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get job params +func (o *GetJobParams) WithImpersonateUser(impersonateUser *string) *GetJobParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get job params +func (o *GetJobParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get job params +func (o *GetJobParams) WithAppName(appName string) *GetJobParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get job params +func (o *GetJobParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get job params +func (o *GetJobParams) WithEnvName(envName string) *GetJobParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get job params +func (o *GetJobParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the get job params +func (o *GetJobParams) WithJobComponentName(jobComponentName string) *GetJobParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the get job params +func (o *GetJobParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithJobName adds the jobName to the get job params +func (o *GetJobParams) WithJobName(jobName string) *GetJobParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get job params +func (o *GetJobParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetJob binds the parameter Impersonate-Group +func (o *GetJobParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/get_job_payload_parameters.go b/generated-client/client/job/get_job_payload_parameters.go new file mode 100644 index 0000000..39376dc --- /dev/null +++ b/generated-client/client/job/get_job_payload_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetJobPayloadParams creates a new GetJobPayloadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetJobPayloadParams() *GetJobPayloadParams { + return &GetJobPayloadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobPayloadParamsWithTimeout creates a new GetJobPayloadParams object +// with the ability to set a timeout on a request. +func NewGetJobPayloadParamsWithTimeout(timeout time.Duration) *GetJobPayloadParams { + return &GetJobPayloadParams{ + timeout: timeout, + } +} + +// NewGetJobPayloadParamsWithContext creates a new GetJobPayloadParams object +// with the ability to set a context for a request. +func NewGetJobPayloadParamsWithContext(ctx context.Context) *GetJobPayloadParams { + return &GetJobPayloadParams{ + Context: ctx, + } +} + +// NewGetJobPayloadParamsWithHTTPClient creates a new GetJobPayloadParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetJobPayloadParamsWithHTTPClient(client *http.Client) *GetJobPayloadParams { + return &GetJobPayloadParams{ + HTTPClient: client, + } +} + +/* +GetJobPayloadParams contains all the parameters to send to the API endpoint + + for the get job payload operation. + + Typically these are written to a http.Request. +*/ +type GetJobPayloadParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* JobName. + + Name of job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get job payload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobPayloadParams) WithDefaults() *GetJobPayloadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get job payload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobPayloadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get job payload params +func (o *GetJobPayloadParams) WithTimeout(timeout time.Duration) *GetJobPayloadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get job payload params +func (o *GetJobPayloadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get job payload params +func (o *GetJobPayloadParams) WithContext(ctx context.Context) *GetJobPayloadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get job payload params +func (o *GetJobPayloadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get job payload params +func (o *GetJobPayloadParams) WithHTTPClient(client *http.Client) *GetJobPayloadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get job payload params +func (o *GetJobPayloadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get job payload params +func (o *GetJobPayloadParams) WithImpersonateGroup(impersonateGroup []string) *GetJobPayloadParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get job payload params +func (o *GetJobPayloadParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get job payload params +func (o *GetJobPayloadParams) WithImpersonateUser(impersonateUser *string) *GetJobPayloadParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get job payload params +func (o *GetJobPayloadParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get job payload params +func (o *GetJobPayloadParams) WithAppName(appName string) *GetJobPayloadParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get job payload params +func (o *GetJobPayloadParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get job payload params +func (o *GetJobPayloadParams) WithEnvName(envName string) *GetJobPayloadParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get job payload params +func (o *GetJobPayloadParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the get job payload params +func (o *GetJobPayloadParams) WithJobComponentName(jobComponentName string) *GetJobPayloadParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the get job payload params +func (o *GetJobPayloadParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithJobName adds the jobName to the get job payload params +func (o *GetJobPayloadParams) WithJobName(jobName string) *GetJobPayloadParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get job payload params +func (o *GetJobPayloadParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJobPayloadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetJobPayload binds the parameter Impersonate-Group +func (o *GetJobPayloadParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/get_job_payload_responses.go b/generated-client/client/job/get_job_payload_responses.go new file mode 100644 index 0000000..ad289a4 --- /dev/null +++ b/generated-client/client/job/get_job_payload_responses.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetJobPayloadReader is a Reader for the GetJobPayload structure. +type GetJobPayloadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJobPayloadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJobPayloadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetJobPayloadNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/payload] getJobPayload", response, response.Code()) + } +} + +// NewGetJobPayloadOK creates a GetJobPayloadOK with default headers values +func NewGetJobPayloadOK() *GetJobPayloadOK { + return &GetJobPayloadOK{} +} + +/* +GetJobPayloadOK describes a response with status code 200, with default header values. + +scheduled job payload +*/ +type GetJobPayloadOK struct { + Payload string +} + +// IsSuccess returns true when this get job payload o k response has a 2xx status code +func (o *GetJobPayloadOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get job payload o k response has a 3xx status code +func (o *GetJobPayloadOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get job payload o k response has a 4xx status code +func (o *GetJobPayloadOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get job payload o k response has a 5xx status code +func (o *GetJobPayloadOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get job payload o k response a status code equal to that given +func (o *GetJobPayloadOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get job payload o k response +func (o *GetJobPayloadOK) Code() int { + return 200 +} + +func (o *GetJobPayloadOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/payload][%d] getJobPayloadOK %+v", 200, o.Payload) +} + +func (o *GetJobPayloadOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/payload][%d] getJobPayloadOK %+v", 200, o.Payload) +} + +func (o *GetJobPayloadOK) GetPayload() string { + return o.Payload +} + +func (o *GetJobPayloadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobPayloadNotFound creates a GetJobPayloadNotFound with default headers values +func NewGetJobPayloadNotFound() *GetJobPayloadNotFound { + return &GetJobPayloadNotFound{} +} + +/* +GetJobPayloadNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetJobPayloadNotFound struct { +} + +// IsSuccess returns true when this get job payload not found response has a 2xx status code +func (o *GetJobPayloadNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get job payload not found response has a 3xx status code +func (o *GetJobPayloadNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get job payload not found response has a 4xx status code +func (o *GetJobPayloadNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get job payload not found response has a 5xx status code +func (o *GetJobPayloadNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get job payload not found response a status code equal to that given +func (o *GetJobPayloadNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get job payload not found response +func (o *GetJobPayloadNotFound) Code() int { + return 404 +} + +func (o *GetJobPayloadNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/payload][%d] getJobPayloadNotFound ", 404) +} + +func (o *GetJobPayloadNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/payload][%d] getJobPayloadNotFound ", 404) +} + +func (o *GetJobPayloadNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/get_job_responses.go b/generated-client/client/job/get_job_responses.go new file mode 100644 index 0000000..e5cb5b8 --- /dev/null +++ b/generated-client/client/job/get_job_responses.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetJobReader is a Reader for the GetJob structure. +type GetJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJobOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}] getJob", response, response.Code()) + } +} + +// NewGetJobOK creates a GetJobOK with default headers values +func NewGetJobOK() *GetJobOK { + return &GetJobOK{} +} + +/* +GetJobOK describes a response with status code 200, with default header values. + +scheduled job +*/ +type GetJobOK struct { + Payload *models.ScheduledJobSummary +} + +// IsSuccess returns true when this get job o k response has a 2xx status code +func (o *GetJobOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get job o k response has a 3xx status code +func (o *GetJobOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get job o k response has a 4xx status code +func (o *GetJobOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get job o k response has a 5xx status code +func (o *GetJobOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get job o k response a status code equal to that given +func (o *GetJobOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get job o k response +func (o *GetJobOK) Code() int { + return 200 +} + +func (o *GetJobOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] getJobOK %+v", 200, o.Payload) +} + +func (o *GetJobOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] getJobOK %+v", 200, o.Payload) +} + +func (o *GetJobOK) GetPayload() *models.ScheduledJobSummary { + return o.Payload +} + +func (o *GetJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledJobSummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobNotFound creates a GetJobNotFound with default headers values +func NewGetJobNotFound() *GetJobNotFound { + return &GetJobNotFound{} +} + +/* +GetJobNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetJobNotFound struct { +} + +// IsSuccess returns true when this get job not found response has a 2xx status code +func (o *GetJobNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get job not found response has a 3xx status code +func (o *GetJobNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get job not found response has a 4xx status code +func (o *GetJobNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get job not found response has a 5xx status code +func (o *GetJobNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get job not found response a status code equal to that given +func (o *GetJobNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get job not found response +func (o *GetJobNotFound) Code() int { + return 404 +} + +func (o *GetJobNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] getJobNotFound ", 404) +} + +func (o *GetJobNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}][%d] getJobNotFound ", 404) +} + +func (o *GetJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/get_jobs_parameters.go b/generated-client/client/job/get_jobs_parameters.go new file mode 100644 index 0000000..ae2c4c4 --- /dev/null +++ b/generated-client/client/job/get_jobs_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetJobsParams creates a new GetJobsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetJobsParams() *GetJobsParams { + return &GetJobsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobsParamsWithTimeout creates a new GetJobsParams object +// with the ability to set a timeout on a request. +func NewGetJobsParamsWithTimeout(timeout time.Duration) *GetJobsParams { + return &GetJobsParams{ + timeout: timeout, + } +} + +// NewGetJobsParamsWithContext creates a new GetJobsParams object +// with the ability to set a context for a request. +func NewGetJobsParamsWithContext(ctx context.Context) *GetJobsParams { + return &GetJobsParams{ + Context: ctx, + } +} + +// NewGetJobsParamsWithHTTPClient creates a new GetJobsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetJobsParamsWithHTTPClient(client *http.Client) *GetJobsParams { + return &GetJobsParams{ + HTTPClient: client, + } +} + +/* +GetJobsParams contains all the parameters to send to the API endpoint + + for the get jobs operation. + + Typically these are written to a http.Request. +*/ +type GetJobsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobsParams) WithDefaults() *GetJobsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get jobs params +func (o *GetJobsParams) WithTimeout(timeout time.Duration) *GetJobsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get jobs params +func (o *GetJobsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get jobs params +func (o *GetJobsParams) WithContext(ctx context.Context) *GetJobsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get jobs params +func (o *GetJobsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get jobs params +func (o *GetJobsParams) WithHTTPClient(client *http.Client) *GetJobsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get jobs params +func (o *GetJobsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get jobs params +func (o *GetJobsParams) WithImpersonateGroup(impersonateGroup []string) *GetJobsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get jobs params +func (o *GetJobsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get jobs params +func (o *GetJobsParams) WithImpersonateUser(impersonateUser *string) *GetJobsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get jobs params +func (o *GetJobsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get jobs params +func (o *GetJobsParams) WithAppName(appName string) *GetJobsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get jobs params +func (o *GetJobsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the get jobs params +func (o *GetJobsParams) WithEnvName(envName string) *GetJobsParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the get jobs params +func (o *GetJobsParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the get jobs params +func (o *GetJobsParams) WithJobComponentName(jobComponentName string) *GetJobsParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the get jobs params +func (o *GetJobsParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetJobs binds the parameter Impersonate-Group +func (o *GetJobsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/get_jobs_responses.go b/generated-client/client/job/get_jobs_responses.go new file mode 100644 index 0000000..d9bdd34 --- /dev/null +++ b/generated-client/client/job/get_jobs_responses.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetJobsReader is a Reader for the GetJobs structure. +type GetJobsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJobsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetJobsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs] getJobs", response, response.Code()) + } +} + +// NewGetJobsOK creates a GetJobsOK with default headers values +func NewGetJobsOK() *GetJobsOK { + return &GetJobsOK{} +} + +/* +GetJobsOK describes a response with status code 200, with default header values. + +scheduled jobs +*/ +type GetJobsOK struct { + Payload []*models.ScheduledJobSummary +} + +// IsSuccess returns true when this get jobs o k response has a 2xx status code +func (o *GetJobsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get jobs o k response has a 3xx status code +func (o *GetJobsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get jobs o k response has a 4xx status code +func (o *GetJobsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get jobs o k response has a 5xx status code +func (o *GetJobsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get jobs o k response a status code equal to that given +func (o *GetJobsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get jobs o k response +func (o *GetJobsOK) Code() int { + return 200 +} + +func (o *GetJobsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs][%d] getJobsOK %+v", 200, o.Payload) +} + +func (o *GetJobsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs][%d] getJobsOK %+v", 200, o.Payload) +} + +func (o *GetJobsOK) GetPayload() []*models.ScheduledJobSummary { + return o.Payload +} + +func (o *GetJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsNotFound creates a GetJobsNotFound with default headers values +func NewGetJobsNotFound() *GetJobsNotFound { + return &GetJobsNotFound{} +} + +/* +GetJobsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetJobsNotFound struct { +} + +// IsSuccess returns true when this get jobs not found response has a 2xx status code +func (o *GetJobsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get jobs not found response has a 3xx status code +func (o *GetJobsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get jobs not found response has a 4xx status code +func (o *GetJobsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get jobs not found response has a 5xx status code +func (o *GetJobsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get jobs not found response a status code equal to that given +func (o *GetJobsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get jobs not found response +func (o *GetJobsNotFound) Code() int { + return 404 +} + +func (o *GetJobsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs][%d] getJobsNotFound ", 404) +} + +func (o *GetJobsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs][%d] getJobsNotFound ", 404) +} + +func (o *GetJobsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/job_client.go b/generated-client/client/job/job_client.go new file mode 100644 index 0000000..d3b7778 --- /dev/null +++ b/generated-client/client/job/job_client.go @@ -0,0 +1,654 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new job API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for job API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetJobComponentDeployments(params *GetJobComponentDeploymentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobComponentDeploymentsOK, error) + + CopyBatch(params *CopyBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CopyBatchOK, error) + + CopyJob(params *CopyJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CopyJobOK, error) + + DeleteBatch(params *DeleteBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteBatchNoContent, error) + + DeleteJob(params *DeleteJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteJobNoContent, error) + + GetBatch(params *GetBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBatchOK, error) + + GetBatches(params *GetBatchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBatchesOK, error) + + GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobOK, error) + + GetJobPayload(params *GetJobPayloadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobPayloadOK, error) + + GetJobs(params *GetJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobsOK, error) + + JobLog(params *JobLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*JobLogOK, error) + + RestartBatch(params *RestartBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartBatchNoContent, error) + + RestartJob(params *RestartJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartJobNoContent, error) + + StopBatch(params *StopBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopBatchNoContent, error) + + StopJob(params *StopJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopJobNoContent, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetJobComponentDeployments gets list of deployments for the job component +*/ +func (a *Client) GetJobComponentDeployments(params *GetJobComponentDeploymentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobComponentDeploymentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobComponentDeploymentsParams() + } + op := &runtime.ClientOperation{ + ID: "GetJobComponentDeployments", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/deployments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetJobComponentDeploymentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetJobComponentDeploymentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetJobComponentDeployments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CopyBatch creates a copy of existing scheduled batch with optional changes +*/ +func (a *Client) CopyBatch(params *CopyBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CopyBatchOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCopyBatchParams() + } + op := &runtime.ClientOperation{ + ID: "copyBatch", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/copy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CopyBatchReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CopyBatchOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for copyBatch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CopyJob creates a copy of existing scheduled job with optional changes +*/ +func (a *Client) CopyJob(params *CopyJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CopyJobOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCopyJobParams() + } + op := &runtime.ClientOperation{ + ID: "copyJob", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/copy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CopyJobReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CopyJobOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for copyJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteBatch deletes batch +*/ +func (a *Client) DeleteBatch(params *DeleteBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteBatchNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteBatchParams() + } + op := &runtime.ClientOperation{ + ID: "deleteBatch", + Method: "DELETE", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteBatchReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteBatchNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteBatch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteJob deletes job +*/ +func (a *Client) DeleteJob(params *DeleteJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteJobNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteJobParams() + } + op := &runtime.ClientOperation{ + ID: "deleteJob", + Method: "DELETE", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteJobReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteJobNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetBatch gets list of scheduled batches +*/ +func (a *Client) GetBatch(params *GetBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBatchOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBatchParams() + } + op := &runtime.ClientOperation{ + ID: "getBatch", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetBatchReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBatchOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBatch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetBatches gets list of scheduled batches +*/ +func (a *Client) GetBatches(params *GetBatchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBatchesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBatchesParams() + } + op := &runtime.ClientOperation{ + ID: "getBatches", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetBatchesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBatchesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBatches: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetJob gets list of scheduled jobs +*/ +func (a *Client) GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobParams() + } + op := &runtime.ClientOperation{ + ID: "getJob", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetJobReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetJobOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetJobPayload gets payload of a scheduled job +*/ +func (a *Client) GetJobPayload(params *GetJobPayloadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobPayloadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobPayloadParams() + } + op := &runtime.ClientOperation{ + ID: "getJobPayload", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/payload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetJobPayloadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetJobPayloadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getJobPayload: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetJobs gets list of scheduled jobs +*/ +func (a *Client) GetJobs(params *GetJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobsParams() + } + op := &runtime.ClientOperation{ + ID: "getJobs", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetJobsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetJobsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +JobLog gets log from a scheduled job +*/ +func (a *Client) JobLog(params *JobLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*JobLogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobLogParams() + } + op := &runtime.ClientOperation{ + ID: "jobLog", + Method: "GET", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/scheduledjobs/{scheduledJobName}/logs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &JobLogReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*JobLogOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for jobLog: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RestartBatch restarts a scheduled or stopped batch +*/ +func (a *Client) RestartBatch(params *RestartBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartBatchNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestartBatchParams() + } + op := &runtime.ClientOperation{ + ID: "restartBatch", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RestartBatchReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RestartBatchNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for restartBatch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RestartJob restarts a running or stopped scheduled job +*/ +func (a *Client) RestartJob(params *RestartJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestartJobNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestartJobParams() + } + op := &runtime.ClientOperation{ + ID: "restartJob", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RestartJobReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RestartJobNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for restartJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StopBatch stops scheduled batch +*/ +func (a *Client) StopBatch(params *StopBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopBatchNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStopBatchParams() + } + op := &runtime.ClientOperation{ + ID: "stopBatch", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StopBatchReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StopBatchNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stopBatch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StopJob stops scheduled job +*/ +func (a *Client) StopJob(params *StopJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopJobNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStopJobParams() + } + op := &runtime.ClientOperation{ + ID: "stopJob", + Method: "POST", + PathPattern: "/applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StopJobReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StopJobNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stopJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/job/job_log_parameters.go b/generated-client/client/job/job_log_parameters.go new file mode 100644 index 0000000..59f6fae --- /dev/null +++ b/generated-client/client/job/job_log_parameters.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewJobLogParams creates a new JobLogParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewJobLogParams() *JobLogParams { + return &JobLogParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewJobLogParamsWithTimeout creates a new JobLogParams object +// with the ability to set a timeout on a request. +func NewJobLogParamsWithTimeout(timeout time.Duration) *JobLogParams { + return &JobLogParams{ + timeout: timeout, + } +} + +// NewJobLogParamsWithContext creates a new JobLogParams object +// with the ability to set a context for a request. +func NewJobLogParamsWithContext(ctx context.Context) *JobLogParams { + return &JobLogParams{ + Context: ctx, + } +} + +// NewJobLogParamsWithHTTPClient creates a new JobLogParams object +// with the ability to set a custom HTTPClient for a request. +func NewJobLogParamsWithHTTPClient(client *http.Client) *JobLogParams { + return &JobLogParams{ + HTTPClient: client, + } +} + +/* +JobLogParams contains all the parameters to send to the API endpoint + + for the job log operation. + + Typically these are written to a http.Request. +*/ +type JobLogParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* File. + + Get log as a file if true + + Format: boolean + */ + File *string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* Lines. + + Get log lines (example 1000) + + Format: number + */ + Lines *string + + /* ScheduledJobName. + + Name of scheduled job + */ + ScheduledJobName string + + /* SinceTime. + + Get log only from sinceTime (example 2020-03-18T07:20:41+00:00) + + Format: date-time + */ + SinceTime *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the job log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *JobLogParams) WithDefaults() *JobLogParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the job log params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *JobLogParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the job log params +func (o *JobLogParams) WithTimeout(timeout time.Duration) *JobLogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the job log params +func (o *JobLogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the job log params +func (o *JobLogParams) WithContext(ctx context.Context) *JobLogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the job log params +func (o *JobLogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the job log params +func (o *JobLogParams) WithHTTPClient(client *http.Client) *JobLogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the job log params +func (o *JobLogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the job log params +func (o *JobLogParams) WithImpersonateGroup(impersonateGroup []string) *JobLogParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the job log params +func (o *JobLogParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the job log params +func (o *JobLogParams) WithImpersonateUser(impersonateUser *string) *JobLogParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the job log params +func (o *JobLogParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the job log params +func (o *JobLogParams) WithAppName(appName string) *JobLogParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the job log params +func (o *JobLogParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the job log params +func (o *JobLogParams) WithEnvName(envName string) *JobLogParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the job log params +func (o *JobLogParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithFile adds the file to the job log params +func (o *JobLogParams) WithFile(file *string) *JobLogParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the job log params +func (o *JobLogParams) SetFile(file *string) { + o.File = file +} + +// WithJobComponentName adds the jobComponentName to the job log params +func (o *JobLogParams) WithJobComponentName(jobComponentName string) *JobLogParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the job log params +func (o *JobLogParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithLines adds the lines to the job log params +func (o *JobLogParams) WithLines(lines *string) *JobLogParams { + o.SetLines(lines) + return o +} + +// SetLines adds the lines to the job log params +func (o *JobLogParams) SetLines(lines *string) { + o.Lines = lines +} + +// WithScheduledJobName adds the scheduledJobName to the job log params +func (o *JobLogParams) WithScheduledJobName(scheduledJobName string) *JobLogParams { + o.SetScheduledJobName(scheduledJobName) + return o +} + +// SetScheduledJobName adds the scheduledJobName to the job log params +func (o *JobLogParams) SetScheduledJobName(scheduledJobName string) { + o.ScheduledJobName = scheduledJobName +} + +// WithSinceTime adds the sinceTime to the job log params +func (o *JobLogParams) WithSinceTime(sinceTime *strfmt.DateTime) *JobLogParams { + o.SetSinceTime(sinceTime) + return o +} + +// SetSinceTime adds the sinceTime to the job log params +func (o *JobLogParams) SetSinceTime(sinceTime *strfmt.DateTime) { + o.SinceTime = sinceTime +} + +// WriteToRequest writes these params to a swagger request +func (o *JobLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + if o.File != nil { + + // query param file + var qrFile string + + if o.File != nil { + qrFile = *o.File + } + qFile := qrFile + if qFile != "" { + + if err := r.SetQueryParam("file", qFile); err != nil { + return err + } + } + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if o.Lines != nil { + + // query param lines + var qrLines string + + if o.Lines != nil { + qrLines = *o.Lines + } + qLines := qrLines + if qLines != "" { + + if err := r.SetQueryParam("lines", qLines); err != nil { + return err + } + } + } + + // path param scheduledJobName + if err := r.SetPathParam("scheduledJobName", o.ScheduledJobName); err != nil { + return err + } + + if o.SinceTime != nil { + + // query param sinceTime + var qrSinceTime strfmt.DateTime + + if o.SinceTime != nil { + qrSinceTime = *o.SinceTime + } + qSinceTime := qrSinceTime.String() + if qSinceTime != "" { + + if err := r.SetQueryParam("sinceTime", qSinceTime); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamJobLog binds the parameter Impersonate-Group +func (o *JobLogParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/job_log_responses.go b/generated-client/client/job/job_log_responses.go new file mode 100644 index 0000000..21df6c5 --- /dev/null +++ b/generated-client/client/job/job_log_responses.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// JobLogReader is a Reader for the JobLog structure. +type JobLogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *JobLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewJobLogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewJobLogNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/scheduledjobs/{scheduledJobName}/logs] jobLog", response, response.Code()) + } +} + +// NewJobLogOK creates a JobLogOK with default headers values +func NewJobLogOK() *JobLogOK { + return &JobLogOK{} +} + +/* +JobLogOK describes a response with status code 200, with default header values. + +scheduled job log +*/ +type JobLogOK struct { + Payload string +} + +// IsSuccess returns true when this job log o k response has a 2xx status code +func (o *JobLogOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this job log o k response has a 3xx status code +func (o *JobLogOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this job log o k response has a 4xx status code +func (o *JobLogOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this job log o k response has a 5xx status code +func (o *JobLogOK) IsServerError() bool { + return false +} + +// IsCode returns true when this job log o k response a status code equal to that given +func (o *JobLogOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the job log o k response +func (o *JobLogOK) Code() int { + return 200 +} + +func (o *JobLogOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/scheduledjobs/{scheduledJobName}/logs][%d] jobLogOK %+v", 200, o.Payload) +} + +func (o *JobLogOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/scheduledjobs/{scheduledJobName}/logs][%d] jobLogOK %+v", 200, o.Payload) +} + +func (o *JobLogOK) GetPayload() string { + return o.Payload +} + +func (o *JobLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewJobLogNotFound creates a JobLogNotFound with default headers values +func NewJobLogNotFound() *JobLogNotFound { + return &JobLogNotFound{} +} + +/* +JobLogNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type JobLogNotFound struct { +} + +// IsSuccess returns true when this job log not found response has a 2xx status code +func (o *JobLogNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this job log not found response has a 3xx status code +func (o *JobLogNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this job log not found response has a 4xx status code +func (o *JobLogNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this job log not found response has a 5xx status code +func (o *JobLogNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this job log not found response a status code equal to that given +func (o *JobLogNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the job log not found response +func (o *JobLogNotFound) Code() int { + return 404 +} + +func (o *JobLogNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/scheduledjobs/{scheduledJobName}/logs][%d] jobLogNotFound ", 404) +} + +func (o *JobLogNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/scheduledjobs/{scheduledJobName}/logs][%d] jobLogNotFound ", 404) +} + +func (o *JobLogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/restart_batch_parameters.go b/generated-client/client/job/restart_batch_parameters.go new file mode 100644 index 0000000..7444245 --- /dev/null +++ b/generated-client/client/job/restart_batch_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRestartBatchParams creates a new RestartBatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRestartBatchParams() *RestartBatchParams { + return &RestartBatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRestartBatchParamsWithTimeout creates a new RestartBatchParams object +// with the ability to set a timeout on a request. +func NewRestartBatchParamsWithTimeout(timeout time.Duration) *RestartBatchParams { + return &RestartBatchParams{ + timeout: timeout, + } +} + +// NewRestartBatchParamsWithContext creates a new RestartBatchParams object +// with the ability to set a context for a request. +func NewRestartBatchParamsWithContext(ctx context.Context) *RestartBatchParams { + return &RestartBatchParams{ + Context: ctx, + } +} + +// NewRestartBatchParamsWithHTTPClient creates a new RestartBatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewRestartBatchParamsWithHTTPClient(client *http.Client) *RestartBatchParams { + return &RestartBatchParams{ + HTTPClient: client, + } +} + +/* +RestartBatchParams contains all the parameters to send to the API endpoint + + for the restart batch operation. + + Typically these are written to a http.Request. +*/ +type RestartBatchParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* BatchName. + + Name of batch + */ + BatchName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the restart batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartBatchParams) WithDefaults() *RestartBatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartBatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the restart batch params +func (o *RestartBatchParams) WithTimeout(timeout time.Duration) *RestartBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restart batch params +func (o *RestartBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restart batch params +func (o *RestartBatchParams) WithContext(ctx context.Context) *RestartBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restart batch params +func (o *RestartBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restart batch params +func (o *RestartBatchParams) WithHTTPClient(client *http.Client) *RestartBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restart batch params +func (o *RestartBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the restart batch params +func (o *RestartBatchParams) WithImpersonateGroup(impersonateGroup []string) *RestartBatchParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the restart batch params +func (o *RestartBatchParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the restart batch params +func (o *RestartBatchParams) WithImpersonateUser(impersonateUser *string) *RestartBatchParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the restart batch params +func (o *RestartBatchParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the restart batch params +func (o *RestartBatchParams) WithAppName(appName string) *RestartBatchParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the restart batch params +func (o *RestartBatchParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithBatchName adds the batchName to the restart batch params +func (o *RestartBatchParams) WithBatchName(batchName string) *RestartBatchParams { + o.SetBatchName(batchName) + return o +} + +// SetBatchName adds the batchName to the restart batch params +func (o *RestartBatchParams) SetBatchName(batchName string) { + o.BatchName = batchName +} + +// WithEnvName adds the envName to the restart batch params +func (o *RestartBatchParams) WithEnvName(envName string) *RestartBatchParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the restart batch params +func (o *RestartBatchParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the restart batch params +func (o *RestartBatchParams) WithJobComponentName(jobComponentName string) *RestartBatchParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the restart batch params +func (o *RestartBatchParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WriteToRequest writes these params to a swagger request +func (o *RestartBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param batchName + if err := r.SetPathParam("batchName", o.BatchName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRestartBatch binds the parameter Impersonate-Group +func (o *RestartBatchParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/restart_batch_responses.go b/generated-client/client/job/restart_batch_responses.go new file mode 100644 index 0000000..16680d3 --- /dev/null +++ b/generated-client/client/job/restart_batch_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RestartBatchReader is a Reader for the RestartBatch structure. +type RestartBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestartBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewRestartBatchNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewRestartBatchBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewRestartBatchUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewRestartBatchForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRestartBatchNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart] restartBatch", response, response.Code()) + } +} + +// NewRestartBatchNoContent creates a RestartBatchNoContent with default headers values +func NewRestartBatchNoContent() *RestartBatchNoContent { + return &RestartBatchNoContent{} +} + +/* +RestartBatchNoContent describes a response with status code 204, with default header values. + +Success +*/ +type RestartBatchNoContent struct { +} + +// IsSuccess returns true when this restart batch no content response has a 2xx status code +func (o *RestartBatchNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this restart batch no content response has a 3xx status code +func (o *RestartBatchNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart batch no content response has a 4xx status code +func (o *RestartBatchNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this restart batch no content response has a 5xx status code +func (o *RestartBatchNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this restart batch no content response a status code equal to that given +func (o *RestartBatchNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the restart batch no content response +func (o *RestartBatchNoContent) Code() int { + return 204 +} + +func (o *RestartBatchNoContent) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchNoContent ", 204) +} + +func (o *RestartBatchNoContent) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchNoContent ", 204) +} + +func (o *RestartBatchNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartBatchBadRequest creates a RestartBatchBadRequest with default headers values +func NewRestartBatchBadRequest() *RestartBatchBadRequest { + return &RestartBatchBadRequest{} +} + +/* +RestartBatchBadRequest describes a response with status code 400, with default header values. + +Invalid batch +*/ +type RestartBatchBadRequest struct { +} + +// IsSuccess returns true when this restart batch bad request response has a 2xx status code +func (o *RestartBatchBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart batch bad request response has a 3xx status code +func (o *RestartBatchBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart batch bad request response has a 4xx status code +func (o *RestartBatchBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart batch bad request response has a 5xx status code +func (o *RestartBatchBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this restart batch bad request response a status code equal to that given +func (o *RestartBatchBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the restart batch bad request response +func (o *RestartBatchBadRequest) Code() int { + return 400 +} + +func (o *RestartBatchBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchBadRequest ", 400) +} + +func (o *RestartBatchBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchBadRequest ", 400) +} + +func (o *RestartBatchBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartBatchUnauthorized creates a RestartBatchUnauthorized with default headers values +func NewRestartBatchUnauthorized() *RestartBatchUnauthorized { + return &RestartBatchUnauthorized{} +} + +/* +RestartBatchUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RestartBatchUnauthorized struct { +} + +// IsSuccess returns true when this restart batch unauthorized response has a 2xx status code +func (o *RestartBatchUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart batch unauthorized response has a 3xx status code +func (o *RestartBatchUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart batch unauthorized response has a 4xx status code +func (o *RestartBatchUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart batch unauthorized response has a 5xx status code +func (o *RestartBatchUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this restart batch unauthorized response a status code equal to that given +func (o *RestartBatchUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the restart batch unauthorized response +func (o *RestartBatchUnauthorized) Code() int { + return 401 +} + +func (o *RestartBatchUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchUnauthorized ", 401) +} + +func (o *RestartBatchUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchUnauthorized ", 401) +} + +func (o *RestartBatchUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartBatchForbidden creates a RestartBatchForbidden with default headers values +func NewRestartBatchForbidden() *RestartBatchForbidden { + return &RestartBatchForbidden{} +} + +/* +RestartBatchForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type RestartBatchForbidden struct { +} + +// IsSuccess returns true when this restart batch forbidden response has a 2xx status code +func (o *RestartBatchForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart batch forbidden response has a 3xx status code +func (o *RestartBatchForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart batch forbidden response has a 4xx status code +func (o *RestartBatchForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart batch forbidden response has a 5xx status code +func (o *RestartBatchForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this restart batch forbidden response a status code equal to that given +func (o *RestartBatchForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the restart batch forbidden response +func (o *RestartBatchForbidden) Code() int { + return 403 +} + +func (o *RestartBatchForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchForbidden ", 403) +} + +func (o *RestartBatchForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchForbidden ", 403) +} + +func (o *RestartBatchForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartBatchNotFound creates a RestartBatchNotFound with default headers values +func NewRestartBatchNotFound() *RestartBatchNotFound { + return &RestartBatchNotFound{} +} + +/* +RestartBatchNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RestartBatchNotFound struct { +} + +// IsSuccess returns true when this restart batch not found response has a 2xx status code +func (o *RestartBatchNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart batch not found response has a 3xx status code +func (o *RestartBatchNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart batch not found response has a 4xx status code +func (o *RestartBatchNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart batch not found response has a 5xx status code +func (o *RestartBatchNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this restart batch not found response a status code equal to that given +func (o *RestartBatchNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the restart batch not found response +func (o *RestartBatchNotFound) Code() int { + return 404 +} + +func (o *RestartBatchNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchNotFound ", 404) +} + +func (o *RestartBatchNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/restart][%d] restartBatchNotFound ", 404) +} + +func (o *RestartBatchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/restart_job_parameters.go b/generated-client/client/job/restart_job_parameters.go new file mode 100644 index 0000000..f117a7b --- /dev/null +++ b/generated-client/client/job/restart_job_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRestartJobParams creates a new RestartJobParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRestartJobParams() *RestartJobParams { + return &RestartJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRestartJobParamsWithTimeout creates a new RestartJobParams object +// with the ability to set a timeout on a request. +func NewRestartJobParamsWithTimeout(timeout time.Duration) *RestartJobParams { + return &RestartJobParams{ + timeout: timeout, + } +} + +// NewRestartJobParamsWithContext creates a new RestartJobParams object +// with the ability to set a context for a request. +func NewRestartJobParamsWithContext(ctx context.Context) *RestartJobParams { + return &RestartJobParams{ + Context: ctx, + } +} + +// NewRestartJobParamsWithHTTPClient creates a new RestartJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewRestartJobParamsWithHTTPClient(client *http.Client) *RestartJobParams { + return &RestartJobParams{ + HTTPClient: client, + } +} + +/* +RestartJobParams contains all the parameters to send to the API endpoint + + for the restart job operation. + + Typically these are written to a http.Request. +*/ +type RestartJobParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* JobName. + + Name of job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the restart job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartJobParams) WithDefaults() *RestartJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the restart job params +func (o *RestartJobParams) WithTimeout(timeout time.Duration) *RestartJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restart job params +func (o *RestartJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restart job params +func (o *RestartJobParams) WithContext(ctx context.Context) *RestartJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restart job params +func (o *RestartJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restart job params +func (o *RestartJobParams) WithHTTPClient(client *http.Client) *RestartJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restart job params +func (o *RestartJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the restart job params +func (o *RestartJobParams) WithImpersonateGroup(impersonateGroup []string) *RestartJobParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the restart job params +func (o *RestartJobParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the restart job params +func (o *RestartJobParams) WithImpersonateUser(impersonateUser *string) *RestartJobParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the restart job params +func (o *RestartJobParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the restart job params +func (o *RestartJobParams) WithAppName(appName string) *RestartJobParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the restart job params +func (o *RestartJobParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the restart job params +func (o *RestartJobParams) WithEnvName(envName string) *RestartJobParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the restart job params +func (o *RestartJobParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the restart job params +func (o *RestartJobParams) WithJobComponentName(jobComponentName string) *RestartJobParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the restart job params +func (o *RestartJobParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithJobName adds the jobName to the restart job params +func (o *RestartJobParams) WithJobName(jobName string) *RestartJobParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the restart job params +func (o *RestartJobParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *RestartJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRestartJob binds the parameter Impersonate-Group +func (o *RestartJobParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/restart_job_responses.go b/generated-client/client/job/restart_job_responses.go new file mode 100644 index 0000000..045a363 --- /dev/null +++ b/generated-client/client/job/restart_job_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RestartJobReader is a Reader for the RestartJob structure. +type RestartJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestartJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewRestartJobNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewRestartJobBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewRestartJobUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewRestartJobForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRestartJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart] restartJob", response, response.Code()) + } +} + +// NewRestartJobNoContent creates a RestartJobNoContent with default headers values +func NewRestartJobNoContent() *RestartJobNoContent { + return &RestartJobNoContent{} +} + +/* +RestartJobNoContent describes a response with status code 204, with default header values. + +Success +*/ +type RestartJobNoContent struct { +} + +// IsSuccess returns true when this restart job no content response has a 2xx status code +func (o *RestartJobNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this restart job no content response has a 3xx status code +func (o *RestartJobNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart job no content response has a 4xx status code +func (o *RestartJobNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this restart job no content response has a 5xx status code +func (o *RestartJobNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this restart job no content response a status code equal to that given +func (o *RestartJobNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the restart job no content response +func (o *RestartJobNoContent) Code() int { + return 204 +} + +func (o *RestartJobNoContent) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobNoContent ", 204) +} + +func (o *RestartJobNoContent) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobNoContent ", 204) +} + +func (o *RestartJobNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartJobBadRequest creates a RestartJobBadRequest with default headers values +func NewRestartJobBadRequest() *RestartJobBadRequest { + return &RestartJobBadRequest{} +} + +/* +RestartJobBadRequest describes a response with status code 400, with default header values. + +Invalid job +*/ +type RestartJobBadRequest struct { +} + +// IsSuccess returns true when this restart job bad request response has a 2xx status code +func (o *RestartJobBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart job bad request response has a 3xx status code +func (o *RestartJobBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart job bad request response has a 4xx status code +func (o *RestartJobBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart job bad request response has a 5xx status code +func (o *RestartJobBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this restart job bad request response a status code equal to that given +func (o *RestartJobBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the restart job bad request response +func (o *RestartJobBadRequest) Code() int { + return 400 +} + +func (o *RestartJobBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobBadRequest ", 400) +} + +func (o *RestartJobBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobBadRequest ", 400) +} + +func (o *RestartJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartJobUnauthorized creates a RestartJobUnauthorized with default headers values +func NewRestartJobUnauthorized() *RestartJobUnauthorized { + return &RestartJobUnauthorized{} +} + +/* +RestartJobUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RestartJobUnauthorized struct { +} + +// IsSuccess returns true when this restart job unauthorized response has a 2xx status code +func (o *RestartJobUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart job unauthorized response has a 3xx status code +func (o *RestartJobUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart job unauthorized response has a 4xx status code +func (o *RestartJobUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart job unauthorized response has a 5xx status code +func (o *RestartJobUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this restart job unauthorized response a status code equal to that given +func (o *RestartJobUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the restart job unauthorized response +func (o *RestartJobUnauthorized) Code() int { + return 401 +} + +func (o *RestartJobUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobUnauthorized ", 401) +} + +func (o *RestartJobUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobUnauthorized ", 401) +} + +func (o *RestartJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartJobForbidden creates a RestartJobForbidden with default headers values +func NewRestartJobForbidden() *RestartJobForbidden { + return &RestartJobForbidden{} +} + +/* +RestartJobForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type RestartJobForbidden struct { +} + +// IsSuccess returns true when this restart job forbidden response has a 2xx status code +func (o *RestartJobForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart job forbidden response has a 3xx status code +func (o *RestartJobForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart job forbidden response has a 4xx status code +func (o *RestartJobForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart job forbidden response has a 5xx status code +func (o *RestartJobForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this restart job forbidden response a status code equal to that given +func (o *RestartJobForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the restart job forbidden response +func (o *RestartJobForbidden) Code() int { + return 403 +} + +func (o *RestartJobForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobForbidden ", 403) +} + +func (o *RestartJobForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobForbidden ", 403) +} + +func (o *RestartJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRestartJobNotFound creates a RestartJobNotFound with default headers values +func NewRestartJobNotFound() *RestartJobNotFound { + return &RestartJobNotFound{} +} + +/* +RestartJobNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type RestartJobNotFound struct { +} + +// IsSuccess returns true when this restart job not found response has a 2xx status code +func (o *RestartJobNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this restart job not found response has a 3xx status code +func (o *RestartJobNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restart job not found response has a 4xx status code +func (o *RestartJobNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this restart job not found response has a 5xx status code +func (o *RestartJobNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this restart job not found response a status code equal to that given +func (o *RestartJobNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the restart job not found response +func (o *RestartJobNotFound) Code() int { + return 404 +} + +func (o *RestartJobNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobNotFound ", 404) +} + +func (o *RestartJobNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/restart][%d] restartJobNotFound ", 404) +} + +func (o *RestartJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/stop_batch_parameters.go b/generated-client/client/job/stop_batch_parameters.go new file mode 100644 index 0000000..ece878b --- /dev/null +++ b/generated-client/client/job/stop_batch_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStopBatchParams creates a new StopBatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStopBatchParams() *StopBatchParams { + return &StopBatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStopBatchParamsWithTimeout creates a new StopBatchParams object +// with the ability to set a timeout on a request. +func NewStopBatchParamsWithTimeout(timeout time.Duration) *StopBatchParams { + return &StopBatchParams{ + timeout: timeout, + } +} + +// NewStopBatchParamsWithContext creates a new StopBatchParams object +// with the ability to set a context for a request. +func NewStopBatchParamsWithContext(ctx context.Context) *StopBatchParams { + return &StopBatchParams{ + Context: ctx, + } +} + +// NewStopBatchParamsWithHTTPClient creates a new StopBatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewStopBatchParamsWithHTTPClient(client *http.Client) *StopBatchParams { + return &StopBatchParams{ + HTTPClient: client, + } +} + +/* +StopBatchParams contains all the parameters to send to the API endpoint + + for the stop batch operation. + + Typically these are written to a http.Request. +*/ +type StopBatchParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* BatchName. + + Name of batch + */ + BatchName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stop batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopBatchParams) WithDefaults() *StopBatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stop batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopBatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stop batch params +func (o *StopBatchParams) WithTimeout(timeout time.Duration) *StopBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stop batch params +func (o *StopBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stop batch params +func (o *StopBatchParams) WithContext(ctx context.Context) *StopBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stop batch params +func (o *StopBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stop batch params +func (o *StopBatchParams) WithHTTPClient(client *http.Client) *StopBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stop batch params +func (o *StopBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the stop batch params +func (o *StopBatchParams) WithImpersonateGroup(impersonateGroup []string) *StopBatchParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the stop batch params +func (o *StopBatchParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the stop batch params +func (o *StopBatchParams) WithImpersonateUser(impersonateUser *string) *StopBatchParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the stop batch params +func (o *StopBatchParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the stop batch params +func (o *StopBatchParams) WithAppName(appName string) *StopBatchParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the stop batch params +func (o *StopBatchParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithBatchName adds the batchName to the stop batch params +func (o *StopBatchParams) WithBatchName(batchName string) *StopBatchParams { + o.SetBatchName(batchName) + return o +} + +// SetBatchName adds the batchName to the stop batch params +func (o *StopBatchParams) SetBatchName(batchName string) { + o.BatchName = batchName +} + +// WithEnvName adds the envName to the stop batch params +func (o *StopBatchParams) WithEnvName(envName string) *StopBatchParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the stop batch params +func (o *StopBatchParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the stop batch params +func (o *StopBatchParams) WithJobComponentName(jobComponentName string) *StopBatchParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the stop batch params +func (o *StopBatchParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WriteToRequest writes these params to a swagger request +func (o *StopBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param batchName + if err := r.SetPathParam("batchName", o.BatchName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStopBatch binds the parameter Impersonate-Group +func (o *StopBatchParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/stop_batch_responses.go b/generated-client/client/job/stop_batch_responses.go new file mode 100644 index 0000000..9edf0cc --- /dev/null +++ b/generated-client/client/job/stop_batch_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StopBatchReader is a Reader for the StopBatch structure. +type StopBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StopBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewStopBatchNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewStopBatchBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewStopBatchUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewStopBatchForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStopBatchNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop] stopBatch", response, response.Code()) + } +} + +// NewStopBatchNoContent creates a StopBatchNoContent with default headers values +func NewStopBatchNoContent() *StopBatchNoContent { + return &StopBatchNoContent{} +} + +/* +StopBatchNoContent describes a response with status code 204, with default header values. + +Success +*/ +type StopBatchNoContent struct { +} + +// IsSuccess returns true when this stop batch no content response has a 2xx status code +func (o *StopBatchNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stop batch no content response has a 3xx status code +func (o *StopBatchNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop batch no content response has a 4xx status code +func (o *StopBatchNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this stop batch no content response has a 5xx status code +func (o *StopBatchNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this stop batch no content response a status code equal to that given +func (o *StopBatchNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the stop batch no content response +func (o *StopBatchNoContent) Code() int { + return 204 +} + +func (o *StopBatchNoContent) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchNoContent ", 204) +} + +func (o *StopBatchNoContent) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchNoContent ", 204) +} + +func (o *StopBatchNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopBatchBadRequest creates a StopBatchBadRequest with default headers values +func NewStopBatchBadRequest() *StopBatchBadRequest { + return &StopBatchBadRequest{} +} + +/* +StopBatchBadRequest describes a response with status code 400, with default header values. + +Invalid batch +*/ +type StopBatchBadRequest struct { +} + +// IsSuccess returns true when this stop batch bad request response has a 2xx status code +func (o *StopBatchBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop batch bad request response has a 3xx status code +func (o *StopBatchBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop batch bad request response has a 4xx status code +func (o *StopBatchBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop batch bad request response has a 5xx status code +func (o *StopBatchBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this stop batch bad request response a status code equal to that given +func (o *StopBatchBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the stop batch bad request response +func (o *StopBatchBadRequest) Code() int { + return 400 +} + +func (o *StopBatchBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchBadRequest ", 400) +} + +func (o *StopBatchBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchBadRequest ", 400) +} + +func (o *StopBatchBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopBatchUnauthorized creates a StopBatchUnauthorized with default headers values +func NewStopBatchUnauthorized() *StopBatchUnauthorized { + return &StopBatchUnauthorized{} +} + +/* +StopBatchUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StopBatchUnauthorized struct { +} + +// IsSuccess returns true when this stop batch unauthorized response has a 2xx status code +func (o *StopBatchUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop batch unauthorized response has a 3xx status code +func (o *StopBatchUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop batch unauthorized response has a 4xx status code +func (o *StopBatchUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop batch unauthorized response has a 5xx status code +func (o *StopBatchUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this stop batch unauthorized response a status code equal to that given +func (o *StopBatchUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the stop batch unauthorized response +func (o *StopBatchUnauthorized) Code() int { + return 401 +} + +func (o *StopBatchUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchUnauthorized ", 401) +} + +func (o *StopBatchUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchUnauthorized ", 401) +} + +func (o *StopBatchUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopBatchForbidden creates a StopBatchForbidden with default headers values +func NewStopBatchForbidden() *StopBatchForbidden { + return &StopBatchForbidden{} +} + +/* +StopBatchForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type StopBatchForbidden struct { +} + +// IsSuccess returns true when this stop batch forbidden response has a 2xx status code +func (o *StopBatchForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop batch forbidden response has a 3xx status code +func (o *StopBatchForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop batch forbidden response has a 4xx status code +func (o *StopBatchForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop batch forbidden response has a 5xx status code +func (o *StopBatchForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this stop batch forbidden response a status code equal to that given +func (o *StopBatchForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the stop batch forbidden response +func (o *StopBatchForbidden) Code() int { + return 403 +} + +func (o *StopBatchForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchForbidden ", 403) +} + +func (o *StopBatchForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchForbidden ", 403) +} + +func (o *StopBatchForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopBatchNotFound creates a StopBatchNotFound with default headers values +func NewStopBatchNotFound() *StopBatchNotFound { + return &StopBatchNotFound{} +} + +/* +StopBatchNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StopBatchNotFound struct { +} + +// IsSuccess returns true when this stop batch not found response has a 2xx status code +func (o *StopBatchNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop batch not found response has a 3xx status code +func (o *StopBatchNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop batch not found response has a 4xx status code +func (o *StopBatchNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop batch not found response has a 5xx status code +func (o *StopBatchNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this stop batch not found response a status code equal to that given +func (o *StopBatchNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the stop batch not found response +func (o *StopBatchNotFound) Code() int { + return 404 +} + +func (o *StopBatchNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchNotFound ", 404) +} + +func (o *StopBatchNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/batches/{batchName}/stop][%d] stopBatchNotFound ", 404) +} + +func (o *StopBatchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/job/stop_job_parameters.go b/generated-client/client/job/stop_job_parameters.go new file mode 100644 index 0000000..99557c7 --- /dev/null +++ b/generated-client/client/job/stop_job_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStopJobParams creates a new StopJobParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStopJobParams() *StopJobParams { + return &StopJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStopJobParamsWithTimeout creates a new StopJobParams object +// with the ability to set a timeout on a request. +func NewStopJobParamsWithTimeout(timeout time.Duration) *StopJobParams { + return &StopJobParams{ + timeout: timeout, + } +} + +// NewStopJobParamsWithContext creates a new StopJobParams object +// with the ability to set a context for a request. +func NewStopJobParamsWithContext(ctx context.Context) *StopJobParams { + return &StopJobParams{ + Context: ctx, + } +} + +// NewStopJobParamsWithHTTPClient creates a new StopJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewStopJobParamsWithHTTPClient(client *http.Client) *StopJobParams { + return &StopJobParams{ + HTTPClient: client, + } +} + +/* +StopJobParams contains all the parameters to send to the API endpoint + + for the stop job operation. + + Typically these are written to a http.Request. +*/ +type StopJobParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + Name of application + */ + AppName string + + /* EnvName. + + Name of environment + */ + EnvName string + + /* JobComponentName. + + Name of job-component + */ + JobComponentName string + + /* JobName. + + Name of job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stop job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopJobParams) WithDefaults() *StopJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stop job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stop job params +func (o *StopJobParams) WithTimeout(timeout time.Duration) *StopJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stop job params +func (o *StopJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stop job params +func (o *StopJobParams) WithContext(ctx context.Context) *StopJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stop job params +func (o *StopJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stop job params +func (o *StopJobParams) WithHTTPClient(client *http.Client) *StopJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stop job params +func (o *StopJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the stop job params +func (o *StopJobParams) WithImpersonateGroup(impersonateGroup []string) *StopJobParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the stop job params +func (o *StopJobParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the stop job params +func (o *StopJobParams) WithImpersonateUser(impersonateUser *string) *StopJobParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the stop job params +func (o *StopJobParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the stop job params +func (o *StopJobParams) WithAppName(appName string) *StopJobParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the stop job params +func (o *StopJobParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithEnvName adds the envName to the stop job params +func (o *StopJobParams) WithEnvName(envName string) *StopJobParams { + o.SetEnvName(envName) + return o +} + +// SetEnvName adds the envName to the stop job params +func (o *StopJobParams) SetEnvName(envName string) { + o.EnvName = envName +} + +// WithJobComponentName adds the jobComponentName to the stop job params +func (o *StopJobParams) WithJobComponentName(jobComponentName string) *StopJobParams { + o.SetJobComponentName(jobComponentName) + return o +} + +// SetJobComponentName adds the jobComponentName to the stop job params +func (o *StopJobParams) SetJobComponentName(jobComponentName string) { + o.JobComponentName = jobComponentName +} + +// WithJobName adds the jobName to the stop job params +func (o *StopJobParams) WithJobName(jobName string) *StopJobParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the stop job params +func (o *StopJobParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *StopJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param envName + if err := r.SetPathParam("envName", o.EnvName); err != nil { + return err + } + + // path param jobComponentName + if err := r.SetPathParam("jobComponentName", o.JobComponentName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStopJob binds the parameter Impersonate-Group +func (o *StopJobParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/job/stop_job_responses.go b/generated-client/client/job/stop_job_responses.go new file mode 100644 index 0000000..0de5757 --- /dev/null +++ b/generated-client/client/job/stop_job_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StopJobReader is a Reader for the StopJob structure. +type StopJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StopJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewStopJobNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewStopJobBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewStopJobUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewStopJobForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStopJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop] stopJob", response, response.Code()) + } +} + +// NewStopJobNoContent creates a StopJobNoContent with default headers values +func NewStopJobNoContent() *StopJobNoContent { + return &StopJobNoContent{} +} + +/* +StopJobNoContent describes a response with status code 204, with default header values. + +Success +*/ +type StopJobNoContent struct { +} + +// IsSuccess returns true when this stop job no content response has a 2xx status code +func (o *StopJobNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stop job no content response has a 3xx status code +func (o *StopJobNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop job no content response has a 4xx status code +func (o *StopJobNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this stop job no content response has a 5xx status code +func (o *StopJobNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this stop job no content response a status code equal to that given +func (o *StopJobNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the stop job no content response +func (o *StopJobNoContent) Code() int { + return 204 +} + +func (o *StopJobNoContent) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobNoContent ", 204) +} + +func (o *StopJobNoContent) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobNoContent ", 204) +} + +func (o *StopJobNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopJobBadRequest creates a StopJobBadRequest with default headers values +func NewStopJobBadRequest() *StopJobBadRequest { + return &StopJobBadRequest{} +} + +/* +StopJobBadRequest describes a response with status code 400, with default header values. + +Invalid job +*/ +type StopJobBadRequest struct { +} + +// IsSuccess returns true when this stop job bad request response has a 2xx status code +func (o *StopJobBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop job bad request response has a 3xx status code +func (o *StopJobBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop job bad request response has a 4xx status code +func (o *StopJobBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop job bad request response has a 5xx status code +func (o *StopJobBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this stop job bad request response a status code equal to that given +func (o *StopJobBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the stop job bad request response +func (o *StopJobBadRequest) Code() int { + return 400 +} + +func (o *StopJobBadRequest) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobBadRequest ", 400) +} + +func (o *StopJobBadRequest) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobBadRequest ", 400) +} + +func (o *StopJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopJobUnauthorized creates a StopJobUnauthorized with default headers values +func NewStopJobUnauthorized() *StopJobUnauthorized { + return &StopJobUnauthorized{} +} + +/* +StopJobUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StopJobUnauthorized struct { +} + +// IsSuccess returns true when this stop job unauthorized response has a 2xx status code +func (o *StopJobUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop job unauthorized response has a 3xx status code +func (o *StopJobUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop job unauthorized response has a 4xx status code +func (o *StopJobUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop job unauthorized response has a 5xx status code +func (o *StopJobUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this stop job unauthorized response a status code equal to that given +func (o *StopJobUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the stop job unauthorized response +func (o *StopJobUnauthorized) Code() int { + return 401 +} + +func (o *StopJobUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobUnauthorized ", 401) +} + +func (o *StopJobUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobUnauthorized ", 401) +} + +func (o *StopJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopJobForbidden creates a StopJobForbidden with default headers values +func NewStopJobForbidden() *StopJobForbidden { + return &StopJobForbidden{} +} + +/* +StopJobForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type StopJobForbidden struct { +} + +// IsSuccess returns true when this stop job forbidden response has a 2xx status code +func (o *StopJobForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop job forbidden response has a 3xx status code +func (o *StopJobForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop job forbidden response has a 4xx status code +func (o *StopJobForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop job forbidden response has a 5xx status code +func (o *StopJobForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this stop job forbidden response a status code equal to that given +func (o *StopJobForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the stop job forbidden response +func (o *StopJobForbidden) Code() int { + return 403 +} + +func (o *StopJobForbidden) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobForbidden ", 403) +} + +func (o *StopJobForbidden) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobForbidden ", 403) +} + +func (o *StopJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopJobNotFound creates a StopJobNotFound with default headers values +func NewStopJobNotFound() *StopJobNotFound { + return &StopJobNotFound{} +} + +/* +StopJobNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StopJobNotFound struct { +} + +// IsSuccess returns true when this stop job not found response has a 2xx status code +func (o *StopJobNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop job not found response has a 3xx status code +func (o *StopJobNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop job not found response has a 4xx status code +func (o *StopJobNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop job not found response has a 5xx status code +func (o *StopJobNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this stop job not found response a status code equal to that given +func (o *StopJobNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the stop job not found response +func (o *StopJobNotFound) Code() int { + return 404 +} + +func (o *StopJobNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobNotFound ", 404) +} + +func (o *StopJobNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/environments/{envName}/jobcomponents/{jobComponentName}/jobs/{jobName}/stop][%d] stopJobNotFound ", 404) +} + +func (o *StopJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_application_job_parameters.go b/generated-client/client/pipeline_job/get_application_job_parameters.go new file mode 100644 index 0000000..40f6d02 --- /dev/null +++ b/generated-client/client/pipeline_job/get_application_job_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetApplicationJobParams creates a new GetApplicationJobParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetApplicationJobParams() *GetApplicationJobParams { + return &GetApplicationJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetApplicationJobParamsWithTimeout creates a new GetApplicationJobParams object +// with the ability to set a timeout on a request. +func NewGetApplicationJobParamsWithTimeout(timeout time.Duration) *GetApplicationJobParams { + return &GetApplicationJobParams{ + timeout: timeout, + } +} + +// NewGetApplicationJobParamsWithContext creates a new GetApplicationJobParams object +// with the ability to set a context for a request. +func NewGetApplicationJobParamsWithContext(ctx context.Context) *GetApplicationJobParams { + return &GetApplicationJobParams{ + Context: ctx, + } +} + +// NewGetApplicationJobParamsWithHTTPClient creates a new GetApplicationJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetApplicationJobParamsWithHTTPClient(client *http.Client) *GetApplicationJobParams { + return &GetApplicationJobParams{ + HTTPClient: client, + } +} + +/* +GetApplicationJobParams contains all the parameters to send to the API endpoint + + for the get application job operation. + + Typically these are written to a http.Request. +*/ +type GetApplicationJobParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* JobName. + + name of job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get application job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationJobParams) WithDefaults() *GetApplicationJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get application job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get application job params +func (o *GetApplicationJobParams) WithTimeout(timeout time.Duration) *GetApplicationJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get application job params +func (o *GetApplicationJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get application job params +func (o *GetApplicationJobParams) WithContext(ctx context.Context) *GetApplicationJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get application job params +func (o *GetApplicationJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get application job params +func (o *GetApplicationJobParams) WithHTTPClient(client *http.Client) *GetApplicationJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get application job params +func (o *GetApplicationJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get application job params +func (o *GetApplicationJobParams) WithImpersonateGroup(impersonateGroup []string) *GetApplicationJobParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get application job params +func (o *GetApplicationJobParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get application job params +func (o *GetApplicationJobParams) WithImpersonateUser(impersonateUser *string) *GetApplicationJobParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get application job params +func (o *GetApplicationJobParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get application job params +func (o *GetApplicationJobParams) WithAppName(appName string) *GetApplicationJobParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get application job params +func (o *GetApplicationJobParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithJobName adds the jobName to the get application job params +func (o *GetApplicationJobParams) WithJobName(jobName string) *GetApplicationJobParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get application job params +func (o *GetApplicationJobParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetApplicationJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetApplicationJob binds the parameter Impersonate-Group +func (o *GetApplicationJobParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_application_job_responses.go b/generated-client/client/pipeline_job/get_application_job_responses.go new file mode 100644 index 0000000..51b1232 --- /dev/null +++ b/generated-client/client/pipeline_job/get_application_job_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetApplicationJobReader is a Reader for the GetApplicationJob structure. +type GetApplicationJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetApplicationJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetApplicationJobOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetApplicationJobUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetApplicationJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}] getApplicationJob", response, response.Code()) + } +} + +// NewGetApplicationJobOK creates a GetApplicationJobOK with default headers values +func NewGetApplicationJobOK() *GetApplicationJobOK { + return &GetApplicationJobOK{} +} + +/* +GetApplicationJobOK describes a response with status code 200, with default header values. + +Successful get job +*/ +type GetApplicationJobOK struct { + Payload *models.Job +} + +// IsSuccess returns true when this get application job o k response has a 2xx status code +func (o *GetApplicationJobOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get application job o k response has a 3xx status code +func (o *GetApplicationJobOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application job o k response has a 4xx status code +func (o *GetApplicationJobOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get application job o k response has a 5xx status code +func (o *GetApplicationJobOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get application job o k response a status code equal to that given +func (o *GetApplicationJobOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get application job o k response +func (o *GetApplicationJobOK) Code() int { + return 200 +} + +func (o *GetApplicationJobOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}][%d] getApplicationJobOK %+v", 200, o.Payload) +} + +func (o *GetApplicationJobOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}][%d] getApplicationJobOK %+v", 200, o.Payload) +} + +func (o *GetApplicationJobOK) GetPayload() *models.Job { + return o.Payload +} + +func (o *GetApplicationJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Job) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetApplicationJobUnauthorized creates a GetApplicationJobUnauthorized with default headers values +func NewGetApplicationJobUnauthorized() *GetApplicationJobUnauthorized { + return &GetApplicationJobUnauthorized{} +} + +/* +GetApplicationJobUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetApplicationJobUnauthorized struct { +} + +// IsSuccess returns true when this get application job unauthorized response has a 2xx status code +func (o *GetApplicationJobUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application job unauthorized response has a 3xx status code +func (o *GetApplicationJobUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application job unauthorized response has a 4xx status code +func (o *GetApplicationJobUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application job unauthorized response has a 5xx status code +func (o *GetApplicationJobUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get application job unauthorized response a status code equal to that given +func (o *GetApplicationJobUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get application job unauthorized response +func (o *GetApplicationJobUnauthorized) Code() int { + return 401 +} + +func (o *GetApplicationJobUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}][%d] getApplicationJobUnauthorized ", 401) +} + +func (o *GetApplicationJobUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}][%d] getApplicationJobUnauthorized ", 401) +} + +func (o *GetApplicationJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationJobNotFound creates a GetApplicationJobNotFound with default headers values +func NewGetApplicationJobNotFound() *GetApplicationJobNotFound { + return &GetApplicationJobNotFound{} +} + +/* +GetApplicationJobNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetApplicationJobNotFound struct { +} + +// IsSuccess returns true when this get application job not found response has a 2xx status code +func (o *GetApplicationJobNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application job not found response has a 3xx status code +func (o *GetApplicationJobNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application job not found response has a 4xx status code +func (o *GetApplicationJobNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application job not found response has a 5xx status code +func (o *GetApplicationJobNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get application job not found response a status code equal to that given +func (o *GetApplicationJobNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get application job not found response +func (o *GetApplicationJobNotFound) Code() int { + return 404 +} + +func (o *GetApplicationJobNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}][%d] getApplicationJobNotFound ", 404) +} + +func (o *GetApplicationJobNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}][%d] getApplicationJobNotFound ", 404) +} + +func (o *GetApplicationJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_application_jobs_parameters.go b/generated-client/client/pipeline_job/get_application_jobs_parameters.go new file mode 100644 index 0000000..0ce8127 --- /dev/null +++ b/generated-client/client/pipeline_job/get_application_jobs_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetApplicationJobsParams creates a new GetApplicationJobsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetApplicationJobsParams() *GetApplicationJobsParams { + return &GetApplicationJobsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetApplicationJobsParamsWithTimeout creates a new GetApplicationJobsParams object +// with the ability to set a timeout on a request. +func NewGetApplicationJobsParamsWithTimeout(timeout time.Duration) *GetApplicationJobsParams { + return &GetApplicationJobsParams{ + timeout: timeout, + } +} + +// NewGetApplicationJobsParamsWithContext creates a new GetApplicationJobsParams object +// with the ability to set a context for a request. +func NewGetApplicationJobsParamsWithContext(ctx context.Context) *GetApplicationJobsParams { + return &GetApplicationJobsParams{ + Context: ctx, + } +} + +// NewGetApplicationJobsParamsWithHTTPClient creates a new GetApplicationJobsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetApplicationJobsParamsWithHTTPClient(client *http.Client) *GetApplicationJobsParams { + return &GetApplicationJobsParams{ + HTTPClient: client, + } +} + +/* +GetApplicationJobsParams contains all the parameters to send to the API endpoint + + for the get application jobs operation. + + Typically these are written to a http.Request. +*/ +type GetApplicationJobsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get application jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationJobsParams) WithDefaults() *GetApplicationJobsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get application jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetApplicationJobsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get application jobs params +func (o *GetApplicationJobsParams) WithTimeout(timeout time.Duration) *GetApplicationJobsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get application jobs params +func (o *GetApplicationJobsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get application jobs params +func (o *GetApplicationJobsParams) WithContext(ctx context.Context) *GetApplicationJobsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get application jobs params +func (o *GetApplicationJobsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get application jobs params +func (o *GetApplicationJobsParams) WithHTTPClient(client *http.Client) *GetApplicationJobsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get application jobs params +func (o *GetApplicationJobsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get application jobs params +func (o *GetApplicationJobsParams) WithImpersonateGroup(impersonateGroup []string) *GetApplicationJobsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get application jobs params +func (o *GetApplicationJobsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get application jobs params +func (o *GetApplicationJobsParams) WithImpersonateUser(impersonateUser *string) *GetApplicationJobsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get application jobs params +func (o *GetApplicationJobsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get application jobs params +func (o *GetApplicationJobsParams) WithAppName(appName string) *GetApplicationJobsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get application jobs params +func (o *GetApplicationJobsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetApplicationJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetApplicationJobs binds the parameter Impersonate-Group +func (o *GetApplicationJobsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_application_jobs_responses.go b/generated-client/client/pipeline_job/get_application_jobs_responses.go new file mode 100644 index 0000000..132894a --- /dev/null +++ b/generated-client/client/pipeline_job/get_application_jobs_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetApplicationJobsReader is a Reader for the GetApplicationJobs structure. +type GetApplicationJobsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetApplicationJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetApplicationJobsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetApplicationJobsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetApplicationJobsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs] getApplicationJobs", response, response.Code()) + } +} + +// NewGetApplicationJobsOK creates a GetApplicationJobsOK with default headers values +func NewGetApplicationJobsOK() *GetApplicationJobsOK { + return &GetApplicationJobsOK{} +} + +/* +GetApplicationJobsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type GetApplicationJobsOK struct { + Payload []*models.JobSummary +} + +// IsSuccess returns true when this get application jobs o k response has a 2xx status code +func (o *GetApplicationJobsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get application jobs o k response has a 3xx status code +func (o *GetApplicationJobsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application jobs o k response has a 4xx status code +func (o *GetApplicationJobsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get application jobs o k response has a 5xx status code +func (o *GetApplicationJobsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get application jobs o k response a status code equal to that given +func (o *GetApplicationJobsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get application jobs o k response +func (o *GetApplicationJobsOK) Code() int { + return 200 +} + +func (o *GetApplicationJobsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs][%d] getApplicationJobsOK %+v", 200, o.Payload) +} + +func (o *GetApplicationJobsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs][%d] getApplicationJobsOK %+v", 200, o.Payload) +} + +func (o *GetApplicationJobsOK) GetPayload() []*models.JobSummary { + return o.Payload +} + +func (o *GetApplicationJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetApplicationJobsUnauthorized creates a GetApplicationJobsUnauthorized with default headers values +func NewGetApplicationJobsUnauthorized() *GetApplicationJobsUnauthorized { + return &GetApplicationJobsUnauthorized{} +} + +/* +GetApplicationJobsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetApplicationJobsUnauthorized struct { +} + +// IsSuccess returns true when this get application jobs unauthorized response has a 2xx status code +func (o *GetApplicationJobsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application jobs unauthorized response has a 3xx status code +func (o *GetApplicationJobsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application jobs unauthorized response has a 4xx status code +func (o *GetApplicationJobsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application jobs unauthorized response has a 5xx status code +func (o *GetApplicationJobsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get application jobs unauthorized response a status code equal to that given +func (o *GetApplicationJobsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get application jobs unauthorized response +func (o *GetApplicationJobsUnauthorized) Code() int { + return 401 +} + +func (o *GetApplicationJobsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs][%d] getApplicationJobsUnauthorized ", 401) +} + +func (o *GetApplicationJobsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs][%d] getApplicationJobsUnauthorized ", 401) +} + +func (o *GetApplicationJobsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetApplicationJobsNotFound creates a GetApplicationJobsNotFound with default headers values +func NewGetApplicationJobsNotFound() *GetApplicationJobsNotFound { + return &GetApplicationJobsNotFound{} +} + +/* +GetApplicationJobsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetApplicationJobsNotFound struct { +} + +// IsSuccess returns true when this get application jobs not found response has a 2xx status code +func (o *GetApplicationJobsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get application jobs not found response has a 3xx status code +func (o *GetApplicationJobsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get application jobs not found response has a 4xx status code +func (o *GetApplicationJobsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get application jobs not found response has a 5xx status code +func (o *GetApplicationJobsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get application jobs not found response a status code equal to that given +func (o *GetApplicationJobsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get application jobs not found response +func (o *GetApplicationJobsNotFound) Code() int { + return 404 +} + +func (o *GetApplicationJobsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs][%d] getApplicationJobsNotFound ", 404) +} + +func (o *GetApplicationJobsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs][%d] getApplicationJobsNotFound ", 404) +} + +func (o *GetApplicationJobsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_pipeline_job_step_logs_parameters.go b/generated-client/client/pipeline_job/get_pipeline_job_step_logs_parameters.go new file mode 100644 index 0000000..1db5011 --- /dev/null +++ b/generated-client/client/pipeline_job/get_pipeline_job_step_logs_parameters.go @@ -0,0 +1,376 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetPipelineJobStepLogsParams creates a new GetPipelineJobStepLogsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPipelineJobStepLogsParams() *GetPipelineJobStepLogsParams { + return &GetPipelineJobStepLogsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPipelineJobStepLogsParamsWithTimeout creates a new GetPipelineJobStepLogsParams object +// with the ability to set a timeout on a request. +func NewGetPipelineJobStepLogsParamsWithTimeout(timeout time.Duration) *GetPipelineJobStepLogsParams { + return &GetPipelineJobStepLogsParams{ + timeout: timeout, + } +} + +// NewGetPipelineJobStepLogsParamsWithContext creates a new GetPipelineJobStepLogsParams object +// with the ability to set a context for a request. +func NewGetPipelineJobStepLogsParamsWithContext(ctx context.Context) *GetPipelineJobStepLogsParams { + return &GetPipelineJobStepLogsParams{ + Context: ctx, + } +} + +// NewGetPipelineJobStepLogsParamsWithHTTPClient creates a new GetPipelineJobStepLogsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPipelineJobStepLogsParamsWithHTTPClient(client *http.Client) *GetPipelineJobStepLogsParams { + return &GetPipelineJobStepLogsParams{ + HTTPClient: client, + } +} + +/* +GetPipelineJobStepLogsParams contains all the parameters to send to the API endpoint + + for the get pipeline job step logs operation. + + Typically these are written to a http.Request. +*/ +type GetPipelineJobStepLogsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* File. + + Get log as a file if true + + Format: boolean + */ + File *string + + /* JobName. + + Name of the pipeline job + */ + JobName string + + /* Lines. + + Get log lines (example 1000) + + Format: number + */ + Lines *string + + /* SinceTime. + + Get log only from sinceTime (example 2020-03-18T07:20:41+00:00) + + Format: date-time + */ + SinceTime *strfmt.DateTime + + /* StepName. + + Name of the pipeline job step + */ + StepName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get pipeline job step logs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPipelineJobStepLogsParams) WithDefaults() *GetPipelineJobStepLogsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get pipeline job step logs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPipelineJobStepLogsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithTimeout(timeout time.Duration) *GetPipelineJobStepLogsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithContext(ctx context.Context) *GetPipelineJobStepLogsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithHTTPClient(client *http.Client) *GetPipelineJobStepLogsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithImpersonateGroup(impersonateGroup []string) *GetPipelineJobStepLogsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithImpersonateUser(impersonateUser *string) *GetPipelineJobStepLogsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithAppName(appName string) *GetPipelineJobStepLogsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithFile adds the file to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithFile(file *string) *GetPipelineJobStepLogsParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetFile(file *string) { + o.File = file +} + +// WithJobName adds the jobName to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithJobName(jobName string) *GetPipelineJobStepLogsParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WithLines adds the lines to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithLines(lines *string) *GetPipelineJobStepLogsParams { + o.SetLines(lines) + return o +} + +// SetLines adds the lines to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetLines(lines *string) { + o.Lines = lines +} + +// WithSinceTime adds the sinceTime to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithSinceTime(sinceTime *strfmt.DateTime) *GetPipelineJobStepLogsParams { + o.SetSinceTime(sinceTime) + return o +} + +// SetSinceTime adds the sinceTime to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetSinceTime(sinceTime *strfmt.DateTime) { + o.SinceTime = sinceTime +} + +// WithStepName adds the stepName to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) WithStepName(stepName string) *GetPipelineJobStepLogsParams { + o.SetStepName(stepName) + return o +} + +// SetStepName adds the stepName to the get pipeline job step logs params +func (o *GetPipelineJobStepLogsParams) SetStepName(stepName string) { + o.StepName = stepName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPipelineJobStepLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if o.File != nil { + + // query param file + var qrFile string + + if o.File != nil { + qrFile = *o.File + } + qFile := qrFile + if qFile != "" { + + if err := r.SetQueryParam("file", qFile); err != nil { + return err + } + } + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if o.Lines != nil { + + // query param lines + var qrLines string + + if o.Lines != nil { + qrLines = *o.Lines + } + qLines := qrLines + if qLines != "" { + + if err := r.SetQueryParam("lines", qLines); err != nil { + return err + } + } + } + + if o.SinceTime != nil { + + // query param sinceTime + var qrSinceTime strfmt.DateTime + + if o.SinceTime != nil { + qrSinceTime = *o.SinceTime + } + qSinceTime := qrSinceTime.String() + if qSinceTime != "" { + + if err := r.SetQueryParam("sinceTime", qSinceTime); err != nil { + return err + } + } + } + + // path param stepName + if err := r.SetPathParam("stepName", o.StepName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetPipelineJobStepLogs binds the parameter Impersonate-Group +func (o *GetPipelineJobStepLogsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_pipeline_job_step_logs_responses.go b/generated-client/client/pipeline_job/get_pipeline_job_step_logs_responses.go new file mode 100644 index 0000000..dce1b13 --- /dev/null +++ b/generated-client/client/pipeline_job/get_pipeline_job_step_logs_responses.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetPipelineJobStepLogsReader is a Reader for the GetPipelineJobStepLogs structure. +type GetPipelineJobStepLogsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPipelineJobStepLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPipelineJobStepLogsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPipelineJobStepLogsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPipelineJobStepLogsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}/logs/{stepName}] getPipelineJobStepLogs", response, response.Code()) + } +} + +// NewGetPipelineJobStepLogsOK creates a GetPipelineJobStepLogsOK with default headers values +func NewGetPipelineJobStepLogsOK() *GetPipelineJobStepLogsOK { + return &GetPipelineJobStepLogsOK{} +} + +/* +GetPipelineJobStepLogsOK describes a response with status code 200, with default header values. + +Job step log +*/ +type GetPipelineJobStepLogsOK struct { + Payload string +} + +// IsSuccess returns true when this get pipeline job step logs o k response has a 2xx status code +func (o *GetPipelineJobStepLogsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get pipeline job step logs o k response has a 3xx status code +func (o *GetPipelineJobStepLogsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get pipeline job step logs o k response has a 4xx status code +func (o *GetPipelineJobStepLogsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get pipeline job step logs o k response has a 5xx status code +func (o *GetPipelineJobStepLogsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get pipeline job step logs o k response a status code equal to that given +func (o *GetPipelineJobStepLogsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get pipeline job step logs o k response +func (o *GetPipelineJobStepLogsOK) Code() int { + return 200 +} + +func (o *GetPipelineJobStepLogsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/logs/{stepName}][%d] getPipelineJobStepLogsOK %+v", 200, o.Payload) +} + +func (o *GetPipelineJobStepLogsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/logs/{stepName}][%d] getPipelineJobStepLogsOK %+v", 200, o.Payload) +} + +func (o *GetPipelineJobStepLogsOK) GetPayload() string { + return o.Payload +} + +func (o *GetPipelineJobStepLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPipelineJobStepLogsUnauthorized creates a GetPipelineJobStepLogsUnauthorized with default headers values +func NewGetPipelineJobStepLogsUnauthorized() *GetPipelineJobStepLogsUnauthorized { + return &GetPipelineJobStepLogsUnauthorized{} +} + +/* +GetPipelineJobStepLogsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetPipelineJobStepLogsUnauthorized struct { +} + +// IsSuccess returns true when this get pipeline job step logs unauthorized response has a 2xx status code +func (o *GetPipelineJobStepLogsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get pipeline job step logs unauthorized response has a 3xx status code +func (o *GetPipelineJobStepLogsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get pipeline job step logs unauthorized response has a 4xx status code +func (o *GetPipelineJobStepLogsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get pipeline job step logs unauthorized response has a 5xx status code +func (o *GetPipelineJobStepLogsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get pipeline job step logs unauthorized response a status code equal to that given +func (o *GetPipelineJobStepLogsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get pipeline job step logs unauthorized response +func (o *GetPipelineJobStepLogsUnauthorized) Code() int { + return 401 +} + +func (o *GetPipelineJobStepLogsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/logs/{stepName}][%d] getPipelineJobStepLogsUnauthorized ", 401) +} + +func (o *GetPipelineJobStepLogsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/logs/{stepName}][%d] getPipelineJobStepLogsUnauthorized ", 401) +} + +func (o *GetPipelineJobStepLogsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetPipelineJobStepLogsNotFound creates a GetPipelineJobStepLogsNotFound with default headers values +func NewGetPipelineJobStepLogsNotFound() *GetPipelineJobStepLogsNotFound { + return &GetPipelineJobStepLogsNotFound{} +} + +/* +GetPipelineJobStepLogsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetPipelineJobStepLogsNotFound struct { +} + +// IsSuccess returns true when this get pipeline job step logs not found response has a 2xx status code +func (o *GetPipelineJobStepLogsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get pipeline job step logs not found response has a 3xx status code +func (o *GetPipelineJobStepLogsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get pipeline job step logs not found response has a 4xx status code +func (o *GetPipelineJobStepLogsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get pipeline job step logs not found response has a 5xx status code +func (o *GetPipelineJobStepLogsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get pipeline job step logs not found response a status code equal to that given +func (o *GetPipelineJobStepLogsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get pipeline job step logs not found response +func (o *GetPipelineJobStepLogsNotFound) Code() int { + return 404 +} + +func (o *GetPipelineJobStepLogsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/logs/{stepName}][%d] getPipelineJobStepLogsNotFound ", 404) +} + +func (o *GetPipelineJobStepLogsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/logs/{stepName}][%d] getPipelineJobStepLogsNotFound ", 404) +} + +func (o *GetPipelineJobStepLogsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_parameters.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_parameters.go new file mode 100644 index 0000000..15e674b --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTektonPipelineRunParams creates a new GetTektonPipelineRunParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTektonPipelineRunParams() *GetTektonPipelineRunParams { + return &GetTektonPipelineRunParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTektonPipelineRunParamsWithTimeout creates a new GetTektonPipelineRunParams object +// with the ability to set a timeout on a request. +func NewGetTektonPipelineRunParamsWithTimeout(timeout time.Duration) *GetTektonPipelineRunParams { + return &GetTektonPipelineRunParams{ + timeout: timeout, + } +} + +// NewGetTektonPipelineRunParamsWithContext creates a new GetTektonPipelineRunParams object +// with the ability to set a context for a request. +func NewGetTektonPipelineRunParamsWithContext(ctx context.Context) *GetTektonPipelineRunParams { + return &GetTektonPipelineRunParams{ + Context: ctx, + } +} + +// NewGetTektonPipelineRunParamsWithHTTPClient creates a new GetTektonPipelineRunParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTektonPipelineRunParamsWithHTTPClient(client *http.Client) *GetTektonPipelineRunParams { + return &GetTektonPipelineRunParams{ + HTTPClient: client, + } +} + +/* +GetTektonPipelineRunParams contains all the parameters to send to the API endpoint + + for the get tekton pipeline run operation. + + Typically these are written to a http.Request. +*/ +type GetTektonPipelineRunParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* JobName. + + Name of pipeline job + */ + JobName string + + /* PipelineRunName. + + Name of pipeline run + */ + PipelineRunName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tekton pipeline run params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunParams) WithDefaults() *GetTektonPipelineRunParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tekton pipeline run params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithTimeout(timeout time.Duration) *GetTektonPipelineRunParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithContext(ctx context.Context) *GetTektonPipelineRunParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithHTTPClient(client *http.Client) *GetTektonPipelineRunParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithImpersonateGroup(impersonateGroup []string) *GetTektonPipelineRunParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithImpersonateUser(impersonateUser *string) *GetTektonPipelineRunParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithAppName(appName string) *GetTektonPipelineRunParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithJobName adds the jobName to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithJobName(jobName string) *GetTektonPipelineRunParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WithPipelineRunName adds the pipelineRunName to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) WithPipelineRunName(pipelineRunName string) *GetTektonPipelineRunParams { + o.SetPipelineRunName(pipelineRunName) + return o +} + +// SetPipelineRunName adds the pipelineRunName to the get tekton pipeline run params +func (o *GetTektonPipelineRunParams) SetPipelineRunName(pipelineRunName string) { + o.PipelineRunName = pipelineRunName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTektonPipelineRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + // path param pipelineRunName + if err := r.SetPathParam("pipelineRunName", o.PipelineRunName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetTektonPipelineRun binds the parameter Impersonate-Group +func (o *GetTektonPipelineRunParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_responses.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_responses.go new file mode 100644 index 0000000..19bf62b --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetTektonPipelineRunReader is a Reader for the GetTektonPipelineRun structure. +type GetTektonPipelineRunReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTektonPipelineRunReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTektonPipelineRunOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTektonPipelineRunUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTektonPipelineRunNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}] getTektonPipelineRun", response, response.Code()) + } +} + +// NewGetTektonPipelineRunOK creates a GetTektonPipelineRunOK with default headers values +func NewGetTektonPipelineRunOK() *GetTektonPipelineRunOK { + return &GetTektonPipelineRunOK{} +} + +/* +GetTektonPipelineRunOK describes a response with status code 200, with default header values. + +List of Pipeline Runs +*/ +type GetTektonPipelineRunOK struct { + Payload *models.PipelineRun +} + +// IsSuccess returns true when this get tekton pipeline run o k response has a 2xx status code +func (o *GetTektonPipelineRunOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tekton pipeline run o k response has a 3xx status code +func (o *GetTektonPipelineRunOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run o k response has a 4xx status code +func (o *GetTektonPipelineRunOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tekton pipeline run o k response has a 5xx status code +func (o *GetTektonPipelineRunOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run o k response a status code equal to that given +func (o *GetTektonPipelineRunOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tekton pipeline run o k response +func (o *GetTektonPipelineRunOK) Code() int { + return 200 +} + +func (o *GetTektonPipelineRunOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}][%d] getTektonPipelineRunOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}][%d] getTektonPipelineRunOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunOK) GetPayload() *models.PipelineRun { + return o.Payload +} + +func (o *GetTektonPipelineRunOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PipelineRun) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTektonPipelineRunUnauthorized creates a GetTektonPipelineRunUnauthorized with default headers values +func NewGetTektonPipelineRunUnauthorized() *GetTektonPipelineRunUnauthorized { + return &GetTektonPipelineRunUnauthorized{} +} + +/* +GetTektonPipelineRunUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetTektonPipelineRunUnauthorized struct { +} + +// IsSuccess returns true when this get tekton pipeline run unauthorized response has a 2xx status code +func (o *GetTektonPipelineRunUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run unauthorized response has a 3xx status code +func (o *GetTektonPipelineRunUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run unauthorized response has a 4xx status code +func (o *GetTektonPipelineRunUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run unauthorized response has a 5xx status code +func (o *GetTektonPipelineRunUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run unauthorized response a status code equal to that given +func (o *GetTektonPipelineRunUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get tekton pipeline run unauthorized response +func (o *GetTektonPipelineRunUnauthorized) Code() int { + return 401 +} + +func (o *GetTektonPipelineRunUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}][%d] getTektonPipelineRunUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}][%d] getTektonPipelineRunUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTektonPipelineRunNotFound creates a GetTektonPipelineRunNotFound with default headers values +func NewGetTektonPipelineRunNotFound() *GetTektonPipelineRunNotFound { + return &GetTektonPipelineRunNotFound{} +} + +/* +GetTektonPipelineRunNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetTektonPipelineRunNotFound struct { +} + +// IsSuccess returns true when this get tekton pipeline run not found response has a 2xx status code +func (o *GetTektonPipelineRunNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run not found response has a 3xx status code +func (o *GetTektonPipelineRunNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run not found response has a 4xx status code +func (o *GetTektonPipelineRunNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run not found response has a 5xx status code +func (o *GetTektonPipelineRunNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run not found response a status code equal to that given +func (o *GetTektonPipelineRunNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get tekton pipeline run not found response +func (o *GetTektonPipelineRunNotFound) Code() int { + return 404 +} + +func (o *GetTektonPipelineRunNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}][%d] getTektonPipelineRunNotFound ", 404) +} + +func (o *GetTektonPipelineRunNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}][%d] getTektonPipelineRunNotFound ", 404) +} + +func (o *GetTektonPipelineRunNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_parameters.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_parameters.go new file mode 100644 index 0000000..45d45dc --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTektonPipelineRunTaskParams creates a new GetTektonPipelineRunTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTektonPipelineRunTaskParams() *GetTektonPipelineRunTaskParams { + return &GetTektonPipelineRunTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTektonPipelineRunTaskParamsWithTimeout creates a new GetTektonPipelineRunTaskParams object +// with the ability to set a timeout on a request. +func NewGetTektonPipelineRunTaskParamsWithTimeout(timeout time.Duration) *GetTektonPipelineRunTaskParams { + return &GetTektonPipelineRunTaskParams{ + timeout: timeout, + } +} + +// NewGetTektonPipelineRunTaskParamsWithContext creates a new GetTektonPipelineRunTaskParams object +// with the ability to set a context for a request. +func NewGetTektonPipelineRunTaskParamsWithContext(ctx context.Context) *GetTektonPipelineRunTaskParams { + return &GetTektonPipelineRunTaskParams{ + Context: ctx, + } +} + +// NewGetTektonPipelineRunTaskParamsWithHTTPClient creates a new GetTektonPipelineRunTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTektonPipelineRunTaskParamsWithHTTPClient(client *http.Client) *GetTektonPipelineRunTaskParams { + return &GetTektonPipelineRunTaskParams{ + HTTPClient: client, + } +} + +/* +GetTektonPipelineRunTaskParams contains all the parameters to send to the API endpoint + + for the get tekton pipeline run task operation. + + Typically these are written to a http.Request. +*/ +type GetTektonPipelineRunTaskParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* JobName. + + Name of pipeline job + */ + JobName string + + /* PipelineRunName. + + Name of pipeline run + */ + PipelineRunName string + + /* TaskName. + + Name of pipeline run task + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tekton pipeline run task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTaskParams) WithDefaults() *GetTektonPipelineRunTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tekton pipeline run task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithTimeout(timeout time.Duration) *GetTektonPipelineRunTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithContext(ctx context.Context) *GetTektonPipelineRunTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithHTTPClient(client *http.Client) *GetTektonPipelineRunTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithImpersonateGroup(impersonateGroup []string) *GetTektonPipelineRunTaskParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithImpersonateUser(impersonateUser *string) *GetTektonPipelineRunTaskParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithAppName(appName string) *GetTektonPipelineRunTaskParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithJobName adds the jobName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithJobName(jobName string) *GetTektonPipelineRunTaskParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WithPipelineRunName adds the pipelineRunName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithPipelineRunName(pipelineRunName string) *GetTektonPipelineRunTaskParams { + o.SetPipelineRunName(pipelineRunName) + return o +} + +// SetPipelineRunName adds the pipelineRunName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetPipelineRunName(pipelineRunName string) { + o.PipelineRunName = pipelineRunName +} + +// WithTaskName adds the taskName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) WithTaskName(taskName string) *GetTektonPipelineRunTaskParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get tekton pipeline run task params +func (o *GetTektonPipelineRunTaskParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTektonPipelineRunTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + // path param pipelineRunName + if err := r.SetPathParam("pipelineRunName", o.PipelineRunName); err != nil { + return err + } + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetTektonPipelineRunTask binds the parameter Impersonate-Group +func (o *GetTektonPipelineRunTaskParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_responses.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_responses.go new file mode 100644 index 0000000..8c795b4 --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetTektonPipelineRunTaskReader is a Reader for the GetTektonPipelineRunTask structure. +type GetTektonPipelineRunTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTektonPipelineRunTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTektonPipelineRunTaskOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTektonPipelineRunTaskUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTektonPipelineRunTaskNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}] getTektonPipelineRunTask", response, response.Code()) + } +} + +// NewGetTektonPipelineRunTaskOK creates a GetTektonPipelineRunTaskOK with default headers values +func NewGetTektonPipelineRunTaskOK() *GetTektonPipelineRunTaskOK { + return &GetTektonPipelineRunTaskOK{} +} + +/* +GetTektonPipelineRunTaskOK describes a response with status code 200, with default header values. + +Pipeline Run Task +*/ +type GetTektonPipelineRunTaskOK struct { + Payload *models.PipelineRunTask +} + +// IsSuccess returns true when this get tekton pipeline run task o k response has a 2xx status code +func (o *GetTektonPipelineRunTaskOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tekton pipeline run task o k response has a 3xx status code +func (o *GetTektonPipelineRunTaskOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task o k response has a 4xx status code +func (o *GetTektonPipelineRunTaskOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tekton pipeline run task o k response has a 5xx status code +func (o *GetTektonPipelineRunTaskOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task o k response a status code equal to that given +func (o *GetTektonPipelineRunTaskOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tekton pipeline run task o k response +func (o *GetTektonPipelineRunTaskOK) Code() int { + return 200 +} + +func (o *GetTektonPipelineRunTaskOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}][%d] getTektonPipelineRunTaskOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTaskOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}][%d] getTektonPipelineRunTaskOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTaskOK) GetPayload() *models.PipelineRunTask { + return o.Payload +} + +func (o *GetTektonPipelineRunTaskOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PipelineRunTask) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTektonPipelineRunTaskUnauthorized creates a GetTektonPipelineRunTaskUnauthorized with default headers values +func NewGetTektonPipelineRunTaskUnauthorized() *GetTektonPipelineRunTaskUnauthorized { + return &GetTektonPipelineRunTaskUnauthorized{} +} + +/* +GetTektonPipelineRunTaskUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetTektonPipelineRunTaskUnauthorized struct { +} + +// IsSuccess returns true when this get tekton pipeline run task unauthorized response has a 2xx status code +func (o *GetTektonPipelineRunTaskUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run task unauthorized response has a 3xx status code +func (o *GetTektonPipelineRunTaskUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task unauthorized response has a 4xx status code +func (o *GetTektonPipelineRunTaskUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run task unauthorized response has a 5xx status code +func (o *GetTektonPipelineRunTaskUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task unauthorized response a status code equal to that given +func (o *GetTektonPipelineRunTaskUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get tekton pipeline run task unauthorized response +func (o *GetTektonPipelineRunTaskUnauthorized) Code() int { + return 401 +} + +func (o *GetTektonPipelineRunTaskUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}][%d] getTektonPipelineRunTaskUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTaskUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}][%d] getTektonPipelineRunTaskUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTaskUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTektonPipelineRunTaskNotFound creates a GetTektonPipelineRunTaskNotFound with default headers values +func NewGetTektonPipelineRunTaskNotFound() *GetTektonPipelineRunTaskNotFound { + return &GetTektonPipelineRunTaskNotFound{} +} + +/* +GetTektonPipelineRunTaskNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetTektonPipelineRunTaskNotFound struct { +} + +// IsSuccess returns true when this get tekton pipeline run task not found response has a 2xx status code +func (o *GetTektonPipelineRunTaskNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run task not found response has a 3xx status code +func (o *GetTektonPipelineRunTaskNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task not found response has a 4xx status code +func (o *GetTektonPipelineRunTaskNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run task not found response has a 5xx status code +func (o *GetTektonPipelineRunTaskNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task not found response a status code equal to that given +func (o *GetTektonPipelineRunTaskNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get tekton pipeline run task not found response +func (o *GetTektonPipelineRunTaskNotFound) Code() int { + return 404 +} + +func (o *GetTektonPipelineRunTaskNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}][%d] getTektonPipelineRunTaskNotFound ", 404) +} + +func (o *GetTektonPipelineRunTaskNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}][%d] getTektonPipelineRunTaskNotFound ", 404) +} + +func (o *GetTektonPipelineRunTaskNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_step_logs_parameters.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_step_logs_parameters.go new file mode 100644 index 0000000..743e234 --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_step_logs_parameters.go @@ -0,0 +1,420 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTektonPipelineRunTaskStepLogsParams creates a new GetTektonPipelineRunTaskStepLogsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTektonPipelineRunTaskStepLogsParams() *GetTektonPipelineRunTaskStepLogsParams { + return &GetTektonPipelineRunTaskStepLogsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTektonPipelineRunTaskStepLogsParamsWithTimeout creates a new GetTektonPipelineRunTaskStepLogsParams object +// with the ability to set a timeout on a request. +func NewGetTektonPipelineRunTaskStepLogsParamsWithTimeout(timeout time.Duration) *GetTektonPipelineRunTaskStepLogsParams { + return &GetTektonPipelineRunTaskStepLogsParams{ + timeout: timeout, + } +} + +// NewGetTektonPipelineRunTaskStepLogsParamsWithContext creates a new GetTektonPipelineRunTaskStepLogsParams object +// with the ability to set a context for a request. +func NewGetTektonPipelineRunTaskStepLogsParamsWithContext(ctx context.Context) *GetTektonPipelineRunTaskStepLogsParams { + return &GetTektonPipelineRunTaskStepLogsParams{ + Context: ctx, + } +} + +// NewGetTektonPipelineRunTaskStepLogsParamsWithHTTPClient creates a new GetTektonPipelineRunTaskStepLogsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTektonPipelineRunTaskStepLogsParamsWithHTTPClient(client *http.Client) *GetTektonPipelineRunTaskStepLogsParams { + return &GetTektonPipelineRunTaskStepLogsParams{ + HTTPClient: client, + } +} + +/* +GetTektonPipelineRunTaskStepLogsParams contains all the parameters to send to the API endpoint + + for the get tekton pipeline run task step logs operation. + + Typically these are written to a http.Request. +*/ +type GetTektonPipelineRunTaskStepLogsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* File. + + Get log as a file if true + + Format: boolean + */ + File *string + + /* JobName. + + Name of pipeline job + */ + JobName string + + /* Lines. + + Get log lines (example 1000) + + Format: number + */ + Lines *string + + /* PipelineRunName. + + Name of pipeline run + */ + PipelineRunName string + + /* SinceTime. + + Get log only from sinceTime (example 2020-03-18T07:20:41+00:00) + + Format: date-time + */ + SinceTime *strfmt.DateTime + + /* StepName. + + Name of pipeline run task step + */ + StepName string + + /* TaskName. + + Name of pipeline run task + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tekton pipeline run task step logs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTaskStepLogsParams) WithDefaults() *GetTektonPipelineRunTaskStepLogsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tekton pipeline run task step logs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTaskStepLogsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithTimeout(timeout time.Duration) *GetTektonPipelineRunTaskStepLogsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithContext(ctx context.Context) *GetTektonPipelineRunTaskStepLogsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithHTTPClient(client *http.Client) *GetTektonPipelineRunTaskStepLogsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithImpersonateGroup(impersonateGroup []string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithImpersonateUser(impersonateUser *string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithAppName(appName string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithFile adds the file to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithFile(file *string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetFile(file *string) { + o.File = file +} + +// WithJobName adds the jobName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithJobName(jobName string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WithLines adds the lines to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithLines(lines *string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetLines(lines) + return o +} + +// SetLines adds the lines to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetLines(lines *string) { + o.Lines = lines +} + +// WithPipelineRunName adds the pipelineRunName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithPipelineRunName(pipelineRunName string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetPipelineRunName(pipelineRunName) + return o +} + +// SetPipelineRunName adds the pipelineRunName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetPipelineRunName(pipelineRunName string) { + o.PipelineRunName = pipelineRunName +} + +// WithSinceTime adds the sinceTime to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithSinceTime(sinceTime *strfmt.DateTime) *GetTektonPipelineRunTaskStepLogsParams { + o.SetSinceTime(sinceTime) + return o +} + +// SetSinceTime adds the sinceTime to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetSinceTime(sinceTime *strfmt.DateTime) { + o.SinceTime = sinceTime +} + +// WithStepName adds the stepName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithStepName(stepName string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetStepName(stepName) + return o +} + +// SetStepName adds the stepName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetStepName(stepName string) { + o.StepName = stepName +} + +// WithTaskName adds the taskName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) WithTaskName(taskName string) *GetTektonPipelineRunTaskStepLogsParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get tekton pipeline run task step logs params +func (o *GetTektonPipelineRunTaskStepLogsParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTektonPipelineRunTaskStepLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + if o.File != nil { + + // query param file + var qrFile string + + if o.File != nil { + qrFile = *o.File + } + qFile := qrFile + if qFile != "" { + + if err := r.SetQueryParam("file", qFile); err != nil { + return err + } + } + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if o.Lines != nil { + + // query param lines + var qrLines string + + if o.Lines != nil { + qrLines = *o.Lines + } + qLines := qrLines + if qLines != "" { + + if err := r.SetQueryParam("lines", qLines); err != nil { + return err + } + } + } + + // path param pipelineRunName + if err := r.SetPathParam("pipelineRunName", o.PipelineRunName); err != nil { + return err + } + + if o.SinceTime != nil { + + // query param sinceTime + var qrSinceTime strfmt.DateTime + + if o.SinceTime != nil { + qrSinceTime = *o.SinceTime + } + qSinceTime := qrSinceTime.String() + if qSinceTime != "" { + + if err := r.SetQueryParam("sinceTime", qSinceTime); err != nil { + return err + } + } + } + + // path param stepName + if err := r.SetPathParam("stepName", o.StepName); err != nil { + return err + } + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetTektonPipelineRunTaskStepLogs binds the parameter Impersonate-Group +func (o *GetTektonPipelineRunTaskStepLogsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_step_logs_responses.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_step_logs_responses.go new file mode 100644 index 0000000..36f790f --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_step_logs_responses.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTektonPipelineRunTaskStepLogsReader is a Reader for the GetTektonPipelineRunTaskStepLogs structure. +type GetTektonPipelineRunTaskStepLogsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTektonPipelineRunTaskStepLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTektonPipelineRunTaskStepLogsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTektonPipelineRunTaskStepLogsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTektonPipelineRunTaskStepLogsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}] getTektonPipelineRunTaskStepLogs", response, response.Code()) + } +} + +// NewGetTektonPipelineRunTaskStepLogsOK creates a GetTektonPipelineRunTaskStepLogsOK with default headers values +func NewGetTektonPipelineRunTaskStepLogsOK() *GetTektonPipelineRunTaskStepLogsOK { + return &GetTektonPipelineRunTaskStepLogsOK{} +} + +/* +GetTektonPipelineRunTaskStepLogsOK describes a response with status code 200, with default header values. + +Task step log +*/ +type GetTektonPipelineRunTaskStepLogsOK struct { + Payload string +} + +// IsSuccess returns true when this get tekton pipeline run task step logs o k response has a 2xx status code +func (o *GetTektonPipelineRunTaskStepLogsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tekton pipeline run task step logs o k response has a 3xx status code +func (o *GetTektonPipelineRunTaskStepLogsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task step logs o k response has a 4xx status code +func (o *GetTektonPipelineRunTaskStepLogsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tekton pipeline run task step logs o k response has a 5xx status code +func (o *GetTektonPipelineRunTaskStepLogsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task step logs o k response a status code equal to that given +func (o *GetTektonPipelineRunTaskStepLogsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tekton pipeline run task step logs o k response +func (o *GetTektonPipelineRunTaskStepLogsOK) Code() int { + return 200 +} + +func (o *GetTektonPipelineRunTaskStepLogsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}][%d] getTektonPipelineRunTaskStepLogsOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTaskStepLogsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}][%d] getTektonPipelineRunTaskStepLogsOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTaskStepLogsOK) GetPayload() string { + return o.Payload +} + +func (o *GetTektonPipelineRunTaskStepLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTektonPipelineRunTaskStepLogsUnauthorized creates a GetTektonPipelineRunTaskStepLogsUnauthorized with default headers values +func NewGetTektonPipelineRunTaskStepLogsUnauthorized() *GetTektonPipelineRunTaskStepLogsUnauthorized { + return &GetTektonPipelineRunTaskStepLogsUnauthorized{} +} + +/* +GetTektonPipelineRunTaskStepLogsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetTektonPipelineRunTaskStepLogsUnauthorized struct { +} + +// IsSuccess returns true when this get tekton pipeline run task step logs unauthorized response has a 2xx status code +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run task step logs unauthorized response has a 3xx status code +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task step logs unauthorized response has a 4xx status code +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run task step logs unauthorized response has a 5xx status code +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task step logs unauthorized response a status code equal to that given +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get tekton pipeline run task step logs unauthorized response +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) Code() int { + return 401 +} + +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}][%d] getTektonPipelineRunTaskStepLogsUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}][%d] getTektonPipelineRunTaskStepLogsUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTaskStepLogsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTektonPipelineRunTaskStepLogsNotFound creates a GetTektonPipelineRunTaskStepLogsNotFound with default headers values +func NewGetTektonPipelineRunTaskStepLogsNotFound() *GetTektonPipelineRunTaskStepLogsNotFound { + return &GetTektonPipelineRunTaskStepLogsNotFound{} +} + +/* +GetTektonPipelineRunTaskStepLogsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetTektonPipelineRunTaskStepLogsNotFound struct { +} + +// IsSuccess returns true when this get tekton pipeline run task step logs not found response has a 2xx status code +func (o *GetTektonPipelineRunTaskStepLogsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run task step logs not found response has a 3xx status code +func (o *GetTektonPipelineRunTaskStepLogsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task step logs not found response has a 4xx status code +func (o *GetTektonPipelineRunTaskStepLogsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run task step logs not found response has a 5xx status code +func (o *GetTektonPipelineRunTaskStepLogsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task step logs not found response a status code equal to that given +func (o *GetTektonPipelineRunTaskStepLogsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get tekton pipeline run task step logs not found response +func (o *GetTektonPipelineRunTaskStepLogsNotFound) Code() int { + return 404 +} + +func (o *GetTektonPipelineRunTaskStepLogsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}][%d] getTektonPipelineRunTaskStepLogsNotFound ", 404) +} + +func (o *GetTektonPipelineRunTaskStepLogsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}][%d] getTektonPipelineRunTaskStepLogsNotFound ", 404) +} + +func (o *GetTektonPipelineRunTaskStepLogsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_steps_parameters.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_steps_parameters.go new file mode 100644 index 0000000..4cdc3c2 --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_steps_parameters.go @@ -0,0 +1,290 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTektonPipelineRunTaskStepsParams creates a new GetTektonPipelineRunTaskStepsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTektonPipelineRunTaskStepsParams() *GetTektonPipelineRunTaskStepsParams { + return &GetTektonPipelineRunTaskStepsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTektonPipelineRunTaskStepsParamsWithTimeout creates a new GetTektonPipelineRunTaskStepsParams object +// with the ability to set a timeout on a request. +func NewGetTektonPipelineRunTaskStepsParamsWithTimeout(timeout time.Duration) *GetTektonPipelineRunTaskStepsParams { + return &GetTektonPipelineRunTaskStepsParams{ + timeout: timeout, + } +} + +// NewGetTektonPipelineRunTaskStepsParamsWithContext creates a new GetTektonPipelineRunTaskStepsParams object +// with the ability to set a context for a request. +func NewGetTektonPipelineRunTaskStepsParamsWithContext(ctx context.Context) *GetTektonPipelineRunTaskStepsParams { + return &GetTektonPipelineRunTaskStepsParams{ + Context: ctx, + } +} + +// NewGetTektonPipelineRunTaskStepsParamsWithHTTPClient creates a new GetTektonPipelineRunTaskStepsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTektonPipelineRunTaskStepsParamsWithHTTPClient(client *http.Client) *GetTektonPipelineRunTaskStepsParams { + return &GetTektonPipelineRunTaskStepsParams{ + HTTPClient: client, + } +} + +/* +GetTektonPipelineRunTaskStepsParams contains all the parameters to send to the API endpoint + + for the get tekton pipeline run task steps operation. + + Typically these are written to a http.Request. +*/ +type GetTektonPipelineRunTaskStepsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* JobName. + + Name of pipeline job + */ + JobName string + + /* PipelineRunName. + + Name of pipeline run + */ + PipelineRunName string + + /* TaskName. + + Name of pipeline run task + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tekton pipeline run task steps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTaskStepsParams) WithDefaults() *GetTektonPipelineRunTaskStepsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tekton pipeline run task steps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTaskStepsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithTimeout(timeout time.Duration) *GetTektonPipelineRunTaskStepsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithContext(ctx context.Context) *GetTektonPipelineRunTaskStepsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithHTTPClient(client *http.Client) *GetTektonPipelineRunTaskStepsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithImpersonateGroup(impersonateGroup []string) *GetTektonPipelineRunTaskStepsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithImpersonateUser(impersonateUser *string) *GetTektonPipelineRunTaskStepsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithAppName(appName string) *GetTektonPipelineRunTaskStepsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithJobName adds the jobName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithJobName(jobName string) *GetTektonPipelineRunTaskStepsParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WithPipelineRunName adds the pipelineRunName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithPipelineRunName(pipelineRunName string) *GetTektonPipelineRunTaskStepsParams { + o.SetPipelineRunName(pipelineRunName) + return o +} + +// SetPipelineRunName adds the pipelineRunName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetPipelineRunName(pipelineRunName string) { + o.PipelineRunName = pipelineRunName +} + +// WithTaskName adds the taskName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) WithTaskName(taskName string) *GetTektonPipelineRunTaskStepsParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get tekton pipeline run task steps params +func (o *GetTektonPipelineRunTaskStepsParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTektonPipelineRunTaskStepsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + // path param pipelineRunName + if err := r.SetPathParam("pipelineRunName", o.PipelineRunName); err != nil { + return err + } + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetTektonPipelineRunTaskSteps binds the parameter Impersonate-Group +func (o *GetTektonPipelineRunTaskStepsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_steps_responses.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_steps_responses.go new file mode 100644 index 0000000..818ab64 --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_task_steps_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetTektonPipelineRunTaskStepsReader is a Reader for the GetTektonPipelineRunTaskSteps structure. +type GetTektonPipelineRunTaskStepsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTektonPipelineRunTaskStepsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTektonPipelineRunTaskStepsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTektonPipelineRunTaskStepsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTektonPipelineRunTaskStepsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps] getTektonPipelineRunTaskSteps", response, response.Code()) + } +} + +// NewGetTektonPipelineRunTaskStepsOK creates a GetTektonPipelineRunTaskStepsOK with default headers values +func NewGetTektonPipelineRunTaskStepsOK() *GetTektonPipelineRunTaskStepsOK { + return &GetTektonPipelineRunTaskStepsOK{} +} + +/* +GetTektonPipelineRunTaskStepsOK describes a response with status code 200, with default header values. + +List of Pipeline Run Task Steps +*/ +type GetTektonPipelineRunTaskStepsOK struct { + Payload []*models.PipelineRunTaskStep +} + +// IsSuccess returns true when this get tekton pipeline run task steps o k response has a 2xx status code +func (o *GetTektonPipelineRunTaskStepsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tekton pipeline run task steps o k response has a 3xx status code +func (o *GetTektonPipelineRunTaskStepsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task steps o k response has a 4xx status code +func (o *GetTektonPipelineRunTaskStepsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tekton pipeline run task steps o k response has a 5xx status code +func (o *GetTektonPipelineRunTaskStepsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task steps o k response a status code equal to that given +func (o *GetTektonPipelineRunTaskStepsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tekton pipeline run task steps o k response +func (o *GetTektonPipelineRunTaskStepsOK) Code() int { + return 200 +} + +func (o *GetTektonPipelineRunTaskStepsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps][%d] getTektonPipelineRunTaskStepsOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTaskStepsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps][%d] getTektonPipelineRunTaskStepsOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTaskStepsOK) GetPayload() []*models.PipelineRunTaskStep { + return o.Payload +} + +func (o *GetTektonPipelineRunTaskStepsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTektonPipelineRunTaskStepsUnauthorized creates a GetTektonPipelineRunTaskStepsUnauthorized with default headers values +func NewGetTektonPipelineRunTaskStepsUnauthorized() *GetTektonPipelineRunTaskStepsUnauthorized { + return &GetTektonPipelineRunTaskStepsUnauthorized{} +} + +/* +GetTektonPipelineRunTaskStepsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetTektonPipelineRunTaskStepsUnauthorized struct { +} + +// IsSuccess returns true when this get tekton pipeline run task steps unauthorized response has a 2xx status code +func (o *GetTektonPipelineRunTaskStepsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run task steps unauthorized response has a 3xx status code +func (o *GetTektonPipelineRunTaskStepsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task steps unauthorized response has a 4xx status code +func (o *GetTektonPipelineRunTaskStepsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run task steps unauthorized response has a 5xx status code +func (o *GetTektonPipelineRunTaskStepsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task steps unauthorized response a status code equal to that given +func (o *GetTektonPipelineRunTaskStepsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get tekton pipeline run task steps unauthorized response +func (o *GetTektonPipelineRunTaskStepsUnauthorized) Code() int { + return 401 +} + +func (o *GetTektonPipelineRunTaskStepsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps][%d] getTektonPipelineRunTaskStepsUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTaskStepsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps][%d] getTektonPipelineRunTaskStepsUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTaskStepsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTektonPipelineRunTaskStepsNotFound creates a GetTektonPipelineRunTaskStepsNotFound with default headers values +func NewGetTektonPipelineRunTaskStepsNotFound() *GetTektonPipelineRunTaskStepsNotFound { + return &GetTektonPipelineRunTaskStepsNotFound{} +} + +/* +GetTektonPipelineRunTaskStepsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetTektonPipelineRunTaskStepsNotFound struct { +} + +// IsSuccess returns true when this get tekton pipeline run task steps not found response has a 2xx status code +func (o *GetTektonPipelineRunTaskStepsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run task steps not found response has a 3xx status code +func (o *GetTektonPipelineRunTaskStepsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run task steps not found response has a 4xx status code +func (o *GetTektonPipelineRunTaskStepsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run task steps not found response has a 5xx status code +func (o *GetTektonPipelineRunTaskStepsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run task steps not found response a status code equal to that given +func (o *GetTektonPipelineRunTaskStepsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get tekton pipeline run task steps not found response +func (o *GetTektonPipelineRunTaskStepsNotFound) Code() int { + return 404 +} + +func (o *GetTektonPipelineRunTaskStepsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps][%d] getTektonPipelineRunTaskStepsNotFound ", 404) +} + +func (o *GetTektonPipelineRunTaskStepsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps][%d] getTektonPipelineRunTaskStepsNotFound ", 404) +} + +func (o *GetTektonPipelineRunTaskStepsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_tasks_parameters.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_tasks_parameters.go new file mode 100644 index 0000000..24e99d7 --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_tasks_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTektonPipelineRunTasksParams creates a new GetTektonPipelineRunTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTektonPipelineRunTasksParams() *GetTektonPipelineRunTasksParams { + return &GetTektonPipelineRunTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTektonPipelineRunTasksParamsWithTimeout creates a new GetTektonPipelineRunTasksParams object +// with the ability to set a timeout on a request. +func NewGetTektonPipelineRunTasksParamsWithTimeout(timeout time.Duration) *GetTektonPipelineRunTasksParams { + return &GetTektonPipelineRunTasksParams{ + timeout: timeout, + } +} + +// NewGetTektonPipelineRunTasksParamsWithContext creates a new GetTektonPipelineRunTasksParams object +// with the ability to set a context for a request. +func NewGetTektonPipelineRunTasksParamsWithContext(ctx context.Context) *GetTektonPipelineRunTasksParams { + return &GetTektonPipelineRunTasksParams{ + Context: ctx, + } +} + +// NewGetTektonPipelineRunTasksParamsWithHTTPClient creates a new GetTektonPipelineRunTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTektonPipelineRunTasksParamsWithHTTPClient(client *http.Client) *GetTektonPipelineRunTasksParams { + return &GetTektonPipelineRunTasksParams{ + HTTPClient: client, + } +} + +/* +GetTektonPipelineRunTasksParams contains all the parameters to send to the API endpoint + + for the get tekton pipeline run tasks operation. + + Typically these are written to a http.Request. +*/ +type GetTektonPipelineRunTasksParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* JobName. + + Name of pipeline job + */ + JobName string + + /* PipelineRunName. + + Name of pipeline run + */ + PipelineRunName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tekton pipeline run tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTasksParams) WithDefaults() *GetTektonPipelineRunTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tekton pipeline run tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunTasksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithTimeout(timeout time.Duration) *GetTektonPipelineRunTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithContext(ctx context.Context) *GetTektonPipelineRunTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithHTTPClient(client *http.Client) *GetTektonPipelineRunTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithImpersonateGroup(impersonateGroup []string) *GetTektonPipelineRunTasksParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithImpersonateUser(impersonateUser *string) *GetTektonPipelineRunTasksParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithAppName(appName string) *GetTektonPipelineRunTasksParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithJobName adds the jobName to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithJobName(jobName string) *GetTektonPipelineRunTasksParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WithPipelineRunName adds the pipelineRunName to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) WithPipelineRunName(pipelineRunName string) *GetTektonPipelineRunTasksParams { + o.SetPipelineRunName(pipelineRunName) + return o +} + +// SetPipelineRunName adds the pipelineRunName to the get tekton pipeline run tasks params +func (o *GetTektonPipelineRunTasksParams) SetPipelineRunName(pipelineRunName string) { + o.PipelineRunName = pipelineRunName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTektonPipelineRunTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + // path param pipelineRunName + if err := r.SetPathParam("pipelineRunName", o.PipelineRunName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetTektonPipelineRunTasks binds the parameter Impersonate-Group +func (o *GetTektonPipelineRunTasksParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_run_tasks_responses.go b/generated-client/client/pipeline_job/get_tekton_pipeline_run_tasks_responses.go new file mode 100644 index 0000000..4d131dc --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_run_tasks_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetTektonPipelineRunTasksReader is a Reader for the GetTektonPipelineRunTasks structure. +type GetTektonPipelineRunTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTektonPipelineRunTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTektonPipelineRunTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTektonPipelineRunTasksUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTektonPipelineRunTasksNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks] getTektonPipelineRunTasks", response, response.Code()) + } +} + +// NewGetTektonPipelineRunTasksOK creates a GetTektonPipelineRunTasksOK with default headers values +func NewGetTektonPipelineRunTasksOK() *GetTektonPipelineRunTasksOK { + return &GetTektonPipelineRunTasksOK{} +} + +/* +GetTektonPipelineRunTasksOK describes a response with status code 200, with default header values. + +List of Pipeline Run Tasks +*/ +type GetTektonPipelineRunTasksOK struct { + Payload []*models.PipelineRunTask +} + +// IsSuccess returns true when this get tekton pipeline run tasks o k response has a 2xx status code +func (o *GetTektonPipelineRunTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tekton pipeline run tasks o k response has a 3xx status code +func (o *GetTektonPipelineRunTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run tasks o k response has a 4xx status code +func (o *GetTektonPipelineRunTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tekton pipeline run tasks o k response has a 5xx status code +func (o *GetTektonPipelineRunTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run tasks o k response a status code equal to that given +func (o *GetTektonPipelineRunTasksOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tekton pipeline run tasks o k response +func (o *GetTektonPipelineRunTasksOK) Code() int { + return 200 +} + +func (o *GetTektonPipelineRunTasksOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks][%d] getTektonPipelineRunTasksOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTasksOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks][%d] getTektonPipelineRunTasksOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunTasksOK) GetPayload() []*models.PipelineRunTask { + return o.Payload +} + +func (o *GetTektonPipelineRunTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTektonPipelineRunTasksUnauthorized creates a GetTektonPipelineRunTasksUnauthorized with default headers values +func NewGetTektonPipelineRunTasksUnauthorized() *GetTektonPipelineRunTasksUnauthorized { + return &GetTektonPipelineRunTasksUnauthorized{} +} + +/* +GetTektonPipelineRunTasksUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetTektonPipelineRunTasksUnauthorized struct { +} + +// IsSuccess returns true when this get tekton pipeline run tasks unauthorized response has a 2xx status code +func (o *GetTektonPipelineRunTasksUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run tasks unauthorized response has a 3xx status code +func (o *GetTektonPipelineRunTasksUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run tasks unauthorized response has a 4xx status code +func (o *GetTektonPipelineRunTasksUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run tasks unauthorized response has a 5xx status code +func (o *GetTektonPipelineRunTasksUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run tasks unauthorized response a status code equal to that given +func (o *GetTektonPipelineRunTasksUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get tekton pipeline run tasks unauthorized response +func (o *GetTektonPipelineRunTasksUnauthorized) Code() int { + return 401 +} + +func (o *GetTektonPipelineRunTasksUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks][%d] getTektonPipelineRunTasksUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTasksUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks][%d] getTektonPipelineRunTasksUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunTasksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTektonPipelineRunTasksNotFound creates a GetTektonPipelineRunTasksNotFound with default headers values +func NewGetTektonPipelineRunTasksNotFound() *GetTektonPipelineRunTasksNotFound { + return &GetTektonPipelineRunTasksNotFound{} +} + +/* +GetTektonPipelineRunTasksNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetTektonPipelineRunTasksNotFound struct { +} + +// IsSuccess returns true when this get tekton pipeline run tasks not found response has a 2xx status code +func (o *GetTektonPipelineRunTasksNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline run tasks not found response has a 3xx status code +func (o *GetTektonPipelineRunTasksNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline run tasks not found response has a 4xx status code +func (o *GetTektonPipelineRunTasksNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline run tasks not found response has a 5xx status code +func (o *GetTektonPipelineRunTasksNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline run tasks not found response a status code equal to that given +func (o *GetTektonPipelineRunTasksNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get tekton pipeline run tasks not found response +func (o *GetTektonPipelineRunTasksNotFound) Code() int { + return 404 +} + +func (o *GetTektonPipelineRunTasksNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks][%d] getTektonPipelineRunTasksNotFound ", 404) +} + +func (o *GetTektonPipelineRunTasksNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks][%d] getTektonPipelineRunTasksNotFound ", 404) +} + +func (o *GetTektonPipelineRunTasksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_runs_parameters.go b/generated-client/client/pipeline_job/get_tekton_pipeline_runs_parameters.go new file mode 100644 index 0000000..89b69ff --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_runs_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTektonPipelineRunsParams creates a new GetTektonPipelineRunsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTektonPipelineRunsParams() *GetTektonPipelineRunsParams { + return &GetTektonPipelineRunsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTektonPipelineRunsParamsWithTimeout creates a new GetTektonPipelineRunsParams object +// with the ability to set a timeout on a request. +func NewGetTektonPipelineRunsParamsWithTimeout(timeout time.Duration) *GetTektonPipelineRunsParams { + return &GetTektonPipelineRunsParams{ + timeout: timeout, + } +} + +// NewGetTektonPipelineRunsParamsWithContext creates a new GetTektonPipelineRunsParams object +// with the ability to set a context for a request. +func NewGetTektonPipelineRunsParamsWithContext(ctx context.Context) *GetTektonPipelineRunsParams { + return &GetTektonPipelineRunsParams{ + Context: ctx, + } +} + +// NewGetTektonPipelineRunsParamsWithHTTPClient creates a new GetTektonPipelineRunsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTektonPipelineRunsParamsWithHTTPClient(client *http.Client) *GetTektonPipelineRunsParams { + return &GetTektonPipelineRunsParams{ + HTTPClient: client, + } +} + +/* +GetTektonPipelineRunsParams contains all the parameters to send to the API endpoint + + for the get tekton pipeline runs operation. + + Typically these are written to a http.Request. +*/ +type GetTektonPipelineRunsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of Radix application + */ + AppName string + + /* JobName. + + Name of pipeline job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tekton pipeline runs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunsParams) WithDefaults() *GetTektonPipelineRunsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tekton pipeline runs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTektonPipelineRunsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) WithTimeout(timeout time.Duration) *GetTektonPipelineRunsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) WithContext(ctx context.Context) *GetTektonPipelineRunsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) WithHTTPClient(client *http.Client) *GetTektonPipelineRunsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) WithImpersonateGroup(impersonateGroup []string) *GetTektonPipelineRunsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) WithImpersonateUser(impersonateUser *string) *GetTektonPipelineRunsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) WithAppName(appName string) *GetTektonPipelineRunsParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithJobName adds the jobName to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) WithJobName(jobName string) *GetTektonPipelineRunsParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the get tekton pipeline runs params +func (o *GetTektonPipelineRunsParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTektonPipelineRunsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetTektonPipelineRuns binds the parameter Impersonate-Group +func (o *GetTektonPipelineRunsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/get_tekton_pipeline_runs_responses.go b/generated-client/client/pipeline_job/get_tekton_pipeline_runs_responses.go new file mode 100644 index 0000000..0ccba5b --- /dev/null +++ b/generated-client/client/pipeline_job/get_tekton_pipeline_runs_responses.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// GetTektonPipelineRunsReader is a Reader for the GetTektonPipelineRuns structure. +type GetTektonPipelineRunsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTektonPipelineRunsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTektonPipelineRunsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTektonPipelineRunsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTektonPipelineRunsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications/{appName}/jobs/{jobName}/pipelineruns] getTektonPipelineRuns", response, response.Code()) + } +} + +// NewGetTektonPipelineRunsOK creates a GetTektonPipelineRunsOK with default headers values +func NewGetTektonPipelineRunsOK() *GetTektonPipelineRunsOK { + return &GetTektonPipelineRunsOK{} +} + +/* +GetTektonPipelineRunsOK describes a response with status code 200, with default header values. + +List of PipelineRun-s +*/ +type GetTektonPipelineRunsOK struct { + Payload []*models.PipelineRun +} + +// IsSuccess returns true when this get tekton pipeline runs o k response has a 2xx status code +func (o *GetTektonPipelineRunsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tekton pipeline runs o k response has a 3xx status code +func (o *GetTektonPipelineRunsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline runs o k response has a 4xx status code +func (o *GetTektonPipelineRunsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tekton pipeline runs o k response has a 5xx status code +func (o *GetTektonPipelineRunsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline runs o k response a status code equal to that given +func (o *GetTektonPipelineRunsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tekton pipeline runs o k response +func (o *GetTektonPipelineRunsOK) Code() int { + return 200 +} + +func (o *GetTektonPipelineRunsOK) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns][%d] getTektonPipelineRunsOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunsOK) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns][%d] getTektonPipelineRunsOK %+v", 200, o.Payload) +} + +func (o *GetTektonPipelineRunsOK) GetPayload() []*models.PipelineRun { + return o.Payload +} + +func (o *GetTektonPipelineRunsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTektonPipelineRunsUnauthorized creates a GetTektonPipelineRunsUnauthorized with default headers values +func NewGetTektonPipelineRunsUnauthorized() *GetTektonPipelineRunsUnauthorized { + return &GetTektonPipelineRunsUnauthorized{} +} + +/* +GetTektonPipelineRunsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type GetTektonPipelineRunsUnauthorized struct { +} + +// IsSuccess returns true when this get tekton pipeline runs unauthorized response has a 2xx status code +func (o *GetTektonPipelineRunsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline runs unauthorized response has a 3xx status code +func (o *GetTektonPipelineRunsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline runs unauthorized response has a 4xx status code +func (o *GetTektonPipelineRunsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline runs unauthorized response has a 5xx status code +func (o *GetTektonPipelineRunsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline runs unauthorized response a status code equal to that given +func (o *GetTektonPipelineRunsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get tekton pipeline runs unauthorized response +func (o *GetTektonPipelineRunsUnauthorized) Code() int { + return 401 +} + +func (o *GetTektonPipelineRunsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns][%d] getTektonPipelineRunsUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns][%d] getTektonPipelineRunsUnauthorized ", 401) +} + +func (o *GetTektonPipelineRunsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTektonPipelineRunsNotFound creates a GetTektonPipelineRunsNotFound with default headers values +func NewGetTektonPipelineRunsNotFound() *GetTektonPipelineRunsNotFound { + return &GetTektonPipelineRunsNotFound{} +} + +/* +GetTektonPipelineRunsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetTektonPipelineRunsNotFound struct { +} + +// IsSuccess returns true when this get tekton pipeline runs not found response has a 2xx status code +func (o *GetTektonPipelineRunsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tekton pipeline runs not found response has a 3xx status code +func (o *GetTektonPipelineRunsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tekton pipeline runs not found response has a 4xx status code +func (o *GetTektonPipelineRunsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tekton pipeline runs not found response has a 5xx status code +func (o *GetTektonPipelineRunsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get tekton pipeline runs not found response a status code equal to that given +func (o *GetTektonPipelineRunsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get tekton pipeline runs not found response +func (o *GetTektonPipelineRunsNotFound) Code() int { + return 404 +} + +func (o *GetTektonPipelineRunsNotFound) Error() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns][%d] getTektonPipelineRunsNotFound ", 404) +} + +func (o *GetTektonPipelineRunsNotFound) String() string { + return fmt.Sprintf("[GET /applications/{appName}/jobs/{jobName}/pipelineruns][%d] getTektonPipelineRunsNotFound ", 404) +} + +func (o *GetTektonPipelineRunsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/pipeline_job/pipeline_job_client.go b/generated-client/client/pipeline_job/pipeline_job_client.go new file mode 100644 index 0000000..c62a8bd --- /dev/null +++ b/generated-client/client/pipeline_job/pipeline_job_client.go @@ -0,0 +1,449 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new pipeline job API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for pipeline job API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetApplicationJob(params *GetApplicationJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationJobOK, error) + + GetApplicationJobs(params *GetApplicationJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationJobsOK, error) + + GetPipelineJobStepLogs(params *GetPipelineJobStepLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPipelineJobStepLogsOK, error) + + GetTektonPipelineRun(params *GetTektonPipelineRunParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunOK, error) + + GetTektonPipelineRunTask(params *GetTektonPipelineRunTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTaskOK, error) + + GetTektonPipelineRunTaskStepLogs(params *GetTektonPipelineRunTaskStepLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTaskStepLogsOK, error) + + GetTektonPipelineRunTaskSteps(params *GetTektonPipelineRunTaskStepsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTaskStepsOK, error) + + GetTektonPipelineRunTasks(params *GetTektonPipelineRunTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTasksOK, error) + + GetTektonPipelineRuns(params *GetTektonPipelineRunsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunsOK, error) + + StopApplicationJob(params *StopApplicationJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopApplicationJobNoContent, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetApplicationJob gets the detail of a given pipeline job for a given application +*/ +func (a *Client) GetApplicationJob(params *GetApplicationJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationJobOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetApplicationJobParams() + } + op := &runtime.ClientOperation{ + ID: "getApplicationJob", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetApplicationJobReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetApplicationJobOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getApplicationJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetApplicationJobs gets the summary of jobs for a given application +*/ +func (a *Client) GetApplicationJobs(params *GetApplicationJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetApplicationJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetApplicationJobsParams() + } + op := &runtime.ClientOperation{ + ID: "getApplicationJobs", + Method: "GET", + PathPattern: "/applications/{appName}/jobs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetApplicationJobsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetApplicationJobsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getApplicationJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetPipelineJobStepLogs gets logs of a pipeline job step +*/ +func (a *Client) GetPipelineJobStepLogs(params *GetPipelineJobStepLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPipelineJobStepLogsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPipelineJobStepLogsParams() + } + op := &runtime.ClientOperation{ + ID: "getPipelineJobStepLogs", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}/logs/{stepName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetPipelineJobStepLogsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetPipelineJobStepLogsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getPipelineJobStepLogs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTektonPipelineRun gets a pipeline run for a pipeline job +*/ +func (a *Client) GetTektonPipelineRun(params *GetTektonPipelineRunParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTektonPipelineRunParams() + } + op := &runtime.ClientOperation{ + ID: "getTektonPipelineRun", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetTektonPipelineRunReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTektonPipelineRunOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTektonPipelineRun: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTektonPipelineRunTask gets list of pipeline run task of a pipeline job +*/ +func (a *Client) GetTektonPipelineRunTask(params *GetTektonPipelineRunTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTaskOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTektonPipelineRunTaskParams() + } + op := &runtime.ClientOperation{ + ID: "getTektonPipelineRunTask", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetTektonPipelineRunTaskReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTektonPipelineRunTaskOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTektonPipelineRunTask: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTektonPipelineRunTaskStepLogs gets logs of pipeline runs for a pipeline job +*/ +func (a *Client) GetTektonPipelineRunTaskStepLogs(params *GetTektonPipelineRunTaskStepLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTaskStepLogsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTektonPipelineRunTaskStepLogsParams() + } + op := &runtime.ClientOperation{ + ID: "getTektonPipelineRunTaskStepLogs", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/logs/{stepName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetTektonPipelineRunTaskStepLogsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTektonPipelineRunTaskStepLogsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTektonPipelineRunTaskStepLogs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTektonPipelineRunTaskSteps gets list of steps for a pipeline run task of a pipeline job +*/ +func (a *Client) GetTektonPipelineRunTaskSteps(params *GetTektonPipelineRunTaskStepsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTaskStepsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTektonPipelineRunTaskStepsParams() + } + op := &runtime.ClientOperation{ + ID: "getTektonPipelineRunTaskSteps", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks/{taskName}/steps", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetTektonPipelineRunTaskStepsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTektonPipelineRunTaskStepsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTektonPipelineRunTaskSteps: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTektonPipelineRunTasks gets list of pipeline run tasks of a pipeline job +*/ +func (a *Client) GetTektonPipelineRunTasks(params *GetTektonPipelineRunTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTektonPipelineRunTasksParams() + } + op := &runtime.ClientOperation{ + ID: "getTektonPipelineRunTasks", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}/pipelineruns/{pipelineRunName}/tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetTektonPipelineRunTasksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTektonPipelineRunTasksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTektonPipelineRunTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTektonPipelineRuns gets list of pipeline runs for a pipeline job +*/ +func (a *Client) GetTektonPipelineRuns(params *GetTektonPipelineRunsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTektonPipelineRunsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTektonPipelineRunsParams() + } + op := &runtime.ClientOperation{ + ID: "getTektonPipelineRuns", + Method: "GET", + PathPattern: "/applications/{appName}/jobs/{jobName}/pipelineruns", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetTektonPipelineRunsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTektonPipelineRunsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTektonPipelineRuns: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StopApplicationJob stops job +*/ +func (a *Client) StopApplicationJob(params *StopApplicationJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopApplicationJobNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStopApplicationJobParams() + } + op := &runtime.ClientOperation{ + ID: "stopApplicationJob", + Method: "POST", + PathPattern: "/applications/{appName}/jobs/{jobName}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StopApplicationJobReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StopApplicationJobNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stopApplicationJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/pipeline_job/stop_application_job_parameters.go b/generated-client/client/pipeline_job/stop_application_job_parameters.go new file mode 100644 index 0000000..4c514a9 --- /dev/null +++ b/generated-client/client/pipeline_job/stop_application_job_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStopApplicationJobParams creates a new StopApplicationJobParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStopApplicationJobParams() *StopApplicationJobParams { + return &StopApplicationJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStopApplicationJobParamsWithTimeout creates a new StopApplicationJobParams object +// with the ability to set a timeout on a request. +func NewStopApplicationJobParamsWithTimeout(timeout time.Duration) *StopApplicationJobParams { + return &StopApplicationJobParams{ + timeout: timeout, + } +} + +// NewStopApplicationJobParamsWithContext creates a new StopApplicationJobParams object +// with the ability to set a context for a request. +func NewStopApplicationJobParamsWithContext(ctx context.Context) *StopApplicationJobParams { + return &StopApplicationJobParams{ + Context: ctx, + } +} + +// NewStopApplicationJobParamsWithHTTPClient creates a new StopApplicationJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewStopApplicationJobParamsWithHTTPClient(client *http.Client) *StopApplicationJobParams { + return &StopApplicationJobParams{ + HTTPClient: client, + } +} + +/* +StopApplicationJobParams contains all the parameters to send to the API endpoint + + for the stop application job operation. + + Typically these are written to a http.Request. +*/ +type StopApplicationJobParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* AppName. + + name of application + */ + AppName string + + /* JobName. + + name of job + */ + JobName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stop application job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopApplicationJobParams) WithDefaults() *StopApplicationJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stop application job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopApplicationJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stop application job params +func (o *StopApplicationJobParams) WithTimeout(timeout time.Duration) *StopApplicationJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stop application job params +func (o *StopApplicationJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stop application job params +func (o *StopApplicationJobParams) WithContext(ctx context.Context) *StopApplicationJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stop application job params +func (o *StopApplicationJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stop application job params +func (o *StopApplicationJobParams) WithHTTPClient(client *http.Client) *StopApplicationJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stop application job params +func (o *StopApplicationJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the stop application job params +func (o *StopApplicationJobParams) WithImpersonateGroup(impersonateGroup []string) *StopApplicationJobParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the stop application job params +func (o *StopApplicationJobParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the stop application job params +func (o *StopApplicationJobParams) WithImpersonateUser(impersonateUser *string) *StopApplicationJobParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the stop application job params +func (o *StopApplicationJobParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithAppName adds the appName to the stop application job params +func (o *StopApplicationJobParams) WithAppName(appName string) *StopApplicationJobParams { + o.SetAppName(appName) + return o +} + +// SetAppName adds the appName to the stop application job params +func (o *StopApplicationJobParams) SetAppName(appName string) { + o.AppName = appName +} + +// WithJobName adds the jobName to the stop application job params +func (o *StopApplicationJobParams) WithJobName(jobName string) *StopApplicationJobParams { + o.SetJobName(jobName) + return o +} + +// SetJobName adds the jobName to the stop application job params +func (o *StopApplicationJobParams) SetJobName(jobName string) { + o.JobName = jobName +} + +// WriteToRequest writes these params to a swagger request +func (o *StopApplicationJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + // path param appName + if err := r.SetPathParam("appName", o.AppName); err != nil { + return err + } + + // path param jobName + if err := r.SetPathParam("jobName", o.JobName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamStopApplicationJob binds the parameter Impersonate-Group +func (o *StopApplicationJobParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/pipeline_job/stop_application_job_responses.go b/generated-client/client/pipeline_job/stop_application_job_responses.go new file mode 100644 index 0000000..572b7f2 --- /dev/null +++ b/generated-client/client/pipeline_job/stop_application_job_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pipeline_job + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StopApplicationJobReader is a Reader for the StopApplicationJob structure. +type StopApplicationJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StopApplicationJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewStopApplicationJobNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewStopApplicationJobUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewStopApplicationJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/{appName}/jobs/{jobName}/stop] stopApplicationJob", response, response.Code()) + } +} + +// NewStopApplicationJobNoContent creates a StopApplicationJobNoContent with default headers values +func NewStopApplicationJobNoContent() *StopApplicationJobNoContent { + return &StopApplicationJobNoContent{} +} + +/* +StopApplicationJobNoContent describes a response with status code 204, with default header values. + +Job stopped ok +*/ +type StopApplicationJobNoContent struct { +} + +// IsSuccess returns true when this stop application job no content response has a 2xx status code +func (o *StopApplicationJobNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stop application job no content response has a 3xx status code +func (o *StopApplicationJobNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop application job no content response has a 4xx status code +func (o *StopApplicationJobNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this stop application job no content response has a 5xx status code +func (o *StopApplicationJobNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this stop application job no content response a status code equal to that given +func (o *StopApplicationJobNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the stop application job no content response +func (o *StopApplicationJobNoContent) Code() int { + return 204 +} + +func (o *StopApplicationJobNoContent) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/jobs/{jobName}/stop][%d] stopApplicationJobNoContent ", 204) +} + +func (o *StopApplicationJobNoContent) String() string { + return fmt.Sprintf("[POST /applications/{appName}/jobs/{jobName}/stop][%d] stopApplicationJobNoContent ", 204) +} + +func (o *StopApplicationJobNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopApplicationJobUnauthorized creates a StopApplicationJobUnauthorized with default headers values +func NewStopApplicationJobUnauthorized() *StopApplicationJobUnauthorized { + return &StopApplicationJobUnauthorized{} +} + +/* +StopApplicationJobUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type StopApplicationJobUnauthorized struct { +} + +// IsSuccess returns true when this stop application job unauthorized response has a 2xx status code +func (o *StopApplicationJobUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop application job unauthorized response has a 3xx status code +func (o *StopApplicationJobUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop application job unauthorized response has a 4xx status code +func (o *StopApplicationJobUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop application job unauthorized response has a 5xx status code +func (o *StopApplicationJobUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this stop application job unauthorized response a status code equal to that given +func (o *StopApplicationJobUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the stop application job unauthorized response +func (o *StopApplicationJobUnauthorized) Code() int { + return 401 +} + +func (o *StopApplicationJobUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/jobs/{jobName}/stop][%d] stopApplicationJobUnauthorized ", 401) +} + +func (o *StopApplicationJobUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/{appName}/jobs/{jobName}/stop][%d] stopApplicationJobUnauthorized ", 401) +} + +func (o *StopApplicationJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStopApplicationJobNotFound creates a StopApplicationJobNotFound with default headers values +func NewStopApplicationJobNotFound() *StopApplicationJobNotFound { + return &StopApplicationJobNotFound{} +} + +/* +StopApplicationJobNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type StopApplicationJobNotFound struct { +} + +// IsSuccess returns true when this stop application job not found response has a 2xx status code +func (o *StopApplicationJobNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stop application job not found response has a 3xx status code +func (o *StopApplicationJobNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop application job not found response has a 4xx status code +func (o *StopApplicationJobNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this stop application job not found response has a 5xx status code +func (o *StopApplicationJobNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this stop application job not found response a status code equal to that given +func (o *StopApplicationJobNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the stop application job not found response +func (o *StopApplicationJobNotFound) Code() int { + return 404 +} + +func (o *StopApplicationJobNotFound) Error() string { + return fmt.Sprintf("[POST /applications/{appName}/jobs/{jobName}/stop][%d] stopApplicationJobNotFound ", 404) +} + +func (o *StopApplicationJobNotFound) String() string { + return fmt.Sprintf("[POST /applications/{appName}/jobs/{jobName}/stop][%d] stopApplicationJobNotFound ", 404) +} + +func (o *StopApplicationJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/platform/platform_client.go b/generated-client/client/platform/platform_client.go new file mode 100644 index 0000000..ffd5735 --- /dev/null +++ b/generated-client/client/platform/platform_client.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new platform API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for platform API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + RegisterApplication(params *RegisterApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RegisterApplicationOK, error) + + SearchApplications(params *SearchApplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SearchApplicationsOK, error) + + ShowApplications(params *ShowApplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ShowApplicationsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +RegisterApplication creates an application registration +*/ +func (a *Client) RegisterApplication(params *RegisterApplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RegisterApplicationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRegisterApplicationParams() + } + op := &runtime.ClientOperation{ + ID: "registerApplication", + Method: "POST", + PathPattern: "/applications", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RegisterApplicationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RegisterApplicationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for registerApplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +SearchApplications gets applications by name n o t e doesn t get application summary latest job environments +*/ +func (a *Client) SearchApplications(params *SearchApplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SearchApplicationsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSearchApplicationsParams() + } + op := &runtime.ClientOperation{ + ID: "searchApplications", + Method: "POST", + PathPattern: "/applications/_search", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &SearchApplicationsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*SearchApplicationsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for searchApplications: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ShowApplications lists the applications n o t e doesn t get application summary latest job environments +*/ +func (a *Client) ShowApplications(params *ShowApplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ShowApplicationsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewShowApplicationsParams() + } + op := &runtime.ClientOperation{ + ID: "showApplications", + Method: "GET", + PathPattern: "/applications", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ShowApplicationsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ShowApplicationsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for showApplications: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/generated-client/client/platform/register_application_parameters.go b/generated-client/client/platform/register_application_parameters.go new file mode 100644 index 0000000..15b57f5 --- /dev/null +++ b/generated-client/client/platform/register_application_parameters.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewRegisterApplicationParams creates a new RegisterApplicationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRegisterApplicationParams() *RegisterApplicationParams { + return &RegisterApplicationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRegisterApplicationParamsWithTimeout creates a new RegisterApplicationParams object +// with the ability to set a timeout on a request. +func NewRegisterApplicationParamsWithTimeout(timeout time.Duration) *RegisterApplicationParams { + return &RegisterApplicationParams{ + timeout: timeout, + } +} + +// NewRegisterApplicationParamsWithContext creates a new RegisterApplicationParams object +// with the ability to set a context for a request. +func NewRegisterApplicationParamsWithContext(ctx context.Context) *RegisterApplicationParams { + return &RegisterApplicationParams{ + Context: ctx, + } +} + +// NewRegisterApplicationParamsWithHTTPClient creates a new RegisterApplicationParams object +// with the ability to set a custom HTTPClient for a request. +func NewRegisterApplicationParamsWithHTTPClient(client *http.Client) *RegisterApplicationParams { + return &RegisterApplicationParams{ + HTTPClient: client, + } +} + +/* +RegisterApplicationParams contains all the parameters to send to the API endpoint + + for the register application operation. + + Typically these are written to a http.Request. +*/ +type RegisterApplicationParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* ApplicationRegistration. + + Request for an Application to register + */ + ApplicationRegistration *models.ApplicationRegistrationRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the register application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegisterApplicationParams) WithDefaults() *RegisterApplicationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the register application params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegisterApplicationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the register application params +func (o *RegisterApplicationParams) WithTimeout(timeout time.Duration) *RegisterApplicationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the register application params +func (o *RegisterApplicationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the register application params +func (o *RegisterApplicationParams) WithContext(ctx context.Context) *RegisterApplicationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the register application params +func (o *RegisterApplicationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the register application params +func (o *RegisterApplicationParams) WithHTTPClient(client *http.Client) *RegisterApplicationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the register application params +func (o *RegisterApplicationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the register application params +func (o *RegisterApplicationParams) WithImpersonateGroup(impersonateGroup []string) *RegisterApplicationParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the register application params +func (o *RegisterApplicationParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the register application params +func (o *RegisterApplicationParams) WithImpersonateUser(impersonateUser *string) *RegisterApplicationParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the register application params +func (o *RegisterApplicationParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithApplicationRegistration adds the applicationRegistration to the register application params +func (o *RegisterApplicationParams) WithApplicationRegistration(applicationRegistration *models.ApplicationRegistrationRequest) *RegisterApplicationParams { + o.SetApplicationRegistration(applicationRegistration) + return o +} + +// SetApplicationRegistration adds the applicationRegistration to the register application params +func (o *RegisterApplicationParams) SetApplicationRegistration(applicationRegistration *models.ApplicationRegistrationRequest) { + o.ApplicationRegistration = applicationRegistration +} + +// WriteToRequest writes these params to a swagger request +func (o *RegisterApplicationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.ApplicationRegistration != nil { + if err := r.SetBodyParam(o.ApplicationRegistration); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamRegisterApplication binds the parameter Impersonate-Group +func (o *RegisterApplicationParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/platform/register_application_responses.go b/generated-client/client/platform/register_application_responses.go new file mode 100644 index 0000000..9740aea --- /dev/null +++ b/generated-client/client/platform/register_application_responses.go @@ -0,0 +1,289 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// RegisterApplicationReader is a Reader for the RegisterApplication structure. +type RegisterApplicationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RegisterApplicationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRegisterApplicationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewRegisterApplicationBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewRegisterApplicationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewRegisterApplicationConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications] registerApplication", response, response.Code()) + } +} + +// NewRegisterApplicationOK creates a RegisterApplicationOK with default headers values +func NewRegisterApplicationOK() *RegisterApplicationOK { + return &RegisterApplicationOK{} +} + +/* +RegisterApplicationOK describes a response with status code 200, with default header values. + +Application registration operation details +*/ +type RegisterApplicationOK struct { + Payload *models.ApplicationRegistrationUpsertResponse +} + +// IsSuccess returns true when this register application o k response has a 2xx status code +func (o *RegisterApplicationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this register application o k response has a 3xx status code +func (o *RegisterApplicationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register application o k response has a 4xx status code +func (o *RegisterApplicationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this register application o k response has a 5xx status code +func (o *RegisterApplicationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this register application o k response a status code equal to that given +func (o *RegisterApplicationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the register application o k response +func (o *RegisterApplicationOK) Code() int { + return 200 +} + +func (o *RegisterApplicationOK) Error() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationOK %+v", 200, o.Payload) +} + +func (o *RegisterApplicationOK) String() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationOK %+v", 200, o.Payload) +} + +func (o *RegisterApplicationOK) GetPayload() *models.ApplicationRegistrationUpsertResponse { + return o.Payload +} + +func (o *RegisterApplicationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ApplicationRegistrationUpsertResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRegisterApplicationBadRequest creates a RegisterApplicationBadRequest with default headers values +func NewRegisterApplicationBadRequest() *RegisterApplicationBadRequest { + return &RegisterApplicationBadRequest{} +} + +/* +RegisterApplicationBadRequest describes a response with status code 400, with default header values. + +Invalid application registration +*/ +type RegisterApplicationBadRequest struct { +} + +// IsSuccess returns true when this register application bad request response has a 2xx status code +func (o *RegisterApplicationBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this register application bad request response has a 3xx status code +func (o *RegisterApplicationBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register application bad request response has a 4xx status code +func (o *RegisterApplicationBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this register application bad request response has a 5xx status code +func (o *RegisterApplicationBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this register application bad request response a status code equal to that given +func (o *RegisterApplicationBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the register application bad request response +func (o *RegisterApplicationBadRequest) Code() int { + return 400 +} + +func (o *RegisterApplicationBadRequest) Error() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationBadRequest ", 400) +} + +func (o *RegisterApplicationBadRequest) String() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationBadRequest ", 400) +} + +func (o *RegisterApplicationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegisterApplicationUnauthorized creates a RegisterApplicationUnauthorized with default headers values +func NewRegisterApplicationUnauthorized() *RegisterApplicationUnauthorized { + return &RegisterApplicationUnauthorized{} +} + +/* +RegisterApplicationUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type RegisterApplicationUnauthorized struct { +} + +// IsSuccess returns true when this register application unauthorized response has a 2xx status code +func (o *RegisterApplicationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this register application unauthorized response has a 3xx status code +func (o *RegisterApplicationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register application unauthorized response has a 4xx status code +func (o *RegisterApplicationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this register application unauthorized response has a 5xx status code +func (o *RegisterApplicationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this register application unauthorized response a status code equal to that given +func (o *RegisterApplicationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the register application unauthorized response +func (o *RegisterApplicationUnauthorized) Code() int { + return 401 +} + +func (o *RegisterApplicationUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationUnauthorized ", 401) +} + +func (o *RegisterApplicationUnauthorized) String() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationUnauthorized ", 401) +} + +func (o *RegisterApplicationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRegisterApplicationConflict creates a RegisterApplicationConflict with default headers values +func NewRegisterApplicationConflict() *RegisterApplicationConflict { + return &RegisterApplicationConflict{} +} + +/* +RegisterApplicationConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type RegisterApplicationConflict struct { +} + +// IsSuccess returns true when this register application conflict response has a 2xx status code +func (o *RegisterApplicationConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this register application conflict response has a 3xx status code +func (o *RegisterApplicationConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register application conflict response has a 4xx status code +func (o *RegisterApplicationConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this register application conflict response has a 5xx status code +func (o *RegisterApplicationConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this register application conflict response a status code equal to that given +func (o *RegisterApplicationConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the register application conflict response +func (o *RegisterApplicationConflict) Code() int { + return 409 +} + +func (o *RegisterApplicationConflict) Error() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationConflict ", 409) +} + +func (o *RegisterApplicationConflict) String() string { + return fmt.Sprintf("[POST /applications][%d] registerApplicationConflict ", 409) +} + +func (o *RegisterApplicationConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/platform/search_applications_parameters.go b/generated-client/client/platform/search_applications_parameters.go new file mode 100644 index 0000000..5ed4f27 --- /dev/null +++ b/generated-client/client/platform/search_applications_parameters.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// NewSearchApplicationsParams creates a new SearchApplicationsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSearchApplicationsParams() *SearchApplicationsParams { + return &SearchApplicationsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSearchApplicationsParamsWithTimeout creates a new SearchApplicationsParams object +// with the ability to set a timeout on a request. +func NewSearchApplicationsParamsWithTimeout(timeout time.Duration) *SearchApplicationsParams { + return &SearchApplicationsParams{ + timeout: timeout, + } +} + +// NewSearchApplicationsParamsWithContext creates a new SearchApplicationsParams object +// with the ability to set a context for a request. +func NewSearchApplicationsParamsWithContext(ctx context.Context) *SearchApplicationsParams { + return &SearchApplicationsParams{ + Context: ctx, + } +} + +// NewSearchApplicationsParamsWithHTTPClient creates a new SearchApplicationsParams object +// with the ability to set a custom HTTPClient for a request. +func NewSearchApplicationsParamsWithHTTPClient(client *http.Client) *SearchApplicationsParams { + return &SearchApplicationsParams{ + HTTPClient: client, + } +} + +/* +SearchApplicationsParams contains all the parameters to send to the API endpoint + + for the search applications operation. + + Typically these are written to a http.Request. +*/ +type SearchApplicationsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* ApplicationSearch. + + List of application names to search for + */ + ApplicationSearch *models.ApplicationsSearchRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the search applications params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchApplicationsParams) WithDefaults() *SearchApplicationsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search applications params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchApplicationsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the search applications params +func (o *SearchApplicationsParams) WithTimeout(timeout time.Duration) *SearchApplicationsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the search applications params +func (o *SearchApplicationsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the search applications params +func (o *SearchApplicationsParams) WithContext(ctx context.Context) *SearchApplicationsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the search applications params +func (o *SearchApplicationsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the search applications params +func (o *SearchApplicationsParams) WithHTTPClient(client *http.Client) *SearchApplicationsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the search applications params +func (o *SearchApplicationsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the search applications params +func (o *SearchApplicationsParams) WithImpersonateGroup(impersonateGroup []string) *SearchApplicationsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the search applications params +func (o *SearchApplicationsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the search applications params +func (o *SearchApplicationsParams) WithImpersonateUser(impersonateUser *string) *SearchApplicationsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the search applications params +func (o *SearchApplicationsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithApplicationSearch adds the applicationSearch to the search applications params +func (o *SearchApplicationsParams) WithApplicationSearch(applicationSearch *models.ApplicationsSearchRequest) *SearchApplicationsParams { + o.SetApplicationSearch(applicationSearch) + return o +} + +// SetApplicationSearch adds the applicationSearch to the search applications params +func (o *SearchApplicationsParams) SetApplicationSearch(applicationSearch *models.ApplicationsSearchRequest) { + o.ApplicationSearch = applicationSearch +} + +// WriteToRequest writes these params to a swagger request +func (o *SearchApplicationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + if o.ApplicationSearch != nil { + if err := r.SetBodyParam(o.ApplicationSearch); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamSearchApplications binds the parameter Impersonate-Group +func (o *SearchApplicationsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/platform/search_applications_responses.go b/generated-client/client/platform/search_applications_responses.go new file mode 100644 index 0000000..d68e282 --- /dev/null +++ b/generated-client/client/platform/search_applications_responses.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// SearchApplicationsReader is a Reader for the SearchApplications structure. +type SearchApplicationsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SearchApplicationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSearchApplicationsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewSearchApplicationsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewSearchApplicationsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewSearchApplicationsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewSearchApplicationsConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewSearchApplicationsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /applications/_search] searchApplications", response, response.Code()) + } +} + +// NewSearchApplicationsOK creates a SearchApplicationsOK with default headers values +func NewSearchApplicationsOK() *SearchApplicationsOK { + return &SearchApplicationsOK{} +} + +/* +SearchApplicationsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type SearchApplicationsOK struct { + Payload []*models.ApplicationSummary +} + +// IsSuccess returns true when this search applications o k response has a 2xx status code +func (o *SearchApplicationsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this search applications o k response has a 3xx status code +func (o *SearchApplicationsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search applications o k response has a 4xx status code +func (o *SearchApplicationsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this search applications o k response has a 5xx status code +func (o *SearchApplicationsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this search applications o k response a status code equal to that given +func (o *SearchApplicationsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the search applications o k response +func (o *SearchApplicationsOK) Code() int { + return 200 +} + +func (o *SearchApplicationsOK) Error() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsOK %+v", 200, o.Payload) +} + +func (o *SearchApplicationsOK) String() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsOK %+v", 200, o.Payload) +} + +func (o *SearchApplicationsOK) GetPayload() []*models.ApplicationSummary { + return o.Payload +} + +func (o *SearchApplicationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSearchApplicationsUnauthorized creates a SearchApplicationsUnauthorized with default headers values +func NewSearchApplicationsUnauthorized() *SearchApplicationsUnauthorized { + return &SearchApplicationsUnauthorized{} +} + +/* +SearchApplicationsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type SearchApplicationsUnauthorized struct { +} + +// IsSuccess returns true when this search applications unauthorized response has a 2xx status code +func (o *SearchApplicationsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search applications unauthorized response has a 3xx status code +func (o *SearchApplicationsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search applications unauthorized response has a 4xx status code +func (o *SearchApplicationsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this search applications unauthorized response has a 5xx status code +func (o *SearchApplicationsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this search applications unauthorized response a status code equal to that given +func (o *SearchApplicationsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the search applications unauthorized response +func (o *SearchApplicationsUnauthorized) Code() int { + return 401 +} + +func (o *SearchApplicationsUnauthorized) Error() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsUnauthorized ", 401) +} + +func (o *SearchApplicationsUnauthorized) String() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsUnauthorized ", 401) +} + +func (o *SearchApplicationsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewSearchApplicationsForbidden creates a SearchApplicationsForbidden with default headers values +func NewSearchApplicationsForbidden() *SearchApplicationsForbidden { + return &SearchApplicationsForbidden{} +} + +/* +SearchApplicationsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type SearchApplicationsForbidden struct { +} + +// IsSuccess returns true when this search applications forbidden response has a 2xx status code +func (o *SearchApplicationsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search applications forbidden response has a 3xx status code +func (o *SearchApplicationsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search applications forbidden response has a 4xx status code +func (o *SearchApplicationsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this search applications forbidden response has a 5xx status code +func (o *SearchApplicationsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this search applications forbidden response a status code equal to that given +func (o *SearchApplicationsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the search applications forbidden response +func (o *SearchApplicationsForbidden) Code() int { + return 403 +} + +func (o *SearchApplicationsForbidden) Error() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsForbidden ", 403) +} + +func (o *SearchApplicationsForbidden) String() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsForbidden ", 403) +} + +func (o *SearchApplicationsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewSearchApplicationsNotFound creates a SearchApplicationsNotFound with default headers values +func NewSearchApplicationsNotFound() *SearchApplicationsNotFound { + return &SearchApplicationsNotFound{} +} + +/* +SearchApplicationsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type SearchApplicationsNotFound struct { +} + +// IsSuccess returns true when this search applications not found response has a 2xx status code +func (o *SearchApplicationsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search applications not found response has a 3xx status code +func (o *SearchApplicationsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search applications not found response has a 4xx status code +func (o *SearchApplicationsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this search applications not found response has a 5xx status code +func (o *SearchApplicationsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this search applications not found response a status code equal to that given +func (o *SearchApplicationsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the search applications not found response +func (o *SearchApplicationsNotFound) Code() int { + return 404 +} + +func (o *SearchApplicationsNotFound) Error() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsNotFound ", 404) +} + +func (o *SearchApplicationsNotFound) String() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsNotFound ", 404) +} + +func (o *SearchApplicationsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewSearchApplicationsConflict creates a SearchApplicationsConflict with default headers values +func NewSearchApplicationsConflict() *SearchApplicationsConflict { + return &SearchApplicationsConflict{} +} + +/* +SearchApplicationsConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type SearchApplicationsConflict struct { +} + +// IsSuccess returns true when this search applications conflict response has a 2xx status code +func (o *SearchApplicationsConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search applications conflict response has a 3xx status code +func (o *SearchApplicationsConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search applications conflict response has a 4xx status code +func (o *SearchApplicationsConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this search applications conflict response has a 5xx status code +func (o *SearchApplicationsConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this search applications conflict response a status code equal to that given +func (o *SearchApplicationsConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the search applications conflict response +func (o *SearchApplicationsConflict) Code() int { + return 409 +} + +func (o *SearchApplicationsConflict) Error() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsConflict ", 409) +} + +func (o *SearchApplicationsConflict) String() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsConflict ", 409) +} + +func (o *SearchApplicationsConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewSearchApplicationsInternalServerError creates a SearchApplicationsInternalServerError with default headers values +func NewSearchApplicationsInternalServerError() *SearchApplicationsInternalServerError { + return &SearchApplicationsInternalServerError{} +} + +/* +SearchApplicationsInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type SearchApplicationsInternalServerError struct { +} + +// IsSuccess returns true when this search applications internal server error response has a 2xx status code +func (o *SearchApplicationsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search applications internal server error response has a 3xx status code +func (o *SearchApplicationsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search applications internal server error response has a 4xx status code +func (o *SearchApplicationsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this search applications internal server error response has a 5xx status code +func (o *SearchApplicationsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this search applications internal server error response a status code equal to that given +func (o *SearchApplicationsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the search applications internal server error response +func (o *SearchApplicationsInternalServerError) Code() int { + return 500 +} + +func (o *SearchApplicationsInternalServerError) Error() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsInternalServerError ", 500) +} + +func (o *SearchApplicationsInternalServerError) String() string { + return fmt.Sprintf("[POST /applications/_search][%d] searchApplicationsInternalServerError ", 500) +} + +func (o *SearchApplicationsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/platform/show_applications_parameters.go b/generated-client/client/platform/show_applications_parameters.go new file mode 100644 index 0000000..02ad44f --- /dev/null +++ b/generated-client/client/platform/show_applications_parameters.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewShowApplicationsParams creates a new ShowApplicationsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewShowApplicationsParams() *ShowApplicationsParams { + return &ShowApplicationsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewShowApplicationsParamsWithTimeout creates a new ShowApplicationsParams object +// with the ability to set a timeout on a request. +func NewShowApplicationsParamsWithTimeout(timeout time.Duration) *ShowApplicationsParams { + return &ShowApplicationsParams{ + timeout: timeout, + } +} + +// NewShowApplicationsParamsWithContext creates a new ShowApplicationsParams object +// with the ability to set a context for a request. +func NewShowApplicationsParamsWithContext(ctx context.Context) *ShowApplicationsParams { + return &ShowApplicationsParams{ + Context: ctx, + } +} + +// NewShowApplicationsParamsWithHTTPClient creates a new ShowApplicationsParams object +// with the ability to set a custom HTTPClient for a request. +func NewShowApplicationsParamsWithHTTPClient(client *http.Client) *ShowApplicationsParams { + return &ShowApplicationsParams{ + HTTPClient: client, + } +} + +/* +ShowApplicationsParams contains all the parameters to send to the API endpoint + + for the show applications operation. + + Typically these are written to a http.Request. +*/ +type ShowApplicationsParams struct { + + /* ImpersonateGroup. + + Works only with custom setup of cluster. Allow impersonation of test group (Required if Impersonate-User is set) + */ + ImpersonateGroup []string + + /* ImpersonateUser. + + Works only with custom setup of cluster. Allow impersonation of test users (Required if Impersonate-Group is set) + */ + ImpersonateUser *string + + /* SSHRepo. + + ssh repo to identify Radix application if exists + */ + SSHRepo *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the show applications params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ShowApplicationsParams) WithDefaults() *ShowApplicationsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the show applications params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ShowApplicationsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the show applications params +func (o *ShowApplicationsParams) WithTimeout(timeout time.Duration) *ShowApplicationsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the show applications params +func (o *ShowApplicationsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the show applications params +func (o *ShowApplicationsParams) WithContext(ctx context.Context) *ShowApplicationsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the show applications params +func (o *ShowApplicationsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the show applications params +func (o *ShowApplicationsParams) WithHTTPClient(client *http.Client) *ShowApplicationsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the show applications params +func (o *ShowApplicationsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpersonateGroup adds the impersonateGroup to the show applications params +func (o *ShowApplicationsParams) WithImpersonateGroup(impersonateGroup []string) *ShowApplicationsParams { + o.SetImpersonateGroup(impersonateGroup) + return o +} + +// SetImpersonateGroup adds the impersonateGroup to the show applications params +func (o *ShowApplicationsParams) SetImpersonateGroup(impersonateGroup []string) { + o.ImpersonateGroup = impersonateGroup +} + +// WithImpersonateUser adds the impersonateUser to the show applications params +func (o *ShowApplicationsParams) WithImpersonateUser(impersonateUser *string) *ShowApplicationsParams { + o.SetImpersonateUser(impersonateUser) + return o +} + +// SetImpersonateUser adds the impersonateUser to the show applications params +func (o *ShowApplicationsParams) SetImpersonateUser(impersonateUser *string) { + o.ImpersonateUser = impersonateUser +} + +// WithSSHRepo adds the sSHRepo to the show applications params +func (o *ShowApplicationsParams) WithSSHRepo(sSHRepo *string) *ShowApplicationsParams { + o.SetSSHRepo(sSHRepo) + return o +} + +// SetSSHRepo adds the sshRepo to the show applications params +func (o *ShowApplicationsParams) SetSSHRepo(sSHRepo *string) { + o.SSHRepo = sSHRepo +} + +// WriteToRequest writes these params to a swagger request +func (o *ShowApplicationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ImpersonateGroup != nil { + + // binding items for Impersonate-Group + joinedImpersonateGroup := o.bindParamImpersonateGroup(reg) + + // header array param Impersonate-Group + if len(joinedImpersonateGroup) > 0 { + if err := r.SetHeaderParam("Impersonate-Group", joinedImpersonateGroup[0]); err != nil { + return err + } + } + } + + if o.ImpersonateUser != nil { + + // header param Impersonate-User + if err := r.SetHeaderParam("Impersonate-User", *o.ImpersonateUser); err != nil { + return err + } + } + + if o.SSHRepo != nil { + + // query param sshRepo + var qrSSHRepo string + + if o.SSHRepo != nil { + qrSSHRepo = *o.SSHRepo + } + qSSHRepo := qrSSHRepo + if qSSHRepo != "" { + + if err := r.SetQueryParam("sshRepo", qSSHRepo); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamShowApplications binds the parameter Impersonate-Group +func (o *ShowApplicationsParams) bindParamImpersonateGroup(formats strfmt.Registry) []string { + impersonateGroupIR := o.ImpersonateGroup + + var impersonateGroupIC []string + for _, impersonateGroupIIR := range impersonateGroupIR { // explode []string + + impersonateGroupIIV := impersonateGroupIIR // string as string + impersonateGroupIC = append(impersonateGroupIC, impersonateGroupIIV) + } + + // items.CollectionFormat: "" + impersonateGroupIS := swag.JoinByFormat(impersonateGroupIC, "") + + return impersonateGroupIS +} diff --git a/generated-client/client/platform/show_applications_responses.go b/generated-client/client/platform/show_applications_responses.go new file mode 100644 index 0000000..5a0ca24 --- /dev/null +++ b/generated-client/client/platform/show_applications_responses.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/models" +) + +// ShowApplicationsReader is a Reader for the ShowApplications structure. +type ShowApplicationsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ShowApplicationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewShowApplicationsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewShowApplicationsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewShowApplicationsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewShowApplicationsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewShowApplicationsConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewShowApplicationsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /applications] showApplications", response, response.Code()) + } +} + +// NewShowApplicationsOK creates a ShowApplicationsOK with default headers values +func NewShowApplicationsOK() *ShowApplicationsOK { + return &ShowApplicationsOK{} +} + +/* +ShowApplicationsOK describes a response with status code 200, with default header values. + +Successful operation +*/ +type ShowApplicationsOK struct { + Payload []*models.ApplicationSummary +} + +// IsSuccess returns true when this show applications o k response has a 2xx status code +func (o *ShowApplicationsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this show applications o k response has a 3xx status code +func (o *ShowApplicationsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this show applications o k response has a 4xx status code +func (o *ShowApplicationsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this show applications o k response has a 5xx status code +func (o *ShowApplicationsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this show applications o k response a status code equal to that given +func (o *ShowApplicationsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the show applications o k response +func (o *ShowApplicationsOK) Code() int { + return 200 +} + +func (o *ShowApplicationsOK) Error() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsOK %+v", 200, o.Payload) +} + +func (o *ShowApplicationsOK) String() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsOK %+v", 200, o.Payload) +} + +func (o *ShowApplicationsOK) GetPayload() []*models.ApplicationSummary { + return o.Payload +} + +func (o *ShowApplicationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewShowApplicationsUnauthorized creates a ShowApplicationsUnauthorized with default headers values +func NewShowApplicationsUnauthorized() *ShowApplicationsUnauthorized { + return &ShowApplicationsUnauthorized{} +} + +/* +ShowApplicationsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type ShowApplicationsUnauthorized struct { +} + +// IsSuccess returns true when this show applications unauthorized response has a 2xx status code +func (o *ShowApplicationsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this show applications unauthorized response has a 3xx status code +func (o *ShowApplicationsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this show applications unauthorized response has a 4xx status code +func (o *ShowApplicationsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this show applications unauthorized response has a 5xx status code +func (o *ShowApplicationsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this show applications unauthorized response a status code equal to that given +func (o *ShowApplicationsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the show applications unauthorized response +func (o *ShowApplicationsUnauthorized) Code() int { + return 401 +} + +func (o *ShowApplicationsUnauthorized) Error() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsUnauthorized ", 401) +} + +func (o *ShowApplicationsUnauthorized) String() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsUnauthorized ", 401) +} + +func (o *ShowApplicationsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewShowApplicationsForbidden creates a ShowApplicationsForbidden with default headers values +func NewShowApplicationsForbidden() *ShowApplicationsForbidden { + return &ShowApplicationsForbidden{} +} + +/* +ShowApplicationsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ShowApplicationsForbidden struct { +} + +// IsSuccess returns true when this show applications forbidden response has a 2xx status code +func (o *ShowApplicationsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this show applications forbidden response has a 3xx status code +func (o *ShowApplicationsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this show applications forbidden response has a 4xx status code +func (o *ShowApplicationsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this show applications forbidden response has a 5xx status code +func (o *ShowApplicationsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this show applications forbidden response a status code equal to that given +func (o *ShowApplicationsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the show applications forbidden response +func (o *ShowApplicationsForbidden) Code() int { + return 403 +} + +func (o *ShowApplicationsForbidden) Error() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsForbidden ", 403) +} + +func (o *ShowApplicationsForbidden) String() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsForbidden ", 403) +} + +func (o *ShowApplicationsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewShowApplicationsNotFound creates a ShowApplicationsNotFound with default headers values +func NewShowApplicationsNotFound() *ShowApplicationsNotFound { + return &ShowApplicationsNotFound{} +} + +/* +ShowApplicationsNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ShowApplicationsNotFound struct { +} + +// IsSuccess returns true when this show applications not found response has a 2xx status code +func (o *ShowApplicationsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this show applications not found response has a 3xx status code +func (o *ShowApplicationsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this show applications not found response has a 4xx status code +func (o *ShowApplicationsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this show applications not found response has a 5xx status code +func (o *ShowApplicationsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this show applications not found response a status code equal to that given +func (o *ShowApplicationsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the show applications not found response +func (o *ShowApplicationsNotFound) Code() int { + return 404 +} + +func (o *ShowApplicationsNotFound) Error() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsNotFound ", 404) +} + +func (o *ShowApplicationsNotFound) String() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsNotFound ", 404) +} + +func (o *ShowApplicationsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewShowApplicationsConflict creates a ShowApplicationsConflict with default headers values +func NewShowApplicationsConflict() *ShowApplicationsConflict { + return &ShowApplicationsConflict{} +} + +/* +ShowApplicationsConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type ShowApplicationsConflict struct { +} + +// IsSuccess returns true when this show applications conflict response has a 2xx status code +func (o *ShowApplicationsConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this show applications conflict response has a 3xx status code +func (o *ShowApplicationsConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this show applications conflict response has a 4xx status code +func (o *ShowApplicationsConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this show applications conflict response has a 5xx status code +func (o *ShowApplicationsConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this show applications conflict response a status code equal to that given +func (o *ShowApplicationsConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the show applications conflict response +func (o *ShowApplicationsConflict) Code() int { + return 409 +} + +func (o *ShowApplicationsConflict) Error() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsConflict ", 409) +} + +func (o *ShowApplicationsConflict) String() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsConflict ", 409) +} + +func (o *ShowApplicationsConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewShowApplicationsInternalServerError creates a ShowApplicationsInternalServerError with default headers values +func NewShowApplicationsInternalServerError() *ShowApplicationsInternalServerError { + return &ShowApplicationsInternalServerError{} +} + +/* +ShowApplicationsInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type ShowApplicationsInternalServerError struct { +} + +// IsSuccess returns true when this show applications internal server error response has a 2xx status code +func (o *ShowApplicationsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this show applications internal server error response has a 3xx status code +func (o *ShowApplicationsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this show applications internal server error response has a 4xx status code +func (o *ShowApplicationsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this show applications internal server error response has a 5xx status code +func (o *ShowApplicationsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this show applications internal server error response a status code equal to that given +func (o *ShowApplicationsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the show applications internal server error response +func (o *ShowApplicationsInternalServerError) Code() int { + return 500 +} + +func (o *ShowApplicationsInternalServerError) Error() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsInternalServerError ", 500) +} + +func (o *ShowApplicationsInternalServerError) String() string { + return fmt.Sprintf("[GET /applications][%d] showApplicationsInternalServerError ", 500) +} + +func (o *ShowApplicationsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/generated-client/client/radixapi_client.go b/generated-client/client/radixapi_client.go new file mode 100644 index 0000000..6c95d59 --- /dev/null +++ b/generated-client/client/radixapi_client.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/equinor/radix-cli/generated-client/client/application" + "github.com/equinor/radix-cli/generated-client/client/buildstatus" + "github.com/equinor/radix-cli/generated-client/client/component" + "github.com/equinor/radix-cli/generated-client/client/deployment" + "github.com/equinor/radix-cli/generated-client/client/environment" + "github.com/equinor/radix-cli/generated-client/client/job" + "github.com/equinor/radix-cli/generated-client/client/pipeline_job" + "github.com/equinor/radix-cli/generated-client/client/platform" +) + +// Default radixapi HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/api/v1" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http", "https"} + +// NewHTTPClient creates a new radixapi HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Radixapi { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new radixapi HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Radixapi { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new radixapi client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Radixapi { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Radixapi) + cli.Transport = transport + cli.Application = application.New(transport, formats) + cli.Buildstatus = buildstatus.New(transport, formats) + cli.Component = component.New(transport, formats) + cli.Deployment = deployment.New(transport, formats) + cli.Environment = environment.New(transport, formats) + cli.Job = job.New(transport, formats) + cli.PipelineJob = pipeline_job.New(transport, formats) + cli.Platform = platform.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Radixapi is a client for radixapi +type Radixapi struct { + Application application.ClientService + + Buildstatus buildstatus.ClientService + + Component component.ClientService + + Deployment deployment.ClientService + + Environment environment.ClientService + + Job job.ClientService + + PipelineJob pipeline_job.ClientService + + Platform platform.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Radixapi) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Application.SetTransport(transport) + c.Buildstatus.SetTransport(transport) + c.Component.SetTransport(transport) + c.Deployment.SetTransport(transport) + c.Environment.SetTransport(transport) + c.Job.SetTransport(transport) + c.PipelineJob.SetTransport(transport) + c.Platform.SetTransport(transport) +} diff --git a/generated-client/models/alert_config.go b/generated-client/models/alert_config.go new file mode 100644 index 0000000..3ec9251 --- /dev/null +++ b/generated-client/models/alert_config.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AlertConfig AlertConfig defines a mapping between a pre-defined alert name and a receiver +// +// swagger:model AlertConfig +type AlertConfig struct { + + // Alert defines the name of a predefined alert + // Required: true + Alert *string `json:"alert"` + + // Receiver is the name of the receiver that will handle this alert + // Required: true + Receiver *string `json:"receiver"` +} + +// Validate validates this alert config +func (m *AlertConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAlert(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceiver(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AlertConfig) validateAlert(formats strfmt.Registry) error { + + if err := validate.Required("alert", "body", m.Alert); err != nil { + return err + } + + return nil +} + +func (m *AlertConfig) validateReceiver(formats strfmt.Registry) error { + + if err := validate.Required("receiver", "body", m.Receiver); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this alert config based on context it is used +func (m *AlertConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AlertConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AlertConfig) UnmarshalBinary(b []byte) error { + var res AlertConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/alert_config_list.go b/generated-client/models/alert_config_list.go new file mode 100644 index 0000000..317bdf5 --- /dev/null +++ b/generated-client/models/alert_config_list.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AlertConfigList AlertConfigList list of AlertConfig +// +// swagger:model AlertConfigList +type AlertConfigList []*AlertConfig + +// Validate validates this alert config list +func (m AlertConfigList) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this alert config list based on the context it is used +func (m AlertConfigList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/generated-client/models/alerting_config.go b/generated-client/models/alerting_config.go new file mode 100644 index 0000000..47f5e73 --- /dev/null +++ b/generated-client/models/alerting_config.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AlertingConfig AlertingConfig current alert settings +// +// swagger:model AlertingConfig +type AlertingConfig struct { + + // AlertNames is the list of alert names that can be handled by Radix + AlertNames []string `json:"alertNames"` + + // Enabled flag tells if alerting is enabled or disabled + Enabled bool `json:"enabled,omitempty"` + + // Ready flag tells tells if alerting is ready to be configured + // Value is always false when Enabled is false + // Vlaue is True if Enabled is true and Radix operator has processed the alert configuration + Ready bool `json:"ready,omitempty"` + + // alerts + Alerts AlertConfigList `json:"alerts,omitempty"` + + // receiver secret status + ReceiverSecretStatus ReceiverConfigSecretStatusMap `json:"receiverSecretStatus,omitempty"` + + // receivers + Receivers ReceiverConfigMap `json:"receivers,omitempty"` +} + +// Validate validates this alerting config +func (m *AlertingConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAlerts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceiverSecretStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceivers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AlertingConfig) validateAlerts(formats strfmt.Registry) error { + if swag.IsZero(m.Alerts) { // not required + return nil + } + + if err := m.Alerts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("alerts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alerts") + } + return err + } + + return nil +} + +func (m *AlertingConfig) validateReceiverSecretStatus(formats strfmt.Registry) error { + if swag.IsZero(m.ReceiverSecretStatus) { // not required + return nil + } + + if m.ReceiverSecretStatus != nil { + if err := m.ReceiverSecretStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receiverSecretStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receiverSecretStatus") + } + return err + } + } + + return nil +} + +func (m *AlertingConfig) validateReceivers(formats strfmt.Registry) error { + if swag.IsZero(m.Receivers) { // not required + return nil + } + + if m.Receivers != nil { + if err := m.Receivers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receivers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receivers") + } + return err + } + } + + return nil +} + +// ContextValidate validate this alerting config based on the context it is used +func (m *AlertingConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAlerts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReceiverSecretStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReceivers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AlertingConfig) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Alerts.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("alerts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alerts") + } + return err + } + + return nil +} + +func (m *AlertingConfig) contextValidateReceiverSecretStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ReceiverSecretStatus) { // not required + return nil + } + + if err := m.ReceiverSecretStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receiverSecretStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receiverSecretStatus") + } + return err + } + + return nil +} + +func (m *AlertingConfig) contextValidateReceivers(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Receivers) { // not required + return nil + } + + if err := m.Receivers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receivers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receivers") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AlertingConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AlertingConfig) UnmarshalBinary(b []byte) error { + var res AlertingConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application.go b/generated-client/models/application.go new file mode 100644 index 0000000..8af3f62 --- /dev/null +++ b/generated-client/models/application.go @@ -0,0 +1,307 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Application Application details of an application +// +// swagger:model Application +type Application struct { + + // Environments List of environments for this application + Environments []*EnvironmentSummary `json:"environments"` + + // Jobs list of run jobs for the application + Jobs []*JobSummary `json:"jobs"` + + // Name the name of the application + // Example: radix-canary-golang + Name string `json:"name,omitempty"` + + // UserIsAdmin if user is member of application's admin groups + // Required: true + UserIsAdmin *bool `json:"userIsAdmin"` + + // app alias + AppAlias *ApplicationAlias `json:"appAlias,omitempty"` + + // registration + Registration *ApplicationRegistration `json:"registration,omitempty"` +} + +// Validate validates this application +func (m *Application) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJobs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserIsAdmin(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAppAlias(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Application) validateEnvironments(formats strfmt.Registry) error { + if swag.IsZero(m.Environments) { // not required + return nil + } + + for i := 0; i < len(m.Environments); i++ { + if swag.IsZero(m.Environments[i]) { // not required + continue + } + + if m.Environments[i] != nil { + if err := m.Environments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Application) validateJobs(formats strfmt.Registry) error { + if swag.IsZero(m.Jobs) { // not required + return nil + } + + for i := 0; i < len(m.Jobs); i++ { + if swag.IsZero(m.Jobs[i]) { // not required + continue + } + + if m.Jobs[i] != nil { + if err := m.Jobs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Application) validateUserIsAdmin(formats strfmt.Registry) error { + + if err := validate.Required("userIsAdmin", "body", m.UserIsAdmin); err != nil { + return err + } + + return nil +} + +func (m *Application) validateAppAlias(formats strfmt.Registry) error { + if swag.IsZero(m.AppAlias) { // not required + return nil + } + + if m.AppAlias != nil { + if err := m.AppAlias.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appAlias") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("appAlias") + } + return err + } + } + + return nil +} + +func (m *Application) validateRegistration(formats strfmt.Registry) error { + if swag.IsZero(m.Registration) { // not required + return nil + } + + if m.Registration != nil { + if err := m.Registration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registration") + } + return err + } + } + + return nil +} + +// ContextValidate validate this application based on the context it is used +func (m *Application) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnvironments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateJobs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAppAlias(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRegistration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Application) contextValidateEnvironments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Environments); i++ { + + if m.Environments[i] != nil { + + if swag.IsZero(m.Environments[i]) { // not required + return nil + } + + if err := m.Environments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Application) contextValidateJobs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Jobs); i++ { + + if m.Jobs[i] != nil { + + if swag.IsZero(m.Jobs[i]) { // not required + return nil + } + + if err := m.Jobs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Application) contextValidateAppAlias(ctx context.Context, formats strfmt.Registry) error { + + if m.AppAlias != nil { + + if swag.IsZero(m.AppAlias) { // not required + return nil + } + + if err := m.AppAlias.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appAlias") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("appAlias") + } + return err + } + } + + return nil +} + +func (m *Application) contextValidateRegistration(ctx context.Context, formats strfmt.Registry) error { + + if m.Registration != nil { + + if swag.IsZero(m.Registration) { // not required + return nil + } + + if err := m.Registration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Application) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Application) UnmarshalBinary(b []byte) error { + var res Application + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_alias.go b/generated-client/models/application_alias.go new file mode 100644 index 0000000..d7a483d --- /dev/null +++ b/generated-client/models/application_alias.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ApplicationAlias ApplicationAlias holds public alias information +// +// swagger:model ApplicationAlias +type ApplicationAlias struct { + + // ComponentName the component exposing the endpoint + // Example: frontend + // Required: true + ComponentName *string `json:"componentName"` + + // EnvironmentName the environment hosting the endpoint + // Example: prod + // Required: true + EnvironmentName *string `json:"environmentName"` + + // URL the public endpoint + // Example: https://my-app.app.radix.equinor.com + // Required: true + URL *string `json:"url"` +} + +// Validate validates this application alias +func (m *ApplicationAlias) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateComponentName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironmentName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationAlias) validateComponentName(formats strfmt.Registry) error { + + if err := validate.Required("componentName", "body", m.ComponentName); err != nil { + return err + } + + return nil +} + +func (m *ApplicationAlias) validateEnvironmentName(formats strfmt.Registry) error { + + if err := validate.Required("environmentName", "body", m.EnvironmentName); err != nil { + return err + } + + return nil +} + +func (m *ApplicationAlias) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this application alias based on context it is used +func (m *ApplicationAlias) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationAlias) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationAlias) UnmarshalBinary(b []byte) error { + var res ApplicationAlias + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_registration.go b/generated-client/models/application_registration.go new file mode 100644 index 0000000..3dc9bdf --- /dev/null +++ b/generated-client/models/application_registration.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ApplicationRegistration ApplicationRegistration describe an application +// +// swagger:model ApplicationRegistration +type ApplicationRegistration struct { + + // AdGroups the groups that should be able to access the application + // Required: true + AdGroups []string `json:"adGroups"` + + // ConfigBranch information + // Required: true + ConfigBranch *string `json:"configBranch"` + + // ConfigurationItem is an identifier for an entity in a configuration management solution such as a CMDB. + // ITIL defines a CI as any component that needs to be managed in order to deliver an IT Service + // Ref: https://en.wikipedia.org/wiki/Configuration_item + ConfigurationItem string `json:"configurationItem,omitempty"` + + // Owner of the application (email). Can be a single person or a shared group email + // Required: true + Creator *string `json:"creator"` + + // MachineUser is on/off toggle of machine user for the application + MachineUser bool `json:"machineUser,omitempty"` + + // Name the unique name of the Radix application + // Example: radix-canary-golang + // Required: true + Name *string `json:"name"` + + // Owner of the application (email). Can be a single person or a shared group email + // Required: true + Owner *string `json:"owner"` + + // radixconfig.yaml file name and path, starting from the GitHub repository root (without leading slash) + RadixConfigFullName string `json:"radixConfigFullName,omitempty"` + + // ReaderAdGroups the groups that should be able to read the application + ReaderAdGroups []string `json:"readerAdGroups"` + + // Repository the github repository + // Example: https://github.com/equinor/radix-canary-golang + // Required: true + Repository *string `json:"repository"` + + // SharedSecret the shared secret of the webhook + // Required: true + SharedSecret *string `json:"sharedSecret"` + + // WBS information + WBS string `json:"wbs,omitempty"` +} + +// Validate validates this application registration +func (m *ApplicationRegistration) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdGroups(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConfigBranch(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRepository(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSharedSecret(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationRegistration) validateAdGroups(formats strfmt.Registry) error { + + if err := validate.Required("adGroups", "body", m.AdGroups); err != nil { + return err + } + + return nil +} + +func (m *ApplicationRegistration) validateConfigBranch(formats strfmt.Registry) error { + + if err := validate.Required("configBranch", "body", m.ConfigBranch); err != nil { + return err + } + + return nil +} + +func (m *ApplicationRegistration) validateCreator(formats strfmt.Registry) error { + + if err := validate.Required("creator", "body", m.Creator); err != nil { + return err + } + + return nil +} + +func (m *ApplicationRegistration) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ApplicationRegistration) validateOwner(formats strfmt.Registry) error { + + if err := validate.Required("owner", "body", m.Owner); err != nil { + return err + } + + return nil +} + +func (m *ApplicationRegistration) validateRepository(formats strfmt.Registry) error { + + if err := validate.Required("repository", "body", m.Repository); err != nil { + return err + } + + return nil +} + +func (m *ApplicationRegistration) validateSharedSecret(formats strfmt.Registry) error { + + if err := validate.Required("sharedSecret", "body", m.SharedSecret); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this application registration based on context it is used +func (m *ApplicationRegistration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationRegistration) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationRegistration) UnmarshalBinary(b []byte) error { + var res ApplicationRegistration + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_registration_patch.go b/generated-client/models/application_registration_patch.go new file mode 100644 index 0000000..7b71d16 --- /dev/null +++ b/generated-client/models/application_registration_patch.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ApplicationRegistrationPatch ApplicationRegistrationPatch contains fields that can be patched on a registration +// +// swagger:model ApplicationRegistrationPatch +type ApplicationRegistrationPatch struct { + + // AdGroups the groups that should be able to access the application + AdGroups []string `json:"adGroups"` + + // ConfigBranch information + ConfigBranch string `json:"configBranch,omitempty"` + + // ConfigurationItem is an identifier for an entity in a configuration management solution such as a CMDB. + // ITIL defines a CI as any component that needs to be managed in order to deliver an IT Service + // Ref: https://en.wikipedia.org/wiki/Configuration_item + ConfigurationItem string `json:"configurationItem,omitempty"` + + // MachineUser is used for interacting directly with Radix API + MachineUser *bool `json:"machineUser,omitempty"` + + // Owner of the application - should be an email + Owner string `json:"owner,omitempty"` + + // radixconfig.yaml file name and path, starting from the GitHub repository root (without leading slash) + RadixConfigFullName string `json:"radixConfigFullName,omitempty"` + + // ReaderAdGroups the groups that should be able to read the application + ReaderAdGroups []string `json:"readerAdGroups"` + + // Repository the github repository + Repository string `json:"repository,omitempty"` + + // WBS information + WBS string `json:"wbs,omitempty"` +} + +// Validate validates this application registration patch +func (m *ApplicationRegistrationPatch) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this application registration patch based on context it is used +func (m *ApplicationRegistrationPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationRegistrationPatch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationRegistrationPatch) UnmarshalBinary(b []byte) error { + var res ApplicationRegistrationPatch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_registration_patch_request.go b/generated-client/models/application_registration_patch_request.go new file mode 100644 index 0000000..c095830 --- /dev/null +++ b/generated-client/models/application_registration_patch_request.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ApplicationRegistrationPatchRequest ApplicationRegistrationPatchRequest contains request with fields that can be patched on a registration +// +// swagger:model ApplicationRegistrationPatchRequest +type ApplicationRegistrationPatchRequest struct { + + // AcknowledgeWarnings acknowledge all warnings + AcknowledgeWarnings bool `json:"acknowledgeWarnings,omitempty"` + + // application registration patch + // Required: true + ApplicationRegistrationPatch *ApplicationRegistrationPatch `json:"applicationRegistrationPatch"` +} + +// Validate validates this application registration patch request +func (m *ApplicationRegistrationPatchRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplicationRegistrationPatch(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationRegistrationPatchRequest) validateApplicationRegistrationPatch(formats strfmt.Registry) error { + + if err := validate.Required("applicationRegistrationPatch", "body", m.ApplicationRegistrationPatch); err != nil { + return err + } + + if m.ApplicationRegistrationPatch != nil { + if err := m.ApplicationRegistrationPatch.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applicationRegistrationPatch") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applicationRegistrationPatch") + } + return err + } + } + + return nil +} + +// ContextValidate validate this application registration patch request based on the context it is used +func (m *ApplicationRegistrationPatchRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApplicationRegistrationPatch(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationRegistrationPatchRequest) contextValidateApplicationRegistrationPatch(ctx context.Context, formats strfmt.Registry) error { + + if m.ApplicationRegistrationPatch != nil { + + if err := m.ApplicationRegistrationPatch.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applicationRegistrationPatch") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applicationRegistrationPatch") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationRegistrationPatchRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationRegistrationPatchRequest) UnmarshalBinary(b []byte) error { + var res ApplicationRegistrationPatchRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_registration_request.go b/generated-client/models/application_registration_request.go new file mode 100644 index 0000000..fec9111 --- /dev/null +++ b/generated-client/models/application_registration_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ApplicationRegistrationRequest ApplicationRegistrationRequest describe a register application request +// +// swagger:model ApplicationRegistrationRequest +type ApplicationRegistrationRequest struct { + + // AcknowledgeWarnings acknowledge all warnings + AcknowledgeWarnings bool `json:"acknowledgeWarnings,omitempty"` + + // application registration + ApplicationRegistration *ApplicationRegistration `json:"applicationRegistration,omitempty"` +} + +// Validate validates this application registration request +func (m *ApplicationRegistrationRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplicationRegistration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationRegistrationRequest) validateApplicationRegistration(formats strfmt.Registry) error { + if swag.IsZero(m.ApplicationRegistration) { // not required + return nil + } + + if m.ApplicationRegistration != nil { + if err := m.ApplicationRegistration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applicationRegistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applicationRegistration") + } + return err + } + } + + return nil +} + +// ContextValidate validate this application registration request based on the context it is used +func (m *ApplicationRegistrationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApplicationRegistration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationRegistrationRequest) contextValidateApplicationRegistration(ctx context.Context, formats strfmt.Registry) error { + + if m.ApplicationRegistration != nil { + + if swag.IsZero(m.ApplicationRegistration) { // not required + return nil + } + + if err := m.ApplicationRegistration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applicationRegistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applicationRegistration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationRegistrationRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationRegistrationRequest) UnmarshalBinary(b []byte) error { + var res ApplicationRegistrationRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_registration_upsert_response.go b/generated-client/models/application_registration_upsert_response.go new file mode 100644 index 0000000..7eb100b --- /dev/null +++ b/generated-client/models/application_registration_upsert_response.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ApplicationRegistrationUpsertResponse ApplicationRegistrationUpsertResponse describe an application upsert operation response +// +// swagger:model ApplicationRegistrationUpsertResponse +type ApplicationRegistrationUpsertResponse struct { + + // Warnings of upsert operation + // Example: ["Repository is used in other application(s)"] + Warnings []string `json:"warnings"` + + // application registration + ApplicationRegistration *ApplicationRegistration `json:"applicationRegistration,omitempty"` +} + +// Validate validates this application registration upsert response +func (m *ApplicationRegistrationUpsertResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplicationRegistration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationRegistrationUpsertResponse) validateApplicationRegistration(formats strfmt.Registry) error { + if swag.IsZero(m.ApplicationRegistration) { // not required + return nil + } + + if m.ApplicationRegistration != nil { + if err := m.ApplicationRegistration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applicationRegistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applicationRegistration") + } + return err + } + } + + return nil +} + +// ContextValidate validate this application registration upsert response based on the context it is used +func (m *ApplicationRegistrationUpsertResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApplicationRegistration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationRegistrationUpsertResponse) contextValidateApplicationRegistration(ctx context.Context, formats strfmt.Registry) error { + + if m.ApplicationRegistration != nil { + + if swag.IsZero(m.ApplicationRegistration) { // not required + return nil + } + + if err := m.ApplicationRegistration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applicationRegistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applicationRegistration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationRegistrationUpsertResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationRegistrationUpsertResponse) UnmarshalBinary(b []byte) error { + var res ApplicationRegistrationUpsertResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_search_include_fields.go b/generated-client/models/application_search_include_fields.go new file mode 100644 index 0000000..072b7d6 --- /dev/null +++ b/generated-client/models/application_search_include_fields.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ApplicationSearchIncludeFields ApplicationSearchIncludeFields specifies additional fields to include in the response of an ApplicationsSearchRequest +// +// swagger:model ApplicationSearchIncludeFields +type ApplicationSearchIncludeFields struct { + + // environment active components + EnvironmentActiveComponents bool `json:"environmentActiveComponents,omitempty"` + + // latest job summary + LatestJobSummary bool `json:"latestJobSummary,omitempty"` +} + +// Validate validates this application search include fields +func (m *ApplicationSearchIncludeFields) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this application search include fields based on context it is used +func (m *ApplicationSearchIncludeFields) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationSearchIncludeFields) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationSearchIncludeFields) UnmarshalBinary(b []byte) error { + var res ApplicationSearchIncludeFields + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/application_summary.go b/generated-client/models/application_summary.go new file mode 100644 index 0000000..4b8ee8b --- /dev/null +++ b/generated-client/models/application_summary.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ApplicationSummary ApplicationSummary describe an application +// +// swagger:model ApplicationSummary +type ApplicationSummary struct { + + // EnvironmentActiveComponents All component summaries of the active deployments in the environments + EnvironmentActiveComponents map[string][]Component `json:"environmentActiveComponents,omitempty"` + + // Name the name of the application + // Example: radix-canary-golang + Name string `json:"name,omitempty"` + + // latest job + LatestJob *JobSummary `json:"latestJob,omitempty"` +} + +// Validate validates this application summary +func (m *ApplicationSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironmentActiveComponents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLatestJob(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationSummary) validateEnvironmentActiveComponents(formats strfmt.Registry) error { + if swag.IsZero(m.EnvironmentActiveComponents) { // not required + return nil + } + + for k := range m.EnvironmentActiveComponents { + + if err := validate.Required("environmentActiveComponents"+"."+k, "body", m.EnvironmentActiveComponents[k]); err != nil { + return err + } + + for i := 0; i < len(m.EnvironmentActiveComponents[k]); i++ { + + if err := m.EnvironmentActiveComponents[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environmentActiveComponents" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environmentActiveComponents" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *ApplicationSummary) validateLatestJob(formats strfmt.Registry) error { + if swag.IsZero(m.LatestJob) { // not required + return nil + } + + if m.LatestJob != nil { + if err := m.LatestJob.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("latestJob") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("latestJob") + } + return err + } + } + + return nil +} + +// ContextValidate validate this application summary based on the context it is used +func (m *ApplicationSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnvironmentActiveComponents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLatestJob(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationSummary) contextValidateEnvironmentActiveComponents(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.EnvironmentActiveComponents { + + for i := 0; i < len(m.EnvironmentActiveComponents[k]); i++ { + + if swag.IsZero(m.EnvironmentActiveComponents[k][i]) { // not required + return nil + } + + if err := m.EnvironmentActiveComponents[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environmentActiveComponents" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environmentActiveComponents" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *ApplicationSummary) contextValidateLatestJob(ctx context.Context, formats strfmt.Registry) error { + + if m.LatestJob != nil { + + if swag.IsZero(m.LatestJob) { // not required + return nil + } + + if err := m.LatestJob.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("latestJob") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("latestJob") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationSummary) UnmarshalBinary(b []byte) error { + var res ApplicationSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/applications_search_request.go b/generated-client/models/applications_search_request.go new file mode 100644 index 0000000..bdca74f --- /dev/null +++ b/generated-client/models/applications_search_request.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ApplicationsSearchRequest ApplicationsSearchRequest contains the list of application names to be queried +// +// swagger:model ApplicationsSearchRequest +type ApplicationsSearchRequest struct { + + // List of application names to be returned + // Example: ["app1","app2"] + // Required: true + Names []string `json:"names"` + + // include fields + IncludeFields *ApplicationSearchIncludeFields `json:"includeFields,omitempty"` +} + +// Validate validates this applications search request +func (m *ApplicationsSearchRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNames(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIncludeFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationsSearchRequest) validateNames(formats strfmt.Registry) error { + + if err := validate.Required("names", "body", m.Names); err != nil { + return err + } + + return nil +} + +func (m *ApplicationsSearchRequest) validateIncludeFields(formats strfmt.Registry) error { + if swag.IsZero(m.IncludeFields) { // not required + return nil + } + + if m.IncludeFields != nil { + if err := m.IncludeFields.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("includeFields") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("includeFields") + } + return err + } + } + + return nil +} + +// ContextValidate validate this applications search request based on the context it is used +func (m *ApplicationsSearchRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIncludeFields(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApplicationsSearchRequest) contextValidateIncludeFields(ctx context.Context, formats strfmt.Registry) error { + + if m.IncludeFields != nil { + + if swag.IsZero(m.IncludeFields) { // not required + return nil + } + + if err := m.IncludeFields.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("includeFields") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("includeFields") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ApplicationsSearchRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApplicationsSearchRequest) UnmarshalBinary(b []byte) error { + var res ApplicationsSearchRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/auxiliary_resource.go b/generated-client/models/auxiliary_resource.go new file mode 100644 index 0000000..884d6ef --- /dev/null +++ b/generated-client/models/auxiliary_resource.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AuxiliaryResource AuxiliaryResource describes an auxiliary resources for a component +// +// swagger:model AuxiliaryResource +type AuxiliaryResource struct { + + // oauth2 + Oauth2 *OAuth2AuxiliaryResource `json:"oauth2,omitempty"` +} + +// Validate validates this auxiliary resource +func (m *AuxiliaryResource) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOauth2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuxiliaryResource) validateOauth2(formats strfmt.Registry) error { + if swag.IsZero(m.Oauth2) { // not required + return nil + } + + if m.Oauth2 != nil { + if err := m.Oauth2.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth2") + } + return err + } + } + + return nil +} + +// ContextValidate validate this auxiliary resource based on the context it is used +func (m *AuxiliaryResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOauth2(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuxiliaryResource) contextValidateOauth2(ctx context.Context, formats strfmt.Registry) error { + + if m.Oauth2 != nil { + + if swag.IsZero(m.Oauth2) { // not required + return nil + } + + if err := m.Oauth2.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth2") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AuxiliaryResource) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AuxiliaryResource) UnmarshalBinary(b []byte) error { + var res AuxiliaryResource + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/auxiliary_resource_deployment.go b/generated-client/models/auxiliary_resource_deployment.go new file mode 100644 index 0000000..8103aea --- /dev/null +++ b/generated-client/models/auxiliary_resource_deployment.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AuxiliaryResourceDeployment AuxiliaryResourceDeployment describes the state of the auxiliary resource's deployment +// +// swagger:model AuxiliaryResourceDeployment +type AuxiliaryResourceDeployment struct { + + // Running replicas of the auxiliary resource's deployment + ReplicaList []*ReplicaSummary `json:"replicaList"` + + // Status of the auxiliary resource's deployment + // Example: Consistent + // Required: true + Status *string `json:"status"` +} + +// Validate validates this auxiliary resource deployment +func (m *AuxiliaryResourceDeployment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReplicaList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuxiliaryResourceDeployment) validateReplicaList(formats strfmt.Registry) error { + if swag.IsZero(m.ReplicaList) { // not required + return nil + } + + for i := 0; i < len(m.ReplicaList); i++ { + if swag.IsZero(m.ReplicaList[i]) { // not required + continue + } + + if m.ReplicaList[i] != nil { + if err := m.ReplicaList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AuxiliaryResourceDeployment) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this auxiliary resource deployment based on the context it is used +func (m *AuxiliaryResourceDeployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateReplicaList(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuxiliaryResourceDeployment) contextValidateReplicaList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ReplicaList); i++ { + + if m.ReplicaList[i] != nil { + + if swag.IsZero(m.ReplicaList[i]) { // not required + return nil + } + + if err := m.ReplicaList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AuxiliaryResourceDeployment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AuxiliaryResourceDeployment) UnmarshalBinary(b []byte) error { + var res AuxiliaryResourceDeployment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/azure_identity.go b/generated-client/models/azure_identity.go new file mode 100644 index 0000000..993abdd --- /dev/null +++ b/generated-client/models/azure_identity.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AzureIdentity AzureIdentity describes an identity in Azure +// +// swagger:model AzureIdentity +type AzureIdentity struct { + + // The Azure Key Vaults names, which use Azure Identity + AzureKeyVaults []string `json:"azureKeyVaults"` + + // ClientId is the client ID of an Azure User Assigned Managed Identity + // or the application ID of an Azure AD Application Registration + // Required: true + ClientID *string `json:"clientId"` + + // The Service Account name to use when configuring Kubernetes Federation Credentials for the identity + // Required: true + ServiceAccountName *string `json:"serviceAccountName"` +} + +// Validate validates this azure identity +func (m *AzureIdentity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClientID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceAccountName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AzureIdentity) validateClientID(formats strfmt.Registry) error { + + if err := validate.Required("clientId", "body", m.ClientID); err != nil { + return err + } + + return nil +} + +func (m *AzureIdentity) validateServiceAccountName(formats strfmt.Registry) error { + + if err := validate.Required("serviceAccountName", "body", m.ServiceAccountName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this azure identity based on context it is used +func (m *AzureIdentity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AzureIdentity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AzureIdentity) UnmarshalBinary(b []byte) error { + var res AzureIdentity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/azure_key_vault_secret_version.go b/generated-client/models/azure_key_vault_secret_version.go new file mode 100644 index 0000000..aa87323 --- /dev/null +++ b/generated-client/models/azure_key_vault_secret_version.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AzureKeyVaultSecretVersion AzureKeyVaultSecretVersion holds a version of a Azure Key vault secret +// +// swagger:model AzureKeyVaultSecretVersion +type AzureKeyVaultSecretVersion struct { + + // BatchCreated which uses the secret + // Example: 2006-01-02T15:04:05Z + BatchCreated string `json:"batchCreated,omitempty"` + + // BatchName which uses the secret + // Example: batch-abc + BatchName string `json:"batchName,omitempty"` + + // JobCreated which uses the secret + // Example: 2006-01-02T15:04:05Z + JobCreated string `json:"jobCreated,omitempty"` + + // JobName which uses the secret + // Example: job-abc + JobName string `json:"jobName,omitempty"` + + // ReplicaCreated which uses the secret + // Example: 2006-01-02T15:04:05Z + // Required: true + ReplicaCreated *string `json:"replicaCreated"` + + // ReplicaName which uses the secret + // Example: abcdf + // Required: true + ReplicaName *string `json:"replicaName"` + + // Version of the secret + // Example: 0123456789 + // Required: true + Version *string `json:"version"` +} + +// Validate validates this azure key vault secret version +func (m *AzureKeyVaultSecretVersion) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReplicaCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicaName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AzureKeyVaultSecretVersion) validateReplicaCreated(formats strfmt.Registry) error { + + if err := validate.Required("replicaCreated", "body", m.ReplicaCreated); err != nil { + return err + } + + return nil +} + +func (m *AzureKeyVaultSecretVersion) validateReplicaName(formats strfmt.Registry) error { + + if err := validate.Required("replicaName", "body", m.ReplicaName); err != nil { + return err + } + + return nil +} + +func (m *AzureKeyVaultSecretVersion) validateVersion(formats strfmt.Registry) error { + + if err := validate.Required("version", "body", m.Version); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this azure key vault secret version based on context it is used +func (m *AzureKeyVaultSecretVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AzureKeyVaultSecretVersion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AzureKeyVaultSecretVersion) UnmarshalBinary(b []byte) error { + var res AzureKeyVaultSecretVersion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/build_secret.go b/generated-client/models/build_secret.go new file mode 100644 index 0000000..764b9a5 --- /dev/null +++ b/generated-client/models/build_secret.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// BuildSecret BuildSecret holds general information about image hubs +// +// swagger:model BuildSecret +type BuildSecret struct { + + // Name name of the build secret + // Example: SECRET_1 + // Required: true + Name *string `json:"name"` + + // Status of the secret + // Pending = Secret value is not set + // Consistent = Secret value is set + // Example: Consistent + Status string `json:"status,omitempty"` +} + +// Validate validates this build secret +func (m *BuildSecret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BuildSecret) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this build secret based on context it is used +func (m *BuildSecret) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BuildSecret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BuildSecret) UnmarshalBinary(b []byte) error { + var res BuildSecret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/component.go b/generated-client/models/component.go new file mode 100644 index 0000000..b20ea85 --- /dev/null +++ b/generated-client/models/component.go @@ -0,0 +1,465 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Component Component describe an component part of an deployment +// +// swagger:model Component +type Component struct { + + // Image name + // Example: radixdev.azurecr.io/app-server:cdgkg + // Required: true + Image *string `json:"image"` + + // Name the component + // Example: server + // Required: true + Name *string `json:"name"` + + // Ports defines the port number and protocol that a component is exposed for internally in environment + Ports []*Port `json:"ports"` + + // Array of ReplicaSummary + ReplicaList []*ReplicaSummary `json:"replicaList"` + + // Array of pod names + // Example: ["server-78fc8857c4-hm76l","server-78fc8857c4-asfa2"] + Replicas []string `json:"replicas"` + + // ScheduledJobPayloadPath defines the payload path, where payload for Job Scheduler will be mapped as a file. From radixconfig.yaml + // Example: \"/tmp/payload\ + ScheduledJobPayloadPath string `json:"scheduledJobPayloadPath,omitempty"` + + // SchedulerPort defines the port number that a Job Scheduler is exposed internally in environment + // Example: 8080 + SchedulerPort int32 `json:"schedulerPort,omitempty"` + + // Component secret names. From radixconfig.yaml + // Example: ["DB_CON","A_SECRET"] + Secrets []string `json:"secrets"` + + // Status of the component + // Example: Consistent + Status string `json:"status,omitempty"` + + // Type of component + // Example: component + // Required: true + Type *string `json:"type"` + + // Variable names map to values. From radixconfig.yaml + Variables map[string]string `json:"variables,omitempty"` + + // horizontal scaling summary + HorizontalScalingSummary *HorizontalScalingSummary `json:"horizontalScalingSummary,omitempty"` + + // identity + Identity *Identity `json:"identity,omitempty"` + + // notifications + Notifications *Notifications `json:"notifications,omitempty"` + + // oauth2 + Oauth2 *OAuth2AuxiliaryResource `json:"oauth2,omitempty"` +} + +// Validate validates this component +func (m *Component) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePorts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicaList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHorizontalScalingSummary(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIdentity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotifications(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOauth2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Component) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", m.Image); err != nil { + return err + } + + return nil +} + +func (m *Component) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *Component) validatePorts(formats strfmt.Registry) error { + if swag.IsZero(m.Ports) { // not required + return nil + } + + for i := 0; i < len(m.Ports); i++ { + if swag.IsZero(m.Ports[i]) { // not required + continue + } + + if m.Ports[i] != nil { + if err := m.Ports[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Component) validateReplicaList(formats strfmt.Registry) error { + if swag.IsZero(m.ReplicaList) { // not required + return nil + } + + for i := 0; i < len(m.ReplicaList); i++ { + if swag.IsZero(m.ReplicaList[i]) { // not required + continue + } + + if m.ReplicaList[i] != nil { + if err := m.ReplicaList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Component) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *Component) validateHorizontalScalingSummary(formats strfmt.Registry) error { + if swag.IsZero(m.HorizontalScalingSummary) { // not required + return nil + } + + if m.HorizontalScalingSummary != nil { + if err := m.HorizontalScalingSummary.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("horizontalScalingSummary") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("horizontalScalingSummary") + } + return err + } + } + + return nil +} + +func (m *Component) validateIdentity(formats strfmt.Registry) error { + if swag.IsZero(m.Identity) { // not required + return nil + } + + if m.Identity != nil { + if err := m.Identity.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("identity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("identity") + } + return err + } + } + + return nil +} + +func (m *Component) validateNotifications(formats strfmt.Registry) error { + if swag.IsZero(m.Notifications) { // not required + return nil + } + + if m.Notifications != nil { + if err := m.Notifications.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("notifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("notifications") + } + return err + } + } + + return nil +} + +func (m *Component) validateOauth2(formats strfmt.Registry) error { + if swag.IsZero(m.Oauth2) { // not required + return nil + } + + if m.Oauth2 != nil { + if err := m.Oauth2.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth2") + } + return err + } + } + + return nil +} + +// ContextValidate validate this component based on the context it is used +func (m *Component) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePorts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReplicaList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHorizontalScalingSummary(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIdentity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNotifications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOauth2(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Component) contextValidatePorts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Ports); i++ { + + if m.Ports[i] != nil { + + if swag.IsZero(m.Ports[i]) { // not required + return nil + } + + if err := m.Ports[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Component) contextValidateReplicaList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ReplicaList); i++ { + + if m.ReplicaList[i] != nil { + + if swag.IsZero(m.ReplicaList[i]) { // not required + return nil + } + + if err := m.ReplicaList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Component) contextValidateHorizontalScalingSummary(ctx context.Context, formats strfmt.Registry) error { + + if m.HorizontalScalingSummary != nil { + + if swag.IsZero(m.HorizontalScalingSummary) { // not required + return nil + } + + if err := m.HorizontalScalingSummary.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("horizontalScalingSummary") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("horizontalScalingSummary") + } + return err + } + } + + return nil +} + +func (m *Component) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { + + if m.Identity != nil { + + if swag.IsZero(m.Identity) { // not required + return nil + } + + if err := m.Identity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("identity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("identity") + } + return err + } + } + + return nil +} + +func (m *Component) contextValidateNotifications(ctx context.Context, formats strfmt.Registry) error { + + if m.Notifications != nil { + + if swag.IsZero(m.Notifications) { // not required + return nil + } + + if err := m.Notifications.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("notifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("notifications") + } + return err + } + } + + return nil +} + +func (m *Component) contextValidateOauth2(ctx context.Context, formats strfmt.Registry) error { + + if m.Oauth2 != nil { + + if swag.IsZero(m.Oauth2) { // not required + return nil + } + + if err := m.Oauth2.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth2") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Component) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Component) UnmarshalBinary(b []byte) error { + var res Component + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/component_summary.go b/generated-client/models/component_summary.go new file mode 100644 index 0000000..0d1220d --- /dev/null +++ b/generated-client/models/component_summary.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ComponentSummary ComponentSummary describe a component part of a deployment +// +// swagger:model ComponentSummary +type ComponentSummary struct { + + // Image name + // Example: radixdev.azurecr.io/app-server:cdgkg + // Required: true + Image *string `json:"image"` + + // Name the component + // Example: server + // Required: true + Name *string `json:"name"` + + // Type of component + // Example: component + // Required: true + Type *string `json:"type"` +} + +// Validate validates this component summary +func (m *ComponentSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComponentSummary) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", m.Image); err != nil { + return err + } + + return nil +} + +func (m *ComponentSummary) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ComponentSummary) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this component summary based on context it is used +func (m *ComponentSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ComponentSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ComponentSummary) UnmarshalBinary(b []byte) error { + var res ComponentSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/deploy_key_and_secret.go b/generated-client/models/deploy_key_and_secret.go new file mode 100644 index 0000000..3459f75 --- /dev/null +++ b/generated-client/models/deploy_key_and_secret.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeployKeyAndSecret DeployKeyAndSecret Holds generated public deploy key and shared secret +// +// swagger:model DeployKeyAndSecret +type DeployKeyAndSecret struct { + + // PublicDeployKey the public value of the deploy key + // Required: true + PublicDeployKey *string `json:"publicDeployKey"` + + // SharedSecret the shared secret + // Required: true + SharedSecret *string `json:"sharedSecret"` +} + +// Validate validates this deploy key and secret +func (m *DeployKeyAndSecret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePublicDeployKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSharedSecret(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeployKeyAndSecret) validatePublicDeployKey(formats strfmt.Registry) error { + + if err := validate.Required("publicDeployKey", "body", m.PublicDeployKey); err != nil { + return err + } + + return nil +} + +func (m *DeployKeyAndSecret) validateSharedSecret(formats strfmt.Registry) error { + + if err := validate.Required("sharedSecret", "body", m.SharedSecret); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this deploy key and secret based on context it is used +func (m *DeployKeyAndSecret) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeployKeyAndSecret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeployKeyAndSecret) UnmarshalBinary(b []byte) error { + var res DeployKeyAndSecret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/deployment.go b/generated-client/models/deployment.go new file mode 100644 index 0000000..5675793 --- /dev/null +++ b/generated-client/models/deployment.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Deployment Deployment describe an deployment +// +// swagger:model Deployment +type Deployment struct { + + // ActiveFrom Timestamp when the deployment starts (or created) + // Example: 2006-01-02T15:04:05Z + ActiveFrom string `json:"activeFrom,omitempty"` + + // ActiveTo Timestamp when the deployment ends + // Example: 2006-01-02T15:04:05Z + ActiveTo string `json:"activeTo,omitempty"` + + // Array of components + Components []*Component `json:"components"` + + // Name of job creating deployment + CreatedByJob string `json:"createdByJob,omitempty"` + + // Environment the environment this Radix application deployment runs in + // Example: prod + Environment string `json:"environment,omitempty"` + + // GitCommitHash the hash of the git commit from which radixconfig.yaml was parsed + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + GitCommitHash string `json:"gitCommitHash,omitempty"` + + // GitTags the git tags that the git commit hash points to + // Example: \"v1.22.1 v1.22.3\ + GitTags string `json:"gitTags,omitempty"` + + // Name the unique name of the Radix application deployment + // Example: radix-canary-golang-tzbqi + Name string `json:"name,omitempty"` + + // Namespace where the deployment is stored + // Example: radix-canary-golang-dev + // Required: true + Namespace *string `json:"namespace"` + + // Repository the GitHub repository that the deployment was built from + // Example: https://github.com/equinor/radix-canary-golang + // Required: true + Repository *string `json:"repository"` +} + +// Validate validates this deployment +func (m *Deployment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateComponents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNamespace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRepository(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Deployment) validateComponents(formats strfmt.Registry) error { + if swag.IsZero(m.Components) { // not required + return nil + } + + for i := 0; i < len(m.Components); i++ { + if swag.IsZero(m.Components[i]) { // not required + continue + } + + if m.Components[i] != nil { + if err := m.Components[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("components" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("components" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Deployment) validateNamespace(formats strfmt.Registry) error { + + if err := validate.Required("namespace", "body", m.Namespace); err != nil { + return err + } + + return nil +} + +func (m *Deployment) validateRepository(formats strfmt.Registry) error { + + if err := validate.Required("repository", "body", m.Repository); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this deployment based on the context it is used +func (m *Deployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateComponents(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Deployment) contextValidateComponents(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Components); i++ { + + if m.Components[i] != nil { + + if swag.IsZero(m.Components[i]) { // not required + return nil + } + + if err := m.Components[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("components" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("components" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Deployment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Deployment) UnmarshalBinary(b []byte) error { + var res Deployment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/deployment_item.go b/generated-client/models/deployment_item.go new file mode 100644 index 0000000..98a92fa --- /dev/null +++ b/generated-client/models/deployment_item.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeploymentItem DeploymentItem describe a deployment short info +// +// swagger:model DeploymentItem +type DeploymentItem struct { + + // ActiveFrom Timestamp when the deployment starts (or created) + // Example: 2006-01-02T15:04:05Z + // Required: true + ActiveFrom *string `json:"activeFrom"` + + // ActiveTo Timestamp when the deployment ends + // Example: 2006-01-02T15:04:05Z + ActiveTo string `json:"activeTo,omitempty"` + + // GitCommitHash the hash of the git commit from which radixconfig.yaml was parsed + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + GitCommitHash string `json:"gitCommitHash,omitempty"` + + // Name the unique name of the Radix application deployment + // Example: radix-canary-golang-tzbqi + // Required: true + Name *string `json:"name"` +} + +// Validate validates this deployment item +func (m *DeploymentItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActiveFrom(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeploymentItem) validateActiveFrom(formats strfmt.Registry) error { + + if err := validate.Required("activeFrom", "body", m.ActiveFrom); err != nil { + return err + } + + return nil +} + +func (m *DeploymentItem) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this deployment item based on context it is used +func (m *DeploymentItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeploymentItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeploymentItem) UnmarshalBinary(b []byte) error { + var res DeploymentItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/deployment_summary.go b/generated-client/models/deployment_summary.go new file mode 100644 index 0000000..32fe4f5 --- /dev/null +++ b/generated-client/models/deployment_summary.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeploymentSummary DeploymentSummary describe an deployment +// +// swagger:model DeploymentSummary +type DeploymentSummary struct { + + // ActiveFrom Timestamp when the deployment starts (or created) + // Example: 2006-01-02T15:04:05Z + // Required: true + ActiveFrom *string `json:"activeFrom"` + + // ActiveTo Timestamp when the deployment ends + // Example: 2006-01-02T15:04:05Z + ActiveTo string `json:"activeTo,omitempty"` + + // CommitID the commit ID of the branch to build + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + CommitID string `json:"commitID,omitempty"` + + // Array of component summaries + Components []*ComponentSummary `json:"components"` + + // Name of job creating deployment + CreatedByJob string `json:"createdByJob,omitempty"` + + // Environment the environment this Radix application deployment runs in + // Example: prod + // Required: true + Environment *string `json:"environment"` + + // GitCommitHash the hash of the git commit from which radixconfig.yaml was parsed + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + GitCommitHash string `json:"gitCommitHash,omitempty"` + + // GitTags the git tags that the git commit hash points to + // Example: \"v1.22.1 v1.22.3\ + GitTags string `json:"gitTags,omitempty"` + + // Name the unique name of the Radix application deployment + // Example: radix-canary-golang-tzbqi + // Required: true + Name *string `json:"name"` + + // Type of pipeline job + // Example: build-deploy + PipelineJobType string `json:"pipelineJobType,omitempty"` + + // Name of the environment the deployment was promoted from + // Applies only for pipeline jobs of type 'promote' + // Example: qa + PromotedFromEnvironment string `json:"promotedFromEnvironment,omitempty"` +} + +// Validate validates this deployment summary +func (m *DeploymentSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActiveFrom(formats); err != nil { + res = append(res, err) + } + + if err := m.validateComponents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeploymentSummary) validateActiveFrom(formats strfmt.Registry) error { + + if err := validate.Required("activeFrom", "body", m.ActiveFrom); err != nil { + return err + } + + return nil +} + +func (m *DeploymentSummary) validateComponents(formats strfmt.Registry) error { + if swag.IsZero(m.Components) { // not required + return nil + } + + for i := 0; i < len(m.Components); i++ { + if swag.IsZero(m.Components[i]) { // not required + continue + } + + if m.Components[i] != nil { + if err := m.Components[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("components" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("components" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeploymentSummary) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + return nil +} + +func (m *DeploymentSummary) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this deployment summary based on the context it is used +func (m *DeploymentSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateComponents(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeploymentSummary) contextValidateComponents(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Components); i++ { + + if m.Components[i] != nil { + + if swag.IsZero(m.Components[i]) { // not required + return nil + } + + if err := m.Components[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("components" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("components" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeploymentSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeploymentSummary) UnmarshalBinary(b []byte) error { + var res DeploymentSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/deployment_summary_pipeline_job_info.go b/generated-client/models/deployment_summary_pipeline_job_info.go new file mode 100644 index 0000000..3d9258e --- /dev/null +++ b/generated-client/models/deployment_summary_pipeline_job_info.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeploymentSummaryPipelineJobInfo deployment summary pipeline job info +// +// swagger:model DeploymentSummaryPipelineJobInfo +type DeploymentSummaryPipelineJobInfo struct { + + // CommitID the commit ID of the branch to build + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + CommitID string `json:"commitID,omitempty"` + + // Name of job creating deployment + CreatedByJob string `json:"createdByJob,omitempty"` + + // Type of pipeline job + // Example: build-deploy + PipelineJobType string `json:"pipelineJobType,omitempty"` + + // Name of the environment the deployment was promoted from + // Applies only for pipeline jobs of type 'promote' + // Example: qa + PromotedFromEnvironment string `json:"promotedFromEnvironment,omitempty"` +} + +// Validate validates this deployment summary pipeline job info +func (m *DeploymentSummaryPipelineJobInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this deployment summary pipeline job info based on context it is used +func (m *DeploymentSummaryPipelineJobInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeploymentSummaryPipelineJobInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeploymentSummaryPipelineJobInfo) UnmarshalBinary(b []byte) error { + var res DeploymentSummaryPipelineJobInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/env_var.go b/generated-client/models/env_var.go new file mode 100644 index 0000000..d2b237d --- /dev/null +++ b/generated-client/models/env_var.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EnvVar EnvVar environment variable with metadata +// +// swagger:model EnvVar +type EnvVar struct { + + // Name of the environment variable + // Example: VAR1 + // Required: true + Name *string `json:"name"` + + // Value of the environment variable + // Example: value1 + Value string `json:"value,omitempty"` + + // metadata + Metadata *EnvVarMetadata `json:"metadata,omitempty"` +} + +// Validate validates this env var +func (m *EnvVar) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMetadata(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EnvVar) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *EnvVar) validateMetadata(formats strfmt.Registry) error { + if swag.IsZero(m.Metadata) { // not required + return nil + } + + if m.Metadata != nil { + if err := m.Metadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("metadata") + } + return err + } + } + + return nil +} + +// ContextValidate validate this env var based on the context it is used +func (m *EnvVar) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMetadata(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EnvVar) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { + + if m.Metadata != nil { + + if swag.IsZero(m.Metadata) { // not required + return nil + } + + if err := m.Metadata.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("metadata") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EnvVar) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EnvVar) UnmarshalBinary(b []byte) error { + var res EnvVar + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/env_var_metadata.go b/generated-client/models/env_var_metadata.go new file mode 100644 index 0000000..f482f87 --- /dev/null +++ b/generated-client/models/env_var_metadata.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EnvVarMetadata EnvVarMetadata Environment variable metadata, holding state of creating or changing of value in Radix console +// +// swagger:model EnvVarMetadata +type EnvVarMetadata struct { + + // Value of the environment variable in radixconfig.yaml + // Example: value1 + RadixConfigValue string `json:"radixConfigValue,omitempty"` +} + +// Validate validates this env var metadata +func (m *EnvVarMetadata) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this env var metadata based on context it is used +func (m *EnvVarMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EnvVarMetadata) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EnvVarMetadata) UnmarshalBinary(b []byte) error { + var res EnvVarMetadata + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/env_var_parameter.go b/generated-client/models/env_var_parameter.go new file mode 100644 index 0000000..6cddd97 --- /dev/null +++ b/generated-client/models/env_var_parameter.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EnvVarParameter EnvVarParameter describes an environment variable +// +// swagger:model EnvVarParameter +type EnvVarParameter struct { + + // Name of the environment variable + // Example: VAR1 + // Required: true + Name *string `json:"name"` + + // Value a new value of the environment variable + // Example: value1 + // Required: true + Value *string `json:"value"` +} + +// Validate validates this env var parameter +func (m *EnvVarParameter) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EnvVarParameter) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *EnvVarParameter) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this env var parameter based on context it is used +func (m *EnvVarParameter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EnvVarParameter) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EnvVarParameter) UnmarshalBinary(b []byte) error { + var res EnvVarParameter + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/environment.go b/generated-client/models/environment.go new file mode 100644 index 0000000..d24f80e --- /dev/null +++ b/generated-client/models/environment.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Environment Environment holds detail information about environment +// +// swagger:model Environment +type Environment struct { + + // BranchMapping The branch mapped to this environment + // Example: master + BranchMapping string `json:"branchMapping,omitempty"` + + // Deployments All deployments in environment + Deployments []*DeploymentSummary `json:"deployments"` + + // Name of the environment + // Example: prod + Name string `json:"name,omitempty"` + + // Secrets All secrets in environment + Secrets []*Secret `json:"secrets"` + + // Status of the environment + // Pending = Environment exists in Radix config, but not in cluster + // Consistent = Environment exists in Radix config and in cluster + // Orphan = Environment does not exist in Radix config, but exists in cluster + // Example: Consistent + // Enum: [Pending Consistent Orphan] + Status string `json:"status,omitempty"` + + // active deployment + ActiveDeployment *Deployment `json:"activeDeployment,omitempty"` +} + +// Validate validates this environment +func (m *Environment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeployments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecrets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActiveDeployment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Environment) validateDeployments(formats strfmt.Registry) error { + if swag.IsZero(m.Deployments) { // not required + return nil + } + + for i := 0; i < len(m.Deployments); i++ { + if swag.IsZero(m.Deployments[i]) { // not required + continue + } + + if m.Deployments[i] != nil { + if err := m.Deployments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deployments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deployments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Environment) validateSecrets(formats strfmt.Registry) error { + if swag.IsZero(m.Secrets) { // not required + return nil + } + + for i := 0; i < len(m.Secrets); i++ { + if swag.IsZero(m.Secrets[i]) { // not required + continue + } + + if m.Secrets[i] != nil { + if err := m.Secrets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secrets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secrets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var environmentTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Pending","Consistent","Orphan"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + environmentTypeStatusPropEnum = append(environmentTypeStatusPropEnum, v) + } +} + +const ( + + // EnvironmentStatusPending captures enum value "Pending" + EnvironmentStatusPending string = "Pending" + + // EnvironmentStatusConsistent captures enum value "Consistent" + EnvironmentStatusConsistent string = "Consistent" + + // EnvironmentStatusOrphan captures enum value "Orphan" + EnvironmentStatusOrphan string = "Orphan" +) + +// prop value enum +func (m *Environment) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, environmentTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Environment) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *Environment) validateActiveDeployment(formats strfmt.Registry) error { + if swag.IsZero(m.ActiveDeployment) { // not required + return nil + } + + if m.ActiveDeployment != nil { + if err := m.ActiveDeployment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("activeDeployment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("activeDeployment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this environment based on the context it is used +func (m *Environment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDeployments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecrets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateActiveDeployment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Environment) contextValidateDeployments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Deployments); i++ { + + if m.Deployments[i] != nil { + + if swag.IsZero(m.Deployments[i]) { // not required + return nil + } + + if err := m.Deployments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deployments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deployments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Environment) contextValidateSecrets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Secrets); i++ { + + if m.Secrets[i] != nil { + + if swag.IsZero(m.Secrets[i]) { // not required + return nil + } + + if err := m.Secrets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secrets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secrets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Environment) contextValidateActiveDeployment(ctx context.Context, formats strfmt.Registry) error { + + if m.ActiveDeployment != nil { + + if swag.IsZero(m.ActiveDeployment) { // not required + return nil + } + + if err := m.ActiveDeployment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("activeDeployment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("activeDeployment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Environment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Environment) UnmarshalBinary(b []byte) error { + var res Environment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/environment_summary.go b/generated-client/models/environment_summary.go new file mode 100644 index 0000000..9dc4b26 --- /dev/null +++ b/generated-client/models/environment_summary.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EnvironmentSummary EnvironmentSummary holds general information about environment +// +// swagger:model EnvironmentSummary +type EnvironmentSummary struct { + + // BranchMapping The branch mapped to this environment + BranchMapping string `json:"branchMapping,omitempty"` + + // Name of the environment + // Example: prod + Name string `json:"name,omitempty"` + + // Status of the environment + // Pending = Environment exists in Radix config, but not in cluster + // Consistent = Environment exists in Radix config and in cluster + // Orphan = Environment does not exist in Radix config, but exists in cluster + // Example: Consistent + // Enum: [Pending Consistent Orphan] + Status string `json:"status,omitempty"` + + // active deployment + ActiveDeployment *DeploymentSummary `json:"activeDeployment,omitempty"` +} + +// Validate validates this environment summary +func (m *EnvironmentSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActiveDeployment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var environmentSummaryTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Pending","Consistent","Orphan"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + environmentSummaryTypeStatusPropEnum = append(environmentSummaryTypeStatusPropEnum, v) + } +} + +const ( + + // EnvironmentSummaryStatusPending captures enum value "Pending" + EnvironmentSummaryStatusPending string = "Pending" + + // EnvironmentSummaryStatusConsistent captures enum value "Consistent" + EnvironmentSummaryStatusConsistent string = "Consistent" + + // EnvironmentSummaryStatusOrphan captures enum value "Orphan" + EnvironmentSummaryStatusOrphan string = "Orphan" +) + +// prop value enum +func (m *EnvironmentSummary) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, environmentSummaryTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *EnvironmentSummary) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *EnvironmentSummary) validateActiveDeployment(formats strfmt.Registry) error { + if swag.IsZero(m.ActiveDeployment) { // not required + return nil + } + + if m.ActiveDeployment != nil { + if err := m.ActiveDeployment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("activeDeployment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("activeDeployment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this environment summary based on the context it is used +func (m *EnvironmentSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateActiveDeployment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EnvironmentSummary) contextValidateActiveDeployment(ctx context.Context, formats strfmt.Registry) error { + + if m.ActiveDeployment != nil { + + if swag.IsZero(m.ActiveDeployment) { // not required + return nil + } + + if err := m.ActiveDeployment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("activeDeployment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("activeDeployment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EnvironmentSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EnvironmentSummary) UnmarshalBinary(b []byte) error { + var res EnvironmentSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/event.go b/generated-client/models/event.go new file mode 100644 index 0000000..0563060 --- /dev/null +++ b/generated-client/models/event.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Event Event holds information about Kubernetes events +// +// swagger:model Event +type Event struct { + + // Kind of object involved in this event + // Example: Pod + InvolvedObjectKind string `json:"involvedObjectKind,omitempty"` + + // Name of object involved in this event + // Example: www-74cb7c986-fgcrl + InvolvedObjectName string `json:"involvedObjectName,omitempty"` + + // Namespace of object involved in this event + // Example: myapp-production + InvolvedObjectNamespace string `json:"involvedObjectNamespace,omitempty"` + + // The time (ISO8601) at which the event was last recorded + // Example: 2020-11-05T13:25:07.000Z + LastTimestamp interface{} `json:"lastTimestamp,omitempty"` + + // A human-readable description of the status of this event + // Example: 'Readiness probe failed: dial tcp 10.40.1.5:3003: connect: connection refused' + Message string `json:"message,omitempty"` + + // A short, machine understandable string that gives the reason for this event + // Example: Unhealthy + Reason string `json:"reason,omitempty"` + + // Type of event (Normal, Warning) + // Example: Warning + Type string `json:"type,omitempty"` + + // involved object state + InvolvedObjectState *ObjectState `json:"involvedObjectState,omitempty"` +} + +// Validate validates this event +func (m *Event) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInvolvedObjectState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Event) validateInvolvedObjectState(formats strfmt.Registry) error { + if swag.IsZero(m.InvolvedObjectState) { // not required + return nil + } + + if m.InvolvedObjectState != nil { + if err := m.InvolvedObjectState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("involvedObjectState") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("involvedObjectState") + } + return err + } + } + + return nil +} + +// ContextValidate validate this event based on the context it is used +func (m *Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateInvolvedObjectState(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Event) contextValidateInvolvedObjectState(ctx context.Context, formats strfmt.Registry) error { + + if m.InvolvedObjectState != nil { + + if swag.IsZero(m.InvolvedObjectState) { // not required + return nil + } + + if err := m.InvolvedObjectState.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("involvedObjectState") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("involvedObjectState") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Event) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Event) UnmarshalBinary(b []byte) error { + var res Event + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/horizontal_scaling_summary.go b/generated-client/models/horizontal_scaling_summary.go new file mode 100644 index 0000000..da4c983 --- /dev/null +++ b/generated-client/models/horizontal_scaling_summary.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HorizontalScalingSummary HorizontalScalingSummary describe the summary of horizontal scaling of a component +// +// swagger:model HorizontalScalingSummary +type HorizontalScalingSummary struct { + + // Component current average CPU utilization over all pods, represented as a percentage of requested CPU + // Example: 70 + CurrentCPUUtilizationPercentage int32 `json:"currentCPUUtilizationPercentage,omitempty"` + + // Component current average memory utilization over all pods, represented as a percentage of requested memory + // Example: 80 + CurrentMemoryUtilizationPercentage int32 `json:"currentMemoryUtilizationPercentage,omitempty"` + + // Component maximum replicas. From radixconfig.yaml + // Example: 5 + MaxReplicas int32 `json:"maxReplicas,omitempty"` + + // Component minimum replicas. From radixconfig.yaml + // Example: 2 + MinReplicas int32 `json:"minReplicas,omitempty"` + + // Component target average CPU utilization over all pods + // Example: 80 + TargetCPUUtilizationPercentage int32 `json:"targetCPUUtilizationPercentage,omitempty"` + + // Component target average memory utilization over all pods + // Example: 80 + TargetMemoryUtilizationPercentage int32 `json:"targetMemoryUtilizationPercentage,omitempty"` +} + +// Validate validates this horizontal scaling summary +func (m *HorizontalScalingSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this horizontal scaling summary based on context it is used +func (m *HorizontalScalingSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HorizontalScalingSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HorizontalScalingSummary) UnmarshalBinary(b []byte) error { + var res HorizontalScalingSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/identity.go b/generated-client/models/identity.go new file mode 100644 index 0000000..2eab2ea --- /dev/null +++ b/generated-client/models/identity.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Identity Identity describes external identities +// +// swagger:model Identity +type Identity struct { + + // azure + Azure *AzureIdentity `json:"azure,omitempty"` +} + +// Validate validates this identity +func (m *Identity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAzure(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Identity) validateAzure(formats strfmt.Registry) error { + if swag.IsZero(m.Azure) { // not required + return nil + } + + if m.Azure != nil { + if err := m.Azure.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure") + } + return err + } + } + + return nil +} + +// ContextValidate validate this identity based on the context it is used +func (m *Identity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAzure(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Identity) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error { + + if m.Azure != nil { + + if swag.IsZero(m.Azure) { // not required + return nil + } + + if err := m.Azure.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Identity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Identity) UnmarshalBinary(b []byte) error { + var res Identity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/image_hub_secret.go b/generated-client/models/image_hub_secret.go new file mode 100644 index 0000000..ea89581 --- /dev/null +++ b/generated-client/models/image_hub_secret.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ImageHubSecret ImageHubSecret holds general information about image hubs +// +// swagger:model ImageHubSecret +type ImageHubSecret struct { + + // Email provided in radixconfig.yaml + // Example: radix@equinor.com + Email string `json:"email,omitempty"` + + // Server name of the image hub + // Example: myprivaterepo.azurecr.io + // Required: true + Server *string `json:"server"` + + // Status of the secret + // Pending = Secret value is not set + // Consistent = Secret value is set + // Example: Consistent + Status string `json:"status,omitempty"` + + // Username for connecting to private image hub + // Example: my-user-name + // Required: true + Username *string `json:"username"` +} + +// Validate validates this image hub secret +func (m *ImageHubSecret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsername(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageHubSecret) validateServer(formats strfmt.Registry) error { + + if err := validate.Required("server", "body", m.Server); err != nil { + return err + } + + return nil +} + +func (m *ImageHubSecret) validateUsername(formats strfmt.Registry) error { + + if err := validate.Required("username", "body", m.Username); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this image hub secret based on context it is used +func (m *ImageHubSecret) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ImageHubSecret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImageHubSecret) UnmarshalBinary(b []byte) error { + var res ImageHubSecret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/job.go b/generated-client/models/job.go new file mode 100644 index 0000000..79ea4e3 --- /dev/null +++ b/generated-client/models/job.go @@ -0,0 +1,403 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Job Job holds general information about job +// +// swagger:model Job +type Job struct { + + // Branch branch to build from + // Example: master + Branch string `json:"branch,omitempty"` + + // CommitID the commit ID of the branch to build + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + CommitID string `json:"commitID,omitempty"` + + // Components (array of ComponentSummary) created by the job + // + // Deprecated: Inspect each deployment to get list of components created by the job + Components []*ComponentSummary `json:"components"` + + // Created timestamp + // Example: 2006-01-02T15:04:05Z + Created string `json:"created,omitempty"` + + // Array of deployments + Deployments []*DeploymentSummary `json:"deployments"` + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // Name of the job + // Example: radix-pipeline-20181029135644-algpv-6hznh + Name string `json:"name,omitempty"` + + // Name of the pipeline + // Example: build-deploy + // Enum: [build-deploy] + Pipeline string `json:"pipeline,omitempty"` + + // PromotedDeploymentName the name of the deployment that was promoted + // Example: component-6hznh + PromotedDeploymentName string `json:"promotedDeploymentName,omitempty"` + + // PromotedFromEnvironment the name of the environment that was promoted from + // Example: dev + PromotedFromEnvironment string `json:"promotedFromEnvironment,omitempty"` + + // PromotedToEnvironment the name of the environment that was promoted to + // Example: qa + PromotedToEnvironment string `json:"promotedToEnvironment,omitempty"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the job + // Example: Waiting + // Enum: [Waiting Running Succeeded Stopping Stopped Failed StoppedNoChanges] + Status string `json:"status,omitempty"` + + // Array of steps + Steps []*Step `json:"steps"` + + // TriggeredBy user that triggered the job. If through webhook = sender.login. If through api = usertoken.upn + // Example: a_user@equinor.com + TriggeredBy string `json:"triggeredBy,omitempty"` +} + +// Validate validates this job +func (m *Job) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateComponents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeployments(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePipeline(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSteps(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Job) validateComponents(formats strfmt.Registry) error { + if swag.IsZero(m.Components) { // not required + return nil + } + + for i := 0; i < len(m.Components); i++ { + if swag.IsZero(m.Components[i]) { // not required + continue + } + + if m.Components[i] != nil { + if err := m.Components[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("components" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("components" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Job) validateDeployments(formats strfmt.Registry) error { + if swag.IsZero(m.Deployments) { // not required + return nil + } + + for i := 0; i < len(m.Deployments); i++ { + if swag.IsZero(m.Deployments[i]) { // not required + continue + } + + if m.Deployments[i] != nil { + if err := m.Deployments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deployments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deployments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var jobTypePipelinePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["build-deploy"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypePipelinePropEnum = append(jobTypePipelinePropEnum, v) + } +} + +const ( + + // JobPipelineBuildDashDeploy captures enum value "build-deploy" + JobPipelineBuildDashDeploy string = "build-deploy" +) + +// prop value enum +func (m *Job) validatePipelineEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypePipelinePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validatePipeline(formats strfmt.Registry) error { + if swag.IsZero(m.Pipeline) { // not required + return nil + } + + // value enum + if err := m.validatePipelineEnum("pipeline", "body", m.Pipeline); err != nil { + return err + } + + return nil +} + +var jobTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Stopping","Stopped","Failed","StoppedNoChanges"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeStatusPropEnum = append(jobTypeStatusPropEnum, v) + } +} + +const ( + + // JobStatusWaiting captures enum value "Waiting" + JobStatusWaiting string = "Waiting" + + // JobStatusRunning captures enum value "Running" + JobStatusRunning string = "Running" + + // JobStatusSucceeded captures enum value "Succeeded" + JobStatusSucceeded string = "Succeeded" + + // JobStatusStopping captures enum value "Stopping" + JobStatusStopping string = "Stopping" + + // JobStatusStopped captures enum value "Stopped" + JobStatusStopped string = "Stopped" + + // JobStatusFailed captures enum value "Failed" + JobStatusFailed string = "Failed" + + // JobStatusStoppedNoChanges captures enum value "StoppedNoChanges" + JobStatusStoppedNoChanges string = "StoppedNoChanges" +) + +// prop value enum +func (m *Job) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *Job) validateSteps(formats strfmt.Registry) error { + if swag.IsZero(m.Steps) { // not required + return nil + } + + for i := 0; i < len(m.Steps); i++ { + if swag.IsZero(m.Steps[i]) { // not required + continue + } + + if m.Steps[i] != nil { + if err := m.Steps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this job based on the context it is used +func (m *Job) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateComponents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeployments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSteps(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Job) contextValidateComponents(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Components); i++ { + + if m.Components[i] != nil { + + if swag.IsZero(m.Components[i]) { // not required + return nil + } + + if err := m.Components[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("components" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("components" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Job) contextValidateDeployments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Deployments); i++ { + + if m.Deployments[i] != nil { + + if swag.IsZero(m.Deployments[i]) { // not required + return nil + } + + if err := m.Deployments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deployments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deployments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Job) contextValidateSteps(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Steps); i++ { + + if m.Steps[i] != nil { + + if swag.IsZero(m.Steps[i]) { // not required + return nil + } + + if err := m.Steps[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Job) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Job) UnmarshalBinary(b []byte) error { + var res Job + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/job_summary.go b/generated-client/models/job_summary.go new file mode 100644 index 0000000..7643348 --- /dev/null +++ b/generated-client/models/job_summary.go @@ -0,0 +1,208 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// JobSummary JobSummary holds general information about job +// +// swagger:model JobSummary +type JobSummary struct { + + // AppName of the application + // Example: radix-pipeline-20181029135644-algpv-6hznh + AppName string `json:"appName,omitempty"` + + // Branch branch to build from + // Example: master + Branch string `json:"branch,omitempty"` + + // CommitID the commit ID of the branch to build + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + CommitID string `json:"commitID,omitempty"` + + // Created timestamp + // Example: 2006-01-02T15:04:05Z + Created string `json:"created,omitempty"` + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // Environments the job deployed to + // Example: ["dev","qa"] + Environments []string `json:"environments"` + + // Name of the job + // Example: radix-pipeline-20181029135644-algpv-6hznh + Name string `json:"name,omitempty"` + + // Name of the pipeline + // Example: build-deploy + // Enum: [build-deploy build] + Pipeline string `json:"pipeline,omitempty"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the job + // Example: Waiting + // Enum: [Waiting Running Succeeded Stopping Stopped Failed StoppedNoChanges] + Status string `json:"status,omitempty"` + + // TriggeredBy user that triggered the job. If through webhook = sender.login. If through api - usertoken.upn + // Example: a_user@equinor.com + TriggeredBy string `json:"triggeredBy,omitempty"` +} + +// Validate validates this job summary +func (m *JobSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePipeline(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var jobSummaryTypePipelinePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["build-deploy"," build"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobSummaryTypePipelinePropEnum = append(jobSummaryTypePipelinePropEnum, v) + } +} + +const ( + + // JobSummaryPipelineBuildDashDeploy captures enum value "build-deploy" + JobSummaryPipelineBuildDashDeploy string = "build-deploy" + + // JobSummaryPipelineBuild captures enum value " build" + JobSummaryPipelineBuild string = " build" +) + +// prop value enum +func (m *JobSummary) validatePipelineEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobSummaryTypePipelinePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *JobSummary) validatePipeline(formats strfmt.Registry) error { + if swag.IsZero(m.Pipeline) { // not required + return nil + } + + // value enum + if err := m.validatePipelineEnum("pipeline", "body", m.Pipeline); err != nil { + return err + } + + return nil +} + +var jobSummaryTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Stopping","Stopped","Failed","StoppedNoChanges"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobSummaryTypeStatusPropEnum = append(jobSummaryTypeStatusPropEnum, v) + } +} + +const ( + + // JobSummaryStatusWaiting captures enum value "Waiting" + JobSummaryStatusWaiting string = "Waiting" + + // JobSummaryStatusRunning captures enum value "Running" + JobSummaryStatusRunning string = "Running" + + // JobSummaryStatusSucceeded captures enum value "Succeeded" + JobSummaryStatusSucceeded string = "Succeeded" + + // JobSummaryStatusStopping captures enum value "Stopping" + JobSummaryStatusStopping string = "Stopping" + + // JobSummaryStatusStopped captures enum value "Stopped" + JobSummaryStatusStopped string = "Stopped" + + // JobSummaryStatusFailed captures enum value "Failed" + JobSummaryStatusFailed string = "Failed" + + // JobSummaryStatusStoppedNoChanges captures enum value "StoppedNoChanges" + JobSummaryStatusStoppedNoChanges string = "StoppedNoChanges" +) + +// prop value enum +func (m *JobSummary) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobSummaryTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *JobSummary) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this job summary based on context it is used +func (m *JobSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JobSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JobSummary) UnmarshalBinary(b []byte) error { + var res JobSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/machine_user.go b/generated-client/models/machine_user.go new file mode 100644 index 0000000..ca40e52 --- /dev/null +++ b/generated-client/models/machine_user.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MachineUser MachineUser Holds info about machine user +// +// swagger:model MachineUser +type MachineUser struct { + + // Token the value of the token + // Required: true + Token *string `json:"token"` +} + +// Validate validates this machine user +func (m *MachineUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateToken(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MachineUser) validateToken(formats strfmt.Registry) error { + + if err := validate.Required("token", "body", m.Token); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this machine user based on context it is used +func (m *MachineUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MachineUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MachineUser) UnmarshalBinary(b []byte) error { + var res MachineUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/node.go b/generated-client/models/node.go new file mode 100644 index 0000000..3ccdf27 --- /dev/null +++ b/generated-client/models/node.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Node Node Defines node attributes, where pod should be scheduled +// +// swagger:model Node +type Node struct { + + // Gpu Holds lists of node GPU types, with dashed types to exclude + Gpu string `json:"gpu,omitempty"` + + // GpuCount Holds minimum count of GPU on node + GpuCount string `json:"gpuCount,omitempty"` +} + +// Validate validates this node +func (m *Node) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this node based on context it is used +func (m *Node) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Node) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Node) UnmarshalBinary(b []byte) error { + var res Node + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/notifications.go b/generated-client/models/notifications.go new file mode 100644 index 0000000..ab18f95 --- /dev/null +++ b/generated-client/models/notifications.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Notifications Notifications is the spec for notification about internal events or changes +// +// swagger:model Notifications +type Notifications struct { + + // Webhook is a URL for notification about internal events or changes. The URL should be of a Radix component or job-component, with not public port. + Webhook string `json:"webhook,omitempty"` +} + +// Validate validates this notifications +func (m *Notifications) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this notifications based on context it is used +func (m *Notifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Notifications) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Notifications) UnmarshalBinary(b []byte) error { + var res Notifications + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/o_auth2_auxiliary_resource.go b/generated-client/models/o_auth2_auxiliary_resource.go new file mode 100644 index 0000000..8c22650 --- /dev/null +++ b/generated-client/models/o_auth2_auxiliary_resource.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OAuth2AuxiliaryResource o auth2 auxiliary resource +// +// swagger:model OAuth2AuxiliaryResource +type OAuth2AuxiliaryResource struct { + + // deployment + // Required: true + Deployment *AuxiliaryResourceDeployment `json:"deployment"` +} + +// Validate validates this o auth2 auxiliary resource +func (m *OAuth2AuxiliaryResource) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeployment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OAuth2AuxiliaryResource) validateDeployment(formats strfmt.Registry) error { + + if err := validate.Required("deployment", "body", m.Deployment); err != nil { + return err + } + + if m.Deployment != nil { + if err := m.Deployment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deployment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deployment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this o auth2 auxiliary resource based on the context it is used +func (m *OAuth2AuxiliaryResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDeployment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OAuth2AuxiliaryResource) contextValidateDeployment(ctx context.Context, formats strfmt.Registry) error { + + if m.Deployment != nil { + + if err := m.Deployment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deployment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deployment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OAuth2AuxiliaryResource) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OAuth2AuxiliaryResource) UnmarshalBinary(b []byte) error { + var res OAuth2AuxiliaryResource + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/object_state.go b/generated-client/models/object_state.go new file mode 100644 index 0000000..f298cf5 --- /dev/null +++ b/generated-client/models/object_state.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ObjectState ObjectState holds information about the state of objects involved in an event +// +// swagger:model ObjectState +type ObjectState struct { + + // pod + Pod *PodState `json:"pod,omitempty"` +} + +// Validate validates this object state +func (m *ObjectState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePod(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ObjectState) validatePod(formats strfmt.Registry) error { + if swag.IsZero(m.Pod) { // not required + return nil + } + + if m.Pod != nil { + if err := m.Pod.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pod") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pod") + } + return err + } + } + + return nil +} + +// ContextValidate validate this object state based on the context it is used +func (m *ObjectState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePod(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ObjectState) contextValidatePod(ctx context.Context, formats strfmt.Registry) error { + + if m.Pod != nil { + + if swag.IsZero(m.Pod) { // not required + return nil + } + + if err := m.Pod.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pod") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pod") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ObjectState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ObjectState) UnmarshalBinary(b []byte) error { + var res ObjectState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/pipeline_parameters_build.go b/generated-client/models/pipeline_parameters_build.go new file mode 100644 index 0000000..3cc14ee --- /dev/null +++ b/generated-client/models/pipeline_parameters_build.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PipelineParametersBuild PipelineParametersBuild describe branch to build and its commit ID +// +// swagger:model PipelineParametersBuild +type PipelineParametersBuild struct { + + // Branch the branch to build + // REQUIRED for "build" and "build-deploy" pipelines + // Example: master + Branch string `json:"branch,omitempty"` + + // CommitID the commit ID of the branch to build + // REQUIRED for "build" and "build-deploy" pipelines + // Example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e + CommitID string `json:"commitID,omitempty"` + + // ImageName of the component, without repository name and image-tag + // Example: radix-component + ImageName string `json:"imageName,omitempty"` + + // ImageRepository of the component, without image name and image-tag + // Example: ghcr.io/test + ImageRepository string `json:"imageRepository,omitempty"` + + // ImageTag of the image - if empty will use default logic + // Example: master-latest + ImageTag string `json:"imageTag,omitempty"` + + // PushImage should image be pushed to container registry. Defaults pushing + // Example: true + PushImage string `json:"pushImage,omitempty"` + + // TriggeredBy of the job - if empty will use user token upn (user principle name) + // Example: a_user@equinor.com + TriggeredBy string `json:"triggeredBy,omitempty"` +} + +// Validate validates this pipeline parameters build +func (m *PipelineParametersBuild) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pipeline parameters build based on context it is used +func (m *PipelineParametersBuild) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PipelineParametersBuild) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PipelineParametersBuild) UnmarshalBinary(b []byte) error { + var res PipelineParametersBuild + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/pipeline_parameters_deploy.go b/generated-client/models/pipeline_parameters_deploy.go new file mode 100644 index 0000000..85cee15 --- /dev/null +++ b/generated-client/models/pipeline_parameters_deploy.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PipelineParametersDeploy PipelineParametersDeploy describes environment to deploy +// +// swagger:model PipelineParametersDeploy +type PipelineParametersDeploy struct { + + // Image tags names for components + // Example: component1=tag1,component2=tag2 + ImageTagNames map[string]string `json:"imageTagNames,omitempty"` + + // Name of environment to deploy + // REQUIRED for "deploy" pipeline + // Example: prod + ToEnvironment string `json:"toEnvironment,omitempty"` + + // TriggeredBy of the job - if empty will use user token upn (user principle name) + // Example: a_user@equinor.com + TriggeredBy string `json:"triggeredBy,omitempty"` +} + +// Validate validates this pipeline parameters deploy +func (m *PipelineParametersDeploy) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pipeline parameters deploy based on context it is used +func (m *PipelineParametersDeploy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PipelineParametersDeploy) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PipelineParametersDeploy) UnmarshalBinary(b []byte) error { + var res PipelineParametersDeploy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/pipeline_parameters_promote.go b/generated-client/models/pipeline_parameters_promote.go new file mode 100644 index 0000000..0e26591 --- /dev/null +++ b/generated-client/models/pipeline_parameters_promote.go @@ -0,0 +1,66 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PipelineParametersPromote PipelineParametersPromote identify deployment to promote and a target environment +// +// swagger:model PipelineParametersPromote +type PipelineParametersPromote struct { + + // ID of the deployment to promote + // REQUIRED for "promote" pipeline + // Example: dev-9tyu1-tftmnqzq + DeploymentName string `json:"deploymentName,omitempty"` + + // Name of environment where to look for the deployment to be promoted + // REQUIRED for "promote" pipeline + // Example: prod + FromEnvironment string `json:"fromEnvironment,omitempty"` + + // Name of environment to receive the promoted deployment + // REQUIRED for "promote" pipeline + // Example: prod + ToEnvironment string `json:"toEnvironment,omitempty"` + + // TriggeredBy of the job - if empty will use user token upn (user principle name) + // Example: a_user@equinor.com + TriggeredBy string `json:"triggeredBy,omitempty"` +} + +// Validate validates this pipeline parameters promote +func (m *PipelineParametersPromote) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pipeline parameters promote based on context it is used +func (m *PipelineParametersPromote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PipelineParametersPromote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PipelineParametersPromote) UnmarshalBinary(b []byte) error { + var res PipelineParametersPromote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/pipeline_run.go b/generated-client/models/pipeline_run.go new file mode 100644 index 0000000..632bc39 --- /dev/null +++ b/generated-client/models/pipeline_run.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PipelineRun PipelineRun holds general information about pipeline run +// +// swagger:model PipelineRun +type PipelineRun struct { + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // Env Environment of the pipeline run + // Example: prod + // Required: true + Env *string `json:"env"` + + // Name Original name of the pipeline run + // Example: build-pipeline + // Required: true + Name *string `json:"name"` + + // RealName Name of the pipeline run in the namespace + // Example: radix-tekton-pipelinerun-dev-2022-05-09-abcde + // Required: true + RealName *string `json:"realName"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the step + // Example: Waiting + // Enum: [Waiting Running Succeeded Failed] + Status string `json:"status,omitempty"` + + // StatusMessage of the task + StatusMessage string `json:"statusMessage,omitempty"` +} + +// Validate validates this pipeline run +func (m *PipelineRun) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnv(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRealName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PipelineRun) validateEnv(formats strfmt.Registry) error { + + if err := validate.Required("env", "body", m.Env); err != nil { + return err + } + + return nil +} + +func (m *PipelineRun) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *PipelineRun) validateRealName(formats strfmt.Registry) error { + + if err := validate.Required("realName", "body", m.RealName); err != nil { + return err + } + + return nil +} + +var pipelineRunTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pipelineRunTypeStatusPropEnum = append(pipelineRunTypeStatusPropEnum, v) + } +} + +const ( + + // PipelineRunStatusWaiting captures enum value "Waiting" + PipelineRunStatusWaiting string = "Waiting" + + // PipelineRunStatusRunning captures enum value "Running" + PipelineRunStatusRunning string = "Running" + + // PipelineRunStatusSucceeded captures enum value "Succeeded" + PipelineRunStatusSucceeded string = "Succeeded" + + // PipelineRunStatusFailed captures enum value "Failed" + PipelineRunStatusFailed string = "Failed" +) + +// prop value enum +func (m *PipelineRun) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, pipelineRunTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PipelineRun) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this pipeline run based on context it is used +func (m *PipelineRun) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PipelineRun) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PipelineRun) UnmarshalBinary(b []byte) error { + var res PipelineRun + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/pipeline_run_task.go b/generated-client/models/pipeline_run_task.go new file mode 100644 index 0000000..0ab5b94 --- /dev/null +++ b/generated-client/models/pipeline_run_task.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PipelineRunTask PipelineRunTask holds general information about pipeline run task +// +// swagger:model PipelineRunTask +type PipelineRunTask struct { + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // Name of the task + // Example: build + // Required: true + Name *string `json:"name"` + + // PipelineName of the task + // Example: build-pipeline + // Required: true + PipelineName *string `json:"pipelineName"` + + // PipelineRunEnv Environment of the pipeline run + // Example: prod + // Required: true + PipelineRunEnv *string `json:"pipelineRunEnv"` + + // RealName Name of the pipeline run in the namespace + // Example: radix-tekton-task-dev-2022-05-09-abcde + // Required: true + RealName *string `json:"realName"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the task + // Example: Waiting + // Enum: [Waiting Running Succeeded Failed] + Status string `json:"status,omitempty"` + + // StatusMessage of the task + StatusMessage string `json:"statusMessage,omitempty"` +} + +// Validate validates this pipeline run task +func (m *PipelineRunTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePipelineName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePipelineRunEnv(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRealName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PipelineRunTask) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *PipelineRunTask) validatePipelineName(formats strfmt.Registry) error { + + if err := validate.Required("pipelineName", "body", m.PipelineName); err != nil { + return err + } + + return nil +} + +func (m *PipelineRunTask) validatePipelineRunEnv(formats strfmt.Registry) error { + + if err := validate.Required("pipelineRunEnv", "body", m.PipelineRunEnv); err != nil { + return err + } + + return nil +} + +func (m *PipelineRunTask) validateRealName(formats strfmt.Registry) error { + + if err := validate.Required("realName", "body", m.RealName); err != nil { + return err + } + + return nil +} + +var pipelineRunTaskTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pipelineRunTaskTypeStatusPropEnum = append(pipelineRunTaskTypeStatusPropEnum, v) + } +} + +const ( + + // PipelineRunTaskStatusWaiting captures enum value "Waiting" + PipelineRunTaskStatusWaiting string = "Waiting" + + // PipelineRunTaskStatusRunning captures enum value "Running" + PipelineRunTaskStatusRunning string = "Running" + + // PipelineRunTaskStatusSucceeded captures enum value "Succeeded" + PipelineRunTaskStatusSucceeded string = "Succeeded" + + // PipelineRunTaskStatusFailed captures enum value "Failed" + PipelineRunTaskStatusFailed string = "Failed" +) + +// prop value enum +func (m *PipelineRunTask) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, pipelineRunTaskTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PipelineRunTask) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this pipeline run task based on context it is used +func (m *PipelineRunTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PipelineRunTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PipelineRunTask) UnmarshalBinary(b []byte) error { + var res PipelineRunTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/pipeline_run_task_step.go b/generated-client/models/pipeline_run_task_step.go new file mode 100644 index 0000000..b4020d6 --- /dev/null +++ b/generated-client/models/pipeline_run_task_step.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PipelineRunTaskStep PipelineRunTaskStep holds general information about pipeline run task steps +// +// swagger:model PipelineRunTaskStep +type PipelineRunTaskStep struct { + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // Name of the step + // Example: build + // Required: true + Name *string `json:"name"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the task + // Example: Waiting + // Enum: [Waiting Running Succeeded Failed] + Status string `json:"status,omitempty"` + + // StatusMessage of the task + StatusMessage string `json:"statusMessage,omitempty"` +} + +// Validate validates this pipeline run task step +func (m *PipelineRunTaskStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PipelineRunTaskStep) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +var pipelineRunTaskStepTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pipelineRunTaskStepTypeStatusPropEnum = append(pipelineRunTaskStepTypeStatusPropEnum, v) + } +} + +const ( + + // PipelineRunTaskStepStatusWaiting captures enum value "Waiting" + PipelineRunTaskStepStatusWaiting string = "Waiting" + + // PipelineRunTaskStepStatusRunning captures enum value "Running" + PipelineRunTaskStepStatusRunning string = "Running" + + // PipelineRunTaskStepStatusSucceeded captures enum value "Succeeded" + PipelineRunTaskStepStatusSucceeded string = "Succeeded" + + // PipelineRunTaskStepStatusFailed captures enum value "Failed" + PipelineRunTaskStepStatusFailed string = "Failed" +) + +// prop value enum +func (m *PipelineRunTaskStep) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, pipelineRunTaskStepTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PipelineRunTaskStep) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this pipeline run task step based on context it is used +func (m *PipelineRunTaskStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PipelineRunTaskStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PipelineRunTaskStep) UnmarshalBinary(b []byte) error { + var res PipelineRunTaskStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/pod_state.go b/generated-client/models/pod_state.go new file mode 100644 index 0000000..a884531 --- /dev/null +++ b/generated-client/models/pod_state.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PodState PodState holds information about the state of the first container in a Pod +// +// swagger:model PodState +type PodState struct { + + // Specifies whether the first container has passed its readiness probe. + // Example: false + Ready bool `json:"ready,omitempty"` + + // The number of times the first container has been restarted + // Example: 1 + RestartCount int32 `json:"restartCount,omitempty"` + + // Specifies whether the first container has started. + // Example: true + Started *bool `json:"started,omitempty"` +} + +// Validate validates this pod state +func (m *PodState) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pod state based on context it is used +func (m *PodState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PodState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PodState) UnmarshalBinary(b []byte) error { + var res PodState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/port.go b/generated-client/models/port.go new file mode 100644 index 0000000..7bd1f64 --- /dev/null +++ b/generated-client/models/port.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Port Port describe a port of a component +// +// swagger:model Port +type Port struct { + + // Component port name. From radixconfig.yaml + // Example: http + // Required: true + Name *string `json:"name"` + + // Component port number. From radixconfig.yaml + // Example: 8080 + Port int32 `json:"port,omitempty"` +} + +// Validate validates this port +func (m *Port) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Port) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this port based on context it is used +func (m *Port) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Port) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Port) UnmarshalBinary(b []byte) error { + var res Port + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/promotion_parameters.go b/generated-client/models/promotion_parameters.go new file mode 100644 index 0000000..67d4954 --- /dev/null +++ b/generated-client/models/promotion_parameters.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PromotionParameters PromotionParameters describe environment to promote from and to +// +// swagger:model PromotionParameters +type PromotionParameters struct { + + // FromEnvironment the environment to promote from + // Example: dev + // Required: true + FromEnvironment *string `json:"fromEnvironment"` + + // ToEnvironment the environment to promote to + // Example: prod + // Required: true + ToEnvironment *string `json:"toEnvironment"` +} + +// Validate validates this promotion parameters +func (m *PromotionParameters) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFromEnvironment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateToEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PromotionParameters) validateFromEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("fromEnvironment", "body", m.FromEnvironment); err != nil { + return err + } + + return nil +} + +func (m *PromotionParameters) validateToEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("toEnvironment", "body", m.ToEnvironment); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this promotion parameters based on context it is used +func (m *PromotionParameters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PromotionParameters) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PromotionParameters) UnmarshalBinary(b []byte) error { + var res PromotionParameters + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/receiver_config.go b/generated-client/models/receiver_config.go new file mode 100644 index 0000000..391d942 --- /dev/null +++ b/generated-client/models/receiver_config.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReceiverConfig ReceiverConfig receiver configuration +// +// swagger:model ReceiverConfig +type ReceiverConfig struct { + + // slack config + // Required: true + SlackConfig *SlackConfig `json:"slackConfig"` +} + +// Validate validates this receiver config +func (m *ReceiverConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSlackConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReceiverConfig) validateSlackConfig(formats strfmt.Registry) error { + + if err := validate.Required("slackConfig", "body", m.SlackConfig); err != nil { + return err + } + + if m.SlackConfig != nil { + if err := m.SlackConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slackConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slackConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this receiver config based on the context it is used +func (m *ReceiverConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReceiverConfig) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.SlackConfig != nil { + + if err := m.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slackConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slackConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReceiverConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReceiverConfig) UnmarshalBinary(b []byte) error { + var res ReceiverConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/receiver_config_map.go b/generated-client/models/receiver_config_map.go new file mode 100644 index 0000000..f1ed41d --- /dev/null +++ b/generated-client/models/receiver_config_map.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReceiverConfigMap ReceiverConfigMap defines a map of ReceiverConfig where key is the name of the receiver +// +// swagger:model ReceiverConfigMap +type ReceiverConfigMap map[string]ReceiverConfig + +// Validate validates this receiver config map +func (m ReceiverConfigMap) Validate(formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := validate.Required(k, "body", m[k]); err != nil { + return err + } + if val, ok := m[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this receiver config map based on the context it is used +func (m ReceiverConfigMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if val, ok := m[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/generated-client/models/receiver_config_secret_status.go b/generated-client/models/receiver_config_secret_status.go new file mode 100644 index 0000000..becc662 --- /dev/null +++ b/generated-client/models/receiver_config_secret_status.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ReceiverConfigSecretStatus receiver config secret status +// +// swagger:model ReceiverConfigSecretStatus +type ReceiverConfigSecretStatus struct { + + // slack config + SlackConfig *SlackConfigSecretStatus `json:"slackConfig,omitempty"` +} + +// Validate validates this receiver config secret status +func (m *ReceiverConfigSecretStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSlackConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReceiverConfigSecretStatus) validateSlackConfig(formats strfmt.Registry) error { + if swag.IsZero(m.SlackConfig) { // not required + return nil + } + + if m.SlackConfig != nil { + if err := m.SlackConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slackConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slackConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this receiver config secret status based on the context it is used +func (m *ReceiverConfigSecretStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReceiverConfigSecretStatus) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.SlackConfig != nil { + + if swag.IsZero(m.SlackConfig) { // not required + return nil + } + + if err := m.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slackConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slackConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReceiverConfigSecretStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReceiverConfigSecretStatus) UnmarshalBinary(b []byte) error { + var res ReceiverConfigSecretStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/receiver_config_secret_status_map.go b/generated-client/models/receiver_config_secret_status_map.go new file mode 100644 index 0000000..659f90e --- /dev/null +++ b/generated-client/models/receiver_config_secret_status_map.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReceiverConfigSecretStatusMap ReceiverConfigSecretStatusMap defines a map of ReceiverConfigSecretStatus where key is the name of the receiver +// +// swagger:model ReceiverConfigSecretStatusMap +type ReceiverConfigSecretStatusMap map[string]ReceiverConfigSecretStatus + +// Validate validates this receiver config secret status map +func (m ReceiverConfigSecretStatusMap) Validate(formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := validate.Required(k, "body", m[k]); err != nil { + return err + } + if val, ok := m[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this receiver config secret status map based on the context it is used +func (m ReceiverConfigSecretStatusMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if val, ok := m[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/generated-client/models/regenerate_deploy_key_and_secret_data.go b/generated-client/models/regenerate_deploy_key_and_secret_data.go new file mode 100644 index 0000000..356ab67 --- /dev/null +++ b/generated-client/models/regenerate_deploy_key_and_secret_data.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RegenerateDeployKeyAndSecretData RegenerateDeployKeyAndSecretData Holds regenerated shared secret +// +// swagger:model RegenerateDeployKeyAndSecretData +type RegenerateDeployKeyAndSecretData struct { + + // PrivateKey of the deploy key + PrivateKey string `json:"privateKey,omitempty"` + + // SharedSecret of the shared secret + SharedSecret string `json:"sharedSecret,omitempty"` +} + +// Validate validates this regenerate deploy key and secret data +func (m *RegenerateDeployKeyAndSecretData) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this regenerate deploy key and secret data based on context it is used +func (m *RegenerateDeployKeyAndSecretData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RegenerateDeployKeyAndSecretData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegenerateDeployKeyAndSecretData) UnmarshalBinary(b []byte) error { + var res RegenerateDeployKeyAndSecretData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/replica_status.go b/generated-client/models/replica_status.go new file mode 100644 index 0000000..f241f5f --- /dev/null +++ b/generated-client/models/replica_status.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReplicaStatus ReplicaStatus describes the status of a component container inside a pod +// +// swagger:model ReplicaStatus +type ReplicaStatus struct { + + // Status of the container + // Pending = Container in Waiting state and the reason is ContainerCreating + // Failing = Container in Waiting state and the reason is anything else but ContainerCreating + // Running = Container in Running state + // Terminated = Container in Terminated state + // Example: Running + // Required: true + // Enum: [Pending Failing Running Terminated Starting] + Status *string `json:"status"` +} + +// Validate validates this replica status +func (m *ReplicaStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var replicaStatusTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Pending","Failing","Running","Terminated","Starting"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + replicaStatusTypeStatusPropEnum = append(replicaStatusTypeStatusPropEnum, v) + } +} + +const ( + + // ReplicaStatusStatusPending captures enum value "Pending" + ReplicaStatusStatusPending string = "Pending" + + // ReplicaStatusStatusFailing captures enum value "Failing" + ReplicaStatusStatusFailing string = "Failing" + + // ReplicaStatusStatusRunning captures enum value "Running" + ReplicaStatusStatusRunning string = "Running" + + // ReplicaStatusStatusTerminated captures enum value "Terminated" + ReplicaStatusStatusTerminated string = "Terminated" + + // ReplicaStatusStatusStarting captures enum value "Starting" + ReplicaStatusStatusStarting string = "Starting" +) + +// prop value enum +func (m *ReplicaStatus) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, replicaStatusTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ReplicaStatus) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + // value enum + if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this replica status based on context it is used +func (m *ReplicaStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ReplicaStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReplicaStatus) UnmarshalBinary(b []byte) error { + var res ReplicaStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/replica_summary.go b/generated-client/models/replica_summary.go new file mode 100644 index 0000000..50a1bc5 --- /dev/null +++ b/generated-client/models/replica_summary.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReplicaSummary ReplicaSummary describes condition of a pod +// +// swagger:model ReplicaSummary +type ReplicaSummary struct { + + // Created timestamp + // Example: 2006-01-02T15:04:05Z + Created string `json:"created,omitempty"` + + // The image the container is running. + // Example: radixdev.azurecr.io/app-server:cdgkg + Image string `json:"image,omitempty"` + + // ImageID of the container's image. + // Example: radixdev.azurecr.io/app-server@sha256:d40cda01916ef63da3607c03785efabc56eb2fc2e0dab0726b1a843e9ded093f + ImageID string `json:"imageId,omitempty"` + + // Pod name + // Example: server-78fc8857c4-hm76l + // Required: true + Name *string `json:"name"` + + // RestartCount count of restarts of a component container inside a pod + RestartCount int32 `json:"restartCount,omitempty"` + + // StatusMessage provides message describing the status of a component container inside a pod + StatusMessage string `json:"statusMessage,omitempty"` + + // replica status + ReplicaStatus *ReplicaStatus `json:"replicaStatus,omitempty"` + + // resources + Resources *ResourceRequirements `json:"resources,omitempty"` +} + +// Validate validates this replica summary +func (m *ReplicaSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicaStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReplicaSummary) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ReplicaSummary) validateReplicaStatus(formats strfmt.Registry) error { + if swag.IsZero(m.ReplicaStatus) { // not required + return nil + } + + if m.ReplicaStatus != nil { + if err := m.ReplicaStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaStatus") + } + return err + } + } + + return nil +} + +func (m *ReplicaSummary) validateResources(formats strfmt.Registry) error { + if swag.IsZero(m.Resources) { // not required + return nil + } + + if m.Resources != nil { + if err := m.Resources.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this replica summary based on the context it is used +func (m *ReplicaSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateReplicaStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReplicaSummary) contextValidateReplicaStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.ReplicaStatus != nil { + + if swag.IsZero(m.ReplicaStatus) { // not required + return nil + } + + if err := m.ReplicaStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaStatus") + } + return err + } + } + + return nil +} + +func (m *ReplicaSummary) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + if m.Resources != nil { + + if swag.IsZero(m.Resources) { // not required + return nil + } + + if err := m.Resources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReplicaSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReplicaSummary) UnmarshalBinary(b []byte) error { + var res ReplicaSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/resource_requirements.go b/generated-client/models/resource_requirements.go new file mode 100644 index 0000000..7c1289e --- /dev/null +++ b/generated-client/models/resource_requirements.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResourceRequirements ResourceRequirements Requirements of resources for pods +// +// swagger:model ResourceRequirements +type ResourceRequirements struct { + + // limits + Limits *Resources `json:"limits,omitempty"` + + // requests + Requests *Resources `json:"requests,omitempty"` +} + +// Validate validates this resource requirements +func (m *ResourceRequirements) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLimits(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequests(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResourceRequirements) validateLimits(formats strfmt.Registry) error { + if swag.IsZero(m.Limits) { // not required + return nil + } + + if m.Limits != nil { + if err := m.Limits.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("limits") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limits") + } + return err + } + } + + return nil +} + +func (m *ResourceRequirements) validateRequests(formats strfmt.Registry) error { + if swag.IsZero(m.Requests) { // not required + return nil + } + + if m.Requests != nil { + if err := m.Requests.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requests") + } + return err + } + } + + return nil +} + +// ContextValidate validate this resource requirements based on the context it is used +func (m *ResourceRequirements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLimits(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequests(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResourceRequirements) contextValidateLimits(ctx context.Context, formats strfmt.Registry) error { + + if m.Limits != nil { + + if swag.IsZero(m.Limits) { // not required + return nil + } + + if err := m.Limits.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("limits") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limits") + } + return err + } + } + + return nil +} + +func (m *ResourceRequirements) contextValidateRequests(ctx context.Context, formats strfmt.Registry) error { + + if m.Requests != nil { + + if swag.IsZero(m.Requests) { // not required + return nil + } + + if err := m.Requests.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requests") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ResourceRequirements) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResourceRequirements) UnmarshalBinary(b []byte) error { + var res ResourceRequirements + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/resources.go b/generated-client/models/resources.go new file mode 100644 index 0000000..cdce97c --- /dev/null +++ b/generated-client/models/resources.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Resources Resources Required for pods +// +// swagger:model Resources +type Resources struct { + + // CPU + CPU string `json:"cpu,omitempty"` + + // memory + Memory string `json:"memory,omitempty"` +} + +// Validate validates this resources +func (m *Resources) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this resources based on context it is used +func (m *Resources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Resources) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Resources) UnmarshalBinary(b []byte) error { + var res Resources + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/scheduled_batch_request.go b/generated-client/models/scheduled_batch_request.go new file mode 100644 index 0000000..fd93ae1 --- /dev/null +++ b/generated-client/models/scheduled_batch_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ScheduledBatchRequest ScheduledBatchRequest holds information about a creating scheduled batch request +// +// swagger:model ScheduledBatchRequest +type ScheduledBatchRequest struct { + + // Name of the Radix deployment for a batch + DeploymentName string `json:"deploymentName,omitempty"` +} + +// Validate validates this scheduled batch request +func (m *ScheduledBatchRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this scheduled batch request based on context it is used +func (m *ScheduledBatchRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ScheduledBatchRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ScheduledBatchRequest) UnmarshalBinary(b []byte) error { + var res ScheduledBatchRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/scheduled_batch_summary.go b/generated-client/models/scheduled_batch_summary.go new file mode 100644 index 0000000..65df050 --- /dev/null +++ b/generated-client/models/scheduled_batch_summary.go @@ -0,0 +1,302 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ScheduledBatchSummary ScheduledBatchSummary holds information about scheduled batch +// +// swagger:model ScheduledBatchSummary +type ScheduledBatchSummary struct { + + // Created timestamp + // Example: 2006-01-02T15:04:05Z + Created string `json:"created,omitempty"` + + // DeploymentName name of RadixDeployment for the batch + // Required: true + DeploymentName *string `json:"deploymentName"` + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // Jobs within the batch of ScheduledJobSummary + JobList []*ScheduledJobSummary `json:"jobList"` + + // Deprecated: Message of a status, if any, of the job + // Example: \"Error occurred\ + Message string `json:"message,omitempty"` + + // Name of the scheduled batch + // Example: batch-20181029135644-algpv-6hznh + // Required: true + Name *string `json:"name"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the job + // Example: Waiting + // Required: true + // Enum: [Waiting Running Succeeded Failed] + Status *string `json:"status"` + + // TotalJobCount count of jobs, requested to be scheduled by a batch + // Example: 5 + // Required: true + TotalJobCount *int64 `json:"totalJobCount"` + + // replica + Replica *ReplicaSummary `json:"replica,omitempty"` +} + +// Validate validates this scheduled batch summary +func (m *ScheduledBatchSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeploymentName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJobList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalJobCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplica(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScheduledBatchSummary) validateDeploymentName(formats strfmt.Registry) error { + + if err := validate.Required("deploymentName", "body", m.DeploymentName); err != nil { + return err + } + + return nil +} + +func (m *ScheduledBatchSummary) validateJobList(formats strfmt.Registry) error { + if swag.IsZero(m.JobList) { // not required + return nil + } + + for i := 0; i < len(m.JobList); i++ { + if swag.IsZero(m.JobList[i]) { // not required + continue + } + + if m.JobList[i] != nil { + if err := m.JobList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jobList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ScheduledBatchSummary) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +var scheduledBatchSummaryTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + scheduledBatchSummaryTypeStatusPropEnum = append(scheduledBatchSummaryTypeStatusPropEnum, v) + } +} + +const ( + + // ScheduledBatchSummaryStatusWaiting captures enum value "Waiting" + ScheduledBatchSummaryStatusWaiting string = "Waiting" + + // ScheduledBatchSummaryStatusRunning captures enum value "Running" + ScheduledBatchSummaryStatusRunning string = "Running" + + // ScheduledBatchSummaryStatusSucceeded captures enum value "Succeeded" + ScheduledBatchSummaryStatusSucceeded string = "Succeeded" + + // ScheduledBatchSummaryStatusFailed captures enum value "Failed" + ScheduledBatchSummaryStatusFailed string = "Failed" +) + +// prop value enum +func (m *ScheduledBatchSummary) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, scheduledBatchSummaryTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ScheduledBatchSummary) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + // value enum + if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { + return err + } + + return nil +} + +func (m *ScheduledBatchSummary) validateTotalJobCount(formats strfmt.Registry) error { + + if err := validate.Required("totalJobCount", "body", m.TotalJobCount); err != nil { + return err + } + + return nil +} + +func (m *ScheduledBatchSummary) validateReplica(formats strfmt.Registry) error { + if swag.IsZero(m.Replica) { // not required + return nil + } + + if m.Replica != nil { + if err := m.Replica.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replica") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replica") + } + return err + } + } + + return nil +} + +// ContextValidate validate this scheduled batch summary based on the context it is used +func (m *ScheduledBatchSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateJobList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReplica(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScheduledBatchSummary) contextValidateJobList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.JobList); i++ { + + if m.JobList[i] != nil { + + if swag.IsZero(m.JobList[i]) { // not required + return nil + } + + if err := m.JobList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jobList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ScheduledBatchSummary) contextValidateReplica(ctx context.Context, formats strfmt.Registry) error { + + if m.Replica != nil { + + if swag.IsZero(m.Replica) { // not required + return nil + } + + if err := m.Replica.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replica") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replica") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ScheduledBatchSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ScheduledBatchSummary) UnmarshalBinary(b []byte) error { + var res ScheduledBatchSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/scheduled_job_request.go b/generated-client/models/scheduled_job_request.go new file mode 100644 index 0000000..6b2a7c5 --- /dev/null +++ b/generated-client/models/scheduled_job_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ScheduledJobRequest ScheduledJobRequest holds information about a creating scheduled job request +// +// swagger:model ScheduledJobRequest +type ScheduledJobRequest struct { + + // Name of the Radix deployment for a job + DeploymentName string `json:"deploymentName,omitempty"` +} + +// Validate validates this scheduled job request +func (m *ScheduledJobRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this scheduled job request based on context it is used +func (m *ScheduledJobRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ScheduledJobRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ScheduledJobRequest) UnmarshalBinary(b []byte) error { + var res ScheduledJobRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/scheduled_job_summary.go b/generated-client/models/scheduled_job_summary.go new file mode 100644 index 0000000..7935adc --- /dev/null +++ b/generated-client/models/scheduled_job_summary.go @@ -0,0 +1,365 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ScheduledJobSummary ScheduledJobSummary holds general information about scheduled job +// +// swagger:model ScheduledJobSummary +type ScheduledJobSummary struct { + + // BackoffLimit Amount of retries due to a logical error in configuration etc. + // Example: 1 + // Required: true + BackoffLimit *int32 `json:"backoffLimit"` + + // BatchName Batch name, if any + // Example: \"batch-abc\ + BatchName string `json:"batchName,omitempty"` + + // Created timestamp + // Example: 2006-01-02T15:04:05Z + Created string `json:"created,omitempty"` + + // DeploymentName name of RadixDeployment for the job + DeploymentName string `json:"deploymentName,omitempty"` + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // FailedCount is the number of times the job has failed + // Example: 1 + // Required: true + FailedCount *int32 `json:"failedCount"` + + // JobId JobId, if any + // Example: \"job1\ + JobID string `json:"jobId,omitempty"` + + // Message of a status, if any, of the job + // Example: \"Error occurred\ + Message string `json:"message,omitempty"` + + // Name of the scheduled job + // Example: job-component-20181029135644-algpv-6hznh + Name string `json:"name,omitempty"` + + // Array of ReplicaSummary + ReplicaList []*ReplicaSummary `json:"replicaList"` + + // Timestamp of the job restart, if applied. + // +optional + Restart string `json:"Restart,omitempty"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the job + // Example: Waiting + // Required: true + // Enum: [Waiting Running Succeeded Stopping Stopped Failed] + Status *string `json:"status"` + + // TimeLimitSeconds How long the job supposed to run at maximum + // Example: 3600 + TimeLimitSeconds int64 `json:"timeLimitSeconds,omitempty"` + + // node + Node *Node `json:"node,omitempty"` + + // resources + Resources *ResourceRequirements `json:"resources,omitempty"` +} + +// Validate validates this scheduled job summary +func (m *ScheduledJobSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBackoffLimit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFailedCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicaList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScheduledJobSummary) validateBackoffLimit(formats strfmt.Registry) error { + + if err := validate.Required("backoffLimit", "body", m.BackoffLimit); err != nil { + return err + } + + return nil +} + +func (m *ScheduledJobSummary) validateFailedCount(formats strfmt.Registry) error { + + if err := validate.Required("failedCount", "body", m.FailedCount); err != nil { + return err + } + + return nil +} + +func (m *ScheduledJobSummary) validateReplicaList(formats strfmt.Registry) error { + if swag.IsZero(m.ReplicaList) { // not required + return nil + } + + for i := 0; i < len(m.ReplicaList); i++ { + if swag.IsZero(m.ReplicaList[i]) { // not required + continue + } + + if m.ReplicaList[i] != nil { + if err := m.ReplicaList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var scheduledJobSummaryTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Stopping","Stopped","Failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + scheduledJobSummaryTypeStatusPropEnum = append(scheduledJobSummaryTypeStatusPropEnum, v) + } +} + +const ( + + // ScheduledJobSummaryStatusWaiting captures enum value "Waiting" + ScheduledJobSummaryStatusWaiting string = "Waiting" + + // ScheduledJobSummaryStatusRunning captures enum value "Running" + ScheduledJobSummaryStatusRunning string = "Running" + + // ScheduledJobSummaryStatusSucceeded captures enum value "Succeeded" + ScheduledJobSummaryStatusSucceeded string = "Succeeded" + + // ScheduledJobSummaryStatusStopping captures enum value "Stopping" + ScheduledJobSummaryStatusStopping string = "Stopping" + + // ScheduledJobSummaryStatusStopped captures enum value "Stopped" + ScheduledJobSummaryStatusStopped string = "Stopped" + + // ScheduledJobSummaryStatusFailed captures enum value "Failed" + ScheduledJobSummaryStatusFailed string = "Failed" +) + +// prop value enum +func (m *ScheduledJobSummary) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, scheduledJobSummaryTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ScheduledJobSummary) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + // value enum + if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { + return err + } + + return nil +} + +func (m *ScheduledJobSummary) validateNode(formats strfmt.Registry) error { + if swag.IsZero(m.Node) { // not required + return nil + } + + if m.Node != nil { + if err := m.Node.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("node") + } + return err + } + } + + return nil +} + +func (m *ScheduledJobSummary) validateResources(formats strfmt.Registry) error { + if swag.IsZero(m.Resources) { // not required + return nil + } + + if m.Resources != nil { + if err := m.Resources.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this scheduled job summary based on the context it is used +func (m *ScheduledJobSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateReplicaList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScheduledJobSummary) contextValidateReplicaList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ReplicaList); i++ { + + if m.ReplicaList[i] != nil { + + if swag.IsZero(m.ReplicaList[i]) { // not required + return nil + } + + if err := m.ReplicaList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ScheduledJobSummary) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { + + if m.Node != nil { + + if swag.IsZero(m.Node) { // not required + return nil + } + + if err := m.Node.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("node") + } + return err + } + } + + return nil +} + +func (m *ScheduledJobSummary) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + if m.Resources != nil { + + if swag.IsZero(m.Resources) { // not required + return nil + } + + if err := m.Resources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ScheduledJobSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ScheduledJobSummary) UnmarshalBinary(b []byte) error { + var res ScheduledJobSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/secret.go b/generated-client/models/secret.go new file mode 100644 index 0000000..3c8ea3e --- /dev/null +++ b/generated-client/models/secret.go @@ -0,0 +1,213 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Secret Secret holds general information about secret +// +// swagger:model Secret +type Secret struct { + + // Component name of the component having the secret + // Example: api + Component string `json:"component,omitempty"` + + // DisplayName of the secret + // Example: Database password + DisplayName string `json:"displayName,omitempty"` + + // ID of the secret within the Resource + // Example: clientId + ID string `json:"id,omitempty"` + + // Name of the secret or its property, related to type and resource) + // Example: db_password + // Required: true + Name *string `json:"name"` + + // Resource of the secrets + // Example: volumeAbc + Resource string `json:"resource,omitempty"` + + // Status of the secret + // Pending = Secret exists in Radix config, but not in cluster + // Consistent = Secret exists in Radix config and in cluster + // NotAvailable = Secret is available in external secret configuration but not in cluster + // Example: Consistent + Status string `json:"status,omitempty"` + + // StatusMessages contains a list of messages related to the Status + StatusMessages []string `json:"statusMessages"` + + // TLSCertificates holds the TLS certificate and certificate authorities (CA) + // The first certificate in the list should be the TLS certificate and the rest should be CA certificates + TLSCertificates []*TLSCertificate `json:"tlsCertificates"` + + // type + Type SecretType `json:"type,omitempty"` +} + +// Validate validates this secret +func (m *Secret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTLSCertificates(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Secret) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *Secret) validateTLSCertificates(formats strfmt.Registry) error { + if swag.IsZero(m.TLSCertificates) { // not required + return nil + } + + for i := 0; i < len(m.TLSCertificates); i++ { + if swag.IsZero(m.TLSCertificates[i]) { // not required + continue + } + + if m.TLSCertificates[i] != nil { + if err := m.TLSCertificates[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tlsCertificates" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tlsCertificates" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Secret) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this secret based on the context it is used +func (m *Secret) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTLSCertificates(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Secret) contextValidateTLSCertificates(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TLSCertificates); i++ { + + if m.TLSCertificates[i] != nil { + + if swag.IsZero(m.TLSCertificates[i]) { // not required + return nil + } + + if err := m.TLSCertificates[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tlsCertificates" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tlsCertificates" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Secret) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Secret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Secret) UnmarshalBinary(b []byte) error { + var res Secret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/secret_parameters.go b/generated-client/models/secret_parameters.go new file mode 100644 index 0000000..5d4439d --- /dev/null +++ b/generated-client/models/secret_parameters.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SecretParameters SecretParameters describes a component secret +// +// swagger:model SecretParameters +type SecretParameters struct { + + // Name the unique name of the Radix application deployment + // Example: p4$sW0rDz + // Required: true + SecretValue *string `json:"secretValue"` + + // type + Type SecretType `json:"type,omitempty"` +} + +// Validate validates this secret parameters +func (m *SecretParameters) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSecretValue(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretParameters) validateSecretValue(formats strfmt.Registry) error { + + if err := validate.Required("secretValue", "body", m.SecretValue); err != nil { + return err + } + + return nil +} + +func (m *SecretParameters) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this secret parameters based on the context it is used +func (m *SecretParameters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretParameters) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SecretParameters) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecretParameters) UnmarshalBinary(b []byte) error { + var res SecretParameters + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/secret_type.go b/generated-client/models/secret_type.go new file mode 100644 index 0000000..6f994e6 --- /dev/null +++ b/generated-client/models/secret_type.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// SecretType secret type +// +// swagger:model SecretType +type SecretType string + +// Validate validates this secret type +func (m SecretType) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this secret type based on context it is used +func (m SecretType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/generated-client/models/slack_config.go b/generated-client/models/slack_config.go new file mode 100644 index 0000000..ee18051 --- /dev/null +++ b/generated-client/models/slack_config.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SlackConfig SlackConfig configuration options for Slack +// +// swagger:model SlackConfig +type SlackConfig struct { + + // Enabled flag indicates if alert notifications should be sent to Slack + // Required: true + Enabled *bool `json:"enabled"` +} + +// Validate validates this slack config +func (m *SlackConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnabled(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SlackConfig) validateEnabled(formats strfmt.Registry) error { + + if err := validate.Required("enabled", "body", m.Enabled); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this slack config based on context it is used +func (m *SlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SlackConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SlackConfig) UnmarshalBinary(b []byte) error { + var res SlackConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/slack_config_secret_status.go b/generated-client/models/slack_config_secret_status.go new file mode 100644 index 0000000..4bbcfad --- /dev/null +++ b/generated-client/models/slack_config_secret_status.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SlackConfigSecretStatus SlackConfigSecretStatus +// +// swagger:model SlackConfigSecretStatus +type SlackConfigSecretStatus struct { + + // WebhookURLConfigured flag indicates if a Slack webhook URL is set + WebhookURLConfigured bool `json:"webhookUrlConfigured,omitempty"` +} + +// Validate validates this slack config secret status +func (m *SlackConfigSecretStatus) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this slack config secret status based on context it is used +func (m *SlackConfigSecretStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SlackConfigSecretStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SlackConfigSecretStatus) UnmarshalBinary(b []byte) error { + var res SlackConfigSecretStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/step.go b/generated-client/models/step.go new file mode 100644 index 0000000..c1b2254 --- /dev/null +++ b/generated-client/models/step.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Step Step holds general information about job step +// +// swagger:model Step +type Step struct { + + // Components associated components + Components []string `json:"components"` + + // Ended timestamp + // Example: 2006-01-02T15:04:05Z + Ended string `json:"ended,omitempty"` + + // Name of the step + // Example: build + Name string `json:"name,omitempty"` + + // Started timestamp + // Example: 2006-01-02T15:04:05Z + Started string `json:"started,omitempty"` + + // Status of the step + // Example: Waiting + // Enum: [Waiting Running Succeeded Failed] + Status string `json:"status,omitempty"` +} + +// Validate validates this step +func (m *Step) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var stepTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Waiting","Running","Succeeded","Failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + stepTypeStatusPropEnum = append(stepTypeStatusPropEnum, v) + } +} + +const ( + + // StepStatusWaiting captures enum value "Waiting" + StepStatusWaiting string = "Waiting" + + // StepStatusRunning captures enum value "Running" + StepStatusRunning string = "Running" + + // StepStatusSucceeded captures enum value "Succeeded" + StepStatusSucceeded string = "Succeeded" + + // StepStatusFailed captures enum value "Failed" + StepStatusFailed string = "Failed" +) + +// prop value enum +func (m *Step) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, stepTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Step) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this step based on context it is used +func (m *Step) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Step) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Step) UnmarshalBinary(b []byte) error { + var res Step + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/tls_certificate.go b/generated-client/models/tls_certificate.go new file mode 100644 index 0000000..0bf2590 --- /dev/null +++ b/generated-client/models/tls_certificate.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TLSCertificate TLSCertificate holds information about a TLS certificate +// +// swagger:model TLSCertificate +type TLSCertificate struct { + + // DNSNames defines list of Subject Alternate Names in the certificate + DNSNames []string `json:"dnsNames"` + + // Issuer contains the distinguished name for the certificate's issuer + // Example: CN=DigiCert TLS RSA SHA256 2020 CA1,O=DigiCert Inc,C=US + // Required: true + Issuer *string `json:"issuer"` + + // NotAfter defines the uppdater date/time validity boundary + // Example: 2023-08-25T23:59:59Z + // Required: true + NotAfter interface{} `json:"notAfter"` + + // NotBefore defines the lower date/time validity boundary + // Example: 2022-08-09T00:00:00Z + // Required: true + NotBefore interface{} `json:"notBefore"` + + // Subject contains the distinguished name for the certificate + // Example: CN=mysite.example.com,O=MyOrg,L=MyLocation,C=NO + // Required: true + Subject *string `json:"subject"` +} + +// Validate validates this TLS certificate +func (m *TLSCertificate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIssuer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotAfter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotBefore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubject(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TLSCertificate) validateIssuer(formats strfmt.Registry) error { + + if err := validate.Required("issuer", "body", m.Issuer); err != nil { + return err + } + + return nil +} + +func (m *TLSCertificate) validateNotAfter(formats strfmt.Registry) error { + + if m.NotAfter == nil { + return errors.Required("notAfter", "body", nil) + } + + return nil +} + +func (m *TLSCertificate) validateNotBefore(formats strfmt.Registry) error { + + if m.NotBefore == nil { + return errors.Required("notBefore", "body", nil) + } + + return nil +} + +func (m *TLSCertificate) validateSubject(formats strfmt.Registry) error { + + if err := validate.Required("subject", "body", m.Subject); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this TLS certificate based on context it is used +func (m *TLSCertificate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TLSCertificate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TLSCertificate) UnmarshalBinary(b []byte) error { + var res TLSCertificate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/update_alerting_config.go b/generated-client/models/update_alerting_config.go new file mode 100644 index 0000000..65a8d80 --- /dev/null +++ b/generated-client/models/update_alerting_config.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAlertingConfig UpdateAlertingConfig contains fields for updating alert settings +// +// swagger:model UpdateAlertingConfig +type UpdateAlertingConfig struct { + + // alerts + // Required: true + Alerts AlertConfigList `json:"alerts"` + + // receiver secrets + // Required: true + ReceiverSecrets UpdateReceiverConfigSecretsMap `json:"receiverSecrets"` + + // receivers + // Required: true + Receivers ReceiverConfigMap `json:"receivers"` +} + +// Validate validates this update alerting config +func (m *UpdateAlertingConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAlerts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceiverSecrets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceivers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAlertingConfig) validateAlerts(formats strfmt.Registry) error { + + if err := validate.Required("alerts", "body", m.Alerts); err != nil { + return err + } + + if err := m.Alerts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("alerts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alerts") + } + return err + } + + return nil +} + +func (m *UpdateAlertingConfig) validateReceiverSecrets(formats strfmt.Registry) error { + + if err := validate.Required("receiverSecrets", "body", m.ReceiverSecrets); err != nil { + return err + } + + if m.ReceiverSecrets != nil { + if err := m.ReceiverSecrets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receiverSecrets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receiverSecrets") + } + return err + } + } + + return nil +} + +func (m *UpdateAlertingConfig) validateReceivers(formats strfmt.Registry) error { + + if err := validate.Required("receivers", "body", m.Receivers); err != nil { + return err + } + + if m.Receivers != nil { + if err := m.Receivers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receivers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receivers") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update alerting config based on the context it is used +func (m *UpdateAlertingConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAlerts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReceiverSecrets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReceivers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAlertingConfig) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Alerts.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("alerts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alerts") + } + return err + } + + return nil +} + +func (m *UpdateAlertingConfig) contextValidateReceiverSecrets(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ReceiverSecrets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receiverSecrets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receiverSecrets") + } + return err + } + + return nil +} + +func (m *UpdateAlertingConfig) contextValidateReceivers(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Receivers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receivers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receivers") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAlertingConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAlertingConfig) UnmarshalBinary(b []byte) error { + var res UpdateAlertingConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/update_receiver_config_secrets.go b/generated-client/models/update_receiver_config_secrets.go new file mode 100644 index 0000000..dbbf555 --- /dev/null +++ b/generated-client/models/update_receiver_config_secrets.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateReceiverConfigSecrets UpdateReceiverConfigSecrets defines secrets to be updated +// +// swagger:model UpdateReceiverConfigSecrets +type UpdateReceiverConfigSecrets struct { + + // slack config + SlackConfig *UpdateSlackConfigSecrets `json:"slackConfig,omitempty"` +} + +// Validate validates this update receiver config secrets +func (m *UpdateReceiverConfigSecrets) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSlackConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateReceiverConfigSecrets) validateSlackConfig(formats strfmt.Registry) error { + if swag.IsZero(m.SlackConfig) { // not required + return nil + } + + if m.SlackConfig != nil { + if err := m.SlackConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slackConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slackConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update receiver config secrets based on the context it is used +func (m *UpdateReceiverConfigSecrets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateReceiverConfigSecrets) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.SlackConfig != nil { + + if swag.IsZero(m.SlackConfig) { // not required + return nil + } + + if err := m.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slackConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slackConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateReceiverConfigSecrets) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateReceiverConfigSecrets) UnmarshalBinary(b []byte) error { + var res UpdateReceiverConfigSecrets + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/generated-client/models/update_receiver_config_secrets_map.go b/generated-client/models/update_receiver_config_secrets_map.go new file mode 100644 index 0000000..59212a1 --- /dev/null +++ b/generated-client/models/update_receiver_config_secrets_map.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UpdateReceiverConfigSecretsMap UpdateReceiverConfigSecretsMap defines a map of UpdateReceiverConfigSecrets where key is the name of the receiver +// +// swagger:model UpdateReceiverConfigSecretsMap +type UpdateReceiverConfigSecretsMap map[string]UpdateReceiverConfigSecrets + +// Validate validates this update receiver config secrets map +func (m UpdateReceiverConfigSecretsMap) Validate(formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := validate.Required(k, "body", m[k]); err != nil { + return err + } + if val, ok := m[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this update receiver config secrets map based on the context it is used +func (m UpdateReceiverConfigSecretsMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if val, ok := m[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/generated-client/models/update_slack_config_secrets.go b/generated-client/models/update_slack_config_secrets.go new file mode 100644 index 0000000..0537163 --- /dev/null +++ b/generated-client/models/update_slack_config_secrets.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateSlackConfigSecrets UpdateSlackConfig defines secrets to be updated for Slack +// +// swagger:model UpdateSlackConfigSecrets +type UpdateSlackConfigSecrets struct { + + // WebhookURL the Slack webhook URL where alerts are sent + // Secret key for webhook URL is updated if a non-nil value is present, and deleted if omitted or set to null + // + // required: + WebhookURL *string `json:"webhookUrl,omitempty"` +} + +// Validate validates this update slack config secrets +func (m *UpdateSlackConfigSecrets) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update slack config secrets based on context it is used +func (m *UpdateSlackConfigSecrets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSlackConfigSecrets) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSlackConfigSecrets) UnmarshalBinary(b []byte) error { + var res UpdateSlackConfigSecrets + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}