Class: TencentCloud::Cloudapp::V20220530::Client

Inherits:
TencentCloud::Common::AbstractClient
  • Object
show all
Defined in:
lib/v20220530/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(credential, region, profile = nil) ⇒ Client

Returns a new instance of Client.



24
25
26
27
28
29
# File 'lib/v20220530/client.rb', line 24

def initialize(credential, region, profile = nil)
    api_version = '2022-05-30'
    api_endpoint = 'cloudapp.tencentcloudapi.com'
    sdk_version = 'CLOUDAPP_' + File.read(File.expand_path('../VERSION', __dir__)).strip
    super(credential, region, api_version, api_endpoint, sdk_version, profile)
end

Instance Method Details

#DescribeLicense(request) ⇒ Object

@rtype: :class:‘Tencentcloud::cloudapp::V20220530::DescribeLicenseResponse`

Parameters:

  • request:

    Request instance for DescribeLicense.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/v20220530/client.rb', line 150

def DescribeLicense(request)
  body = send_request('DescribeLicense', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = DescribeLicenseResponse.new
    model.deserialize(response['Response'])
    model
  else
    code = response['Response']['Error']['Code']
    message = response['Response']['Error']['Message']
    reqid = response['Response']['RequestId']
    raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
  end
rescue TencentCloud::Common::TencentCloudSDKException => e
  raise e
rescue StandardError => e
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end

#VerifyLicense(request) ⇒ Object

@rtype: :class:‘Tencentcloud::cloudapp::V20220530::VerifyLicenseResponse`

Parameters:

  • request:

    Request instance for VerifyLicense.



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/v20220530/client.rb', line 174

def VerifyLicense(request)
  body = send_request('VerifyLicense', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = VerifyLicenseResponse.new
    model.deserialize(response['Response'])
    model
  else
    code = response['Response']['Error']['Code']
    message = response['Response']['Error']['Message']
    reqid = response['Response']['RequestId']
    raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
  end
rescue TencentCloud::Common::TencentCloudSDKException => e
  raise e
rescue StandardError => e
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end