github.com/aavshr/aws-sdk-go@v1.41.3/service/lexruntimev2/lexruntimev2iface/interface.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 // Package lexruntimev2iface provides an interface to enable mocking the Amazon Lex Runtime V2 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 lexruntimev2iface 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/lexruntimev2" 15 ) 16 17 // LexRuntimeV2API provides an interface to enable mocking the 18 // lexruntimev2.LexRuntimeV2 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 // // Amazon Lex Runtime V2. 28 // func myFunc(svc lexruntimev2iface.LexRuntimeV2API) bool { 29 // // Make svc.DeleteSession request 30 // } 31 // 32 // func main() { 33 // sess := session.New() 34 // svc := lexruntimev2.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 mockLexRuntimeV2Client struct { 43 // lexruntimev2iface.LexRuntimeV2API 44 // } 45 // func (m *mockLexRuntimeV2Client) DeleteSession(input *lexruntimev2.DeleteSessionInput) (*lexruntimev2.DeleteSessionOutput, error) { 46 // // mock response/functionality 47 // } 48 // 49 // func TestMyFunc(t *testing.T) { 50 // // Setup Test 51 // mockSvc := &mockLexRuntimeV2Client{} 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 LexRuntimeV2API interface { 63 DeleteSession(*lexruntimev2.DeleteSessionInput) (*lexruntimev2.DeleteSessionOutput, error) 64 DeleteSessionWithContext(aws.Context, *lexruntimev2.DeleteSessionInput, ...request.Option) (*lexruntimev2.DeleteSessionOutput, error) 65 DeleteSessionRequest(*lexruntimev2.DeleteSessionInput) (*request.Request, *lexruntimev2.DeleteSessionOutput) 66 67 GetSession(*lexruntimev2.GetSessionInput) (*lexruntimev2.GetSessionOutput, error) 68 GetSessionWithContext(aws.Context, *lexruntimev2.GetSessionInput, ...request.Option) (*lexruntimev2.GetSessionOutput, error) 69 GetSessionRequest(*lexruntimev2.GetSessionInput) (*request.Request, *lexruntimev2.GetSessionOutput) 70 71 PutSession(*lexruntimev2.PutSessionInput) (*lexruntimev2.PutSessionOutput, error) 72 PutSessionWithContext(aws.Context, *lexruntimev2.PutSessionInput, ...request.Option) (*lexruntimev2.PutSessionOutput, error) 73 PutSessionRequest(*lexruntimev2.PutSessionInput) (*request.Request, *lexruntimev2.PutSessionOutput) 74 75 RecognizeText(*lexruntimev2.RecognizeTextInput) (*lexruntimev2.RecognizeTextOutput, error) 76 RecognizeTextWithContext(aws.Context, *lexruntimev2.RecognizeTextInput, ...request.Option) (*lexruntimev2.RecognizeTextOutput, error) 77 RecognizeTextRequest(*lexruntimev2.RecognizeTextInput) (*request.Request, *lexruntimev2.RecognizeTextOutput) 78 79 RecognizeUtterance(*lexruntimev2.RecognizeUtteranceInput) (*lexruntimev2.RecognizeUtteranceOutput, error) 80 RecognizeUtteranceWithContext(aws.Context, *lexruntimev2.RecognizeUtteranceInput, ...request.Option) (*lexruntimev2.RecognizeUtteranceOutput, error) 81 RecognizeUtteranceRequest(*lexruntimev2.RecognizeUtteranceInput) (*request.Request, *lexruntimev2.RecognizeUtteranceOutput) 82 83 StartConversation(*lexruntimev2.StartConversationInput) (*lexruntimev2.StartConversationOutput, error) 84 StartConversationWithContext(aws.Context, *lexruntimev2.StartConversationInput, ...request.Option) (*lexruntimev2.StartConversationOutput, error) 85 StartConversationRequest(*lexruntimev2.StartConversationInput) (*request.Request, *lexruntimev2.StartConversationOutput) 86 } 87 88 var _ LexRuntimeV2API = (*lexruntimev2.LexRuntimeV2)(nil)