ModifySubnet.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 ModifySubnetRequest struct {
  21. core.JDCloudRequest
  22. /* Region ID */
  23. RegionId string `json:"regionId"`
  24. /* Subnet ID */
  25. SubnetId string `json:"subnetId"`
  26. /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */
  27. SubnetName *string `json:"subnetName"`
  28. /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */
  29. Description *string `json:"description"`
  30. }
  31. /*
  32. * param regionId: Region ID (Required)
  33. * param subnetId: Subnet ID (Required)
  34. *
  35. * @Deprecated, not compatible when mandatory parameters changed
  36. */
  37. func NewModifySubnetRequest(
  38. regionId string,
  39. subnetId string,
  40. ) *ModifySubnetRequest {
  41. return &ModifySubnetRequest{
  42. JDCloudRequest: core.JDCloudRequest{
  43. URL: "/regions/{regionId}/subnets/{subnetId}",
  44. Method: "PATCH",
  45. Header: nil,
  46. Version: "v1",
  47. },
  48. RegionId: regionId,
  49. SubnetId: subnetId,
  50. }
  51. }
  52. /*
  53. * param regionId: Region ID (Required)
  54. * param subnetId: Subnet ID (Required)
  55. * param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional)
  56. * param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional)
  57. */
  58. func NewModifySubnetRequestWithAllParams(
  59. regionId string,
  60. subnetId string,
  61. subnetName *string,
  62. description *string,
  63. ) *ModifySubnetRequest {
  64. return &ModifySubnetRequest{
  65. JDCloudRequest: core.JDCloudRequest{
  66. URL: "/regions/{regionId}/subnets/{subnetId}",
  67. Method: "PATCH",
  68. Header: nil,
  69. Version: "v1",
  70. },
  71. RegionId: regionId,
  72. SubnetId: subnetId,
  73. SubnetName: subnetName,
  74. Description: description,
  75. }
  76. }
  77. /* This constructor has better compatible ability when API parameters changed */
  78. func NewModifySubnetRequestWithoutParam() *ModifySubnetRequest {
  79. return &ModifySubnetRequest{
  80. JDCloudRequest: core.JDCloudRequest{
  81. URL: "/regions/{regionId}/subnets/{subnetId}",
  82. Method: "PATCH",
  83. Header: nil,
  84. Version: "v1",
  85. },
  86. }
  87. }
  88. /* param regionId: Region ID(Required) */
  89. func (r *ModifySubnetRequest) SetRegionId(regionId string) {
  90. r.RegionId = regionId
  91. }
  92. /* param subnetId: Subnet ID(Required) */
  93. func (r *ModifySubnetRequest) SetSubnetId(subnetId string) {
  94. r.SubnetId = subnetId
  95. }
  96. /* param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Optional) */
  97. func (r *ModifySubnetRequest) SetSubnetName(subnetName string) {
  98. r.SubnetName = &subnetName
  99. }
  100. /* param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */
  101. func (r *ModifySubnetRequest) SetDescription(description string) {
  102. r.Description = &description
  103. }
  104. // GetRegionId returns path parameter 'regionId' if exist,
  105. // otherwise return empty string
  106. func (r ModifySubnetRequest) GetRegionId() string {
  107. return r.RegionId
  108. }
  109. type ModifySubnetResponse struct {
  110. RequestID string `json:"requestId"`
  111. Error core.ErrorResponse `json:"error"`
  112. Result ModifySubnetResult `json:"result"`
  113. }
  114. type ModifySubnetResult struct {
  115. }