AlterTableWithOnlineDDL.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. // Copyright 2018 JDCLOUD.COM
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. // NOTE: This class is auto generated by the jdcloud code generator program.
  16. package apis
  17. import (
  18. "github.com/jdcloud-api/jdcloud-sdk-go/core"
  19. )
  20. type AlterTableWithOnlineDDLRequest struct {
  21. core.JDCloudRequest
  22. /* 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) */
  23. RegionId string `json:"regionId"`
  24. /* RDS 实例ID,唯一标识一个RDS实例 */
  25. InstanceId string `json:"instanceId"`
  26. /* DDL命令修改的库名 */
  27. Database string `json:"database"`
  28. /* DDL命令修改的表名 */
  29. Table string `json:"table"`
  30. /* 需要执行的的DDL命令 */
  31. Command string `json:"command"`
  32. }
  33. /*
  34. * param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) (Required)
  35. * param instanceId: RDS 实例ID,唯一标识一个RDS实例 (Required)
  36. * param database: DDL命令修改的库名 (Required)
  37. * param table: DDL命令修改的表名 (Required)
  38. * param command: 需要执行的的DDL命令 (Required)
  39. *
  40. * @Deprecated, not compatible when mandatory parameters changed
  41. */
  42. func NewAlterTableWithOnlineDDLRequest(
  43. regionId string,
  44. instanceId string,
  45. database string,
  46. table string,
  47. command string,
  48. ) *AlterTableWithOnlineDDLRequest {
  49. return &AlterTableWithOnlineDDLRequest{
  50. JDCloudRequest: core.JDCloudRequest{
  51. URL: "/regions/{regionId}/instances/{instanceId}:alterTableWithOnlineDDL",
  52. Method: "POST",
  53. Header: nil,
  54. Version: "v1",
  55. },
  56. RegionId: regionId,
  57. InstanceId: instanceId,
  58. Database: database,
  59. Table: table,
  60. Command: command,
  61. }
  62. }
  63. /*
  64. * param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) (Required)
  65. * param instanceId: RDS 实例ID,唯一标识一个RDS实例 (Required)
  66. * param database: DDL命令修改的库名 (Required)
  67. * param table: DDL命令修改的表名 (Required)
  68. * param command: 需要执行的的DDL命令 (Required)
  69. */
  70. func NewAlterTableWithOnlineDDLRequestWithAllParams(
  71. regionId string,
  72. instanceId string,
  73. database string,
  74. table string,
  75. command string,
  76. ) *AlterTableWithOnlineDDLRequest {
  77. return &AlterTableWithOnlineDDLRequest{
  78. JDCloudRequest: core.JDCloudRequest{
  79. URL: "/regions/{regionId}/instances/{instanceId}:alterTableWithOnlineDDL",
  80. Method: "POST",
  81. Header: nil,
  82. Version: "v1",
  83. },
  84. RegionId: regionId,
  85. InstanceId: instanceId,
  86. Database: database,
  87. Table: table,
  88. Command: command,
  89. }
  90. }
  91. /* This constructor has better compatible ability when API parameters changed */
  92. func NewAlterTableWithOnlineDDLRequestWithoutParam() *AlterTableWithOnlineDDLRequest {
  93. return &AlterTableWithOnlineDDLRequest{
  94. JDCloudRequest: core.JDCloudRequest{
  95. URL: "/regions/{regionId}/instances/{instanceId}:alterTableWithOnlineDDL",
  96. Method: "POST",
  97. Header: nil,
  98. Version: "v1",
  99. },
  100. }
  101. }
  102. /* param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md)(Required) */
  103. func (r *AlterTableWithOnlineDDLRequest) SetRegionId(regionId string) {
  104. r.RegionId = regionId
  105. }
  106. /* param instanceId: RDS 实例ID,唯一标识一个RDS实例(Required) */
  107. func (r *AlterTableWithOnlineDDLRequest) SetInstanceId(instanceId string) {
  108. r.InstanceId = instanceId
  109. }
  110. /* param database: DDL命令修改的库名(Required) */
  111. func (r *AlterTableWithOnlineDDLRequest) SetDatabase(database string) {
  112. r.Database = database
  113. }
  114. /* param table: DDL命令修改的表名(Required) */
  115. func (r *AlterTableWithOnlineDDLRequest) SetTable(table string) {
  116. r.Table = table
  117. }
  118. /* param command: 需要执行的的DDL命令(Required) */
  119. func (r *AlterTableWithOnlineDDLRequest) SetCommand(command string) {
  120. r.Command = command
  121. }
  122. // GetRegionId returns path parameter 'regionId' if exist,
  123. // otherwise return empty string
  124. func (r AlterTableWithOnlineDDLRequest) GetRegionId() string {
  125. return r.RegionId
  126. }
  127. type AlterTableWithOnlineDDLResponse struct {
  128. RequestID string `json:"requestId"`
  129. Error core.ErrorResponse `json:"error"`
  130. Result AlterTableWithOnlineDDLResult `json:"result"`
  131. }
  132. type AlterTableWithOnlineDDLResult struct {
  133. }