service.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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
  17. // action:
  18. //
  19. // DescribeStream - Returns detailed information about a particular stream.
  20. //
  21. // GetRecords - Retrieves the stream records from within a shard.
  22. //
  23. // GetShardIterator - Returns information on how to retrieve the streams
  24. // record from a shard with a given shard ID.
  25. //
  26. // ListStreams - Returns a list of all the streams associated with the current
  27. // AWS account and endpoint.
  28. //The service client's operations are safe to be used concurrently.
  29. // It is not safe to mutate any of the client's properties though.
  30. type DynamoDBStreams struct {
  31. *client.Client
  32. }
  33. // Used for custom client initialization logic
  34. var initClient func(*client.Client)
  35. // Used for custom request initialization logic
  36. var initRequest func(*request.Request)
  37. // A ServiceName is the name of the service the client will make API calls to.
  38. const ServiceName = "streams.dynamodb"
  39. // New creates a new instance of the DynamoDBStreams client with a session.
  40. // If additional configuration is needed for the client instance use the optional
  41. // aws.Config parameter to add your extra config.
  42. //
  43. // Example:
  44. // // Create a DynamoDBStreams client from just a session.
  45. // svc := dynamodbstreams.New(mySession)
  46. //
  47. // // Create a DynamoDBStreams client with additional configuration
  48. // svc := dynamodbstreams.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  49. func New(p client.ConfigProvider, cfgs ...*aws.Config) *DynamoDBStreams {
  50. c := p.ClientConfig(ServiceName, cfgs...)
  51. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  52. }
  53. // newClient creates, initializes and returns a new service client instance.
  54. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *DynamoDBStreams {
  55. svc := &DynamoDBStreams{
  56. Client: client.New(
  57. cfg,
  58. metadata.ClientInfo{
  59. ServiceName: ServiceName,
  60. SigningName: "dynamodb",
  61. SigningRegion: signingRegion,
  62. Endpoint: endpoint,
  63. APIVersion: "2012-08-10",
  64. JSONVersion: "1.0",
  65. TargetPrefix: "DynamoDBStreams_20120810",
  66. },
  67. handlers,
  68. ),
  69. }
  70. // Handlers
  71. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  72. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  73. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  74. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  75. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  76. // Run custom client initialization if present
  77. if initClient != nil {
  78. initClient(svc.Client)
  79. }
  80. return svc
  81. }
  82. // newRequest creates a new request for a DynamoDBStreams operation and runs any
  83. // custom request initialization.
  84. func (c *DynamoDBStreams) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  85. req := c.NewRequest(op, params, data)
  86. // Run custom request initialization if present
  87. if initRequest != nil {
  88. initRequest(req)
  89. }
  90. return req
  91. }