service.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package devicefarm
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/defaults"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. "github.com/aws/aws-sdk-go/aws/service"
  8. "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
  9. "github.com/aws/aws-sdk-go/internal/protocol/jsonrpc"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // AWS Device Farm is a service that enables mobile app developers to test Android,
  13. // iOS, and Fire OS apps on physical phones, tablets, and other devices in the
  14. // cloud.
  15. type DeviceFarm struct {
  16. *service.Service
  17. }
  18. // Used for custom service initialization logic
  19. var initService func(*service.Service)
  20. // Used for custom request initialization logic
  21. var initRequest func(*request.Request)
  22. // New returns a new DeviceFarm client.
  23. func New(config *aws.Config) *DeviceFarm {
  24. service := &service.Service{
  25. ServiceInfo: serviceinfo.ServiceInfo{
  26. Config: defaults.DefaultConfig.Merge(config),
  27. ServiceName: "devicefarm",
  28. APIVersion: "2015-06-23",
  29. JSONVersion: "1.1",
  30. TargetPrefix: "DeviceFarm_20150623",
  31. },
  32. }
  33. service.Initialize()
  34. // Handlers
  35. service.Handlers.Sign.PushBack(v4.Sign)
  36. service.Handlers.Build.PushBack(jsonrpc.Build)
  37. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  38. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  39. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  40. // Run custom service initialization if present
  41. if initService != nil {
  42. initService(service)
  43. }
  44. return &DeviceFarm{service}
  45. }
  46. // newRequest creates a new request for a DeviceFarm operation and runs any
  47. // custom request initialization.
  48. func (c *DeviceFarm) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  49. req := c.NewRequest(op, params, data)
  50. // Run custom request initialization if present
  51. if initRequest != nil {
  52. initRequest(req)
  53. }
  54. return req
  55. }