github.com/aavshr/aws-sdk-go@v1.41.3/service/iotsecuretunneling/iotsecuretunnelingiface/interface.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 // Package iotsecuretunnelingiface provides an interface to enable mocking the AWS IoT Secure Tunneling 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 iotsecuretunnelingiface 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/iotsecuretunneling" 15 ) 16 17 // IoTSecureTunnelingAPI provides an interface to enable mocking the 18 // iotsecuretunneling.IoTSecureTunneling 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 // // AWS IoT Secure Tunneling. 28 // func myFunc(svc iotsecuretunnelingiface.IoTSecureTunnelingAPI) bool { 29 // // Make svc.CloseTunnel request 30 // } 31 // 32 // func main() { 33 // sess := session.New() 34 // svc := iotsecuretunneling.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 mockIoTSecureTunnelingClient struct { 43 // iotsecuretunnelingiface.IoTSecureTunnelingAPI 44 // } 45 // func (m *mockIoTSecureTunnelingClient) CloseTunnel(input *iotsecuretunneling.CloseTunnelInput) (*iotsecuretunneling.CloseTunnelOutput, error) { 46 // // mock response/functionality 47 // } 48 // 49 // func TestMyFunc(t *testing.T) { 50 // // Setup Test 51 // mockSvc := &mockIoTSecureTunnelingClient{} 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 IoTSecureTunnelingAPI interface { 63 CloseTunnel(*iotsecuretunneling.CloseTunnelInput) (*iotsecuretunneling.CloseTunnelOutput, error) 64 CloseTunnelWithContext(aws.Context, *iotsecuretunneling.CloseTunnelInput, ...request.Option) (*iotsecuretunneling.CloseTunnelOutput, error) 65 CloseTunnelRequest(*iotsecuretunneling.CloseTunnelInput) (*request.Request, *iotsecuretunneling.CloseTunnelOutput) 66 67 DescribeTunnel(*iotsecuretunneling.DescribeTunnelInput) (*iotsecuretunneling.DescribeTunnelOutput, error) 68 DescribeTunnelWithContext(aws.Context, *iotsecuretunneling.DescribeTunnelInput, ...request.Option) (*iotsecuretunneling.DescribeTunnelOutput, error) 69 DescribeTunnelRequest(*iotsecuretunneling.DescribeTunnelInput) (*request.Request, *iotsecuretunneling.DescribeTunnelOutput) 70 71 ListTagsForResource(*iotsecuretunneling.ListTagsForResourceInput) (*iotsecuretunneling.ListTagsForResourceOutput, error) 72 ListTagsForResourceWithContext(aws.Context, *iotsecuretunneling.ListTagsForResourceInput, ...request.Option) (*iotsecuretunneling.ListTagsForResourceOutput, error) 73 ListTagsForResourceRequest(*iotsecuretunneling.ListTagsForResourceInput) (*request.Request, *iotsecuretunneling.ListTagsForResourceOutput) 74 75 ListTunnels(*iotsecuretunneling.ListTunnelsInput) (*iotsecuretunneling.ListTunnelsOutput, error) 76 ListTunnelsWithContext(aws.Context, *iotsecuretunneling.ListTunnelsInput, ...request.Option) (*iotsecuretunneling.ListTunnelsOutput, error) 77 ListTunnelsRequest(*iotsecuretunneling.ListTunnelsInput) (*request.Request, *iotsecuretunneling.ListTunnelsOutput) 78 79 ListTunnelsPages(*iotsecuretunneling.ListTunnelsInput, func(*iotsecuretunneling.ListTunnelsOutput, bool) bool) error 80 ListTunnelsPagesWithContext(aws.Context, *iotsecuretunneling.ListTunnelsInput, func(*iotsecuretunneling.ListTunnelsOutput, bool) bool, ...request.Option) error 81 82 OpenTunnel(*iotsecuretunneling.OpenTunnelInput) (*iotsecuretunneling.OpenTunnelOutput, error) 83 OpenTunnelWithContext(aws.Context, *iotsecuretunneling.OpenTunnelInput, ...request.Option) (*iotsecuretunneling.OpenTunnelOutput, error) 84 OpenTunnelRequest(*iotsecuretunneling.OpenTunnelInput) (*request.Request, *iotsecuretunneling.OpenTunnelOutput) 85 86 TagResource(*iotsecuretunneling.TagResourceInput) (*iotsecuretunneling.TagResourceOutput, error) 87 TagResourceWithContext(aws.Context, *iotsecuretunneling.TagResourceInput, ...request.Option) (*iotsecuretunneling.TagResourceOutput, error) 88 TagResourceRequest(*iotsecuretunneling.TagResourceInput) (*request.Request, *iotsecuretunneling.TagResourceOutput) 89 90 UntagResource(*iotsecuretunneling.UntagResourceInput) (*iotsecuretunneling.UntagResourceOutput, error) 91 UntagResourceWithContext(aws.Context, *iotsecuretunneling.UntagResourceInput, ...request.Option) (*iotsecuretunneling.UntagResourceOutput, error) 92 UntagResourceRequest(*iotsecuretunneling.UntagResourceInput) (*request.Request, *iotsecuretunneling.UntagResourceOutput) 93 } 94 95 var _ IoTSecureTunnelingAPI = (*iotsecuretunneling.IoTSecureTunneling)(nil)