CreateMonitorTarget.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  )
  22  
  23  type CreateMonitorTargetRequest struct {
  24  	core.JDCloudRequest
  25  
  26  	/* 实例所属的地域ID  */
  27  	RegionId string `json:"regionId"`
  28  
  29  	/* 域名ID,请使用describeDomains接口获取。  */
  30  	DomainId string `json:"domainId"`
  31  
  32  	/* 子域名  */
  33  	SubDomainName string `json:"subDomainName"`
  34  
  35  	/* 子域名可用监控对象的数组  */
  36  	Targets []string `json:"targets"`
  37  }
  38  
  39  /*
  40   * param regionId: 实例所属的地域ID (Required)
  41   * param domainId: 域名ID,请使用describeDomains接口获取。 (Required)
  42   * param subDomainName: 子域名 (Required)
  43   * param targets: 子域名可用监控对象的数组 (Required)
  44   *
  45   * @Deprecated, not compatible when mandatory parameters changed
  46   */
  47  func NewCreateMonitorTargetRequest(
  48  	regionId string,
  49  	domainId string,
  50  	subDomainName string,
  51  	targets []string,
  52  ) *CreateMonitorTargetRequest {
  53  
  54  	return &CreateMonitorTargetRequest{
  55  		JDCloudRequest: core.JDCloudRequest{
  56  			URL:     "/regions/{regionId}/domain/{domainId}/monitorTarget",
  57  			Method:  "POST",
  58  			Header:  nil,
  59  			Version: "v2",
  60  		},
  61  		RegionId:      regionId,
  62  		DomainId:      domainId,
  63  		SubDomainName: subDomainName,
  64  		Targets:       targets,
  65  	}
  66  }
  67  
  68  /*
  69   * param regionId: 实例所属的地域ID (Required)
  70   * param domainId: 域名ID,请使用describeDomains接口获取。 (Required)
  71   * param subDomainName: 子域名 (Required)
  72   * param targets: 子域名可用监控对象的数组 (Required)
  73   */
  74  func NewCreateMonitorTargetRequestWithAllParams(
  75  	regionId string,
  76  	domainId string,
  77  	subDomainName string,
  78  	targets []string,
  79  ) *CreateMonitorTargetRequest {
  80  
  81  	return &CreateMonitorTargetRequest{
  82  		JDCloudRequest: core.JDCloudRequest{
  83  			URL:     "/regions/{regionId}/domain/{domainId}/monitorTarget",
  84  			Method:  "POST",
  85  			Header:  nil,
  86  			Version: "v2",
  87  		},
  88  		RegionId:      regionId,
  89  		DomainId:      domainId,
  90  		SubDomainName: subDomainName,
  91  		Targets:       targets,
  92  	}
  93  }
  94  
  95  /* This constructor has better compatible ability when API parameters changed */
  96  func NewCreateMonitorTargetRequestWithoutParam() *CreateMonitorTargetRequest {
  97  
  98  	return &CreateMonitorTargetRequest{
  99  		JDCloudRequest: core.JDCloudRequest{
 100  			URL:     "/regions/{regionId}/domain/{domainId}/monitorTarget",
 101  			Method:  "POST",
 102  			Header:  nil,
 103  			Version: "v2",
 104  		},
 105  	}
 106  }
 107  
 108  /* param regionId: 实例所属的地域ID(Required) */
 109  func (r *CreateMonitorTargetRequest) SetRegionId(regionId string) {
 110  	r.RegionId = regionId
 111  }
 112  
 113  /* param domainId: 域名ID,请使用describeDomains接口获取。(Required) */
 114  func (r *CreateMonitorTargetRequest) SetDomainId(domainId string) {
 115  	r.DomainId = domainId
 116  }
 117  
 118  /* param subDomainName: 子域名(Required) */
 119  func (r *CreateMonitorTargetRequest) SetSubDomainName(subDomainName string) {
 120  	r.SubDomainName = subDomainName
 121  }
 122  
 123  /* param targets: 子域名可用监控对象的数组(Required) */
 124  func (r *CreateMonitorTargetRequest) SetTargets(targets []string) {
 125  	r.Targets = targets
 126  }
 127  
 128  // GetRegionId returns path parameter 'regionId' if exist,
 129  // otherwise return empty string
 130  func (r CreateMonitorTargetRequest) GetRegionId() string {
 131  	return r.RegionId
 132  }
 133  
 134  type CreateMonitorTargetResponse struct {
 135  	RequestID string                    `json:"requestId"`
 136  	Error     core.ErrorResponse        `json:"error"`
 137  	Result    CreateMonitorTargetResult `json:"result"`
 138  }
 139  
 140  type CreateMonitorTargetResult struct {
 141  }
 142