DescribeDomains.go raw

   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  
  17  package apis
  18  
  19  import (
  20  	"github.com/go-acme/jdcloud-sdk-go/core"
  21  	domainservice "github.com/go-acme/jdcloud-sdk-go/services/domainservice/models"
  22  )
  23  
  24  type DescribeDomainsRequest struct {
  25  	core.JDCloudRequest
  26  
  27  	/* 实例所属的地域ID  */
  28  	RegionId string `json:"regionId"`
  29  
  30  	/* 分页查询时查询的每页的序号,起始值为1,默认为1  */
  31  	PageNumber int `json:"pageNumber"`
  32  
  33  	/* 分页查询时设置的每页行数,默认为10  */
  34  	PageSize int `json:"pageSize"`
  35  
  36  	/* 关键字,按照”%domainName%”模式匹配主域名 (Optional) */
  37  	DomainName *string `json:"domainName"`
  38  
  39  	/* 域名ID。不为0时,只查此domainId的域名 (Optional) */
  40  	DomainId *int `json:"domainId"`
  41  }
  42  
  43  /*
  44   * param regionId: 实例所属的地域ID (Required)
  45   * param pageNumber: 分页查询时查询的每页的序号,起始值为1,默认为1 (Required)
  46   * param pageSize: 分页查询时设置的每页行数,默认为10 (Required)
  47   *
  48   * @Deprecated, not compatible when mandatory parameters changed
  49   */
  50  func NewDescribeDomainsRequest(
  51  	regionId string,
  52  	pageNumber int,
  53  	pageSize int,
  54  ) *DescribeDomainsRequest {
  55  
  56  	return &DescribeDomainsRequest{
  57  		JDCloudRequest: core.JDCloudRequest{
  58  			URL:     "/regions/{regionId}/domain",
  59  			Method:  "GET",
  60  			Header:  nil,
  61  			Version: "v2",
  62  		},
  63  		RegionId:   regionId,
  64  		PageNumber: pageNumber,
  65  		PageSize:   pageSize,
  66  	}
  67  }
  68  
  69  /*
  70   * param regionId: 实例所属的地域ID (Required)
  71   * param pageNumber: 分页查询时查询的每页的序号,起始值为1,默认为1 (Required)
  72   * param pageSize: 分页查询时设置的每页行数,默认为10 (Required)
  73   * param domainName: 关键字,按照”%domainName%”模式匹配主域名 (Optional)
  74   * param domainId: 域名ID。不为0时,只查此domainId的域名 (Optional)
  75   */
  76  func NewDescribeDomainsRequestWithAllParams(
  77  	regionId string,
  78  	pageNumber int,
  79  	pageSize int,
  80  	domainName *string,
  81  	domainId *int,
  82  ) *DescribeDomainsRequest {
  83  
  84  	return &DescribeDomainsRequest{
  85  		JDCloudRequest: core.JDCloudRequest{
  86  			URL:     "/regions/{regionId}/domain",
  87  			Method:  "GET",
  88  			Header:  nil,
  89  			Version: "v2",
  90  		},
  91  		RegionId:   regionId,
  92  		PageNumber: pageNumber,
  93  		PageSize:   pageSize,
  94  		DomainName: domainName,
  95  		DomainId:   domainId,
  96  	}
  97  }
  98  
  99  /* This constructor has better compatible ability when API parameters changed */
 100  func NewDescribeDomainsRequestWithoutParam() *DescribeDomainsRequest {
 101  
 102  	return &DescribeDomainsRequest{
 103  		JDCloudRequest: core.JDCloudRequest{
 104  			URL:     "/regions/{regionId}/domain",
 105  			Method:  "GET",
 106  			Header:  nil,
 107  			Version: "v2",
 108  		},
 109  	}
 110  }
 111  
 112  /* param regionId: 实例所属的地域ID(Required) */
 113  func (r *DescribeDomainsRequest) SetRegionId(regionId string) {
 114  	r.RegionId = regionId
 115  }
 116  
 117  /* param pageNumber: 分页查询时查询的每页的序号,起始值为1,默认为1(Required) */
 118  func (r *DescribeDomainsRequest) SetPageNumber(pageNumber int) {
 119  	r.PageNumber = pageNumber
 120  }
 121  
 122  /* param pageSize: 分页查询时设置的每页行数,默认为10(Required) */
 123  func (r *DescribeDomainsRequest) SetPageSize(pageSize int) {
 124  	r.PageSize = pageSize
 125  }
 126  
 127  /* param domainName: 关键字,按照”%domainName%”模式匹配主域名(Optional) */
 128  func (r *DescribeDomainsRequest) SetDomainName(domainName string) {
 129  	r.DomainName = &domainName
 130  }
 131  
 132  /* param domainId: 域名ID。不为0时,只查此domainId的域名(Optional) */
 133  func (r *DescribeDomainsRequest) SetDomainId(domainId int) {
 134  	r.DomainId = &domainId
 135  }
 136  
 137  // GetRegionId returns path parameter 'regionId' if exist,
 138  // otherwise return empty string
 139  func (r DescribeDomainsRequest) GetRegionId() string {
 140  	return r.RegionId
 141  }
 142  
 143  type DescribeDomainsResponse struct {
 144  	RequestID string                `json:"requestId"`
 145  	Error     core.ErrorResponse    `json:"error"`
 146  	Result    DescribeDomainsResult `json:"result"`
 147  }
 148  
 149  type DescribeDomainsResult struct {
 150  	DataList     []domainservice.DomainInfo `json:"dataList"`
 151  	CurrentCount int                        `json:"currentCount"`
 152  	TotalCount   int                        `json:"totalCount"`
 153  	TotalPage    int                        `json:"totalPage"`
 154  }
 155