Class: TencentCloud::Aiart::V20221229::Client

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

Instance Method Summary collapse

Constructor Details

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



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

def initialize(credential, region, profile = nil)
    api_version = '2022-12-29'
    api_endpoint = 'aiart.tencentcloudapi.com'
    sdk_version = 'AIART_' + File.read(File.expand_path('../VERSION', __dir__)).strip
    super(credential, region, api_version, api_endpoint, sdk_version, profile)
end

Instance Method Details

#ChangeClothes(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::ChangeClothesResponse`



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/v20221229/client.rb', line 39

def ChangeClothes(request)
  body = send_request('ChangeClothes', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = ChangeClothesResponse.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

#GenerateAvatar(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::GenerateAvatarResponse`



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/v20221229/client.rb', line 64

def GenerateAvatar(request)
  body = send_request('GenerateAvatar', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = GenerateAvatarResponse.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

#ImageInpaintingRemoval(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::ImageInpaintingRemovalResponse`



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/v20221229/client.rb', line 89

def ImageInpaintingRemoval(request)
  body = send_request('ImageInpaintingRemoval', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = ImageInpaintingRemovalResponse.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

#ImageOutpainting(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::ImageOutpaintingResponse`



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/v20221229/client.rb', line 114

def ImageOutpainting(request)
  body = send_request('ImageOutpainting', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = ImageOutpaintingResponse.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

#ImageToImage(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::ImageToImageResponse`



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/v20221229/client.rb', line 139

def ImageToImage(request)
  body = send_request('ImageToImage', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = ImageToImageResponse.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

#QueryDrawPortraitJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::QueryDrawPortraitJobResponse`



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/v20221229/client.rb', line 169

def QueryDrawPortraitJob(request)
  body = send_request('QueryDrawPortraitJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = QueryDrawPortraitJobResponse.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

#QueryGlamPicJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::QueryGlamPicJobResponse`



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/v20221229/client.rb', line 197

def QueryGlamPicJob(request)
  body = send_request('QueryGlamPicJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = QueryGlamPicJobResponse.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

#QueryMemeJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::QueryMemeJobResponse`



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/v20221229/client.rb', line 225

def QueryMemeJob(request)
  body = send_request('QueryMemeJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = QueryMemeJobResponse.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

#QueryTextToImageJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::QueryTextToImageJobResponse`



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/v20221229/client.rb', line 250

def QueryTextToImageJob(request)
  body = send_request('QueryTextToImageJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = QueryTextToImageJobResponse.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

#QueryTextToImageProJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::QueryTextToImageProJobResponse`



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/v20221229/client.rb', line 278

def QueryTextToImageProJob(request)
  body = send_request('QueryTextToImageProJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = QueryTextToImageProJobResponse.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

#QueryTrainPortraitModelJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::QueryTrainPortraitModelJobResponse`



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/v20221229/client.rb', line 309

def QueryTrainPortraitModelJob(request)
  body = send_request('QueryTrainPortraitModelJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = QueryTrainPortraitModelJobResponse.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

#RefineImage(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::RefineImageResponse`



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/v20221229/client.rb', line 334

def RefineImage(request)
  body = send_request('RefineImage', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = RefineImageResponse.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

#ReplaceBackground(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::ReplaceBackgroundResponse`



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/v20221229/client.rb', line 360

def ReplaceBackground(request)
  body = send_request('ReplaceBackground', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = ReplaceBackgroundResponse.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

#SketchToImage(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::SketchToImageResponse`



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/v20221229/client.rb', line 385

def SketchToImage(request)
  body = send_request('SketchToImage', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SketchToImageResponse.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

#SubmitDrawPortraitJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::SubmitDrawPortraitJobResponse`



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/v20221229/client.rb', line 416

def SubmitDrawPortraitJob(request)
  body = send_request('SubmitDrawPortraitJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SubmitDrawPortraitJobResponse.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

#SubmitGlamPicJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::SubmitGlamPicJobResponse`



444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/v20221229/client.rb', line 444

def SubmitGlamPicJob(request)
  body = send_request('SubmitGlamPicJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SubmitGlamPicJobResponse.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

#SubmitMemeJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::SubmitMemeJobResponse`



473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/v20221229/client.rb', line 473

def SubmitMemeJob(request)
  body = send_request('SubmitMemeJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SubmitMemeJobResponse.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

#SubmitTextToImageJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::SubmitTextToImageJobResponse`



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/v20221229/client.rb', line 498

def SubmitTextToImageJob(request)
  body = send_request('SubmitTextToImageJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SubmitTextToImageJobResponse.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

#SubmitTextToImageProJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::SubmitTextToImageProJobResponse`



526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/v20221229/client.rb', line 526

def SubmitTextToImageProJob(request)
  body = send_request('SubmitTextToImageProJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SubmitTextToImageProJobResponse.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

#SubmitTrainPortraitModelJob(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::SubmitTrainPortraitModelJobResponse`



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/v20221229/client.rb', line 557

def SubmitTrainPortraitModelJob(request)
  body = send_request('SubmitTrainPortraitModelJob', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SubmitTrainPortraitModelJobResponse.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

#TextToImageLite(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::TextToImageLiteResponse`



582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
# File 'lib/v20221229/client.rb', line 582

def TextToImageLite(request)
  body = send_request('TextToImageLite', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = TextToImageLiteResponse.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

#TextToImageRapid(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::TextToImageRapidResponse`



607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/v20221229/client.rb', line 607

def TextToImageRapid(request)
  body = send_request('TextToImageRapid', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = TextToImageRapidResponse.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

#UploadTrainPortraitImages(request) ⇒ Object

@rtype: :class:‘Tencentcloud::aiart::V20221229::UploadTrainPortraitImagesResponse`



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/v20221229/client.rb', line 638

def UploadTrainPortraitImages(request)
  body = send_request('UploadTrainPortraitImages', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = UploadTrainPortraitImagesResponse.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