interface.go 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. // Package iotdataplaneiface provides an interface to enable mocking the AWS IoT Data Plane service client
  3. // for testing your code.
  4. //
  5. // It is important to note that this interface will have breaking changes
  6. // when the service model is updated and adds new API operations, paginators,
  7. // and waiters.
  8. package iotdataplaneiface
  9. import (
  10. "github.com/aws/aws-sdk-go/aws"
  11. "github.com/aws/aws-sdk-go/aws/request"
  12. "github.com/aws/aws-sdk-go/service/iotdataplane"
  13. )
  14. // IoTDataPlaneAPI provides an interface to enable mocking the
  15. // iotdataplane.IoTDataPlane service client's API operation,
  16. // paginators, and waiters. This make unit testing your code that calls out
  17. // to the SDK's service client's calls easier.
  18. //
  19. // The best way to use this interface is so the SDK's service client's calls
  20. // can be stubbed out for unit testing your code with the SDK without needing
  21. // to inject custom request handlers into the SDK's request pipeline.
  22. //
  23. // // myFunc uses an SDK service client to make a request to
  24. // // AWS IoT Data Plane.
  25. // func myFunc(svc iotdataplaneiface.IoTDataPlaneAPI) bool {
  26. // // Make svc.DeleteThingShadow request
  27. // }
  28. //
  29. // func main() {
  30. // sess := session.New()
  31. // svc := iotdataplane.New(sess)
  32. //
  33. // myFunc(svc)
  34. // }
  35. //
  36. // In your _test.go file:
  37. //
  38. // // Define a mock struct to be used in your unit tests of myFunc.
  39. // type mockIoTDataPlaneClient struct {
  40. // iotdataplaneiface.IoTDataPlaneAPI
  41. // }
  42. // func (m *mockIoTDataPlaneClient) DeleteThingShadow(input *iotdataplane.DeleteThingShadowInput) (*iotdataplane.DeleteThingShadowOutput, error) {
  43. // // mock response/functionality
  44. // }
  45. //
  46. // func TestMyFunc(t *testing.T) {
  47. // // Setup Test
  48. // mockSvc := &mockIoTDataPlaneClient{}
  49. //
  50. // myfunc(mockSvc)
  51. //
  52. // // Verify myFunc's functionality
  53. // }
  54. //
  55. // It is important to note that this interface will have breaking changes
  56. // when the service model is updated and adds new API operations, paginators,
  57. // and waiters. Its suggested to use the pattern above for testing, or using
  58. // tooling to generate mocks to satisfy the interfaces.
  59. type IoTDataPlaneAPI interface {
  60. DeleteThingShadow(*iotdataplane.DeleteThingShadowInput) (*iotdataplane.DeleteThingShadowOutput, error)
  61. DeleteThingShadowWithContext(aws.Context, *iotdataplane.DeleteThingShadowInput, ...request.Option) (*iotdataplane.DeleteThingShadowOutput, error)
  62. DeleteThingShadowRequest(*iotdataplane.DeleteThingShadowInput) (*request.Request, *iotdataplane.DeleteThingShadowOutput)
  63. GetThingShadow(*iotdataplane.GetThingShadowInput) (*iotdataplane.GetThingShadowOutput, error)
  64. GetThingShadowWithContext(aws.Context, *iotdataplane.GetThingShadowInput, ...request.Option) (*iotdataplane.GetThingShadowOutput, error)
  65. GetThingShadowRequest(*iotdataplane.GetThingShadowInput) (*request.Request, *iotdataplane.GetThingShadowOutput)
  66. Publish(*iotdataplane.PublishInput) (*iotdataplane.PublishOutput, error)
  67. PublishWithContext(aws.Context, *iotdataplane.PublishInput, ...request.Option) (*iotdataplane.PublishOutput, error)
  68. PublishRequest(*iotdataplane.PublishInput) (*request.Request, *iotdataplane.PublishOutput)
  69. UpdateThingShadow(*iotdataplane.UpdateThingShadowInput) (*iotdataplane.UpdateThingShadowOutput, error)
  70. UpdateThingShadowWithContext(aws.Context, *iotdataplane.UpdateThingShadowInput, ...request.Option) (*iotdataplane.UpdateThingShadowOutput, error)
  71. UpdateThingShadowRequest(*iotdataplane.UpdateThingShadowInput) (*request.Request, *iotdataplane.UpdateThingShadowOutput)
  72. }
  73. var _ IoTDataPlaneAPI = (*iotdataplane.IoTDataPlane)(nil)