service.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package directconnect
  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 Direct Connect makes it easy to establish a dedicated network connection
  13. // from your premises to Amazon Web Services (AWS). Using AWS Direct Connect,
  14. // you can establish private connectivity between AWS and your data center,
  15. // office, or colocation environment, which in many cases can reduce your network
  16. // costs, increase bandwidth throughput, and provide a more consistent network
  17. // experience than Internet-based connections.
  18. //
  19. // The AWS Direct Connect API Reference provides descriptions, syntax, and
  20. // usage examples for each of the actions and data types for AWS Direct Connect.
  21. // Use the following links to get started using the AWS Direct Connect API Reference:
  22. //
  23. // Actions (http://docs.aws.amazon.com/directconnect/latest/APIReference/API_Operations.html):
  24. // An alphabetical list of all AWS Direct Connect actions. Data Types (http://docs.aws.amazon.com/directconnect/latest/APIReference/API_Types.html):
  25. // An alphabetical list of all AWS Direct Connect data types. Common Query
  26. // Parameters (http://docs.aws.amazon.com/directconnect/latest/APIReference/CommonParameters.html):
  27. // Parameters that all Query actions can use. Common Errors (http://docs.aws.amazon.com/directconnect/latest/APIReference/CommonErrors.html):
  28. // Client and server errors that all actions can return.
  29. type DirectConnect struct {
  30. *service.Service
  31. }
  32. // Used for custom service initialization logic
  33. var initService func(*service.Service)
  34. // Used for custom request initialization logic
  35. var initRequest func(*request.Request)
  36. // New returns a new DirectConnect client.
  37. func New(config *aws.Config) *DirectConnect {
  38. service := &service.Service{
  39. ServiceInfo: serviceinfo.ServiceInfo{
  40. Config: defaults.DefaultConfig.Merge(config),
  41. ServiceName: "directconnect",
  42. APIVersion: "2012-10-25",
  43. JSONVersion: "1.1",
  44. TargetPrefix: "OvertureService",
  45. },
  46. }
  47. service.Initialize()
  48. // Handlers
  49. service.Handlers.Sign.PushBack(v4.Sign)
  50. service.Handlers.Build.PushBack(jsonrpc.Build)
  51. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  52. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  53. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  54. // Run custom service initialization if present
  55. if initService != nil {
  56. initService(service)
  57. }
  58. return &DirectConnect{service}
  59. }
  60. // newRequest creates a new request for a DirectConnect operation and runs any
  61. // custom request initialization.
  62. func (c *DirectConnect) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  63. req := c.NewRequest(op, params, data)
  64. // Run custom request initialization if present
  65. if initRequest != nil {
  66. initRequest(req)
  67. }
  68. return req
  69. }