service.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudsearchdomain
  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/restjson"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // You use the AmazonCloudSearch2013 API to upload documents to a search domain
  13. // and search those documents.
  14. //
  15. // The endpoints for submitting UploadDocuments, Search, and Suggest requests
  16. // are domain-specific. To get the endpoints for your domain, use the Amazon
  17. // CloudSearch configuration service DescribeDomains action. The domain endpoints
  18. // are also displayed on the domain dashboard in the Amazon CloudSearch console.
  19. // You submit suggest requests to the search endpoint.
  20. //
  21. // For more information, see the Amazon CloudSearch Developer Guide (http://docs.aws.amazon.com/cloudsearch/latest/developerguide).
  22. type CloudSearchDomain struct {
  23. *service.Service
  24. }
  25. // Used for custom service initialization logic
  26. var initService func(*service.Service)
  27. // Used for custom request initialization logic
  28. var initRequest func(*request.Request)
  29. // New returns a new CloudSearchDomain client.
  30. func New(config *aws.Config) *CloudSearchDomain {
  31. service := &service.Service{
  32. ServiceInfo: serviceinfo.ServiceInfo{
  33. Config: defaults.DefaultConfig.Merge(config),
  34. ServiceName: "cloudsearchdomain",
  35. SigningName: "cloudsearch",
  36. APIVersion: "2013-01-01",
  37. },
  38. }
  39. service.Initialize()
  40. // Handlers
  41. service.Handlers.Sign.PushBack(v4.Sign)
  42. service.Handlers.Build.PushBack(restjson.Build)
  43. service.Handlers.Unmarshal.PushBack(restjson.Unmarshal)
  44. service.Handlers.UnmarshalMeta.PushBack(restjson.UnmarshalMeta)
  45. service.Handlers.UnmarshalError.PushBack(restjson.UnmarshalError)
  46. // Run custom service initialization if present
  47. if initService != nil {
  48. initService(service)
  49. }
  50. return &CloudSearchDomain{service}
  51. }
  52. // newRequest creates a new request for a CloudSearchDomain operation and runs any
  53. // custom request initialization.
  54. func (c *CloudSearchDomain) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  55. req := c.NewRequest(op, params, data)
  56. // Run custom request initialization if present
  57. if initRequest != nil {
  58. initRequest(req)
  59. }
  60. return req
  61. }