service.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package swf
  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. // The Amazon Simple Workflow Service (Amazon SWF) makes it easy to build applications
  13. // that use Amazon's cloud to coordinate work across distributed components.
  14. // In Amazon SWF, a task represents a logical unit of work that is performed
  15. // by a component of your workflow. Coordinating tasks in a workflow involves
  16. // managing intertask dependencies, scheduling, and concurrency in accordance
  17. // with the logical flow of the application.
  18. //
  19. // Amazon SWF gives you full control over implementing tasks and coordinating
  20. // them without worrying about underlying complexities such as tracking their
  21. // progress and maintaining their state.
  22. //
  23. // This documentation serves as reference only. For a broader overview of the
  24. // Amazon SWF programming model, see the Amazon SWF Developer Guide (http://docs.aws.amazon.com/amazonswf/latest/developerguide/).
  25. type SWF 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 SWF client.
  33. func New(config *aws.Config) *SWF {
  34. service := &service.Service{
  35. ServiceInfo: serviceinfo.ServiceInfo{
  36. Config: defaults.DefaultConfig.Merge(config),
  37. ServiceName: "swf",
  38. APIVersion: "2012-01-25",
  39. JSONVersion: "1.0",
  40. TargetPrefix: "SimpleWorkflowService",
  41. },
  42. }
  43. service.Initialize()
  44. // Handlers
  45. service.Handlers.Sign.PushBack(v4.Sign)
  46. service.Handlers.Build.PushBack(jsonrpc.Build)
  47. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  48. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  49. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  50. // Run custom service initialization if present
  51. if initService != nil {
  52. initService(service)
  53. }
  54. return &SWF{service}
  55. }
  56. // newRequest creates a new request for a SWF operation and runs any
  57. // custom request initialization.
  58. func (c *SWF) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  59. req := c.NewRequest(op, params, data)
  60. // Run custom request initialization if present
  61. if initRequest != nil {
  62. initRequest(req)
  63. }
  64. return req
  65. }