interface.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. // Package sagemakerruntimeiface provides an interface to enable mocking the Amazon SageMaker Runtime 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 sagemakerruntimeiface
  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/sagemakerruntime"
  13. )
  14. // SageMakerRuntimeAPI provides an interface to enable mocking the
  15. // sagemakerruntime.SageMakerRuntime 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. // // Amazon SageMaker Runtime.
  25. // func myFunc(svc sagemakerruntimeiface.SageMakerRuntimeAPI) bool {
  26. // // Make svc.InvokeEndpoint request
  27. // }
  28. //
  29. // func main() {
  30. // sess := session.New()
  31. // svc := sagemakerruntime.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 mockSageMakerRuntimeClient struct {
  40. // sagemakerruntimeiface.SageMakerRuntimeAPI
  41. // }
  42. // func (m *mockSageMakerRuntimeClient) InvokeEndpoint(input *sagemakerruntime.InvokeEndpointInput) (*sagemakerruntime.InvokeEndpointOutput, error) {
  43. // // mock response/functionality
  44. // }
  45. //
  46. // func TestMyFunc(t *testing.T) {
  47. // // Setup Test
  48. // mockSvc := &mockSageMakerRuntimeClient{}
  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 SageMakerRuntimeAPI interface {
  60. InvokeEndpoint(*sagemakerruntime.InvokeEndpointInput) (*sagemakerruntime.InvokeEndpointOutput, error)
  61. InvokeEndpointWithContext(aws.Context, *sagemakerruntime.InvokeEndpointInput, ...request.Option) (*sagemakerruntime.InvokeEndpointOutput, error)
  62. InvokeEndpointRequest(*sagemakerruntime.InvokeEndpointInput) (*request.Request, *sagemakerruntime.InvokeEndpointOutput)
  63. }
  64. var _ SageMakerRuntimeAPI = (*sagemakerruntime.SageMakerRuntime)(nil)