service.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package datapipeline
  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. // AWS Data Pipeline configures and manages a data-driven workflow called a
  12. // pipeline. AWS Data Pipeline handles the details of scheduling and ensuring
  13. // that data dependencies are met so that your application can focus on processing
  14. // the data.
  15. //
  16. // AWS Data Pipeline provides a JAR implementation of a task runner called AWS
  17. // Data Pipeline Task Runner. AWS Data Pipeline Task Runner provides logic for
  18. // common data management scenarios, such as performing database queries and
  19. // running data analysis using Amazon Elastic MapReduce (Amazon EMR). You can
  20. // use AWS Data Pipeline Task Runner as your task runner, or you can write your
  21. // own task runner to provide custom data management.
  22. //
  23. // AWS Data Pipeline implements two main sets of functionality. Use the first
  24. // set to create a pipeline and define data sources, schedules, dependencies,
  25. // and the transforms to be performed on the data. Use the second set in your
  26. // task runner application to receive the next task ready for processing. The
  27. // logic for performing the task, such as querying the data, running data analysis,
  28. // or converting the data from one format to another, is contained within the
  29. // task runner. The task runner performs the task assigned to it by the web
  30. // service, reporting progress to the web service as it does so. When the task
  31. // is done, the task runner reports the final success or failure of the task
  32. // to the web service.
  33. //The service client's operations are safe to be used concurrently.
  34. // It is not safe to mutate any of the client's properties though.
  35. type DataPipeline struct {
  36. *client.Client
  37. }
  38. // Used for custom client initialization logic
  39. var initClient func(*client.Client)
  40. // Used for custom request initialization logic
  41. var initRequest func(*request.Request)
  42. // A ServiceName is the name of the service the client will make API calls to.
  43. const ServiceName = "datapipeline"
  44. // New creates a new instance of the DataPipeline client with a session.
  45. // If additional configuration is needed for the client instance use the optional
  46. // aws.Config parameter to add your extra config.
  47. //
  48. // Example:
  49. // // Create a DataPipeline client from just a session.
  50. // svc := datapipeline.New(mySession)
  51. //
  52. // // Create a DataPipeline client with additional configuration
  53. // svc := datapipeline.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  54. func New(p client.ConfigProvider, cfgs ...*aws.Config) *DataPipeline {
  55. c := p.ClientConfig(ServiceName, cfgs...)
  56. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  57. }
  58. // newClient creates, initializes and returns a new service client instance.
  59. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *DataPipeline {
  60. svc := &DataPipeline{
  61. Client: client.New(
  62. cfg,
  63. metadata.ClientInfo{
  64. ServiceName: ServiceName,
  65. SigningRegion: signingRegion,
  66. Endpoint: endpoint,
  67. APIVersion: "2012-10-29",
  68. JSONVersion: "1.1",
  69. TargetPrefix: "DataPipeline",
  70. },
  71. handlers,
  72. ),
  73. }
  74. // Handlers
  75. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  76. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  77. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  78. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  79. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  80. // Run custom client initialization if present
  81. if initClient != nil {
  82. initClient(svc.Client)
  83. }
  84. return svc
  85. }
  86. // newRequest creates a new request for a DataPipeline operation and runs any
  87. // custom request initialization.
  88. func (c *DataPipeline) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  89. req := c.NewRequest(op, params, data)
  90. // Run custom request initialization if present
  91. if initRequest != nil {
  92. initRequest(req)
  93. }
  94. return req
  95. }