CreateVpcPeering.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 CreateVpcPeeringRequest struct {
  22. core.JDCloudRequest
  23. /* Region ID */
  24. RegionId string `json:"regionId"`
  25. /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 */
  26. VpcPeeringName string `json:"vpcPeeringName"`
  27. /* VpcPeering本端Vpc的Id */
  28. VpcId string `json:"vpcId"`
  29. /* VpcPeering对端Vpc的Id */
  30. RemoteVpcId string `json:"remoteVpcId"`
  31. /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */
  32. Description *string `json:"description"`
  33. }
  34. /*
  35. * param regionId: Region ID (Required)
  36. * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Required)
  37. * param vpcId: VpcPeering本端Vpc的Id (Required)
  38. * param remoteVpcId: VpcPeering对端Vpc的Id (Required)
  39. *
  40. * @Deprecated, not compatible when mandatory parameters changed
  41. */
  42. func NewCreateVpcPeeringRequest(
  43. regionId string,
  44. vpcPeeringName string,
  45. vpcId string,
  46. remoteVpcId string,
  47. ) *CreateVpcPeeringRequest {
  48. return &CreateVpcPeeringRequest{
  49. JDCloudRequest: core.JDCloudRequest{
  50. URL: "/regions/{regionId}/vpcPeerings/",
  51. Method: "POST",
  52. Header: nil,
  53. Version: "v1",
  54. },
  55. RegionId: regionId,
  56. VpcPeeringName: vpcPeeringName,
  57. VpcId: vpcId,
  58. RemoteVpcId: remoteVpcId,
  59. }
  60. }
  61. /*
  62. * param regionId: Region ID (Required)
  63. * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Required)
  64. * param vpcId: VpcPeering本端Vpc的Id (Required)
  65. * param remoteVpcId: VpcPeering对端Vpc的Id (Required)
  66. * param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional)
  67. */
  68. func NewCreateVpcPeeringRequestWithAllParams(
  69. regionId string,
  70. vpcPeeringName string,
  71. vpcId string,
  72. remoteVpcId string,
  73. description *string,
  74. ) *CreateVpcPeeringRequest {
  75. return &CreateVpcPeeringRequest{
  76. JDCloudRequest: core.JDCloudRequest{
  77. URL: "/regions/{regionId}/vpcPeerings/",
  78. Method: "POST",
  79. Header: nil,
  80. Version: "v1",
  81. },
  82. RegionId: regionId,
  83. VpcPeeringName: vpcPeeringName,
  84. VpcId: vpcId,
  85. RemoteVpcId: remoteVpcId,
  86. Description: description,
  87. }
  88. }
  89. /* This constructor has better compatible ability when API parameters changed */
  90. func NewCreateVpcPeeringRequestWithoutParam() *CreateVpcPeeringRequest {
  91. return &CreateVpcPeeringRequest{
  92. JDCloudRequest: core.JDCloudRequest{
  93. URL: "/regions/{regionId}/vpcPeerings/",
  94. Method: "POST",
  95. Header: nil,
  96. Version: "v1",
  97. },
  98. }
  99. }
  100. /* param regionId: Region ID(Required) */
  101. func (r *CreateVpcPeeringRequest) SetRegionId(regionId string) {
  102. r.RegionId = regionId
  103. }
  104. /* param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Required) */
  105. func (r *CreateVpcPeeringRequest) SetVpcPeeringName(vpcPeeringName string) {
  106. r.VpcPeeringName = vpcPeeringName
  107. }
  108. /* param vpcId: VpcPeering本端Vpc的Id(Required) */
  109. func (r *CreateVpcPeeringRequest) SetVpcId(vpcId string) {
  110. r.VpcId = vpcId
  111. }
  112. /* param remoteVpcId: VpcPeering对端Vpc的Id(Required) */
  113. func (r *CreateVpcPeeringRequest) SetRemoteVpcId(remoteVpcId string) {
  114. r.RemoteVpcId = remoteVpcId
  115. }
  116. /* param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符(Optional) */
  117. func (r *CreateVpcPeeringRequest) SetDescription(description string) {
  118. r.Description = &description
  119. }
  120. // GetRegionId returns path parameter 'regionId' if exist,
  121. // otherwise return empty string
  122. func (r CreateVpcPeeringRequest) GetRegionId() string {
  123. return r.RegionId
  124. }
  125. type CreateVpcPeeringResponse struct {
  126. RequestID string `json:"requestId"`
  127. Error core.ErrorResponse `json:"error"`
  128. Result CreateVpcPeeringResult `json:"result"`
  129. }
  130. type CreateVpcPeeringResult struct {
  131. VpcPeering vpc.VpcPeering `json:"vpcPeering"`
  132. }