service.go 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/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/jsonrpc"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // AWS Data Pipeline configures and manages a data-driven workflow called a
  13. // pipeline. AWS Data Pipeline handles the details of scheduling and ensuring
  14. // that data dependencies are met so that your application can focus on processing
  15. // the data.
  16. //
  17. // AWS Data Pipeline provides a JAR implementation of a task runner called
  18. // AWS Data Pipeline Task Runner. AWS Data Pipeline Task Runner provides logic
  19. // for common data management scenarios, such as performing database queries
  20. // and running data analysis using Amazon Elastic MapReduce (Amazon EMR). You
  21. // can use AWS Data Pipeline Task Runner as your task runner, or you can write
  22. // your own task runner to provide custom data management.
  23. //
  24. // AWS Data Pipeline implements two main sets of functionality. Use the first
  25. // set to create a pipeline and define data sources, schedules, dependencies,
  26. // and the transforms to be performed on the data. Use the second set in your
  27. // task runner application to receive the next task ready for processing. The
  28. // logic for performing the task, such as querying the data, running data analysis,
  29. // or converting the data from one format to another, is contained within the
  30. // task runner. The task runner performs the task assigned to it by the web
  31. // service, reporting progress to the web service as it does so. When the task
  32. // is done, the task runner reports the final success or failure of the task
  33. // to the web service.
  34. type DataPipeline struct {
  35. *service.Service
  36. }
  37. // Used for custom service initialization logic
  38. var initService func(*service.Service)
  39. // Used for custom request initialization logic
  40. var initRequest func(*request.Request)
  41. // New returns a new DataPipeline client.
  42. func New(config *aws.Config) *DataPipeline {
  43. service := &service.Service{
  44. ServiceInfo: serviceinfo.ServiceInfo{
  45. Config: defaults.DefaultConfig.Merge(config),
  46. ServiceName: "datapipeline",
  47. APIVersion: "2012-10-29",
  48. JSONVersion: "1.1",
  49. TargetPrefix: "DataPipeline",
  50. },
  51. }
  52. service.Initialize()
  53. // Handlers
  54. service.Handlers.Sign.PushBack(v4.Sign)
  55. service.Handlers.Build.PushBack(jsonrpc.Build)
  56. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  57. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  58. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  59. // Run custom service initialization if present
  60. if initService != nil {
  61. initService(service)
  62. }
  63. return &DataPipeline{service}
  64. }
  65. // newRequest creates a new request for a DataPipeline operation and runs any
  66. // custom request initialization.
  67. func (c *DataPipeline) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  68. req := c.NewRequest(op, params, data)
  69. // Run custom request initialization if present
  70. if initRequest != nil {
  71. initRequest(req)
  72. }
  73. return req
  74. }