service.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package mobileanalytics
  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/restjson"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // Amazon Mobile Analytics is a service for collecting, visualizing, and understanding
  13. // app usage data at scale.
  14. type MobileAnalytics struct {
  15. *service.Service
  16. }
  17. // Used for custom service initialization logic
  18. var initService func(*service.Service)
  19. // Used for custom request initialization logic
  20. var initRequest func(*request.Request)
  21. // New returns a new MobileAnalytics client.
  22. func New(config *aws.Config) *MobileAnalytics {
  23. service := &service.Service{
  24. ServiceInfo: serviceinfo.ServiceInfo{
  25. Config: defaults.DefaultConfig.Merge(config),
  26. ServiceName: "mobileanalytics",
  27. APIVersion: "2014-06-05",
  28. },
  29. }
  30. service.Initialize()
  31. // Handlers
  32. service.Handlers.Sign.PushBack(v4.Sign)
  33. service.Handlers.Build.PushBack(restjson.Build)
  34. service.Handlers.Unmarshal.PushBack(restjson.Unmarshal)
  35. service.Handlers.UnmarshalMeta.PushBack(restjson.UnmarshalMeta)
  36. service.Handlers.UnmarshalError.PushBack(restjson.UnmarshalError)
  37. // Run custom service initialization if present
  38. if initService != nil {
  39. initService(service)
  40. }
  41. return &MobileAnalytics{service}
  42. }
  43. // newRequest creates a new request for a MobileAnalytics operation and runs any
  44. // custom request initialization.
  45. func (c *MobileAnalytics) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  46. req := c.NewRequest(op, params, data)
  47. // Run custom request initialization if present
  48. if initRequest != nil {
  49. initRequest(req)
  50. }
  51. return req
  52. }