github.com/aavshr/aws-sdk-go@v1.41.3/service/timestreamwrite/timestreamwriteiface/interface.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 // Package timestreamwriteiface provides an interface to enable mocking the Amazon Timestream Write 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 timestreamwriteiface 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/timestreamwrite" 15 ) 16 17 // TimestreamWriteAPI provides an interface to enable mocking the 18 // timestreamwrite.TimestreamWrite 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 Timestream Write. 28 // func myFunc(svc timestreamwriteiface.TimestreamWriteAPI) bool { 29 // // Make svc.CreateDatabase request 30 // } 31 // 32 // func main() { 33 // sess := session.New() 34 // svc := timestreamwrite.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 mockTimestreamWriteClient struct { 43 // timestreamwriteiface.TimestreamWriteAPI 44 // } 45 // func (m *mockTimestreamWriteClient) CreateDatabase(input *timestreamwrite.CreateDatabaseInput) (*timestreamwrite.CreateDatabaseOutput, error) { 46 // // mock response/functionality 47 // } 48 // 49 // func TestMyFunc(t *testing.T) { 50 // // Setup Test 51 // mockSvc := &mockTimestreamWriteClient{} 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 TimestreamWriteAPI interface { 63 CreateDatabase(*timestreamwrite.CreateDatabaseInput) (*timestreamwrite.CreateDatabaseOutput, error) 64 CreateDatabaseWithContext(aws.Context, *timestreamwrite.CreateDatabaseInput, ...request.Option) (*timestreamwrite.CreateDatabaseOutput, error) 65 CreateDatabaseRequest(*timestreamwrite.CreateDatabaseInput) (*request.Request, *timestreamwrite.CreateDatabaseOutput) 66 67 CreateTable(*timestreamwrite.CreateTableInput) (*timestreamwrite.CreateTableOutput, error) 68 CreateTableWithContext(aws.Context, *timestreamwrite.CreateTableInput, ...request.Option) (*timestreamwrite.CreateTableOutput, error) 69 CreateTableRequest(*timestreamwrite.CreateTableInput) (*request.Request, *timestreamwrite.CreateTableOutput) 70 71 DeleteDatabase(*timestreamwrite.DeleteDatabaseInput) (*timestreamwrite.DeleteDatabaseOutput, error) 72 DeleteDatabaseWithContext(aws.Context, *timestreamwrite.DeleteDatabaseInput, ...request.Option) (*timestreamwrite.DeleteDatabaseOutput, error) 73 DeleteDatabaseRequest(*timestreamwrite.DeleteDatabaseInput) (*request.Request, *timestreamwrite.DeleteDatabaseOutput) 74 75 DeleteTable(*timestreamwrite.DeleteTableInput) (*timestreamwrite.DeleteTableOutput, error) 76 DeleteTableWithContext(aws.Context, *timestreamwrite.DeleteTableInput, ...request.Option) (*timestreamwrite.DeleteTableOutput, error) 77 DeleteTableRequest(*timestreamwrite.DeleteTableInput) (*request.Request, *timestreamwrite.DeleteTableOutput) 78 79 DescribeDatabase(*timestreamwrite.DescribeDatabaseInput) (*timestreamwrite.DescribeDatabaseOutput, error) 80 DescribeDatabaseWithContext(aws.Context, *timestreamwrite.DescribeDatabaseInput, ...request.Option) (*timestreamwrite.DescribeDatabaseOutput, error) 81 DescribeDatabaseRequest(*timestreamwrite.DescribeDatabaseInput) (*request.Request, *timestreamwrite.DescribeDatabaseOutput) 82 83 DescribeEndpoints(*timestreamwrite.DescribeEndpointsInput) (*timestreamwrite.DescribeEndpointsOutput, error) 84 DescribeEndpointsWithContext(aws.Context, *timestreamwrite.DescribeEndpointsInput, ...request.Option) (*timestreamwrite.DescribeEndpointsOutput, error) 85 DescribeEndpointsRequest(*timestreamwrite.DescribeEndpointsInput) (*request.Request, *timestreamwrite.DescribeEndpointsOutput) 86 87 DescribeTable(*timestreamwrite.DescribeTableInput) (*timestreamwrite.DescribeTableOutput, error) 88 DescribeTableWithContext(aws.Context, *timestreamwrite.DescribeTableInput, ...request.Option) (*timestreamwrite.DescribeTableOutput, error) 89 DescribeTableRequest(*timestreamwrite.DescribeTableInput) (*request.Request, *timestreamwrite.DescribeTableOutput) 90 91 ListDatabases(*timestreamwrite.ListDatabasesInput) (*timestreamwrite.ListDatabasesOutput, error) 92 ListDatabasesWithContext(aws.Context, *timestreamwrite.ListDatabasesInput, ...request.Option) (*timestreamwrite.ListDatabasesOutput, error) 93 ListDatabasesRequest(*timestreamwrite.ListDatabasesInput) (*request.Request, *timestreamwrite.ListDatabasesOutput) 94 95 ListDatabasesPages(*timestreamwrite.ListDatabasesInput, func(*timestreamwrite.ListDatabasesOutput, bool) bool) error 96 ListDatabasesPagesWithContext(aws.Context, *timestreamwrite.ListDatabasesInput, func(*timestreamwrite.ListDatabasesOutput, bool) bool, ...request.Option) error 97 98 ListTables(*timestreamwrite.ListTablesInput) (*timestreamwrite.ListTablesOutput, error) 99 ListTablesWithContext(aws.Context, *timestreamwrite.ListTablesInput, ...request.Option) (*timestreamwrite.ListTablesOutput, error) 100 ListTablesRequest(*timestreamwrite.ListTablesInput) (*request.Request, *timestreamwrite.ListTablesOutput) 101 102 ListTablesPages(*timestreamwrite.ListTablesInput, func(*timestreamwrite.ListTablesOutput, bool) bool) error 103 ListTablesPagesWithContext(aws.Context, *timestreamwrite.ListTablesInput, func(*timestreamwrite.ListTablesOutput, bool) bool, ...request.Option) error 104 105 ListTagsForResource(*timestreamwrite.ListTagsForResourceInput) (*timestreamwrite.ListTagsForResourceOutput, error) 106 ListTagsForResourceWithContext(aws.Context, *timestreamwrite.ListTagsForResourceInput, ...request.Option) (*timestreamwrite.ListTagsForResourceOutput, error) 107 ListTagsForResourceRequest(*timestreamwrite.ListTagsForResourceInput) (*request.Request, *timestreamwrite.ListTagsForResourceOutput) 108 109 TagResource(*timestreamwrite.TagResourceInput) (*timestreamwrite.TagResourceOutput, error) 110 TagResourceWithContext(aws.Context, *timestreamwrite.TagResourceInput, ...request.Option) (*timestreamwrite.TagResourceOutput, error) 111 TagResourceRequest(*timestreamwrite.TagResourceInput) (*request.Request, *timestreamwrite.TagResourceOutput) 112 113 UntagResource(*timestreamwrite.UntagResourceInput) (*timestreamwrite.UntagResourceOutput, error) 114 UntagResourceWithContext(aws.Context, *timestreamwrite.UntagResourceInput, ...request.Option) (*timestreamwrite.UntagResourceOutput, error) 115 UntagResourceRequest(*timestreamwrite.UntagResourceInput) (*request.Request, *timestreamwrite.UntagResourceOutput) 116 117 UpdateDatabase(*timestreamwrite.UpdateDatabaseInput) (*timestreamwrite.UpdateDatabaseOutput, error) 118 UpdateDatabaseWithContext(aws.Context, *timestreamwrite.UpdateDatabaseInput, ...request.Option) (*timestreamwrite.UpdateDatabaseOutput, error) 119 UpdateDatabaseRequest(*timestreamwrite.UpdateDatabaseInput) (*request.Request, *timestreamwrite.UpdateDatabaseOutput) 120 121 UpdateTable(*timestreamwrite.UpdateTableInput) (*timestreamwrite.UpdateTableOutput, error) 122 UpdateTableWithContext(aws.Context, *timestreamwrite.UpdateTableInput, ...request.Option) (*timestreamwrite.UpdateTableOutput, error) 123 UpdateTableRequest(*timestreamwrite.UpdateTableInput) (*request.Request, *timestreamwrite.UpdateTableOutput) 124 125 WriteRecords(*timestreamwrite.WriteRecordsInput) (*timestreamwrite.WriteRecordsOutput, error) 126 WriteRecordsWithContext(aws.Context, *timestreamwrite.WriteRecordsInput, ...request.Option) (*timestreamwrite.WriteRecordsOutput, error) 127 WriteRecordsRequest(*timestreamwrite.WriteRecordsInput) (*request.Request, *timestreamwrite.WriteRecordsOutput) 128 } 129 130 var _ TimestreamWriteAPI = (*timestreamwrite.TimestreamWrite)(nil)