service.go 5.2 KB

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