diff --git a/.changelog/198.txt b/.changelog/198.txt new file mode 100644 index 00000000..457fb776 --- /dev/null +++ b/.changelog/198.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +waypoint: Require no-code module ID for creating templates and add-on defintiions. +``` diff --git a/go.mod b/go.mod index d595ddd9..f12ce988 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/hcl/v2 v2.23.0 - github.com/hashicorp/hcp-sdk-go v0.123.0 + github.com/hashicorp/hcp-sdk-go v0.125.0 github.com/lithammer/dedent v1.1.0 github.com/manifoldco/promptui v0.9.0 github.com/mitchellh/cli v1.1.5 diff --git a/go.sum b/go.sum index 23ff85a6..163fe032 100644 --- a/go.sum +++ b/go.sum @@ -96,8 +96,8 @@ github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKe github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos= github.com/hashicorp/hcl/v2 v2.23.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= -github.com/hashicorp/hcp-sdk-go v0.123.0 h1:kUf/kSCVkQ4XXyny8GUyUWjvIIIanGRRkhRmgj2lC+4= -github.com/hashicorp/hcp-sdk-go v0.123.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= +github.com/hashicorp/hcp-sdk-go v0.125.0 h1:pak7lGeNmoQTR5Dkx+CxYF6xLjn1UJ4XPg43ldyle+Y= +github.com/hashicorp/hcp-sdk-go v0.125.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= diff --git a/internal/commands/waypoint/add-ons/definitions/add_on_definition.go b/internal/commands/waypoint/add-ons/definitions/add_on_definition.go index bbfb4c74..4ce6f298 100644 --- a/internal/commands/waypoint/add-ons/definitions/add_on_definition.go +++ b/internal/commands/waypoint/add-ons/definitions/add_on_definition.go @@ -23,6 +23,7 @@ type AddOnDefinitionOpts struct { TerraformCloudProjectID string TerraformExecutionMode string TerraformAgentPoolID string + TerraformNoCodeModuleID string VariableOptionsFile string diff --git a/internal/commands/waypoint/add-ons/definitions/create.go b/internal/commands/waypoint/add-ons/definitions/create.go index c93fe2c4..ecebca99 100644 --- a/internal/commands/waypoint/add-ons/definitions/create.go +++ b/internal/commands/waypoint/add-ons/definitions/create.go @@ -33,6 +33,7 @@ $ hcp waypoint add-ons definitions create -n=my-add-on-definition \ -d="My Add-on Definition description." \ --readme-markdown-template-file="README.tpl" \ --tfc-no-code-module-source="app.terraform.io/hashicorp/dir/template" \ + --tf-no-code-module-id="nocode-123456" \ --tfc-project-name="my-tfc-project" \ --tfc-project-id="prj-123456" \ -l=label1 \ @@ -135,6 +136,15 @@ $ hcp waypoint add-ons definitions create -n=my-add-on-definition \ "when the execution mode is set to 'agent'.", Value: flagvalue.Simple("", &opts.TerraformAgentPoolID), }, + { + Name: "tf-no-code-module-id", + DisplayValue: "TF_NO_CODE_MODULE_ID", + Description: "The ID of the Terraform no-code module to use for " + + "running Terraform operations. This is in the format " + + "of 'nocode-'.", + Value: flagvalue.Simple("", &opts.TerraformNoCodeModuleID), + Required: true, + }, }, }, } @@ -174,17 +184,20 @@ func addOnDefinitionCreate(opts *AddOnDefinitionOpts) error { &waypoint_service.WaypointServiceCreateAddOnDefinitionParams{ NamespaceID: ns.ID, Body: &models.HashicorpCloudWaypointWaypointServiceCreateAddOnDefinitionBody{ - Name: opts.Name, - Summary: opts.Summary, - Description: opts.Description, - ReadmeMarkdownTemplate: readmeTpl, - Labels: opts.Labels, - TerraformCloudWorkspaceDetails: &models.HashicorpCloudWaypointTerraformCloudWorkspaceDetails{ - Name: opts.TerraformCloudProjectName, - ProjectID: opts.TerraformCloudProjectID, + AddOnDefinition: &models.HashicorpCloudWaypointAddOnDefinition{ + Name: opts.Name, + Summary: opts.Summary, + Description: opts.Description, + ReadmeMarkdownTemplate: readmeTpl, + Labels: opts.Labels, + TerraformCloudWorkspaceDetails: &models.HashicorpCloudWaypointTerraformCloudWorkspaceDetails{ + Name: opts.TerraformCloudProjectName, + ProjectID: opts.TerraformCloudProjectID, + }, + ModuleSource: opts.TerraformNoCodeModuleSource, + VariableOptions: variables, + ModuleID: opts.TerraformNoCodeModuleID, }, - ModuleSource: opts.TerraformNoCodeModuleSource, - VariableOptions: variables, }, Context: opts.Ctx, }, nil) diff --git a/internal/commands/waypoint/add-ons/definitions/create_test.go b/internal/commands/waypoint/add-ons/definitions/create_test.go index 29e34fb4..26eb62b9 100644 --- a/internal/commands/waypoint/add-ons/definitions/create_test.go +++ b/internal/commands/waypoint/add-ons/definitions/create_test.go @@ -56,6 +56,7 @@ func TestCmdAddOnDefinitionCreate(t *testing.T) { "--tf-execution-mode", "agent", "--tf-agent-pool-id", "pool-abc123", "--variable-options-file", "vars.hcl", + "--tf-no-code-module-id", "nocode-abc123", }, Expect: &AddOnDefinitionOpts{ Name: "cli-test", @@ -69,6 +70,7 @@ func TestCmdAddOnDefinitionCreate(t *testing.T) { TerraformExecutionMode: "agent", TerraformAgentPoolID: "pool-abc123", VariableOptionsFile: "vars.hcl", + TerraformNoCodeModuleID: "nocode-abc123", }, }, } diff --git a/internal/commands/waypoint/add-ons/definitions/read.go b/internal/commands/waypoint/add-ons/definitions/read.go index e8548cf8..94ea455f 100644 --- a/internal/commands/waypoint/add-ons/definitions/read.go +++ b/internal/commands/waypoint/add-ons/definitions/read.go @@ -100,6 +100,7 @@ func addOnDefinitionRead(opts *AddOnDefinitionOpts) error { format.NewField("Execution Mode", "{{ .TfExecutionMode }}"), format.NewField("Agent Pool ID", "{{ .TfAgentPoolID }}"), format.NewField("Variable Options", optionNamesStr), + format.NewField("Terraform No-code Module ID", "{{ .ModuleID }}"), } return opts.Output.Display(format.NewDisplayer(addOnDef, format.Pretty, fields)) diff --git a/internal/commands/waypoint/add-ons/definitions/update.go b/internal/commands/waypoint/add-ons/definitions/update.go index 10c6ca9d..19143630 100644 --- a/internal/commands/waypoint/add-ons/definitions/update.go +++ b/internal/commands/waypoint/add-ons/definitions/update.go @@ -162,17 +162,19 @@ func addOnDefinitionUpdate(opts *AddOnDefinitionOpts) error { Context: opts.Ctx, ExistingAddOnDefinitionName: opts.Name, Body: &models.HashicorpCloudWaypointWaypointServiceUpdateAddOnDefinitionBody{ - Summary: opts.Summary, - Description: opts.Description, - ReadmeMarkdownTemplate: readmeTpl, - Labels: opts.Labels, - TerraformCloudWorkspaceDetails: &models.HashicorpCloudWaypointTerraformCloudWorkspaceDetails{ - ProjectID: opts.TerraformCloudProjectID, - Name: opts.TerraformCloudProjectName, + AddOnDefinition: &models.HashicorpCloudWaypointAddOnDefinition{ + Summary: opts.Summary, + Description: opts.Description, + ReadmeMarkdownTemplate: readmeTpl, + Labels: opts.Labels, + TerraformCloudWorkspaceDetails: &models.HashicorpCloudWaypointTerraformCloudWorkspaceDetails{ + ProjectID: opts.TerraformCloudProjectID, + Name: opts.TerraformCloudProjectName, + }, + TfExecutionMode: opts.TerraformExecutionMode, + TfAgentPoolID: opts.TerraformAgentPoolID, + VariableOptions: variables, }, - TfExecutionMode: opts.TerraformExecutionMode, - TfAgentPoolID: opts.TerraformAgentPoolID, - VariableOptions: variables, }, }, nil, ) diff --git a/internal/commands/waypoint/templates/create.go b/internal/commands/waypoint/templates/create.go index 430c695e..39e8b15e 100644 --- a/internal/commands/waypoint/templates/create.go +++ b/internal/commands/waypoint/templates/create.go @@ -33,6 +33,7 @@ $ hcp waypoint templates create -n=my-template \ -d="My Template Description" \ --readme-markdown-template-file "README.tpl" \ --tfc-no-code-module-source="app.terraform.io/hashicorp/dir/template" \ + --tf-no-code-module-id="nocode-123456" \ --tfc-project-name="my-tfc-project" \ --tfc-project-id="prj-123456" \ -l="label1" \ @@ -146,6 +147,15 @@ $ hcp waypoint templates create -n=my-template \ "when the execution mode is set to 'agent'.", Value: flagvalue.Simple("", &opts.TerraformAgentPoolID), }, + { + Name: "tf-no-code-module-id", + DisplayValue: "TF_NO_CODE_MODULE_ID", + Description: "The ID of the Terraform no-code module to use for " + + "running Terraform operations. This is in the format " + + "of 'nocode-'.", + Value: flagvalue.Simple("", &opts.TerraformNoCodeModuleID), + Required: true, + }, }, }, } @@ -209,6 +219,7 @@ func templateCreate(opts *TemplateOpts) error { VariableOptions: variables, TfExecutionMode: opts.TerraformExecutionMode, TfAgentPoolID: opts.TerraformAgentPoolID, + ModuleID: opts.TerraformNoCodeModuleID, }, }, Context: opts.Ctx, diff --git a/internal/commands/waypoint/templates/create_test.go b/internal/commands/waypoint/templates/create_test.go index fbc9ca04..4518ed26 100644 --- a/internal/commands/waypoint/templates/create_test.go +++ b/internal/commands/waypoint/templates/create_test.go @@ -56,6 +56,7 @@ func TestCmdTemplateCreate(t *testing.T) { "--readme-markdown-template-file", "readme_test.txt", "--tf-execution-mode", "agent", "--tf-agent-pool-id", "pool-abc123", + "--tf-no-code-module-id", "nocode-abc123", }, Expect: &TemplateOpts{ Name: "cli-test", @@ -69,6 +70,7 @@ func TestCmdTemplateCreate(t *testing.T) { Tags: map[string]string{"cli": "true"}, TerraformExecutionMode: "agent", TerraformAgentPoolID: "pool-abc123", + TerraformNoCodeModuleID: "nocode-abc123", }, }, { @@ -87,6 +89,7 @@ func TestCmdTemplateCreate(t *testing.T) { "-l", "cli", "-t", "cli=true", "--variable-options-file", "variable_options.hcl", + "--tf-no-code-module-id", "nocode-abc123", }, Expect: &TemplateOpts{ Name: "cli-test", @@ -99,6 +102,7 @@ func TestCmdTemplateCreate(t *testing.T) { VariableOptionsFile: "variable_options.hcl", Labels: []string{"cli"}, Tags: map[string]string{"cli": "true"}, + TerraformNoCodeModuleID: "nocode-abc123", }, }, } @@ -142,6 +146,7 @@ func TestCmdTemplateCreate(t *testing.T) { r.Equal(c.Expect.VariableOptionsFile, tplOpts.VariableOptionsFile) r.Equal(c.Expect.Labels, tplOpts.Labels) r.Equal(c.Expect.Tags, tplOpts.Tags) + r.Equal(c.Expect.TerraformNoCodeModuleID, tplOpts.TerraformNoCodeModuleID) } }) } diff --git a/internal/commands/waypoint/templates/read.go b/internal/commands/waypoint/templates/read.go index 2beaff66..05a05e7a 100644 --- a/internal/commands/waypoint/templates/read.go +++ b/internal/commands/waypoint/templates/read.go @@ -101,10 +101,11 @@ func templateRead(opts *TemplateOpts) error { format.NewField("Labels", "{{ .Labels }}"), format.NewField("Readme Template", "{{ .ReadmeTemplate }}"), format.NewField("Tags", "{{ .Tags}}"), - format.NewField("Terraform Nocode Source", "{{ .ModuleSource}}"), + format.NewField("Terraform No-Code Module Source", "{{ .ModuleSource}}"), format.NewField("Execution Mode", "{{ .TfExecutionMode}}"), format.NewField("Agent Pool ID", "{{ .TfAgentPoolID}}"), format.NewField("Variable Options", optionNamesStr), + format.NewField("Terraform No-code Module ID", "{{ .ModuleID }}"), } // Display the created project diff --git a/internal/commands/waypoint/templates/template.go b/internal/commands/waypoint/templates/template.go index 7b15bd48..63898e05 100644 --- a/internal/commands/waypoint/templates/template.go +++ b/internal/commands/waypoint/templates/template.go @@ -32,6 +32,7 @@ type TemplateOpts struct { TerraformCloudProjectID string TerraformExecutionMode string TerraformAgentPoolID string + TerraformNoCodeModuleID string VariableOptionsFile string diff --git a/internal/pkg/api/mocks/github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/client/secret_service/mock_ClientService.go b/internal/pkg/api/mocks/github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/client/secret_service/mock_ClientService.go index e36a8542..85139a10 100644 --- a/internal/pkg/api/mocks/github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/client/secret_service/mock_ClientService.go +++ b/internal/pkg/api/mocks/github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/client/secret_service/mock_ClientService.go @@ -392,6 +392,80 @@ func (_c *MockClientService_CreateAwsIntegration_Call) RunAndReturn(run func(*se return _c } +// CreateAzureApplicationPasswordRotatingSecret provides a mock function with given fields: params, authInfo, opts +func (_m *MockClientService) CreateAzureApplicationPasswordRotatingSecret(params *secret_service.CreateAzureApplicationPasswordRotatingSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption) (*secret_service.CreateAzureApplicationPasswordRotatingSecretOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateAzureApplicationPasswordRotatingSecret") + } + + var r0 *secret_service.CreateAzureApplicationPasswordRotatingSecretOK + var r1 error + if rf, ok := ret.Get(0).(func(*secret_service.CreateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) (*secret_service.CreateAzureApplicationPasswordRotatingSecretOK, error)); ok { + return rf(params, authInfo, opts...) + } + if rf, ok := ret.Get(0).(func(*secret_service.CreateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) *secret_service.CreateAzureApplicationPasswordRotatingSecretOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*secret_service.CreateAzureApplicationPasswordRotatingSecretOK) + } + } + + if rf, ok := ret.Get(1).(func(*secret_service.CreateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAzureApplicationPasswordRotatingSecret' +type MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call struct { + *mock.Call +} + +// CreateAzureApplicationPasswordRotatingSecret is a helper method to define mock.On call +// - params *secret_service.CreateAzureApplicationPasswordRotatingSecretParams +// - authInfo runtime.ClientAuthInfoWriter +// - opts ...secret_service.ClientOption +func (_e *MockClientService_Expecter) CreateAzureApplicationPasswordRotatingSecret(params interface{}, authInfo interface{}, opts ...interface{}) *MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call { + return &MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call{Call: _e.mock.On("CreateAzureApplicationPasswordRotatingSecret", + append([]interface{}{params, authInfo}, opts...)...)} +} + +func (_c *MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call) Run(run func(params *secret_service.CreateAzureApplicationPasswordRotatingSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption)) *MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]secret_service.ClientOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(secret_service.ClientOption) + } + } + run(args[0].(*secret_service.CreateAzureApplicationPasswordRotatingSecretParams), args[1].(runtime.ClientAuthInfoWriter), variadicArgs...) + }) + return _c +} + +func (_c *MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call) Return(_a0 *secret_service.CreateAzureApplicationPasswordRotatingSecretOK, _a1 error) *MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call) RunAndReturn(run func(*secret_service.CreateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) (*secret_service.CreateAzureApplicationPasswordRotatingSecretOK, error)) *MockClientService_CreateAzureApplicationPasswordRotatingSecret_Call { + _c.Call.Return(run) + return _c +} + // CreateAzureIntegration provides a mock function with given fields: params, authInfo, opts func (_m *MockClientService) CreateAzureIntegration(params *secret_service.CreateAzureIntegrationParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption) (*secret_service.CreateAzureIntegrationOK, error) { _va := make([]interface{}, len(opts)) @@ -3130,6 +3204,80 @@ func (_c *MockClientService_GetAwsIntegration_Call) RunAndReturn(run func(*secre return _c } +// GetAzureApplicationPasswordRotatingSecretConfig provides a mock function with given fields: params, authInfo, opts +func (_m *MockClientService) GetAzureApplicationPasswordRotatingSecretConfig(params *secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption) (*secret_service.GetAzureApplicationPasswordRotatingSecretConfigOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetAzureApplicationPasswordRotatingSecretConfig") + } + + var r0 *secret_service.GetAzureApplicationPasswordRotatingSecretConfigOK + var r1 error + if rf, ok := ret.Get(0).(func(*secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) (*secret_service.GetAzureApplicationPasswordRotatingSecretConfigOK, error)); ok { + return rf(params, authInfo, opts...) + } + if rf, ok := ret.Get(0).(func(*secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) *secret_service.GetAzureApplicationPasswordRotatingSecretConfigOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*secret_service.GetAzureApplicationPasswordRotatingSecretConfigOK) + } + } + + if rf, ok := ret.Get(1).(func(*secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAzureApplicationPasswordRotatingSecretConfig' +type MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call struct { + *mock.Call +} + +// GetAzureApplicationPasswordRotatingSecretConfig is a helper method to define mock.On call +// - params *secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams +// - authInfo runtime.ClientAuthInfoWriter +// - opts ...secret_service.ClientOption +func (_e *MockClientService_Expecter) GetAzureApplicationPasswordRotatingSecretConfig(params interface{}, authInfo interface{}, opts ...interface{}) *MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call { + return &MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call{Call: _e.mock.On("GetAzureApplicationPasswordRotatingSecretConfig", + append([]interface{}{params, authInfo}, opts...)...)} +} + +func (_c *MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call) Run(run func(params *secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption)) *MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]secret_service.ClientOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(secret_service.ClientOption) + } + } + run(args[0].(*secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams), args[1].(runtime.ClientAuthInfoWriter), variadicArgs...) + }) + return _c +} + +func (_c *MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call) Return(_a0 *secret_service.GetAzureApplicationPasswordRotatingSecretConfigOK, _a1 error) *MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call) RunAndReturn(run func(*secret_service.GetAzureApplicationPasswordRotatingSecretConfigParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) (*secret_service.GetAzureApplicationPasswordRotatingSecretConfigOK, error)) *MockClientService_GetAzureApplicationPasswordRotatingSecretConfig_Call { + _c.Call.Return(run) + return _c +} + // GetAzureIntegration provides a mock function with given fields: params, authInfo, opts func (_m *MockClientService) GetAzureIntegration(params *secret_service.GetAzureIntegrationParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption) (*secret_service.GetAzureIntegrationOK, error) { _va := make([]interface{}, len(opts)) @@ -6715,6 +6863,80 @@ func (_c *MockClientService_UpdateAwsIntegration_Call) RunAndReturn(run func(*se return _c } +// UpdateAzureApplicationPasswordRotatingSecret provides a mock function with given fields: params, authInfo, opts +func (_m *MockClientService) UpdateAzureApplicationPasswordRotatingSecret(params *secret_service.UpdateAzureApplicationPasswordRotatingSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption) (*secret_service.UpdateAzureApplicationPasswordRotatingSecretOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for UpdateAzureApplicationPasswordRotatingSecret") + } + + var r0 *secret_service.UpdateAzureApplicationPasswordRotatingSecretOK + var r1 error + if rf, ok := ret.Get(0).(func(*secret_service.UpdateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) (*secret_service.UpdateAzureApplicationPasswordRotatingSecretOK, error)); ok { + return rf(params, authInfo, opts...) + } + if rf, ok := ret.Get(0).(func(*secret_service.UpdateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) *secret_service.UpdateAzureApplicationPasswordRotatingSecretOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*secret_service.UpdateAzureApplicationPasswordRotatingSecretOK) + } + } + + if rf, ok := ret.Get(1).(func(*secret_service.UpdateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAzureApplicationPasswordRotatingSecret' +type MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call struct { + *mock.Call +} + +// UpdateAzureApplicationPasswordRotatingSecret is a helper method to define mock.On call +// - params *secret_service.UpdateAzureApplicationPasswordRotatingSecretParams +// - authInfo runtime.ClientAuthInfoWriter +// - opts ...secret_service.ClientOption +func (_e *MockClientService_Expecter) UpdateAzureApplicationPasswordRotatingSecret(params interface{}, authInfo interface{}, opts ...interface{}) *MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call { + return &MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call{Call: _e.mock.On("UpdateAzureApplicationPasswordRotatingSecret", + append([]interface{}{params, authInfo}, opts...)...)} +} + +func (_c *MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call) Run(run func(params *secret_service.UpdateAzureApplicationPasswordRotatingSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption)) *MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]secret_service.ClientOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(secret_service.ClientOption) + } + } + run(args[0].(*secret_service.UpdateAzureApplicationPasswordRotatingSecretParams), args[1].(runtime.ClientAuthInfoWriter), variadicArgs...) + }) + return _c +} + +func (_c *MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call) Return(_a0 *secret_service.UpdateAzureApplicationPasswordRotatingSecretOK, _a1 error) *MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call) RunAndReturn(run func(*secret_service.UpdateAzureApplicationPasswordRotatingSecretParams, runtime.ClientAuthInfoWriter, ...secret_service.ClientOption) (*secret_service.UpdateAzureApplicationPasswordRotatingSecretOK, error)) *MockClientService_UpdateAzureApplicationPasswordRotatingSecret_Call { + _c.Call.Return(run) + return _c +} + // UpdateAzureIntegration provides a mock function with given fields: params, authInfo, opts func (_m *MockClientService) UpdateAzureIntegration(params *secret_service.UpdateAzureIntegrationParams, authInfo runtime.ClientAuthInfoWriter, opts ...secret_service.ClientOption) (*secret_service.UpdateAzureIntegrationOK, error) { _va := make([]interface{}, len(opts))