CreateElasticIps.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models"
  20. )
  21. type CreateElasticIpsRequest struct {
  22. core.JDCloudRequest
  23. /* Region ID */
  24. RegionId string `json:"regionId"`
  25. /* 购买弹性ip数量;取值范围:[1,100] */
  26. MaxCount int `json:"maxCount"`
  27. /* 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional) */
  28. ElasticIpAddress *string `json:"elasticIpAddress"`
  29. /* 弹性ip规格 */
  30. ElasticIpSpec *vpc.ElasticIpSpec `json:"elasticIpSpec"`
  31. /* 用户标签 (Optional) */
  32. UserTags []vpc.Tag `json:"userTags"`
  33. /* 弹性ip类型,取值:standard(标准公网IP),edge(边缘公网IP),默认为standard (Optional) */
  34. IpType *string `json:"ipType"`
  35. }
  36. /*
  37. * param regionId: Region ID (Required)
  38. * param maxCount: 购买弹性ip数量;取值范围:[1,100] (Required)
  39. * param elasticIpSpec: 弹性ip规格 (Required)
  40. *
  41. * @Deprecated, not compatible when mandatory parameters changed
  42. */
  43. func NewCreateElasticIpsRequest(
  44. regionId string,
  45. maxCount int,
  46. elasticIpSpec *vpc.ElasticIpSpec,
  47. ) *CreateElasticIpsRequest {
  48. return &CreateElasticIpsRequest{
  49. JDCloudRequest: core.JDCloudRequest{
  50. URL: "/regions/{regionId}/elasticIps/",
  51. Method: "POST",
  52. Header: nil,
  53. Version: "v1",
  54. },
  55. RegionId: regionId,
  56. MaxCount: maxCount,
  57. ElasticIpSpec: elasticIpSpec,
  58. }
  59. }
  60. /*
  61. * param regionId: Region ID (Required)
  62. * param maxCount: 购买弹性ip数量;取值范围:[1,100] (Required)
  63. * param elasticIpAddress: 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional)
  64. * param elasticIpSpec: 弹性ip规格 (Required)
  65. * param userTags: 用户标签 (Optional)
  66. * param ipType: 弹性ip类型,取值:standard(标准公网IP),edge(边缘公网IP),默认为standard (Optional)
  67. */
  68. func NewCreateElasticIpsRequestWithAllParams(
  69. regionId string,
  70. maxCount int,
  71. elasticIpAddress *string,
  72. elasticIpSpec *vpc.ElasticIpSpec,
  73. userTags []vpc.Tag,
  74. ipType *string,
  75. ) *CreateElasticIpsRequest {
  76. return &CreateElasticIpsRequest{
  77. JDCloudRequest: core.JDCloudRequest{
  78. URL: "/regions/{regionId}/elasticIps/",
  79. Method: "POST",
  80. Header: nil,
  81. Version: "v1",
  82. },
  83. RegionId: regionId,
  84. MaxCount: maxCount,
  85. ElasticIpAddress: elasticIpAddress,
  86. ElasticIpSpec: elasticIpSpec,
  87. UserTags: userTags,
  88. IpType: ipType,
  89. }
  90. }
  91. /* This constructor has better compatible ability when API parameters changed */
  92. func NewCreateElasticIpsRequestWithoutParam() *CreateElasticIpsRequest {
  93. return &CreateElasticIpsRequest{
  94. JDCloudRequest: core.JDCloudRequest{
  95. URL: "/regions/{regionId}/elasticIps/",
  96. Method: "POST",
  97. Header: nil,
  98. Version: "v1",
  99. },
  100. }
  101. }
  102. /* param regionId: Region ID(Required) */
  103. func (r *CreateElasticIpsRequest) SetRegionId(regionId string) {
  104. r.RegionId = regionId
  105. }
  106. /* param maxCount: 购买弹性ip数量;取值范围:[1,100](Required) */
  107. func (r *CreateElasticIpsRequest) SetMaxCount(maxCount int) {
  108. r.MaxCount = maxCount
  109. }
  110. /* param elasticIpAddress: 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空(Optional) */
  111. func (r *CreateElasticIpsRequest) SetElasticIpAddress(elasticIpAddress string) {
  112. r.ElasticIpAddress = &elasticIpAddress
  113. }
  114. /* param elasticIpSpec: 弹性ip规格(Required) */
  115. func (r *CreateElasticIpsRequest) SetElasticIpSpec(elasticIpSpec *vpc.ElasticIpSpec) {
  116. r.ElasticIpSpec = elasticIpSpec
  117. }
  118. /* param userTags: 用户标签(Optional) */
  119. func (r *CreateElasticIpsRequest) SetUserTags(userTags []vpc.Tag) {
  120. r.UserTags = userTags
  121. }
  122. /* param ipType: 弹性ip类型,取值:standard(标准公网IP),edge(边缘公网IP),默认为standard(Optional) */
  123. func (r *CreateElasticIpsRequest) SetIpType(ipType string) {
  124. r.IpType = &ipType
  125. }
  126. // GetRegionId returns path parameter 'regionId' if exist,
  127. // otherwise return empty string
  128. func (r CreateElasticIpsRequest) GetRegionId() string {
  129. return r.RegionId
  130. }
  131. type CreateElasticIpsResponse struct {
  132. RequestID string `json:"requestId"`
  133. Error core.ErrorResponse `json:"error"`
  134. Result CreateElasticIpsResult `json:"result"`
  135. }
  136. type CreateElasticIpsResult struct {
  137. ElasticIpIds []string `json:"elasticIpIds"`
  138. RequestId string `json:"requestId"`
  139. }