service.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudsearch
  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/query"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // You use the Amazon CloudSearch configuration service to create, configure,
  13. // and manage search domains. Configuration service requests are submitted using
  14. // the AWS Query protocol. AWS Query requests are HTTP or HTTPS requests submitted
  15. // via HTTP GET or POST with a query parameter named Action.
  16. //
  17. // The endpoint for configuration service requests is region-specific: cloudsearch.region.amazonaws.com.
  18. // For example, cloudsearch.us-east-1.amazonaws.com. For a current list of supported
  19. // regions and endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#cloudsearch_region"
  20. // target="_blank).
  21. type CloudSearch struct {
  22. *service.Service
  23. }
  24. // Used for custom service initialization logic
  25. var initService func(*service.Service)
  26. // Used for custom request initialization logic
  27. var initRequest func(*request.Request)
  28. // New returns a new CloudSearch client.
  29. func New(config *aws.Config) *CloudSearch {
  30. service := &service.Service{
  31. ServiceInfo: serviceinfo.ServiceInfo{
  32. Config: defaults.DefaultConfig.Merge(config),
  33. ServiceName: "cloudsearch",
  34. APIVersion: "2013-01-01",
  35. },
  36. }
  37. service.Initialize()
  38. // Handlers
  39. service.Handlers.Sign.PushBack(v4.Sign)
  40. service.Handlers.Build.PushBack(query.Build)
  41. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  42. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  43. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  44. // Run custom service initialization if present
  45. if initService != nil {
  46. initService(service)
  47. }
  48. return &CloudSearch{service}
  49. }
  50. // newRequest creates a new request for a CloudSearch operation and runs any
  51. // custom request initialization.
  52. func (c *CloudSearch) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  53. req := c.NewRequest(op, params, data)
  54. // Run custom request initialization if present
  55. if initRequest != nil {
  56. initRequest(req)
  57. }
  58. return req
  59. }