service.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package dynamodbstreams
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/client"
  6. "github.com/aws/aws-sdk-go/aws/client/metadata"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/aws/signer/v4"
  9. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  10. )
  11. // Amazon DynamoDB Streams provides API actions for accessing streams and processing
  12. // stream records. To learn more about application development with Streams,
  13. // see Capturing Table Activity with DynamoDB Streams (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html)
  14. // in the Amazon DynamoDB Developer Guide.
  15. //
  16. // The following are short descriptions of each low-level DynamoDB Streams action:
  17. //
  18. // * DescribeStream - Returns detailed information about a particular stream.
  19. //
  20. // * GetRecords - Retrieves the stream records from within a shard.
  21. //
  22. // * GetShardIterator - Returns information on how to retrieve the streams
  23. // record from a shard with a given shard ID.
  24. //
  25. // * ListStreams - Returns a list of all the streams associated with the
  26. // current AWS account and endpoint.
  27. //The service client's operations are safe to be used concurrently.
  28. // It is not safe to mutate any of the client's properties though.
  29. type DynamoDBStreams struct {
  30. *client.Client
  31. }
  32. // Used for custom client initialization logic
  33. var initClient func(*client.Client)
  34. // Used for custom request initialization logic
  35. var initRequest func(*request.Request)
  36. // A ServiceName is the name of the service the client will make API calls to.
  37. const ServiceName = "streams.dynamodb"
  38. // New creates a new instance of the DynamoDBStreams client with a session.
  39. // If additional configuration is needed for the client instance use the optional
  40. // aws.Config parameter to add your extra config.
  41. //
  42. // Example:
  43. // // Create a DynamoDBStreams client from just a session.
  44. // svc := dynamodbstreams.New(mySession)
  45. //
  46. // // Create a DynamoDBStreams client with additional configuration
  47. // svc := dynamodbstreams.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  48. func New(p client.ConfigProvider, cfgs ...*aws.Config) *DynamoDBStreams {
  49. c := p.ClientConfig(ServiceName, cfgs...)
  50. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  51. }
  52. // newClient creates, initializes and returns a new service client instance.
  53. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *DynamoDBStreams {
  54. svc := &DynamoDBStreams{
  55. Client: client.New(
  56. cfg,
  57. metadata.ClientInfo{
  58. ServiceName: ServiceName,
  59. SigningName: "dynamodb",
  60. SigningRegion: signingRegion,
  61. Endpoint: endpoint,
  62. APIVersion: "2012-08-10",
  63. JSONVersion: "1.0",
  64. TargetPrefix: "DynamoDBStreams_20120810",
  65. },
  66. handlers,
  67. ),
  68. }
  69. // Handlers
  70. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  71. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  72. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  73. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  74. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  75. // Run custom client initialization if present
  76. if initClient != nil {
  77. initClient(svc.Client)
  78. }
  79. return svc
  80. }
  81. // newRequest creates a new request for a DynamoDBStreams operation and runs any
  82. // custom request initialization.
  83. func (c *DynamoDBStreams) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  84. req := c.NewRequest(op, params, data)
  85. // Run custom request initialization if present
  86. if initRequest != nil {
  87. initRequest(req)
  88. }
  89. return req
  90. }