@huaweicloud/huaweicloud-sdk-image 3.0.52-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +1 -0
  3. package/huaweicloud-sdk-image.d.ts +1 -0
  4. package/huaweicloud-sdk-image.js +17 -0
  5. package/package.json +19 -0
  6. package/v2/ImageClient.d.ts +166 -0
  7. package/v2/ImageClient.js +317 -0
  8. package/v2/ImageRegion.d.ts +10 -0
  9. package/v2/ImageRegion.js +35 -0
  10. package/v2/model/CelebrityRecognitionReq.d.ts +9 -0
  11. package/v2/model/CelebrityRecognitionReq.js +21 -0
  12. package/v2/model/CelebrityRecognitionResultBody.d.ts +11 -0
  13. package/v2/model/CelebrityRecognitionResultBody.js +31 -0
  14. package/v2/model/ImageDescriptionReq.d.ts +7 -0
  15. package/v2/model/ImageDescriptionReq.js +17 -0
  16. package/v2/model/ImageDescriptionResponseResult.d.ts +5 -0
  17. package/v2/model/ImageDescriptionResponseResult.js +13 -0
  18. package/v2/model/ImageMainObjectDetectionInstance.d.ts +9 -0
  19. package/v2/model/ImageMainObjectDetectionInstance.js +21 -0
  20. package/v2/model/ImageMainObjectDetectionReq.d.ts +9 -0
  21. package/v2/model/ImageMainObjectDetectionReq.js +21 -0
  22. package/v2/model/ImageMediaTaggingItemBody.d.ts +22 -0
  23. package/v2/model/ImageMediaTaggingItemBody.js +53 -0
  24. package/v2/model/ImageMediaTaggingItemBodyI18nTag.d.ts +7 -0
  25. package/v2/model/ImageMediaTaggingItemBodyI18nTag.js +17 -0
  26. package/v2/model/ImageMediaTaggingItemBodyI18nType.d.ts +7 -0
  27. package/v2/model/ImageMediaTaggingItemBodyI18nType.js +17 -0
  28. package/v2/model/ImageMediaTaggingReq.d.ts +13 -0
  29. package/v2/model/ImageMediaTaggingReq.js +29 -0
  30. package/v2/model/ImageMediaTaggingResponseResult.d.ts +6 -0
  31. package/v2/model/ImageMediaTaggingResponseResult.js +13 -0
  32. package/v2/model/ImageTaggingInstance.d.ts +9 -0
  33. package/v2/model/ImageTaggingInstance.js +27 -0
  34. package/v2/model/ImageTaggingItemBody.d.ts +22 -0
  35. package/v2/model/ImageTaggingItemBody.js +53 -0
  36. package/v2/model/ImageTaggingItemBodyI18nTag.d.ts +7 -0
  37. package/v2/model/ImageTaggingItemBodyI18nTag.js +17 -0
  38. package/v2/model/ImageTaggingItemBodyI18nType.d.ts +7 -0
  39. package/v2/model/ImageTaggingItemBodyI18nType.js +17 -0
  40. package/v2/model/ImageTaggingReq.d.ts +13 -0
  41. package/v2/model/ImageTaggingReq.js +29 -0
  42. package/v2/model/ImageTaggingResponseResult.d.ts +6 -0
  43. package/v2/model/ImageTaggingResponseResult.js +13 -0
  44. package/v2/model/RunCelebrityRecognitionRequest.d.ts +6 -0
  45. package/v2/model/RunCelebrityRecognitionRequest.js +13 -0
  46. package/v2/model/RunCelebrityRecognitionResponse.d.ts +7 -0
  47. package/v2/model/RunCelebrityRecognitionResponse.js +31 -0
  48. package/v2/model/RunImageDescriptionRequest.d.ts +6 -0
  49. package/v2/model/RunImageDescriptionRequest.js +13 -0
  50. package/v2/model/RunImageDescriptionResponse.d.ts +7 -0
  51. package/v2/model/RunImageDescriptionResponse.js +31 -0
  52. package/v2/model/RunImageMainObjectDetectionRequest.d.ts +6 -0
  53. package/v2/model/RunImageMainObjectDetectionRequest.js +13 -0
  54. package/v2/model/RunImageMainObjectDetectionResponse.d.ts +7 -0
  55. package/v2/model/RunImageMainObjectDetectionResponse.js +31 -0
  56. package/v2/model/RunImageMediaTaggingRequest.d.ts +6 -0
  57. package/v2/model/RunImageMediaTaggingRequest.js +13 -0
  58. package/v2/model/RunImageMediaTaggingResponse.d.ts +7 -0
  59. package/v2/model/RunImageMediaTaggingResponse.js +31 -0
  60. package/v2/model/RunImageTaggingRequest.d.ts +6 -0
  61. package/v2/model/RunImageTaggingRequest.js +13 -0
  62. package/v2/model/RunImageTaggingResponse.d.ts +7 -0
  63. package/v2/model/RunImageTaggingResponse.js +31 -0
  64. package/v2/public-api.d.ts +29 -0
  65. package/v2/public-api.js +45 -0
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) Huawei Technologies Co., Ltd. 2020-present. All rights reserved.
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.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ See detailed information in [huaweicloud-sdk-nodejs-v3](https://github.com/huaweicloud/huaweicloud-sdk-nodejs-v3).
@@ -0,0 +1 @@
1
+ export * from './v2/public-api';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./v2/public-api"), exports);
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@huaweicloud/huaweicloud-sdk-image",
3
+ "version": "3.0.52-rc",
4
+ "description": "Huaweicloud SDK for image",
5
+ "main": "huaweicloud-sdk-image.js",
6
+ "typings": "huaweicloud-sdk-image.d.ts",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/huaweicloud/huaweicloud-sdk-nodejs-v3"
13
+ },
14
+ "author": "HuaweiCloud_SDK",
15
+ "license": "Apache-2.0",
16
+ "dependencies": {
17
+ "@huaweicloud/huaweicloud-sdk-core": "^3.0.52-rc"
18
+ }
19
+ }
@@ -0,0 +1,166 @@
1
+ import { HcClient } from "@huaweicloud/huaweicloud-sdk-core/HcClient";
2
+ import { ClientBuilder } from "@huaweicloud/huaweicloud-sdk-core/ClientBuilder";
3
+ import { RunCelebrityRecognitionRequest } from './model/RunCelebrityRecognitionRequest';
4
+ import { RunCelebrityRecognitionResponse } from './model/RunCelebrityRecognitionResponse';
5
+ import { RunImageDescriptionRequest } from './model/RunImageDescriptionRequest';
6
+ import { RunImageDescriptionResponse } from './model/RunImageDescriptionResponse';
7
+ import { RunImageMainObjectDetectionRequest } from './model/RunImageMainObjectDetectionRequest';
8
+ import { RunImageMainObjectDetectionResponse } from './model/RunImageMainObjectDetectionResponse';
9
+ import { RunImageMediaTaggingRequest } from './model/RunImageMediaTaggingRequest';
10
+ import { RunImageMediaTaggingResponse } from './model/RunImageMediaTaggingResponse';
11
+ import { RunImageTaggingRequest } from './model/RunImageTaggingRequest';
12
+ import { RunImageTaggingResponse } from './model/RunImageTaggingResponse';
13
+ export declare class ImageClient {
14
+ static newBuilder(): ClientBuilder<ImageClient>;
15
+ private hcClient;
16
+ constructor(client: HcClient);
17
+ getPath(): any;
18
+ /**
19
+ * 分析并识别图片中包含的政治人物、明星及网红人物,返回人物信息及人脸坐标。
20
+ *
21
+ * 详细说明请参考华为云API Explorer。
22
+ * Please refer to Huawei cloud API Explorer for details.
23
+ *
24
+ * @summary 名人识别
25
+ * @param {CelebrityRecognitionReq} runCelebrityRecognitionRequestBody 名人识别接口请求体
26
+ * @param {*} [options] Override http request option.
27
+ * @throws {RequiredError}
28
+ */
29
+ runCelebrityRecognition(runCelebrityRecognitionRequest?: RunCelebrityRecognitionRequest): Promise<RunCelebrityRecognitionResponse>;
30
+ /**
31
+ * 图像描述
32
+ *
33
+ * 详细说明请参考华为云API Explorer。
34
+ * Please refer to Huawei cloud API Explorer for details.
35
+ *
36
+ * @summary 图像描述
37
+ * @param {ImageDescriptionReq} runImageDescriptionRequestBody 图像描述接口请求体
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ */
41
+ runImageDescription(runImageDescriptionRequest?: RunImageDescriptionRequest): Promise<RunImageDescriptionResponse>;
42
+ /**
43
+ * 检测图像中的主要内容,返回主要内容的坐标信息,这里的主要内容包括两方面:bounding_box和main_object_box
44
+ *
45
+ * 详细说明请参考华为云API Explorer。
46
+ * Please refer to Huawei cloud API Explorer for details.
47
+ *
48
+ * @summary 图像主体识别
49
+ * @param {ImageMainObjectDetectionReq} runImageMainObjectDetectionRequestBody 图像主体识别接口请求体
50
+ * @param {*} [options] Override http request option.
51
+ * @throws {RequiredError}
52
+ */
53
+ runImageMainObjectDetection(runImageMainObjectDetectionRequest?: RunImageMainObjectDetectionRequest): Promise<RunImageMainObjectDetectionResponse>;
54
+ /**
55
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
56
+ *
57
+ * 详细说明请参考华为云API Explorer。
58
+ * Please refer to Huawei cloud API Explorer for details.
59
+ *
60
+ * @summary 媒资图像标签
61
+ * @param {ImageMediaTaggingReq} runImageMediaTaggingRequestBody 媒资图像标签接口请求体
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ */
65
+ runImageMediaTagging(runImageMediaTaggingRequest?: RunImageMediaTaggingRequest): Promise<RunImageMediaTaggingResponse>;
66
+ /**
67
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
68
+ *
69
+ * 详细说明请参考华为云API Explorer。
70
+ * Please refer to Huawei cloud API Explorer for details.
71
+ *
72
+ * @summary 图像标签
73
+ * @param {ImageTaggingReq} runImageTaggingRequestBody 图像标签接口请求体
74
+ * @param {*} [options] Override http request option.
75
+ * @throws {RequiredError}
76
+ */
77
+ runImageTagging(runImageTaggingRequest?: RunImageTaggingRequest): Promise<RunImageTaggingResponse>;
78
+ }
79
+ export declare const ParamCreater: () => {
80
+ /**
81
+ * 分析并识别图片中包含的政治人物、明星及网红人物,返回人物信息及人脸坐标。
82
+ *
83
+ * 详细说明请参考华为云API Explorer。
84
+ * Please refer to Huawei cloud API Explorer for details.
85
+ */
86
+ runCelebrityRecognition(runCelebrityRecognitionRequest?: RunCelebrityRecognitionRequest): {
87
+ method: string;
88
+ url: string;
89
+ contentType: string;
90
+ queryParams: {};
91
+ pathParams: {};
92
+ headers: {};
93
+ data: {};
94
+ };
95
+ /**
96
+ * 图像描述
97
+ *
98
+ * 详细说明请参考华为云API Explorer。
99
+ * Please refer to Huawei cloud API Explorer for details.
100
+ */
101
+ runImageDescription(runImageDescriptionRequest?: RunImageDescriptionRequest): {
102
+ method: string;
103
+ url: string;
104
+ contentType: string;
105
+ queryParams: {};
106
+ pathParams: {};
107
+ headers: {};
108
+ data: {};
109
+ };
110
+ /**
111
+ * 检测图像中的主要内容,返回主要内容的坐标信息,这里的主要内容包括两方面:bounding_box和main_object_box
112
+ *
113
+ * 详细说明请参考华为云API Explorer。
114
+ * Please refer to Huawei cloud API Explorer for details.
115
+ */
116
+ runImageMainObjectDetection(runImageMainObjectDetectionRequest?: RunImageMainObjectDetectionRequest): {
117
+ method: string;
118
+ url: string;
119
+ contentType: string;
120
+ queryParams: {};
121
+ pathParams: {};
122
+ headers: {};
123
+ data: {};
124
+ };
125
+ /**
126
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
127
+ *
128
+ * 详细说明请参考华为云API Explorer。
129
+ * Please refer to Huawei cloud API Explorer for details.
130
+ */
131
+ runImageMediaTagging(runImageMediaTaggingRequest?: RunImageMediaTaggingRequest): {
132
+ method: string;
133
+ url: string;
134
+ contentType: string;
135
+ queryParams: {};
136
+ pathParams: {};
137
+ headers: {};
138
+ data: {};
139
+ };
140
+ /**
141
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
142
+ *
143
+ * 详细说明请参考华为云API Explorer。
144
+ * Please refer to Huawei cloud API Explorer for details.
145
+ */
146
+ runImageTagging(runImageTaggingRequest?: RunImageTaggingRequest): {
147
+ method: string;
148
+ url: string;
149
+ contentType: string;
150
+ queryParams: {};
151
+ pathParams: {};
152
+ headers: {};
153
+ data: {};
154
+ };
155
+ };
156
+ /**
157
+ *
158
+ * @export
159
+ * @class RequiredError
160
+ * @extends {Error}
161
+ */
162
+ export declare class RequiredError extends Error {
163
+ field: string;
164
+ name: "RequiredError";
165
+ constructor(field: string, msg?: string);
166
+ }
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.RequiredError = exports.ParamCreater = exports.ImageClient = void 0;
19
+ var ClientBuilder_1 = require("@huaweicloud/huaweicloud-sdk-core/ClientBuilder");
20
+ var RunCelebrityRecognitionRequest_1 = require("./model/RunCelebrityRecognitionRequest");
21
+ var RunImageDescriptionRequest_1 = require("./model/RunImageDescriptionRequest");
22
+ var RunImageMainObjectDetectionRequest_1 = require("./model/RunImageMainObjectDetectionRequest");
23
+ var RunImageMediaTaggingRequest_1 = require("./model/RunImageMediaTaggingRequest");
24
+ var RunImageTaggingRequest_1 = require("./model/RunImageTaggingRequest");
25
+ var ImageClient = /** @class */ (function () {
26
+ function ImageClient(client) {
27
+ this.hcClient = client;
28
+ }
29
+ ImageClient.newBuilder = function () {
30
+ return new ClientBuilder_1.ClientBuilder(newClient);
31
+ };
32
+ ImageClient.prototype.getPath = function () {
33
+ return __dirname;
34
+ };
35
+ /**
36
+ * 分析并识别图片中包含的政治人物、明星及网红人物,返回人物信息及人脸坐标。
37
+ *
38
+ * 详细说明请参考华为云API Explorer。
39
+ * Please refer to Huawei cloud API Explorer for details.
40
+ *
41
+ * @summary 名人识别
42
+ * @param {CelebrityRecognitionReq} runCelebrityRecognitionRequestBody 名人识别接口请求体
43
+ * @param {*} [options] Override http request option.
44
+ * @throws {RequiredError}
45
+ */
46
+ ImageClient.prototype.runCelebrityRecognition = function (runCelebrityRecognitionRequest) {
47
+ var options = (0, exports.ParamCreater)().runCelebrityRecognition(runCelebrityRecognitionRequest);
48
+ options['responseHeaders'] = [''];
49
+ // @ts-ignore
50
+ return this.hcClient.sendRequest(options);
51
+ };
52
+ /**
53
+ * 图像描述
54
+ *
55
+ * 详细说明请参考华为云API Explorer。
56
+ * Please refer to Huawei cloud API Explorer for details.
57
+ *
58
+ * @summary 图像描述
59
+ * @param {ImageDescriptionReq} runImageDescriptionRequestBody 图像描述接口请求体
60
+ * @param {*} [options] Override http request option.
61
+ * @throws {RequiredError}
62
+ */
63
+ ImageClient.prototype.runImageDescription = function (runImageDescriptionRequest) {
64
+ var options = (0, exports.ParamCreater)().runImageDescription(runImageDescriptionRequest);
65
+ options['responseHeaders'] = [''];
66
+ // @ts-ignore
67
+ return this.hcClient.sendRequest(options);
68
+ };
69
+ /**
70
+ * 检测图像中的主要内容,返回主要内容的坐标信息,这里的主要内容包括两方面:bounding_box和main_object_box
71
+ *
72
+ * 详细说明请参考华为云API Explorer。
73
+ * Please refer to Huawei cloud API Explorer for details.
74
+ *
75
+ * @summary 图像主体识别
76
+ * @param {ImageMainObjectDetectionReq} runImageMainObjectDetectionRequestBody 图像主体识别接口请求体
77
+ * @param {*} [options] Override http request option.
78
+ * @throws {RequiredError}
79
+ */
80
+ ImageClient.prototype.runImageMainObjectDetection = function (runImageMainObjectDetectionRequest) {
81
+ var options = (0, exports.ParamCreater)().runImageMainObjectDetection(runImageMainObjectDetectionRequest);
82
+ options['responseHeaders'] = [''];
83
+ // @ts-ignore
84
+ return this.hcClient.sendRequest(options);
85
+ };
86
+ /**
87
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
88
+ *
89
+ * 详细说明请参考华为云API Explorer。
90
+ * Please refer to Huawei cloud API Explorer for details.
91
+ *
92
+ * @summary 媒资图像标签
93
+ * @param {ImageMediaTaggingReq} runImageMediaTaggingRequestBody 媒资图像标签接口请求体
94
+ * @param {*} [options] Override http request option.
95
+ * @throws {RequiredError}
96
+ */
97
+ ImageClient.prototype.runImageMediaTagging = function (runImageMediaTaggingRequest) {
98
+ var options = (0, exports.ParamCreater)().runImageMediaTagging(runImageMediaTaggingRequest);
99
+ options['responseHeaders'] = [''];
100
+ // @ts-ignore
101
+ return this.hcClient.sendRequest(options);
102
+ };
103
+ /**
104
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
105
+ *
106
+ * 详细说明请参考华为云API Explorer。
107
+ * Please refer to Huawei cloud API Explorer for details.
108
+ *
109
+ * @summary 图像标签
110
+ * @param {ImageTaggingReq} runImageTaggingRequestBody 图像标签接口请求体
111
+ * @param {*} [options] Override http request option.
112
+ * @throws {RequiredError}
113
+ */
114
+ ImageClient.prototype.runImageTagging = function (runImageTaggingRequest) {
115
+ var options = (0, exports.ParamCreater)().runImageTagging(runImageTaggingRequest);
116
+ options['responseHeaders'] = [''];
117
+ // @ts-ignore
118
+ return this.hcClient.sendRequest(options);
119
+ };
120
+ return ImageClient;
121
+ }());
122
+ exports.ImageClient = ImageClient;
123
+ var ParamCreater = function () {
124
+ return {
125
+ /**
126
+ * 分析并识别图片中包含的政治人物、明星及网红人物,返回人物信息及人脸坐标。
127
+ *
128
+ * 详细说明请参考华为云API Explorer。
129
+ * Please refer to Huawei cloud API Explorer for details.
130
+ */
131
+ runCelebrityRecognition: function (runCelebrityRecognitionRequest) {
132
+ var options = {
133
+ method: "POST",
134
+ url: "/v2/{project_id}/image/celebrity-recognition",
135
+ contentType: "application/json;charset=UTF-8",
136
+ queryParams: {},
137
+ pathParams: {},
138
+ headers: {},
139
+ data: {}
140
+ };
141
+ var localVarHeaderParameter = {};
142
+ var body;
143
+ if (runCelebrityRecognitionRequest !== null && runCelebrityRecognitionRequest !== undefined) {
144
+ if (runCelebrityRecognitionRequest instanceof RunCelebrityRecognitionRequest_1.RunCelebrityRecognitionRequest) {
145
+ body = runCelebrityRecognitionRequest.body;
146
+ }
147
+ else {
148
+ body = runCelebrityRecognitionRequest['body'];
149
+ }
150
+ }
151
+ if (body === null || body === undefined) {
152
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
153
+ }
154
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
155
+ options.data = body !== undefined ? body : {};
156
+ options.headers = localVarHeaderParameter;
157
+ return options;
158
+ },
159
+ /**
160
+ * 图像描述
161
+ *
162
+ * 详细说明请参考华为云API Explorer。
163
+ * Please refer to Huawei cloud API Explorer for details.
164
+ */
165
+ runImageDescription: function (runImageDescriptionRequest) {
166
+ var options = {
167
+ method: "POST",
168
+ url: "/v2/{project_id}/image/description",
169
+ contentType: "application/json;charset=UTF-8",
170
+ queryParams: {},
171
+ pathParams: {},
172
+ headers: {},
173
+ data: {}
174
+ };
175
+ var localVarHeaderParameter = {};
176
+ var body;
177
+ if (runImageDescriptionRequest !== null && runImageDescriptionRequest !== undefined) {
178
+ if (runImageDescriptionRequest instanceof RunImageDescriptionRequest_1.RunImageDescriptionRequest) {
179
+ body = runImageDescriptionRequest.body;
180
+ }
181
+ else {
182
+ body = runImageDescriptionRequest['body'];
183
+ }
184
+ }
185
+ if (body === null || body === undefined) {
186
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
187
+ }
188
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
189
+ options.data = body !== undefined ? body : {};
190
+ options.headers = localVarHeaderParameter;
191
+ return options;
192
+ },
193
+ /**
194
+ * 检测图像中的主要内容,返回主要内容的坐标信息,这里的主要内容包括两方面:bounding_box和main_object_box
195
+ *
196
+ * 详细说明请参考华为云API Explorer。
197
+ * Please refer to Huawei cloud API Explorer for details.
198
+ */
199
+ runImageMainObjectDetection: function (runImageMainObjectDetectionRequest) {
200
+ var options = {
201
+ method: "POST",
202
+ url: "/v3/{project_id}/image/main-object-detection",
203
+ contentType: "application/json;charset=UTF-8",
204
+ queryParams: {},
205
+ pathParams: {},
206
+ headers: {},
207
+ data: {}
208
+ };
209
+ var localVarHeaderParameter = {};
210
+ var body;
211
+ if (runImageMainObjectDetectionRequest !== null && runImageMainObjectDetectionRequest !== undefined) {
212
+ if (runImageMainObjectDetectionRequest instanceof RunImageMainObjectDetectionRequest_1.RunImageMainObjectDetectionRequest) {
213
+ body = runImageMainObjectDetectionRequest.body;
214
+ }
215
+ else {
216
+ body = runImageMainObjectDetectionRequest['body'];
217
+ }
218
+ }
219
+ if (body === null || body === undefined) {
220
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
221
+ }
222
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
223
+ options.data = body !== undefined ? body : {};
224
+ options.headers = localVarHeaderParameter;
225
+ return options;
226
+ },
227
+ /**
228
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
229
+ *
230
+ * 详细说明请参考华为云API Explorer。
231
+ * Please refer to Huawei cloud API Explorer for details.
232
+ */
233
+ runImageMediaTagging: function (runImageMediaTaggingRequest) {
234
+ var options = {
235
+ method: "POST",
236
+ url: "/v2/{project_id}/image/media-tagging",
237
+ contentType: "application/json;charset=UTF-8",
238
+ queryParams: {},
239
+ pathParams: {},
240
+ headers: {},
241
+ data: {}
242
+ };
243
+ var localVarHeaderParameter = {};
244
+ var body;
245
+ if (runImageMediaTaggingRequest !== null && runImageMediaTaggingRequest !== undefined) {
246
+ if (runImageMediaTaggingRequest instanceof RunImageMediaTaggingRequest_1.RunImageMediaTaggingRequest) {
247
+ body = runImageMediaTaggingRequest.body;
248
+ }
249
+ else {
250
+ body = runImageMediaTaggingRequest['body'];
251
+ }
252
+ }
253
+ if (body === null || body === undefined) {
254
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
255
+ }
256
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
257
+ options.data = body !== undefined ? body : {};
258
+ options.headers = localVarHeaderParameter;
259
+ return options;
260
+ },
261
+ /**
262
+ * 自然图像的语义内容非常丰富,一个图像包含多个标签内容,图像标签服务准确识别自然图片中数百种场景、上千种通用物体及其属性,让智能相册管理、照片检索和分类、基于场景内容或者物体的广告推荐等功能更加直观。使用时用户发送待处理图片,返回图片标签内容及相应置信度。
263
+ *
264
+ * 详细说明请参考华为云API Explorer。
265
+ * Please refer to Huawei cloud API Explorer for details.
266
+ */
267
+ runImageTagging: function (runImageTaggingRequest) {
268
+ var options = {
269
+ method: "POST",
270
+ url: "/v2/{project_id}/image/tagging",
271
+ contentType: "application/json;charset=UTF-8",
272
+ queryParams: {},
273
+ pathParams: {},
274
+ headers: {},
275
+ data: {}
276
+ };
277
+ var localVarHeaderParameter = {};
278
+ var body;
279
+ if (runImageTaggingRequest !== null && runImageTaggingRequest !== undefined) {
280
+ if (runImageTaggingRequest instanceof RunImageTaggingRequest_1.RunImageTaggingRequest) {
281
+ body = runImageTaggingRequest.body;
282
+ }
283
+ else {
284
+ body = runImageTaggingRequest['body'];
285
+ }
286
+ }
287
+ if (body === null || body === undefined) {
288
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
289
+ }
290
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
291
+ options.data = body !== undefined ? body : {};
292
+ options.headers = localVarHeaderParameter;
293
+ return options;
294
+ },
295
+ };
296
+ };
297
+ exports.ParamCreater = ParamCreater;
298
+ function newClient(client) {
299
+ return new ImageClient(client);
300
+ }
301
+ /**
302
+ *
303
+ * @export
304
+ * @class RequiredError
305
+ * @extends {Error}
306
+ */
307
+ var RequiredError = /** @class */ (function (_super) {
308
+ __extends(RequiredError, _super);
309
+ function RequiredError(field, msg) {
310
+ var _this = _super.call(this, msg) || this;
311
+ _this.field = field;
312
+ _this.name = "RequiredError";
313
+ return _this;
314
+ }
315
+ return RequiredError;
316
+ }(Error));
317
+ exports.RequiredError = RequiredError;
@@ -0,0 +1,10 @@
1
+ export declare class ImageRegion {
2
+ static CN_NORTH_4: any;
3
+ static CN_NORTH_1: any;
4
+ static AP_SOUTHEAST_1: any;
5
+ static AP_SOUTHEAST_3: any;
6
+ static CN_EAST_3: any;
7
+ private static STATIC_FIELDS;
8
+ private static createStaticFields;
9
+ static valueOf(regionId: String): any;
10
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageRegion = void 0;
4
+ var region_1 = require("@huaweicloud/huaweicloud-sdk-core/region/region");
5
+ var ImageRegion = /** @class */ (function () {
6
+ function ImageRegion() {
7
+ }
8
+ ImageRegion.createStaticFields = function () {
9
+ var map = new Map();
10
+ map.set("cn-north-4", ImageRegion.CN_NORTH_4);
11
+ map.set("cn-north-1", ImageRegion.CN_NORTH_1);
12
+ map.set("ap-southeast-1", ImageRegion.AP_SOUTHEAST_1);
13
+ map.set("ap-southeast-3", ImageRegion.AP_SOUTHEAST_3);
14
+ map.set("cn-east-3", ImageRegion.CN_EAST_3);
15
+ return map;
16
+ };
17
+ ImageRegion.valueOf = function (regionId) {
18
+ if (!regionId) {
19
+ throw new Error("Unexpected empty parameter: regionId.");
20
+ }
21
+ var result = this.STATIC_FIELDS.get(regionId);
22
+ if (result) {
23
+ return result;
24
+ }
25
+ throw new Error("Unexpected regionId: ".concat(regionId, "."));
26
+ };
27
+ ImageRegion.CN_NORTH_4 = new region_1.Region("cn-north-4", "https://image.cn-north-4.myhuaweicloud.com");
28
+ ImageRegion.CN_NORTH_1 = new region_1.Region("cn-north-1", "https://image.cn-north-1.myhuaweicloud.com");
29
+ ImageRegion.AP_SOUTHEAST_1 = new region_1.Region("ap-southeast-1", "https://image.ap-southeast-1.myhuaweicloud.com");
30
+ ImageRegion.AP_SOUTHEAST_3 = new region_1.Region("ap-southeast-3", "https://image.ap-southeast-3.myhuaweicloud.com");
31
+ ImageRegion.CN_EAST_3 = new region_1.Region("cn-east-3", "https://image.cn-east-3.myhuaweicloud.com");
32
+ ImageRegion.STATIC_FIELDS = ImageRegion.createStaticFields();
33
+ return ImageRegion;
34
+ }());
35
+ exports.ImageRegion = ImageRegion;
@@ -0,0 +1,9 @@
1
+ export declare class CelebrityRecognitionReq {
2
+ image?: string;
3
+ url?: string;
4
+ threshold?: number;
5
+ constructor();
6
+ withImage(image: string): CelebrityRecognitionReq;
7
+ withUrl(url: string): CelebrityRecognitionReq;
8
+ withThreshold(threshold: number): CelebrityRecognitionReq;
9
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CelebrityRecognitionReq = void 0;
4
+ var CelebrityRecognitionReq = /** @class */ (function () {
5
+ function CelebrityRecognitionReq() {
6
+ }
7
+ CelebrityRecognitionReq.prototype.withImage = function (image) {
8
+ this['image'] = image;
9
+ return this;
10
+ };
11
+ CelebrityRecognitionReq.prototype.withUrl = function (url) {
12
+ this['url'] = url;
13
+ return this;
14
+ };
15
+ CelebrityRecognitionReq.prototype.withThreshold = function (threshold) {
16
+ this['threshold'] = threshold;
17
+ return this;
18
+ };
19
+ return CelebrityRecognitionReq;
20
+ }());
21
+ exports.CelebrityRecognitionReq = CelebrityRecognitionReq;
@@ -0,0 +1,11 @@
1
+ export declare class CelebrityRecognitionResultBody {
2
+ confidence?: number;
3
+ private 'face_detail'?;
4
+ label?: string;
5
+ constructor();
6
+ withConfidence(confidence: number): CelebrityRecognitionResultBody;
7
+ withFaceDetail(faceDetail: object): CelebrityRecognitionResultBody;
8
+ set faceDetail(faceDetail: object | undefined);
9
+ get faceDetail(): object | undefined;
10
+ withLabel(label: string): CelebrityRecognitionResultBody;
11
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CelebrityRecognitionResultBody = void 0;
4
+ var CelebrityRecognitionResultBody = /** @class */ (function () {
5
+ function CelebrityRecognitionResultBody() {
6
+ }
7
+ CelebrityRecognitionResultBody.prototype.withConfidence = function (confidence) {
8
+ this['confidence'] = confidence;
9
+ return this;
10
+ };
11
+ CelebrityRecognitionResultBody.prototype.withFaceDetail = function (faceDetail) {
12
+ this['face_detail'] = faceDetail;
13
+ return this;
14
+ };
15
+ Object.defineProperty(CelebrityRecognitionResultBody.prototype, "faceDetail", {
16
+ get: function () {
17
+ return this['face_detail'];
18
+ },
19
+ set: function (faceDetail) {
20
+ this['face_detail'] = faceDetail;
21
+ },
22
+ enumerable: false,
23
+ configurable: true
24
+ });
25
+ CelebrityRecognitionResultBody.prototype.withLabel = function (label) {
26
+ this['label'] = label;
27
+ return this;
28
+ };
29
+ return CelebrityRecognitionResultBody;
30
+ }());
31
+ exports.CelebrityRecognitionResultBody = CelebrityRecognitionResultBody;