service.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package sns
  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. // Amazon Simple Notification Service (Amazon SNS) is a web service that enables
  13. // you to build distributed web-enabled applications. Applications can use Amazon
  14. // SNS to easily push real-time notification messages to interested subscribers
  15. // over multiple delivery protocols. For more information about this product
  16. // see http://aws.amazon.com/sns (http://aws.amazon.com/sns/). For detailed
  17. // information about Amazon SNS features and their associated API calls, see
  18. // the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/).
  19. //
  20. // We also provide SDKs that enable you to access Amazon SNS from your preferred
  21. // programming language. The SDKs contain functionality that automatically takes
  22. // care of tasks such as: cryptographically signing your service requests, retrying
  23. // requests, and handling error responses. For a list of available SDKs, go
  24. // to Tools for Amazon Web Services (http://aws.amazon.com/tools/).
  25. type SNS struct {
  26. *service.Service
  27. }
  28. // Used for custom service initialization logic
  29. var initService func(*service.Service)
  30. // Used for custom request initialization logic
  31. var initRequest func(*request.Request)
  32. // New returns a new SNS client.
  33. func New(config *aws.Config) *SNS {
  34. service := &service.Service{
  35. ServiceInfo: serviceinfo.ServiceInfo{
  36. Config: defaults.DefaultConfig.Merge(config),
  37. ServiceName: "sns",
  38. APIVersion: "2010-03-31",
  39. },
  40. }
  41. service.Initialize()
  42. // Handlers
  43. service.Handlers.Sign.PushBack(v4.Sign)
  44. service.Handlers.Build.PushBack(query.Build)
  45. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  46. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  47. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  48. // Run custom service initialization if present
  49. if initService != nil {
  50. initService(service)
  51. }
  52. return &SNS{service}
  53. }
  54. // newRequest creates a new request for a SNS operation and runs any
  55. // custom request initialization.
  56. func (c *SNS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  57. req := c.NewRequest(op, params, data)
  58. // Run custom request initialization if present
  59. if initRequest != nil {
  60. initRequest(req)
  61. }
  62. return req
  63. }