type MigrationHubOrchestratorAPI interface { CreateTemplate(*migrationhuborchestrator.CreateTemplateInput) (*migrationhuborchestrator.CreateTemplateOutput, error) CreateTemplateWithContext(aws.Context, *migrationhuborchestrator.CreateTemplateInput, ...request.Option) (*migrationhuborchestrator.CreateTemplateOutput, error) CreateTemplateRequest(*migrationhuborchestrator.CreateTemplateInput) (*request.Request, *migrationhuborchestrator.CreateTemplateOutput) CreateWorkflow(*migrationhuborchestrator.CreateWorkflowInput) (*migrationhuborchestrator.CreateWorkflowOutput, error) CreateWorkflowWithContext(aws.Context, *migrationhuborchestrator.CreateWorkflowInput, ...request.Option) (*migrationhuborchestrator.CreateWorkflowOutput, error) CreateWorkflowRequest(*migrationhuborchestrator.CreateWorkflowInput) (*request.Request, *migrationhuborchestrator.CreateWorkflowOutput) CreateWorkflowStep(*migrationhuborchestrator.CreateWorkflowStepInput) (*migrationhuborchestrator.CreateWorkflowStepOutput, error) CreateWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.CreateWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.CreateWorkflowStepOutput, error) CreateWorkflowStepRequest(*migrationhuborchestrator.CreateWorkflowStepInput) (*request.Request, *migrationhuborchestrator.CreateWorkflowStepOutput) CreateWorkflowStepGroup(*migrationhuborchestrator.CreateWorkflowStepGroupInput) (*migrationhuborchestrator.CreateWorkflowStepGroupOutput, error) CreateWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.CreateWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.CreateWorkflowStepGroupOutput, error) CreateWorkflowStepGroupRequest(*migrationhuborchestrator.CreateWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.CreateWorkflowStepGroupOutput) DeleteTemplate(*migrationhuborchestrator.DeleteTemplateInput) (*migrationhuborchestrator.DeleteTemplateOutput, error) DeleteTemplateWithContext(aws.Context, *migrationhuborchestrator.DeleteTemplateInput, ...request.Option) (*migrationhuborchestrator.DeleteTemplateOutput, error) DeleteTemplateRequest(*migrationhuborchestrator.DeleteTemplateInput) (*request.Request, *migrationhuborchestrator.DeleteTemplateOutput) DeleteWorkflow(*migrationhuborchestrator.DeleteWorkflowInput) (*migrationhuborchestrator.DeleteWorkflowOutput, error) DeleteWorkflowWithContext(aws.Context, *migrationhuborchestrator.DeleteWorkflowInput, ...request.Option) (*migrationhuborchestrator.DeleteWorkflowOutput, error) DeleteWorkflowRequest(*migrationhuborchestrator.DeleteWorkflowInput) (*request.Request, *migrationhuborchestrator.DeleteWorkflowOutput) DeleteWorkflowStep(*migrationhuborchestrator.DeleteWorkflowStepInput) (*migrationhuborchestrator.DeleteWorkflowStepOutput, error) DeleteWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.DeleteWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.DeleteWorkflowStepOutput, error) DeleteWorkflowStepRequest(*migrationhuborchestrator.DeleteWorkflowStepInput) (*request.Request, *migrationhuborchestrator.DeleteWorkflowStepOutput) DeleteWorkflowStepGroup(*migrationhuborchestrator.DeleteWorkflowStepGroupInput) (*migrationhuborchestrator.DeleteWorkflowStepGroupOutput, error) DeleteWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.DeleteWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.DeleteWorkflowStepGroupOutput, error) DeleteWorkflowStepGroupRequest(*migrationhuborchestrator.DeleteWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.DeleteWorkflowStepGroupOutput) GetTemplate(*migrationhuborchestrator.GetTemplateInput) (*migrationhuborchestrator.GetTemplateOutput, error) GetTemplateWithContext(aws.Context, *migrationhuborchestrator.GetTemplateInput, ...request.Option) (*migrationhuborchestrator.GetTemplateOutput, error) GetTemplateRequest(*migrationhuborchestrator.GetTemplateInput) (*request.Request, *migrationhuborchestrator.GetTemplateOutput) GetTemplateStep(*migrationhuborchestrator.GetTemplateStepInput) (*migrationhuborchestrator.GetTemplateStepOutput, error) GetTemplateStepWithContext(aws.Context, *migrationhuborchestrator.GetTemplateStepInput, ...request.Option) (*migrationhuborchestrator.GetTemplateStepOutput, error) GetTemplateStepRequest(*migrationhuborchestrator.GetTemplateStepInput) (*request.Request, *migrationhuborchestrator.GetTemplateStepOutput) GetTemplateStepGroup(*migrationhuborchestrator.GetTemplateStepGroupInput) (*migrationhuborchestrator.GetTemplateStepGroupOutput, error) GetTemplateStepGroupWithContext(aws.Context, *migrationhuborchestrator.GetTemplateStepGroupInput, ...request.Option) (*migrationhuborchestrator.GetTemplateStepGroupOutput, error) GetTemplateStepGroupRequest(*migrationhuborchestrator.GetTemplateStepGroupInput) (*request.Request, *migrationhuborchestrator.GetTemplateStepGroupOutput) GetWorkflow(*migrationhuborchestrator.GetWorkflowInput) (*migrationhuborchestrator.GetWorkflowOutput, error) GetWorkflowWithContext(aws.Context, *migrationhuborchestrator.GetWorkflowInput, ...request.Option) (*migrationhuborchestrator.GetWorkflowOutput, error) GetWorkflowRequest(*migrationhuborchestrator.GetWorkflowInput) (*request.Request, *migrationhuborchestrator.GetWorkflowOutput) GetWorkflowStep(*migrationhuborchestrator.GetWorkflowStepInput) (*migrationhuborchestrator.GetWorkflowStepOutput, error) GetWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.GetWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.GetWorkflowStepOutput, error) GetWorkflowStepRequest(*migrationhuborchestrator.GetWorkflowStepInput) (*request.Request, *migrationhuborchestrator.GetWorkflowStepOutput) GetWorkflowStepGroup(*migrationhuborchestrator.GetWorkflowStepGroupInput) (*migrationhuborchestrator.GetWorkflowStepGroupOutput, error) GetWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.GetWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.GetWorkflowStepGroupOutput, error) GetWorkflowStepGroupRequest(*migrationhuborchestrator.GetWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.GetWorkflowStepGroupOutput) ListPlugins(*migrationhuborchestrator.ListPluginsInput) (*migrationhuborchestrator.ListPluginsOutput, error) ListPluginsWithContext(aws.Context, *migrationhuborchestrator.ListPluginsInput, ...request.Option) (*migrationhuborchestrator.ListPluginsOutput, error) ListPluginsRequest(*migrationhuborchestrator.ListPluginsInput) (*request.Request, *migrationhuborchestrator.ListPluginsOutput) ListPluginsPages(*migrationhuborchestrator.ListPluginsInput, func(*migrationhuborchestrator.ListPluginsOutput, bool) bool) error ListPluginsPagesWithContext(aws.Context, *migrationhuborchestrator.ListPluginsInput, func(*migrationhuborchestrator.ListPluginsOutput, bool) bool, ...request.Option) error ListTagsForResource(*migrationhuborchestrator.ListTagsForResourceInput) (*migrationhuborchestrator.ListTagsForResourceOutput, error) ListTagsForResourceWithContext(aws.Context, *migrationhuborchestrator.ListTagsForResourceInput, ...request.Option) (*migrationhuborchestrator.ListTagsForResourceOutput, error) ListTagsForResourceRequest(*migrationhuborchestrator.ListTagsForResourceInput) (*request.Request, *migrationhuborchestrator.ListTagsForResourceOutput) ListTemplateStepGroups(*migrationhuborchestrator.ListTemplateStepGroupsInput) (*migrationhuborchestrator.ListTemplateStepGroupsOutput, error) ListTemplateStepGroupsWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepGroupsInput, ...request.Option) (*migrationhuborchestrator.ListTemplateStepGroupsOutput, error) ListTemplateStepGroupsRequest(*migrationhuborchestrator.ListTemplateStepGroupsInput) (*request.Request, *migrationhuborchestrator.ListTemplateStepGroupsOutput) ListTemplateStepGroupsPages(*migrationhuborchestrator.ListTemplateStepGroupsInput, func(*migrationhuborchestrator.ListTemplateStepGroupsOutput, bool) bool) error ListTemplateStepGroupsPagesWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepGroupsInput, func(*migrationhuborchestrator.ListTemplateStepGroupsOutput, bool) bool, ...request.Option) error ListTemplateSteps(*migrationhuborchestrator.ListTemplateStepsInput) (*migrationhuborchestrator.ListTemplateStepsOutput, error) ListTemplateStepsWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepsInput, ...request.Option) (*migrationhuborchestrator.ListTemplateStepsOutput, error) ListTemplateStepsRequest(*migrationhuborchestrator.ListTemplateStepsInput) (*request.Request, *migrationhuborchestrator.ListTemplateStepsOutput) ListTemplateStepsPages(*migrationhuborchestrator.ListTemplateStepsInput, func(*migrationhuborchestrator.ListTemplateStepsOutput, bool) bool) error ListTemplateStepsPagesWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepsInput, func(*migrationhuborchestrator.ListTemplateStepsOutput, bool) bool, ...request.Option) error ListTemplates(*migrationhuborchestrator.ListTemplatesInput) (*migrationhuborchestrator.ListTemplatesOutput, error) ListTemplatesWithContext(aws.Context, *migrationhuborchestrator.ListTemplatesInput, ...request.Option) (*migrationhuborchestrator.ListTemplatesOutput, error) ListTemplatesRequest(*migrationhuborchestrator.ListTemplatesInput) (*request.Request, *migrationhuborchestrator.ListTemplatesOutput) ListTemplatesPages(*migrationhuborchestrator.ListTemplatesInput, func(*migrationhuborchestrator.ListTemplatesOutput, bool) bool) error ListTemplatesPagesWithContext(aws.Context, *migrationhuborchestrator.ListTemplatesInput, func(*migrationhuborchestrator.ListTemplatesOutput, bool) bool, ...request.Option) error ListWorkflowStepGroups(*migrationhuborchestrator.ListWorkflowStepGroupsInput) (*migrationhuborchestrator.ListWorkflowStepGroupsOutput, error) ListWorkflowStepGroupsWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepGroupsInput, ...request.Option) (*migrationhuborchestrator.ListWorkflowStepGroupsOutput, error) ListWorkflowStepGroupsRequest(*migrationhuborchestrator.ListWorkflowStepGroupsInput) (*request.Request, *migrationhuborchestrator.ListWorkflowStepGroupsOutput) ListWorkflowStepGroupsPages(*migrationhuborchestrator.ListWorkflowStepGroupsInput, func(*migrationhuborchestrator.ListWorkflowStepGroupsOutput, bool) bool) error ListWorkflowStepGroupsPagesWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepGroupsInput, func(*migrationhuborchestrator.ListWorkflowStepGroupsOutput, bool) bool, ...request.Option) error ListWorkflowSteps(*migrationhuborchestrator.ListWorkflowStepsInput) (*migrationhuborchestrator.ListWorkflowStepsOutput, error) ListWorkflowStepsWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepsInput, ...request.Option) (*migrationhuborchestrator.ListWorkflowStepsOutput, error) ListWorkflowStepsRequest(*migrationhuborchestrator.ListWorkflowStepsInput) (*request.Request, *migrationhuborchestrator.ListWorkflowStepsOutput) ListWorkflowStepsPages(*migrationhuborchestrator.ListWorkflowStepsInput, func(*migrationhuborchestrator.ListWorkflowStepsOutput, bool) bool) error ListWorkflowStepsPagesWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepsInput, func(*migrationhuborchestrator.ListWorkflowStepsOutput, bool) bool, ...request.Option) error ListWorkflows(*migrationhuborchestrator.ListWorkflowsInput) (*migrationhuborchestrator.ListWorkflowsOutput, error) ListWorkflowsWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowsInput, ...request.Option) (*migrationhuborchestrator.ListWorkflowsOutput, error) ListWorkflowsRequest(*migrationhuborchestrator.ListWorkflowsInput) (*request.Request, *migrationhuborchestrator.ListWorkflowsOutput) ListWorkflowsPages(*migrationhuborchestrator.ListWorkflowsInput, func(*migrationhuborchestrator.ListWorkflowsOutput, bool) bool) error ListWorkflowsPagesWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowsInput, func(*migrationhuborchestrator.ListWorkflowsOutput, bool) bool, ...request.Option) error RetryWorkflowStep(*migrationhuborchestrator.RetryWorkflowStepInput) (*migrationhuborchestrator.RetryWorkflowStepOutput, error) RetryWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.RetryWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.RetryWorkflowStepOutput, error) RetryWorkflowStepRequest(*migrationhuborchestrator.RetryWorkflowStepInput) (*request.Request, *migrationhuborchestrator.RetryWorkflowStepOutput) StartWorkflow(*migrationhuborchestrator.StartWorkflowInput) (*migrationhuborchestrator.StartWorkflowOutput, error) StartWorkflowWithContext(aws.Context, *migrationhuborchestrator.StartWorkflowInput, ...request.Option) (*migrationhuborchestrator.StartWorkflowOutput, error) StartWorkflowRequest(*migrationhuborchestrator.StartWorkflowInput) (*request.Request, *migrationhuborchestrator.StartWorkflowOutput) StopWorkflow(*migrationhuborchestrator.StopWorkflowInput) (*migrationhuborchestrator.StopWorkflowOutput, error) StopWorkflowWithContext(aws.Context, *migrationhuborchestrator.StopWorkflowInput, ...request.Option) (*migrationhuborchestrator.StopWorkflowOutput, error) StopWorkflowRequest(*migrationhuborchestrator.StopWorkflowInput) (*request.Request, *migrationhuborchestrator.StopWorkflowOutput) TagResource(*migrationhuborchestrator.TagResourceInput) (*migrationhuborchestrator.TagResourceOutput, error) TagResourceWithContext(aws.Context, *migrationhuborchestrator.TagResourceInput, ...request.Option) (*migrationhuborchestrator.TagResourceOutput, error) TagResourceRequest(*migrationhuborchestrator.TagResourceInput) (*request.Request, *migrationhuborchestrator.TagResourceOutput) UntagResource(*migrationhuborchestrator.UntagResourceInput) (*migrationhuborchestrator.UntagResourceOutput, error) UntagResourceWithContext(aws.Context, *migrationhuborchestrator.UntagResourceInput, ...request.Option) (*migrationhuborchestrator.UntagResourceOutput, error) UntagResourceRequest(*migrationhuborchestrator.UntagResourceInput) (*request.Request, *migrationhuborchestrator.UntagResourceOutput) UpdateTemplate(*migrationhuborchestrator.UpdateTemplateInput) (*migrationhuborchestrator.UpdateTemplateOutput, error) UpdateTemplateWithContext(aws.Context, *migrationhuborchestrator.UpdateTemplateInput, ...request.Option) (*migrationhuborchestrator.UpdateTemplateOutput, error) UpdateTemplateRequest(*migrationhuborchestrator.UpdateTemplateInput) (*request.Request, *migrationhuborchestrator.UpdateTemplateOutput) UpdateWorkflow(*migrationhuborchestrator.UpdateWorkflowInput) (*migrationhuborchestrator.UpdateWorkflowOutput, error) UpdateWorkflowWithContext(aws.Context, *migrationhuborchestrator.UpdateWorkflowInput, ...request.Option) (*migrationhuborchestrator.UpdateWorkflowOutput, error) UpdateWorkflowRequest(*migrationhuborchestrator.UpdateWorkflowInput) (*request.Request, *migrationhuborchestrator.UpdateWorkflowOutput) UpdateWorkflowStep(*migrationhuborchestrator.UpdateWorkflowStepInput) (*migrationhuborchestrator.UpdateWorkflowStepOutput, error) UpdateWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.UpdateWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.UpdateWorkflowStepOutput, error) UpdateWorkflowStepRequest(*migrationhuborchestrator.UpdateWorkflowStepInput) (*request.Request, *migrationhuborchestrator.UpdateWorkflowStepOutput) UpdateWorkflowStepGroup(*migrationhuborchestrator.UpdateWorkflowStepGroupInput) (*migrationhuborchestrator.UpdateWorkflowStepGroupOutput, error) UpdateWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.UpdateWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.UpdateWorkflowStepGroupOutput, error) UpdateWorkflowStepGroupRequest(*migrationhuborchestrator.UpdateWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.UpdateWorkflowStepGroupOutput) }
MigrationHubOrchestratorAPI provides an interface to enable mocking the migrationhuborchestrator.MigrationHubOrchestrator service client's API operation, paginators, and waiters. This make unit testing your code that calls out to the SDK's service client's calls easier.
The best way to use this interface is so the SDK's service client's calls can be stubbed out for unit testing your code with the SDK without needing to inject custom request handlers into the SDK's request pipeline.
// myFunc uses an SDK service client to make a request to // AWS Migration Hub Orchestrator. func myFunc(svc migrationhuborchestratoriface.MigrationHubOrchestratorAPI) bool { // Make svc.CreateTemplate request } func main() { sess := session.New() svc := migrationhuborchestrator.New(sess) myFunc(svc) }
In your _test.go file:
// Define a mock struct to be used in your unit tests of myFunc. type mockMigrationHubOrchestratorClient struct { migrationhuborchestratoriface.MigrationHubOrchestratorAPI } func (m *mockMigrationHubOrchestratorClient) CreateTemplate(input *migrationhuborchestrator.CreateTemplateInput) (*migrationhuborchestrator.CreateTemplateOutput, error) { // mock response/functionality } func TestMyFunc(t *testing.T) { // Setup Test mockSvc := &mockMigrationHubOrchestratorClient{} myfunc(mockSvc) // Verify myFunc's functionality }
It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters. Its suggested to use the pattern above for testing, or using tooling to generate mocks to satisfy the interfaces.