tencentcloud-sdk-mrs 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1dec34da9c51012cd4b0568dcfce4bd385f21a23
4
+ data.tar.gz: 1f82d2afea8eff128a295ca4d31a172c7e0e634d
5
+ SHA512:
6
+ metadata.gz: ae1b6447d356931f59d3e5e6046886025f5eb5ed9d83449a2ff0361991d955dcb7ad6fb018412815c18d809f20ea623807ebaba3fd8f5871d9b67d52633b7c2a
7
+ data.tar.gz: 466d74685bee94c9462e72aae22da67c4a8b3371b811f6559f33debcda1df6eb417ec499bb46887c94a503395b32a59bf018798be579f6a9e387e4453ed8fe23
data/lib/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.200
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tencentcloud-sdk-common'
4
+
5
+ require_relative 'v20200910/client'
6
+ require_relative 'v20200910/models'
7
+
8
+ module TencentCloud
9
+ module Mrs
10
+ end
11
+ end
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'json'
18
+
19
+ module TencentCloud
20
+ module Mrs
21
+ module V20200910
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2020-09-10'
26
+ api_endpoint = 'mrs.tencentcloudapi.com'
27
+ sdk_version = 'MRS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 图片分类
33
+
34
+ # @param request: Request instance for ImageToClass.
35
+ # @type request: :class:`Tencentcloud::mrs::V20200910::ImageToClassRequest`
36
+ # @rtype: :class:`Tencentcloud::mrs::V20200910::ImageToClassResponse`
37
+ def ImageToClass(request)
38
+ body = send_request('ImageToClass', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = ImageToClassResponse.new
42
+ model.deserialize(response['Response'])
43
+ model
44
+ else
45
+ code = response['Response']['Error']['Code']
46
+ message = response['Response']['Error']['Message']
47
+ reqid = response['Response']['RequestId']
48
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
49
+ end
50
+ rescue TencentCloud::Common::TencentCloudSDKException => e
51
+ raise e
52
+ rescue StandardError => e
53
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
54
+ end
55
+
56
+ # 图片转结构化对象
57
+
58
+ # @param request: Request instance for ImageToObject.
59
+ # @type request: :class:`Tencentcloud::mrs::V20200910::ImageToObjectRequest`
60
+ # @rtype: :class:`Tencentcloud::mrs::V20200910::ImageToObjectResponse`
61
+ def ImageToObject(request)
62
+ body = send_request('ImageToObject', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = ImageToObjectResponse.new
66
+ model.deserialize(response['Response'])
67
+ model
68
+ else
69
+ code = response['Response']['Error']['Code']
70
+ message = response['Response']['Error']['Message']
71
+ reqid = response['Response']['RequestId']
72
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
73
+ end
74
+ rescue TencentCloud::Common::TencentCloudSDKException => e
75
+ raise e
76
+ rescue StandardError => e
77
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
78
+ end
79
+
80
+ # 文本分类
81
+
82
+ # @param request: Request instance for TextToClass.
83
+ # @type request: :class:`Tencentcloud::mrs::V20200910::TextToClassRequest`
84
+ # @rtype: :class:`Tencentcloud::mrs::V20200910::TextToClassResponse`
85
+ def TextToClass(request)
86
+ body = send_request('TextToClass', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = TextToClassResponse.new
90
+ model.deserialize(response['Response'])
91
+ model
92
+ else
93
+ code = response['Response']['Error']['Code']
94
+ message = response['Response']['Error']['Message']
95
+ reqid = response['Response']['RequestId']
96
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
97
+ end
98
+ rescue TencentCloud::Common::TencentCloudSDKException => e
99
+ raise e
100
+ rescue StandardError => e
101
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
102
+ end
103
+
104
+ # 文本转结构化对象
105
+
106
+ # @param request: Request instance for TextToObject.
107
+ # @type request: :class:`Tencentcloud::mrs::V20200910::TextToObjectRequest`
108
+ # @rtype: :class:`Tencentcloud::mrs::V20200910::TextToObjectResponse`
109
+ def TextToObject(request)
110
+ body = send_request('TextToObject', request.serialize)
111
+ response = JSON.parse(body)
112
+ if response['Response'].key?('Error') == false
113
+ model = TextToObjectResponse.new
114
+ model.deserialize(response['Response'])
115
+ model
116
+ else
117
+ code = response['Response']['Error']['Code']
118
+ message = response['Response']['Error']['Message']
119
+ reqid = response['Response']['RequestId']
120
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
121
+ end
122
+ rescue TencentCloud::Common::TencentCloudSDKException => e
123
+ raise e
124
+ rescue StandardError => e
125
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
126
+ end
127
+
128
+
129
+ end
130
+ end
131
+ end
132
+ end