service.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package rds
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/client"
  6. "github.com/aws/aws-sdk-go/aws/client/metadata"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/aws/signer/v4"
  9. "github.com/aws/aws-sdk-go/private/protocol/query"
  10. )
  11. // Amazon Relational Database Service (Amazon RDS) is a web service that makes
  12. // it easier to set up, operate, and scale a relational database in the cloud.
  13. // It provides cost-efficient, resizeable capacity for an industry-standard
  14. // relational database and manages common database administration tasks, freeing
  15. // up developers to focus on what makes their applications and businesses unique.
  16. //
  17. // Amazon RDS gives you access to the capabilities of a MySQL, MariaDB, PostgreSQL,
  18. // Microsoft SQL Server, Oracle, or Amazon Aurora database server. These capabilities
  19. // mean that the code, applications, and tools you already use today with your
  20. // existing databases work with Amazon RDS without modification. Amazon RDS
  21. // automatically backs up your database and maintains the database software
  22. // that powers your DB instance. Amazon RDS is flexible: you can scale your
  23. // database instance's compute resources and storage capacity to meet your application's
  24. // demand. As with all Amazon Web Services, there are no up-front investments,
  25. // and you pay only for the resources you use.
  26. //
  27. // This interface reference for Amazon RDS contains documentation for a programming
  28. // or command line interface you can use to manage Amazon RDS. Note that Amazon
  29. // RDS is asynchronous, which means that some interfaces might require techniques
  30. // such as polling or callback functions to determine when a command has been
  31. // applied. In this reference, the parameter descriptions indicate whether a
  32. // command is applied immediately, on the next instance reboot, or during the
  33. // maintenance window. The reference structure is as follows, and we list following
  34. // some related topics from the user guide.
  35. //
  36. // Amazon RDS API Reference
  37. //
  38. // For the alphabetical list of API actions, see API Actions (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Operations.html).
  39. //
  40. // For the alphabetical list of data types, see Data Types (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Types.html).
  41. //
  42. // For a list of common query parameters, see Common Parameters (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/CommonParameters.html).
  43. //
  44. // For descriptions of the error codes, see Common Errors (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/CommonErrors.html).
  45. //
  46. // Amazon RDS User Guide
  47. //
  48. // For a summary of the Amazon RDS interfaces, see Available RDS Interfaces
  49. // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html#Welcome.Interfaces).
  50. //
  51. // For more information about how to use the Query API, see Using the Query
  52. // API (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Using_the_Query_API.html).
  53. //The service client's operations are safe to be used concurrently.
  54. // It is not safe to mutate any of the client's properties though.
  55. type RDS struct {
  56. *client.Client
  57. }
  58. // Used for custom client initialization logic
  59. var initClient func(*client.Client)
  60. // Used for custom request initialization logic
  61. var initRequest func(*request.Request)
  62. // A ServiceName is the name of the service the client will make API calls to.
  63. const ServiceName = "rds"
  64. // New creates a new instance of the RDS client with a session.
  65. // If additional configuration is needed for the client instance use the optional
  66. // aws.Config parameter to add your extra config.
  67. //
  68. // Example:
  69. // // Create a RDS client from just a session.
  70. // svc := rds.New(mySession)
  71. //
  72. // // Create a RDS client with additional configuration
  73. // svc := rds.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  74. func New(p client.ConfigProvider, cfgs ...*aws.Config) *RDS {
  75. c := p.ClientConfig(ServiceName, cfgs...)
  76. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  77. }
  78. // newClient creates, initializes and returns a new service client instance.
  79. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *RDS {
  80. svc := &RDS{
  81. Client: client.New(
  82. cfg,
  83. metadata.ClientInfo{
  84. ServiceName: ServiceName,
  85. SigningRegion: signingRegion,
  86. Endpoint: endpoint,
  87. APIVersion: "2014-10-31",
  88. },
  89. handlers,
  90. ),
  91. }
  92. // Handlers
  93. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  94. svc.Handlers.Build.PushBackNamed(query.BuildHandler)
  95. svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
  96. svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
  97. svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
  98. // Run custom client initialization if present
  99. if initClient != nil {
  100. initClient(svc.Client)
  101. }
  102. return svc
  103. }
  104. // newRequest creates a new request for a RDS operation and runs any
  105. // custom request initialization.
  106. func (c *RDS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  107. req := c.NewRequest(op, params, data)
  108. // Run custom request initialization if present
  109. if initRequest != nil {
  110. initRequest(req)
  111. }
  112. return req
  113. }