service.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package ses
  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/query"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // This is the API Reference for Amazon Simple Email Service (Amazon SES). This
  13. // documentation is intended to be used in conjunction with the Amazon SES Developer
  14. // Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html).
  15. //
  16. // For a list of Amazon SES endpoints to use in service requests, see Regions
  17. // and Amazon SES (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html)
  18. // in the Amazon SES Developer Guide.
  19. type SES struct {
  20. *service.Service
  21. }
  22. // Used for custom service initialization logic
  23. var initService func(*service.Service)
  24. // Used for custom request initialization logic
  25. var initRequest func(*request.Request)
  26. // New returns a new SES client.
  27. func New(config *aws.Config) *SES {
  28. service := &service.Service{
  29. ServiceInfo: serviceinfo.ServiceInfo{
  30. Config: defaults.DefaultConfig.Merge(config),
  31. ServiceName: "email",
  32. SigningName: "ses",
  33. APIVersion: "2010-12-01",
  34. },
  35. }
  36. service.Initialize()
  37. // Handlers
  38. service.Handlers.Sign.PushBack(v4.Sign)
  39. service.Handlers.Build.PushBack(query.Build)
  40. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  41. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  42. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  43. // Run custom service initialization if present
  44. if initService != nil {
  45. initService(service)
  46. }
  47. return &SES{service}
  48. }
  49. // newRequest creates a new request for a SES operation and runs any
  50. // custom request initialization.
  51. func (c *SES) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  52. req := c.NewRequest(op, params, data)
  53. // Run custom request initialization if present
  54. if initRequest != nil {
  55. initRequest(req)
  56. }
  57. return req
  58. }