github.com/aavshr/aws-sdk-go@v1.41.3/service/mwaa/mwaaiface/interface.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 // Package mwaaiface provides an interface to enable mocking the AmazonMWAA service client 4 // for testing your code. 5 // 6 // It is important to note that this interface will have breaking changes 7 // when the service model is updated and adds new API operations, paginators, 8 // and waiters. 9 package mwaaiface 10 11 import ( 12 "github.com/aavshr/aws-sdk-go/aws" 13 "github.com/aavshr/aws-sdk-go/aws/request" 14 "github.com/aavshr/aws-sdk-go/service/mwaa" 15 ) 16 17 // MWAAAPI provides an interface to enable mocking the 18 // mwaa.MWAA service client's API operation, 19 // paginators, and waiters. This make unit testing your code that calls out 20 // to the SDK's service client's calls easier. 21 // 22 // The best way to use this interface is so the SDK's service client's calls 23 // can be stubbed out for unit testing your code with the SDK without needing 24 // to inject custom request handlers into the SDK's request pipeline. 25 // 26 // // myFunc uses an SDK service client to make a request to 27 // // AmazonMWAA. 28 // func myFunc(svc mwaaiface.MWAAAPI) bool { 29 // // Make svc.CreateCliToken request 30 // } 31 // 32 // func main() { 33 // sess := session.New() 34 // svc := mwaa.New(sess) 35 // 36 // myFunc(svc) 37 // } 38 // 39 // In your _test.go file: 40 // 41 // // Define a mock struct to be used in your unit tests of myFunc. 42 // type mockMWAAClient struct { 43 // mwaaiface.MWAAAPI 44 // } 45 // func (m *mockMWAAClient) CreateCliToken(input *mwaa.CreateCliTokenInput) (*mwaa.CreateCliTokenOutput, error) { 46 // // mock response/functionality 47 // } 48 // 49 // func TestMyFunc(t *testing.T) { 50 // // Setup Test 51 // mockSvc := &mockMWAAClient{} 52 // 53 // myfunc(mockSvc) 54 // 55 // // Verify myFunc's functionality 56 // } 57 // 58 // It is important to note that this interface will have breaking changes 59 // when the service model is updated and adds new API operations, paginators, 60 // and waiters. Its suggested to use the pattern above for testing, or using 61 // tooling to generate mocks to satisfy the interfaces. 62 type MWAAAPI interface { 63 CreateCliToken(*mwaa.CreateCliTokenInput) (*mwaa.CreateCliTokenOutput, error) 64 CreateCliTokenWithContext(aws.Context, *mwaa.CreateCliTokenInput, ...request.Option) (*mwaa.CreateCliTokenOutput, error) 65 CreateCliTokenRequest(*mwaa.CreateCliTokenInput) (*request.Request, *mwaa.CreateCliTokenOutput) 66 67 CreateEnvironment(*mwaa.CreateEnvironmentInput) (*mwaa.CreateEnvironmentOutput, error) 68 CreateEnvironmentWithContext(aws.Context, *mwaa.CreateEnvironmentInput, ...request.Option) (*mwaa.CreateEnvironmentOutput, error) 69 CreateEnvironmentRequest(*mwaa.CreateEnvironmentInput) (*request.Request, *mwaa.CreateEnvironmentOutput) 70 71 CreateWebLoginToken(*mwaa.CreateWebLoginTokenInput) (*mwaa.CreateWebLoginTokenOutput, error) 72 CreateWebLoginTokenWithContext(aws.Context, *mwaa.CreateWebLoginTokenInput, ...request.Option) (*mwaa.CreateWebLoginTokenOutput, error) 73 CreateWebLoginTokenRequest(*mwaa.CreateWebLoginTokenInput) (*request.Request, *mwaa.CreateWebLoginTokenOutput) 74 75 DeleteEnvironment(*mwaa.DeleteEnvironmentInput) (*mwaa.DeleteEnvironmentOutput, error) 76 DeleteEnvironmentWithContext(aws.Context, *mwaa.DeleteEnvironmentInput, ...request.Option) (*mwaa.DeleteEnvironmentOutput, error) 77 DeleteEnvironmentRequest(*mwaa.DeleteEnvironmentInput) (*request.Request, *mwaa.DeleteEnvironmentOutput) 78 79 GetEnvironment(*mwaa.GetEnvironmentInput) (*mwaa.GetEnvironmentOutput, error) 80 GetEnvironmentWithContext(aws.Context, *mwaa.GetEnvironmentInput, ...request.Option) (*mwaa.GetEnvironmentOutput, error) 81 GetEnvironmentRequest(*mwaa.GetEnvironmentInput) (*request.Request, *mwaa.GetEnvironmentOutput) 82 83 ListEnvironments(*mwaa.ListEnvironmentsInput) (*mwaa.ListEnvironmentsOutput, error) 84 ListEnvironmentsWithContext(aws.Context, *mwaa.ListEnvironmentsInput, ...request.Option) (*mwaa.ListEnvironmentsOutput, error) 85 ListEnvironmentsRequest(*mwaa.ListEnvironmentsInput) (*request.Request, *mwaa.ListEnvironmentsOutput) 86 87 ListEnvironmentsPages(*mwaa.ListEnvironmentsInput, func(*mwaa.ListEnvironmentsOutput, bool) bool) error 88 ListEnvironmentsPagesWithContext(aws.Context, *mwaa.ListEnvironmentsInput, func(*mwaa.ListEnvironmentsOutput, bool) bool, ...request.Option) error 89 90 ListTagsForResource(*mwaa.ListTagsForResourceInput) (*mwaa.ListTagsForResourceOutput, error) 91 ListTagsForResourceWithContext(aws.Context, *mwaa.ListTagsForResourceInput, ...request.Option) (*mwaa.ListTagsForResourceOutput, error) 92 ListTagsForResourceRequest(*mwaa.ListTagsForResourceInput) (*request.Request, *mwaa.ListTagsForResourceOutput) 93 94 PublishMetrics(*mwaa.PublishMetricsInput) (*mwaa.PublishMetricsOutput, error) 95 PublishMetricsWithContext(aws.Context, *mwaa.PublishMetricsInput, ...request.Option) (*mwaa.PublishMetricsOutput, error) 96 PublishMetricsRequest(*mwaa.PublishMetricsInput) (*request.Request, *mwaa.PublishMetricsOutput) 97 98 TagResource(*mwaa.TagResourceInput) (*mwaa.TagResourceOutput, error) 99 TagResourceWithContext(aws.Context, *mwaa.TagResourceInput, ...request.Option) (*mwaa.TagResourceOutput, error) 100 TagResourceRequest(*mwaa.TagResourceInput) (*request.Request, *mwaa.TagResourceOutput) 101 102 UntagResource(*mwaa.UntagResourceInput) (*mwaa.UntagResourceOutput, error) 103 UntagResourceWithContext(aws.Context, *mwaa.UntagResourceInput, ...request.Option) (*mwaa.UntagResourceOutput, error) 104 UntagResourceRequest(*mwaa.UntagResourceInput) (*request.Request, *mwaa.UntagResourceOutput) 105 106 UpdateEnvironment(*mwaa.UpdateEnvironmentInput) (*mwaa.UpdateEnvironmentOutput, error) 107 UpdateEnvironmentWithContext(aws.Context, *mwaa.UpdateEnvironmentInput, ...request.Option) (*mwaa.UpdateEnvironmentOutput, error) 108 UpdateEnvironmentRequest(*mwaa.UpdateEnvironmentInput) (*request.Request, *mwaa.UpdateEnvironmentOutput) 109 } 110 111 var _ MWAAAPI = (*mwaa.MWAA)(nil)