@huaweicloud/huaweicloud-sdk-smn 3.1.10

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 (227) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +1 -0
  3. package/huaweicloud-sdk-smn.d.ts +1 -0
  4. package/huaweicloud-sdk-smn.js +17 -0
  5. package/package.json +19 -0
  6. package/v2/SmnClient.d.ts +1187 -0
  7. package/v2/SmnClient.js +2299 -0
  8. package/v2/SmnRegion.d.ts +22 -0
  9. package/v2/SmnRegion.js +59 -0
  10. package/v2/model/AddSubscriptionRequest.d.ts +10 -0
  11. package/v2/model/AddSubscriptionRequest.js +28 -0
  12. package/v2/model/AddSubscriptionRequestBody.d.ts +9 -0
  13. package/v2/model/AddSubscriptionRequestBody.js +23 -0
  14. package/v2/model/AddSubscriptionResponse.d.ts +12 -0
  15. package/v2/model/AddSubscriptionResponse.js +55 -0
  16. package/v2/model/ApplicationEndpoint.d.ts +19 -0
  17. package/v2/model/ApplicationEndpoint.js +64 -0
  18. package/v2/model/ApplicationItem.d.ts +25 -0
  19. package/v2/model/ApplicationItem.js +83 -0
  20. package/v2/model/BatchCreateOrDeleteResourceTagsRequest.d.ts +14 -0
  21. package/v2/model/BatchCreateOrDeleteResourceTagsRequest.js +43 -0
  22. package/v2/model/BatchCreateOrDeleteResourceTagsRequestBody.d.ts +8 -0
  23. package/v2/model/BatchCreateOrDeleteResourceTagsRequestBody.js +19 -0
  24. package/v2/model/BatchCreateOrDeleteResourceTagsResponse.d.ts +4 -0
  25. package/v2/model/BatchCreateOrDeleteResourceTagsResponse.js +27 -0
  26. package/v2/model/CancelSubscriptionRequest.d.ts +7 -0
  27. package/v2/model/CancelSubscriptionRequest.js +24 -0
  28. package/v2/model/CancelSubscriptionResponse.d.ts +8 -0
  29. package/v2/model/CancelSubscriptionResponse.js +41 -0
  30. package/v2/model/CreateApplicationEndpointRequest.d.ts +10 -0
  31. package/v2/model/CreateApplicationEndpointRequest.js +28 -0
  32. package/v2/model/CreateApplicationEndpointRequestBody.d.ts +9 -0
  33. package/v2/model/CreateApplicationEndpointRequestBody.js +29 -0
  34. package/v2/model/CreateApplicationEndpointResponse.d.ts +12 -0
  35. package/v2/model/CreateApplicationEndpointResponse.js +55 -0
  36. package/v2/model/CreateApplicationRequest.d.ts +6 -0
  37. package/v2/model/CreateApplicationRequest.js +13 -0
  38. package/v2/model/CreateApplicationRequestBody.d.ts +15 -0
  39. package/v2/model/CreateApplicationRequestBody.js +49 -0
  40. package/v2/model/CreateApplicationResponse.d.ts +16 -0
  41. package/v2/model/CreateApplicationResponse.js +69 -0
  42. package/v2/model/CreateMessageTemplateRequest.d.ts +6 -0
  43. package/v2/model/CreateMessageTemplateRequest.js +13 -0
  44. package/v2/model/CreateMessageTemplateRequestBody.d.ts +11 -0
  45. package/v2/model/CreateMessageTemplateRequestBody.js +34 -0
  46. package/v2/model/CreateMessageTemplateResponse.d.ts +12 -0
  47. package/v2/model/CreateMessageTemplateResponse.js +55 -0
  48. package/v2/model/CreateResourceTagRequest.d.ts +14 -0
  49. package/v2/model/CreateResourceTagRequest.js +43 -0
  50. package/v2/model/CreateResourceTagRequestBody.d.ts +6 -0
  51. package/v2/model/CreateResourceTagRequestBody.js +14 -0
  52. package/v2/model/CreateResourceTagRequestBodyTag.d.ts +7 -0
  53. package/v2/model/CreateResourceTagRequestBodyTag.js +19 -0
  54. package/v2/model/CreateResourceTagResponse.d.ts +4 -0
  55. package/v2/model/CreateResourceTagResponse.js +27 -0
  56. package/v2/model/CreateTopicRequest.d.ts +6 -0
  57. package/v2/model/CreateTopicRequest.js +13 -0
  58. package/v2/model/CreateTopicRequestBody.d.ts +13 -0
  59. package/v2/model/CreateTopicRequestBody.js +43 -0
  60. package/v2/model/CreateTopicResponse.d.ts +12 -0
  61. package/v2/model/CreateTopicResponse.js +55 -0
  62. package/v2/model/DeleteApplicationEndpointRequest.d.ts +7 -0
  63. package/v2/model/DeleteApplicationEndpointRequest.js +24 -0
  64. package/v2/model/DeleteApplicationEndpointResponse.d.ts +8 -0
  65. package/v2/model/DeleteApplicationEndpointResponse.js +41 -0
  66. package/v2/model/DeleteApplicationRequest.d.ts +7 -0
  67. package/v2/model/DeleteApplicationRequest.js +24 -0
  68. package/v2/model/DeleteApplicationResponse.d.ts +8 -0
  69. package/v2/model/DeleteApplicationResponse.js +41 -0
  70. package/v2/model/DeleteMessageTemplateRequest.d.ts +7 -0
  71. package/v2/model/DeleteMessageTemplateRequest.js +24 -0
  72. package/v2/model/DeleteMessageTemplateResponse.d.ts +8 -0
  73. package/v2/model/DeleteMessageTemplateResponse.js +41 -0
  74. package/v2/model/DeleteResourceTagRequest.d.ts +13 -0
  75. package/v2/model/DeleteResourceTagRequest.js +44 -0
  76. package/v2/model/DeleteResourceTagResponse.d.ts +4 -0
  77. package/v2/model/DeleteResourceTagResponse.js +27 -0
  78. package/v2/model/DeleteTopicAttributeByNameRequest.d.ts +9 -0
  79. package/v2/model/DeleteTopicAttributeByNameRequest.js +29 -0
  80. package/v2/model/DeleteTopicAttributeByNameResponse.d.ts +8 -0
  81. package/v2/model/DeleteTopicAttributeByNameResponse.js +41 -0
  82. package/v2/model/DeleteTopicAttributesRequest.d.ts +7 -0
  83. package/v2/model/DeleteTopicAttributesRequest.js +24 -0
  84. package/v2/model/DeleteTopicAttributesResponse.d.ts +8 -0
  85. package/v2/model/DeleteTopicAttributesResponse.js +41 -0
  86. package/v2/model/DeleteTopicRequest.d.ts +7 -0
  87. package/v2/model/DeleteTopicRequest.js +24 -0
  88. package/v2/model/DeleteTopicResponse.d.ts +8 -0
  89. package/v2/model/DeleteTopicResponse.js +41 -0
  90. package/v2/model/LinksItem.d.ts +7 -0
  91. package/v2/model/LinksItem.js +19 -0
  92. package/v2/model/ListApplicationAttributesRequest.d.ts +7 -0
  93. package/v2/model/ListApplicationAttributesRequest.js +24 -0
  94. package/v2/model/ListApplicationAttributesResponse.d.ts +15 -0
  95. package/v2/model/ListApplicationAttributesResponse.js +59 -0
  96. package/v2/model/ListApplicationAttributesResponseBodyAttributes.d.ts +9 -0
  97. package/v2/model/ListApplicationAttributesResponseBodyAttributes.js +28 -0
  98. package/v2/model/ListApplicationEndpointAttributesRequest.d.ts +7 -0
  99. package/v2/model/ListApplicationEndpointAttributesRequest.js +24 -0
  100. package/v2/model/ListApplicationEndpointAttributesResponse.d.ts +11 -0
  101. package/v2/model/ListApplicationEndpointAttributesResponse.js +45 -0
  102. package/v2/model/ListApplicationEndpointAttributesResponseBodyAttributes.d.ts +11 -0
  103. package/v2/model/ListApplicationEndpointAttributesResponseBodyAttributes.js +34 -0
  104. package/v2/model/ListApplicationEndpointsRequest.d.ts +19 -0
  105. package/v2/model/ListApplicationEndpointsRequest.js +54 -0
  106. package/v2/model/ListApplicationEndpointsResponse.d.ts +15 -0
  107. package/v2/model/ListApplicationEndpointsResponse.js +59 -0
  108. package/v2/model/ListApplicationsRequest.d.ts +11 -0
  109. package/v2/model/ListApplicationsRequest.js +25 -0
  110. package/v2/model/ListApplicationsResponse.d.ts +15 -0
  111. package/v2/model/ListApplicationsResponse.js +59 -0
  112. package/v2/model/ListInstanceRequestBody.d.ts +27 -0
  113. package/v2/model/ListInstanceRequestBody.js +72 -0
  114. package/v2/model/ListMessageTemplateDetailsRequest.d.ts +7 -0
  115. package/v2/model/ListMessageTemplateDetailsRequest.js +24 -0
  116. package/v2/model/ListMessageTemplateDetailsResponse.d.ts +32 -0
  117. package/v2/model/ListMessageTemplateDetailsResponse.js +119 -0
  118. package/v2/model/ListMessageTemplatesRequest.d.ts +13 -0
  119. package/v2/model/ListMessageTemplatesRequest.js +35 -0
  120. package/v2/model/ListMessageTemplatesResponse.d.ts +17 -0
  121. package/v2/model/ListMessageTemplatesResponse.js +69 -0
  122. package/v2/model/ListProjectTagsRequest.d.ts +7 -0
  123. package/v2/model/ListProjectTagsRequest.js +24 -0
  124. package/v2/model/ListProjectTagsResponse.d.ts +7 -0
  125. package/v2/model/ListProjectTagsResponse.js +31 -0
  126. package/v2/model/ListResourceInstancesRequest.d.ts +10 -0
  127. package/v2/model/ListResourceInstancesRequest.js +28 -0
  128. package/v2/model/ListResourceInstancesResponse.d.ts +11 -0
  129. package/v2/model/ListResourceInstancesResponse.js +45 -0
  130. package/v2/model/ListResourceTagsRequest.d.ts +11 -0
  131. package/v2/model/ListResourceTagsRequest.js +39 -0
  132. package/v2/model/ListResourceTagsResponse.d.ts +7 -0
  133. package/v2/model/ListResourceTagsResponse.js +31 -0
  134. package/v2/model/ListSubscriptionsByTopicRequest.d.ts +11 -0
  135. package/v2/model/ListSubscriptionsByTopicRequest.js +32 -0
  136. package/v2/model/ListSubscriptionsByTopicResponse.d.ts +15 -0
  137. package/v2/model/ListSubscriptionsByTopicResponse.js +59 -0
  138. package/v2/model/ListSubscriptionsItem.d.ts +21 -0
  139. package/v2/model/ListSubscriptionsItem.js +64 -0
  140. package/v2/model/ListSubscriptionsRequest.d.ts +13 -0
  141. package/v2/model/ListSubscriptionsRequest.js +29 -0
  142. package/v2/model/ListSubscriptionsResponse.d.ts +15 -0
  143. package/v2/model/ListSubscriptionsResponse.js +59 -0
  144. package/v2/model/ListTopicAttributesRequest.d.ts +9 -0
  145. package/v2/model/ListTopicAttributesRequest.js +29 -0
  146. package/v2/model/ListTopicAttributesResponse.d.ts +11 -0
  147. package/v2/model/ListTopicAttributesResponse.js +45 -0
  148. package/v2/model/ListTopicDetailsRequest.d.ts +7 -0
  149. package/v2/model/ListTopicDetailsRequest.js +24 -0
  150. package/v2/model/ListTopicDetailsResponse.d.ts +34 -0
  151. package/v2/model/ListTopicDetailsResponse.js +129 -0
  152. package/v2/model/ListTopicsItem.d.ts +21 -0
  153. package/v2/model/ListTopicsItem.js +74 -0
  154. package/v2/model/ListTopicsRequest.d.ts +17 -0
  155. package/v2/model/ListTopicsRequest.js +49 -0
  156. package/v2/model/ListTopicsResponse.d.ts +15 -0
  157. package/v2/model/ListTopicsResponse.js +59 -0
  158. package/v2/model/ListVersionRequest.d.ts +7 -0
  159. package/v2/model/ListVersionRequest.js +24 -0
  160. package/v2/model/ListVersionResponse.d.ts +6 -0
  161. package/v2/model/ListVersionResponse.js +31 -0
  162. package/v2/model/ListVersionsRequest.d.ts +3 -0
  163. package/v2/model/ListVersionsRequest.js +9 -0
  164. package/v2/model/ListVersionsResponse.d.ts +7 -0
  165. package/v2/model/ListVersionsResponse.js +31 -0
  166. package/v2/model/MessageTemplate.d.ts +25 -0
  167. package/v2/model/MessageTemplate.js +89 -0
  168. package/v2/model/PublishAppMessageRequest.d.ts +10 -0
  169. package/v2/model/PublishAppMessageRequest.js +28 -0
  170. package/v2/model/PublishAppMessageRequestBody.d.ts +13 -0
  171. package/v2/model/PublishAppMessageRequestBody.js +41 -0
  172. package/v2/model/PublishAppMessageResponse.d.ts +12 -0
  173. package/v2/model/PublishAppMessageResponse.js +55 -0
  174. package/v2/model/PublishMessageRequest.d.ts +10 -0
  175. package/v2/model/PublishMessageRequest.js +28 -0
  176. package/v2/model/PublishMessageRequestBody.d.ts +25 -0
  177. package/v2/model/PublishMessageRequestBody.js +63 -0
  178. package/v2/model/PublishMessageResponse.d.ts +12 -0
  179. package/v2/model/PublishMessageResponse.js +55 -0
  180. package/v2/model/ResourceDetail.d.ts +17 -0
  181. package/v2/model/ResourceDetail.js +59 -0
  182. package/v2/model/ResourceTag.d.ts +7 -0
  183. package/v2/model/ResourceTag.js +19 -0
  184. package/v2/model/ResourceTags.d.ts +7 -0
  185. package/v2/model/ResourceTags.js +19 -0
  186. package/v2/model/Statement.d.ts +35 -0
  187. package/v2/model/Statement.js +123 -0
  188. package/v2/model/TagMatch.d.ts +7 -0
  189. package/v2/model/TagMatch.js +19 -0
  190. package/v2/model/TagResource.d.ts +19 -0
  191. package/v2/model/TagResource.js +59 -0
  192. package/v2/model/TopicAttribute.d.ts +16 -0
  193. package/v2/model/TopicAttribute.js +54 -0
  194. package/v2/model/UpdateApplicationEndpointRequest.d.ts +10 -0
  195. package/v2/model/UpdateApplicationEndpointRequest.js +28 -0
  196. package/v2/model/UpdateApplicationEndpointRequestBody.d.ts +9 -0
  197. package/v2/model/UpdateApplicationEndpointRequestBody.js +27 -0
  198. package/v2/model/UpdateApplicationEndpointResponse.d.ts +8 -0
  199. package/v2/model/UpdateApplicationEndpointResponse.js +41 -0
  200. package/v2/model/UpdateApplicationRequest.d.ts +10 -0
  201. package/v2/model/UpdateApplicationRequest.js +28 -0
  202. package/v2/model/UpdateApplicationRequestBody.d.ts +11 -0
  203. package/v2/model/UpdateApplicationRequestBody.js +39 -0
  204. package/v2/model/UpdateApplicationResponse.d.ts +8 -0
  205. package/v2/model/UpdateApplicationResponse.js +41 -0
  206. package/v2/model/UpdateMessageTemplateRequest.d.ts +10 -0
  207. package/v2/model/UpdateMessageTemplateRequest.js +28 -0
  208. package/v2/model/UpdateMessageTemplateRequestBody.d.ts +5 -0
  209. package/v2/model/UpdateMessageTemplateRequestBody.js +14 -0
  210. package/v2/model/UpdateMessageTemplateResponse.d.ts +8 -0
  211. package/v2/model/UpdateMessageTemplateResponse.js +41 -0
  212. package/v2/model/UpdateTopicAttributeRequest.d.ts +12 -0
  213. package/v2/model/UpdateTopicAttributeRequest.js +33 -0
  214. package/v2/model/UpdateTopicAttributeRequestBody.d.ts +5 -0
  215. package/v2/model/UpdateTopicAttributeRequestBody.js +14 -0
  216. package/v2/model/UpdateTopicAttributeResponse.d.ts +8 -0
  217. package/v2/model/UpdateTopicAttributeResponse.js +41 -0
  218. package/v2/model/UpdateTopicRequest.d.ts +10 -0
  219. package/v2/model/UpdateTopicRequest.js +28 -0
  220. package/v2/model/UpdateTopicRequestBody.d.ts +7 -0
  221. package/v2/model/UpdateTopicRequestBody.js +24 -0
  222. package/v2/model/UpdateTopicResponse.d.ts +8 -0
  223. package/v2/model/UpdateTopicResponse.js +41 -0
  224. package/v2/model/VersionItem.d.ts +18 -0
  225. package/v2/model/VersionItem.js +49 -0
  226. package/v2/public-api.d.ts +110 -0
  227. package/v2/public-api.js +126 -0
@@ -0,0 +1,2299 @@
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.SmnClient = void 0;
19
+ var ClientBuilder_1 = require("@huaweicloud/huaweicloud-sdk-core/ClientBuilder");
20
+ var AddSubscriptionRequest_1 = require("./model/AddSubscriptionRequest");
21
+ var BatchCreateOrDeleteResourceTagsRequest_1 = require("./model/BatchCreateOrDeleteResourceTagsRequest");
22
+ var CancelSubscriptionRequest_1 = require("./model/CancelSubscriptionRequest");
23
+ var CreateApplicationEndpointRequest_1 = require("./model/CreateApplicationEndpointRequest");
24
+ var CreateApplicationRequest_1 = require("./model/CreateApplicationRequest");
25
+ var CreateMessageTemplateRequest_1 = require("./model/CreateMessageTemplateRequest");
26
+ var CreateResourceTagRequest_1 = require("./model/CreateResourceTagRequest");
27
+ var CreateTopicRequest_1 = require("./model/CreateTopicRequest");
28
+ var DeleteApplicationEndpointRequest_1 = require("./model/DeleteApplicationEndpointRequest");
29
+ var DeleteApplicationRequest_1 = require("./model/DeleteApplicationRequest");
30
+ var DeleteMessageTemplateRequest_1 = require("./model/DeleteMessageTemplateRequest");
31
+ var DeleteResourceTagRequest_1 = require("./model/DeleteResourceTagRequest");
32
+ var DeleteTopicAttributeByNameRequest_1 = require("./model/DeleteTopicAttributeByNameRequest");
33
+ var DeleteTopicAttributesRequest_1 = require("./model/DeleteTopicAttributesRequest");
34
+ var DeleteTopicRequest_1 = require("./model/DeleteTopicRequest");
35
+ var ListApplicationAttributesRequest_1 = require("./model/ListApplicationAttributesRequest");
36
+ var ListApplicationEndpointAttributesRequest_1 = require("./model/ListApplicationEndpointAttributesRequest");
37
+ var ListApplicationEndpointsRequest_1 = require("./model/ListApplicationEndpointsRequest");
38
+ var ListApplicationsRequest_1 = require("./model/ListApplicationsRequest");
39
+ var ListMessageTemplateDetailsRequest_1 = require("./model/ListMessageTemplateDetailsRequest");
40
+ var ListMessageTemplatesRequest_1 = require("./model/ListMessageTemplatesRequest");
41
+ var ListProjectTagsRequest_1 = require("./model/ListProjectTagsRequest");
42
+ var ListResourceInstancesRequest_1 = require("./model/ListResourceInstancesRequest");
43
+ var ListResourceTagsRequest_1 = require("./model/ListResourceTagsRequest");
44
+ var ListSubscriptionsByTopicRequest_1 = require("./model/ListSubscriptionsByTopicRequest");
45
+ var ListSubscriptionsRequest_1 = require("./model/ListSubscriptionsRequest");
46
+ var ListTopicAttributesRequest_1 = require("./model/ListTopicAttributesRequest");
47
+ var ListTopicDetailsRequest_1 = require("./model/ListTopicDetailsRequest");
48
+ var ListTopicsRequest_1 = require("./model/ListTopicsRequest");
49
+ var ListVersionRequest_1 = require("./model/ListVersionRequest");
50
+ var PublishAppMessageRequest_1 = require("./model/PublishAppMessageRequest");
51
+ var PublishMessageRequest_1 = require("./model/PublishMessageRequest");
52
+ var UpdateApplicationEndpointRequest_1 = require("./model/UpdateApplicationEndpointRequest");
53
+ var UpdateApplicationRequest_1 = require("./model/UpdateApplicationRequest");
54
+ var UpdateMessageTemplateRequest_1 = require("./model/UpdateMessageTemplateRequest");
55
+ var UpdateTopicAttributeRequest_1 = require("./model/UpdateTopicAttributeRequest");
56
+ var UpdateTopicRequest_1 = require("./model/UpdateTopicRequest");
57
+ var SmnClient = /** @class */ (function () {
58
+ function SmnClient(client) {
59
+ this.hcClient = client;
60
+ }
61
+ SmnClient.newBuilder = function () {
62
+ return new ClientBuilder_1.ClientBuilder(newClient);
63
+ };
64
+ SmnClient.prototype.getPath = function () {
65
+ return __dirname;
66
+ };
67
+ /**
68
+ * 为指定Topic添加一个订阅者,如果订阅者的状态为未确认,则向订阅者发送一个确认的消息。待订阅者进行ConfirmSubscription确认后,该订阅者才能收到Topic发布的消息。单Topic默认可添加10000个订阅者,高并发场景下,可能会出现订阅者数量超过10000仍添加成功的情况,此为正常现象。接口是幂等的,如果添加已存在的订阅者,则返回成功,且status code为200,否则status code为201。
69
+ *
70
+ * 详细说明请参考华为云API Explorer。
71
+ * Please refer to Huawei cloud API Explorer for details.
72
+ *
73
+ * @summary 订阅
74
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
75
+ * @param {AddSubscriptionRequestBody} [addSubscriptionRequestBody]
76
+ * @param {*} [options] Override http request option.
77
+ * @throws {RequiredError}
78
+ */
79
+ SmnClient.prototype.addSubscription = function (addSubscriptionRequest) {
80
+ var options = (0, exports.ParamCreater)().addSubscription(addSubscriptionRequest);
81
+ options['responseHeaders'] = [''];
82
+ // @ts-ignore
83
+ return this.hcClient.sendRequest(options);
84
+ };
85
+ /**
86
+ * 为指定实例批量添加或删除标签。一个资源上最多有10个标签。
87
+ * 此接口为幂等接口:创建时如果请求体中存在重复key则报错。
88
+ * 创建时,不允许重复key,如果数据库存在就覆盖。
89
+ * 删除时,如果删除的标签不存在,默认处理成功,删除时不对标签字符集范围做校验。
90
+ *
91
+ * 详细说明请参考华为云API Explorer。
92
+ * Please refer to Huawei cloud API Explorer for details.
93
+ *
94
+ * @summary 批量添加删除资源标签
95
+ * @param {string} resourceType 资源类型,目前有: smn_topic,主题 smn_sms,短信 smn_application,移动推送
96
+ * @param {string} resourceId 资源ID。 获取resource_id的方法: 当resource_type为“smn_topic”时, 手动添加请求消息头“X-SMN-RESOURCEID-TYPE=name”,资源ID即为topic名称。 不添加请求消息头,通过“查询资源实例”,获取资源ID。 当resource_type为“smn_sms”时,resource_id为签名ID。您可在控制台获取。
97
+ * @param {BatchCreateOrDeleteResourceTagsRequestBody} [batchCreateOrDeleteResourceTagsRequestBody]
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ */
101
+ SmnClient.prototype.batchCreateOrDeleteResourceTags = function (batchCreateOrDeleteResourceTagsRequest) {
102
+ var options = (0, exports.ParamCreater)().batchCreateOrDeleteResourceTags(batchCreateOrDeleteResourceTagsRequest);
103
+ options['responseHeaders'] = [''];
104
+ // @ts-ignore
105
+ return this.hcClient.sendRequest(options);
106
+ };
107
+ /**
108
+ * 删除指定的订阅者。
109
+ *
110
+ * 详细说明请参考华为云API Explorer。
111
+ * Please refer to Huawei cloud API Explorer for details.
112
+ *
113
+ * @summary 取消订阅
114
+ * @param {string} subscriptionUrn 订阅者的唯一的资源标识,可通过[查询订阅者列表](https://support.huaweicloud.com/api-smn/ListSubscriptions.html)获取该标识。
115
+ * @param {*} [options] Override http request option.
116
+ * @throws {RequiredError}
117
+ */
118
+ SmnClient.prototype.cancelSubscription = function (cancelSubscriptionRequest) {
119
+ var options = (0, exports.ParamCreater)().cancelSubscription(cancelSubscriptionRequest);
120
+ options['responseHeaders'] = [''];
121
+ // @ts-ignore
122
+ return this.hcClient.sendRequest(options);
123
+ };
124
+ /**
125
+ * 创建一个模板,用户可以按照模板去发送消息,这样可以减少请求的数据量。
126
+ * 单用户默认可创建100个消息模板,高并发场景下,可能会出现消息模板数量超过100仍创建成功的情况,此为正常现象。
127
+ *
128
+ * 详细说明请参考华为云API Explorer。
129
+ * Please refer to Huawei cloud API Explorer for details.
130
+ *
131
+ * @summary 创建消息模板
132
+ * @param {CreateMessageTemplateRequestBody} [createMessageTemplateRequestBody]
133
+ * @param {*} [options] Override http request option.
134
+ * @throws {RequiredError}
135
+ */
136
+ SmnClient.prototype.createMessageTemplate = function (createMessageTemplateRequest) {
137
+ var options = (0, exports.ParamCreater)().createMessageTemplate(createMessageTemplateRequest);
138
+ options['responseHeaders'] = [''];
139
+ // @ts-ignore
140
+ return this.hcClient.sendRequest(options);
141
+ };
142
+ /**
143
+ * 一个资源上最多有10个标签。此接口为幂等接口:创建时,如果创建的标签已经存在(key相同),则覆盖。
144
+ *
145
+ * 详细说明请参考华为云API Explorer。
146
+ * Please refer to Huawei cloud API Explorer for details.
147
+ *
148
+ * @summary 添加资源标签
149
+ * @param {string} resourceType 资源类型,目前有: smn_topic,主题 smn_sms,短信 smn_application,移动推送
150
+ * @param {string} resourceId 资源ID。 获取resource_id的方法: 当resource_type为“smn_topic”时, 手动添加请求消息头“X-SMN-RESOURCEID-TYPE=name”,资源ID即为topic名称。 不添加请求消息头,通过“查询资源实例”,获取资源ID。 当resource_type为“smn_sms”时,resource_id为签名ID。您可在控制台获取。
151
+ * @param {CreateResourceTagRequestBody} [createResourceTagRequestBody]
152
+ * @param {*} [options] Override http request option.
153
+ * @throws {RequiredError}
154
+ */
155
+ SmnClient.prototype.createResourceTag = function (createResourceTagRequest) {
156
+ var options = (0, exports.ParamCreater)().createResourceTag(createResourceTagRequest);
157
+ options['responseHeaders'] = [''];
158
+ // @ts-ignore
159
+ return this.hcClient.sendRequest(options);
160
+ };
161
+ /**
162
+ * 创建Topic,单用户默认配额为3000。高并发场景下,可能会出现Topic数量超过3000仍创建成功的情况,此为正常现象。
163
+ * 接口是幂等的,接口调用返回成功时,若已存在同名的Topic,返回的status code为200,否则返回的status code为201
164
+ *
165
+ * 详细说明请参考华为云API Explorer。
166
+ * Please refer to Huawei cloud API Explorer for details.
167
+ *
168
+ * @summary 创建主题
169
+ * @param {CreateTopicRequestBody} createTopicRequestBody This is a auto create Body Object
170
+ * @param {*} [options] Override http request option.
171
+ * @throws {RequiredError}
172
+ */
173
+ SmnClient.prototype.createTopic = function (createTopicRequest) {
174
+ var options = (0, exports.ParamCreater)().createTopic(createTopicRequest);
175
+ options['responseHeaders'] = [''];
176
+ // @ts-ignore
177
+ return this.hcClient.sendRequest(options);
178
+ };
179
+ /**
180
+ * 删除消息模板。删除模板之前的消息请求都可以使用该模板发送,删除之后无法再使用该模板发送消息。
181
+ *
182
+ * 详细说明请参考华为云API Explorer。
183
+ * Please refer to Huawei cloud API Explorer for details.
184
+ *
185
+ * @summary 删除消息模板
186
+ * @param {string} messageTemplateId 模板唯一的资源标识,可通过查询[消息模板列表](https://support.huaweicloud.com/api-smn/ListMessageTemplates.html)获取该标识。
187
+ * @param {*} [options] Override http request option.
188
+ * @throws {RequiredError}
189
+ */
190
+ SmnClient.prototype.deleteMessageTemplate = function (deleteMessageTemplateRequest) {
191
+ var options = (0, exports.ParamCreater)().deleteMessageTemplate(deleteMessageTemplateRequest);
192
+ options['responseHeaders'] = [''];
193
+ // @ts-ignore
194
+ return this.hcClient.sendRequest(options);
195
+ };
196
+ /**
197
+ * 幂等接口:删除时,不对标签做校验。删除的key不存在报404,key不能为空或者空字符串。
198
+ *
199
+ * 详细说明请参考华为云API Explorer。
200
+ * Please refer to Huawei cloud API Explorer for details.
201
+ *
202
+ * @summary 删除资源标签
203
+ * @param {string} resourceType 资源类型,目前有: smn_topic,主题。 smn_sms,短信。 smn_application,移动推送。
204
+ * @param {string} resourceId 资源ID。 获取resource_id的方法: 当resource_type为“smn_topic”时, 手动添加请求消息头“X-SMN-RESOURCEID-TYPE=name”,资源ID即为topic名称。 不添加请求消息头,通过“查询资源实例”,获取资源ID。 当resource_type为“smn_sms”时,resource_id为签名ID。您可在控制台获取。
205
+ * @param {string} key 待删除标签的key值。
206
+ * @param {*} [options] Override http request option.
207
+ * @throws {RequiredError}
208
+ */
209
+ SmnClient.prototype.deleteResourceTag = function (deleteResourceTagRequest) {
210
+ var options = (0, exports.ParamCreater)().deleteResourceTag(deleteResourceTagRequest);
211
+ options['responseHeaders'] = [''];
212
+ // @ts-ignore
213
+ return this.hcClient.sendRequest(options);
214
+ };
215
+ /**
216
+ * 删除主题。
217
+ *
218
+ * 详细说明请参考华为云API Explorer。
219
+ * Please refer to Huawei cloud API Explorer for details.
220
+ *
221
+ * @summary 删除主题
222
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
223
+ * @param {*} [options] Override http request option.
224
+ * @throws {RequiredError}
225
+ */
226
+ SmnClient.prototype.deleteTopic = function (deleteTopicRequest) {
227
+ var options = (0, exports.ParamCreater)().deleteTopic(deleteTopicRequest);
228
+ options['responseHeaders'] = [''];
229
+ // @ts-ignore
230
+ return this.hcClient.sendRequest(options);
231
+ };
232
+ /**
233
+ * 删除指定名称的主题策略。
234
+ *
235
+ * 详细说明请参考华为云API Explorer。
236
+ * Please refer to Huawei cloud API Explorer for details.
237
+ *
238
+ * @summary 删除指定名称的主题策略
239
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
240
+ * @param {string} name 主题策略名称。 只支持特定的策略名称,请参见[Topic属性表](https://support.huaweicloud.com/intl/zh-cn/api-smn/smn_api_a1000.html)。
241
+ * @param {*} [options] Override http request option.
242
+ * @throws {RequiredError}
243
+ */
244
+ SmnClient.prototype.deleteTopicAttributeByName = function (deleteTopicAttributeByNameRequest) {
245
+ var options = (0, exports.ParamCreater)().deleteTopicAttributeByName(deleteTopicAttributeByNameRequest);
246
+ options['responseHeaders'] = [''];
247
+ // @ts-ignore
248
+ return this.hcClient.sendRequest(options);
249
+ };
250
+ /**
251
+ * 删除所有主题策略。
252
+ *
253
+ * 详细说明请参考华为云API Explorer。
254
+ * Please refer to Huawei cloud API Explorer for details.
255
+ *
256
+ * @summary 删除所有主题策略
257
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
258
+ * @param {*} [options] Override http request option.
259
+ * @throws {RequiredError}
260
+ */
261
+ SmnClient.prototype.deleteTopicAttributes = function (deleteTopicAttributesRequest) {
262
+ var options = (0, exports.ParamCreater)().deleteTopicAttributes(deleteTopicAttributesRequest);
263
+ options['responseHeaders'] = [''];
264
+ // @ts-ignore
265
+ return this.hcClient.sendRequest(options);
266
+ };
267
+ /**
268
+ * 查询模板详情,包括模板内容。
269
+ *
270
+ * 详细说明请参考华为云API Explorer。
271
+ * Please refer to Huawei cloud API Explorer for details.
272
+ *
273
+ * @summary 查询消息模板详情
274
+ * @param {string} messageTemplateId 模板唯一的资源标识,可通过查询[消息模板列表](https://support.huaweicloud.com/api-smn/ListMessageTemplates.html)获取该标识。
275
+ * @param {*} [options] Override http request option.
276
+ * @throws {RequiredError}
277
+ */
278
+ SmnClient.prototype.listMessageTemplateDetails = function (listMessageTemplateDetailsRequest) {
279
+ var options = (0, exports.ParamCreater)().listMessageTemplateDetails(listMessageTemplateDetailsRequest);
280
+ options['responseHeaders'] = [''];
281
+ // @ts-ignore
282
+ return this.hcClient.sendRequest(options);
283
+ };
284
+ /**
285
+ * 分页查询模板列表,模板列表按照创建时间进行升序排列。分页查询可以指定offset以及limit。如果不存在模板,则返回空列表。额外的查询参数分别有message_template_name和protocol。
286
+ *
287
+ * 详细说明请参考华为云API Explorer。
288
+ * Please refer to Huawei cloud API Explorer for details.
289
+ *
290
+ * @summary 查询消息模板列表
291
+ * @param {number} [offset] 偏移量,偏移量为一个大于0小于资源总个数的整数,表示查询该偏移量后面的所有的资源,默认值为0。
292
+ * @param {number} [limit] 取值范围:1~100,取值一般为10,20,50。功能说明:每页返回的资源个数。默认值为100。
293
+ * @param {string} [messageTemplateName] 模板的名称。 只能包含大写字母、小写字母、数字、-和_,且必须由大写字母、小写字母或数字开头,长度在1到64个字符之间。
294
+ * @param {string} [protocol] 模板支持的协议类型。 目前支持的协议包括: “default”:默认协议。 “email”:邮件传输协议。 “sms”:短信传输协议。 “functionstage”:FunctionGraph(函数)传输协议。 “dms”:DMS传输协议。 “http”、“https”:HTTP/HTTPS传输协议。
295
+ * @param {*} [options] Override http request option.
296
+ * @throws {RequiredError}
297
+ */
298
+ SmnClient.prototype.listMessageTemplates = function (listMessageTemplatesRequest) {
299
+ var options = (0, exports.ParamCreater)().listMessageTemplates(listMessageTemplatesRequest);
300
+ options['responseHeaders'] = [''];
301
+ // @ts-ignore
302
+ return this.hcClient.sendRequest(options);
303
+ };
304
+ /**
305
+ * 查询租户在指定Region和实例类型的所有标签集合。
306
+ *
307
+ * 详细说明请参考华为云API Explorer。
308
+ * Please refer to Huawei cloud API Explorer for details.
309
+ *
310
+ * @summary 查询项目标签
311
+ * @param {string} resourceType 资源类型 目前有: smn_topic,主题 smn_sms,短信 smn_application,移动推送
312
+ * @param {*} [options] Override http request option.
313
+ * @throws {RequiredError}
314
+ */
315
+ SmnClient.prototype.listProjectTags = function (listProjectTagsRequest) {
316
+ var options = (0, exports.ParamCreater)().listProjectTags(listProjectTagsRequest);
317
+ options['responseHeaders'] = [''];
318
+ // @ts-ignore
319
+ return this.hcClient.sendRequest(options);
320
+ };
321
+ /**
322
+ * 使用标签过滤实例。
323
+ *
324
+ * 详细说明请参考华为云API Explorer。
325
+ * Please refer to Huawei cloud API Explorer for details.
326
+ *
327
+ * @summary 查询资源实例
328
+ * @param {string} resourceType 资源类型,目前有: smn_topic,主题 smn_sms,短信 smn_application,移动推送
329
+ * @param {ListInstanceRequestBody} [listInstancesRequestBody]
330
+ * @param {*} [options] Override http request option.
331
+ * @throws {RequiredError}
332
+ */
333
+ SmnClient.prototype.listResourceInstances = function (listResourceInstancesRequest) {
334
+ var options = (0, exports.ParamCreater)().listResourceInstances(listResourceInstancesRequest);
335
+ options['responseHeaders'] = [''];
336
+ // @ts-ignore
337
+ return this.hcClient.sendRequest(options);
338
+ };
339
+ /**
340
+ * 查询指定实例的标签信息。
341
+ *
342
+ * 详细说明请参考华为云API Explorer。
343
+ * Please refer to Huawei cloud API Explorer for details.
344
+ *
345
+ * @summary 查询资源标签
346
+ * @param {string} resourceType 资源类型 目前有: smn_topic,主题 smn_sms,短信 smn_application,移动推送
347
+ * @param {string} resourceId 资源ID。 获取resource_id的方法: 当resource_type为“smn_topic”时, 手动添加请求消息头“X-SMN-RESOURCEID-TYPE=name”,资源ID即为topic名称。 不添加请求消息头,通过“查询资源实例”,获取资源ID。 当resource_type为“smn_sms”时,resource_id为签名ID。您可在控制台获取。
348
+ * @param {*} [options] Override http request option.
349
+ * @throws {RequiredError}
350
+ */
351
+ SmnClient.prototype.listResourceTags = function (listResourceTagsRequest) {
352
+ var options = (0, exports.ParamCreater)().listResourceTags(listResourceTagsRequest);
353
+ options['responseHeaders'] = [''];
354
+ // @ts-ignore
355
+ return this.hcClient.sendRequest(options);
356
+ };
357
+ /**
358
+ * 分页返回请求者的所有的订阅列表,订阅列表按照订阅创建时间进行升序排列。分页查询可以指定offset以及limit。如果订阅者不存在,返回空列表。
359
+ *
360
+ * 详细说明请参考华为云API Explorer。
361
+ * Please refer to Huawei cloud API Explorer for details.
362
+ *
363
+ * @summary 查询订阅者列表
364
+ * @param {number} [offset] 偏移量。 偏移量为一个大于0小于资源总个数的整数,表示查询该偏移量后面的所有的资源,默认值为0。
365
+ * @param {number} [limit] 查询数量限制。 取值范围:1~100,取值一般为10,20,50。功能说明:每页返回的资源个数。默认值为100。
366
+ * @param {string} [protocol] 协议名称, 枚举值:http、https、sms、email、functionstage、dms、application。
367
+ * @param {number} [status] 状态。 0:未确认 1:已确认 2:不需要确认 3:已取消确认 4:已经删除。
368
+ * @param {string} [endpoint] 订阅终端。
369
+ * @param {*} [options] Override http request option.
370
+ * @throws {RequiredError}
371
+ */
372
+ SmnClient.prototype.listSubscriptions = function (listSubscriptionsRequest) {
373
+ var options = (0, exports.ParamCreater)().listSubscriptions(listSubscriptionsRequest);
374
+ options['responseHeaders'] = [''];
375
+ // @ts-ignore
376
+ return this.hcClient.sendRequest(options);
377
+ };
378
+ /**
379
+ * 分页获取特定Topic的订阅列表,订阅列表按照订阅创建时间进行升序排列。分页查询可以指定offset以及limit。如果指定Topic不存在订阅者,返回空列表。
380
+ *
381
+ * 详细说明请参考华为云API Explorer。
382
+ * Please refer to Huawei cloud API Explorer for details.
383
+ *
384
+ * @summary 查询指定Topic的订阅者列表
385
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
386
+ * @param {number} [offset] 偏移量。 偏移量为一个大于0小于资源总个数的整数,表示查询该偏移量后面的所有的资源,默认值为0。
387
+ * @param {number} [limit] 查询的数量限制。 取值范围:1~100,取值一般为10,20,50。功能说明:每页返回的资源个数。默认值为100。
388
+ * @param {*} [options] Override http request option.
389
+ * @throws {RequiredError}
390
+ */
391
+ SmnClient.prototype.listSubscriptionsByTopic = function (listSubscriptionsByTopicRequest) {
392
+ var options = (0, exports.ParamCreater)().listSubscriptionsByTopic(listSubscriptionsByTopicRequest);
393
+ options['responseHeaders'] = [''];
394
+ // @ts-ignore
395
+ return this.hcClient.sendRequest(options);
396
+ };
397
+ /**
398
+ * 查询主题的策略信息。
399
+ *
400
+ * 详细说明请参考华为云API Explorer。
401
+ * Please refer to Huawei cloud API Explorer for details.
402
+ *
403
+ * @summary 查询主题策略
404
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
405
+ * @param {string} name 主题策略名称。 只支持特定的策略名称,请参见[Topic属性表](https://support.huaweicloud.com/intl/zh-cn/api-smn/smn_api_a1000.html)。
406
+ * @param {*} [options] Override http request option.
407
+ * @throws {RequiredError}
408
+ */
409
+ SmnClient.prototype.listTopicAttributes = function (listTopicAttributesRequest) {
410
+ var options = (0, exports.ParamCreater)().listTopicAttributes(listTopicAttributesRequest);
411
+ options['responseHeaders'] = [''];
412
+ // @ts-ignore
413
+ return this.hcClient.sendRequest(options);
414
+ };
415
+ /**
416
+ * 查询Topic的详细信息。
417
+ *
418
+ * 详细说明请参考华为云API Explorer。
419
+ * Please refer to Huawei cloud API Explorer for details.
420
+ *
421
+ * @summary 查询主题详情
422
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
423
+ * @param {*} [options] Override http request option.
424
+ * @throws {RequiredError}
425
+ */
426
+ SmnClient.prototype.listTopicDetails = function (listTopicDetailsRequest) {
427
+ var options = (0, exports.ParamCreater)().listTopicDetails(listTopicDetailsRequest);
428
+ options['responseHeaders'] = [''];
429
+ // @ts-ignore
430
+ return this.hcClient.sendRequest(options);
431
+ };
432
+ /**
433
+ * 分页查询Topic列表,Topic列表按照Topic创建时间进行降序排列。分页查询可以指定offset以及limit。如果不存在Topic,则返回空列表。
434
+ *
435
+ * 详细说明请参考华为云API Explorer。
436
+ * Please refer to Huawei cloud API Explorer for details.
437
+ *
438
+ * @summary 查询主题列表
439
+ * @param {number} [offset] 偏移量。 偏移量为一个大于0小于资源总个数的整数,表示查询该偏移量后面的所有的资源,默认值为0。
440
+ * @param {number} [limit] 查询的数量限制。 取值范围:1~100,取值一般为10,20,50。功能说明:每页返回的资源个数。默认值为100。
441
+ * @param {string} [enterpriseProjectId] 企业项目id,默认企业项目id为0。
442
+ * @param {string} [name] 检索的主题名称,完全匹配。
443
+ * @param {string} [fuzzyName] 检索的主题名称,模糊匹配,按照startwith模式进行匹配。
444
+ * @param {*} [options] Override http request option.
445
+ * @throws {RequiredError}
446
+ */
447
+ SmnClient.prototype.listTopics = function (listTopicsRequest) {
448
+ var options = (0, exports.ParamCreater)().listTopics(listTopicsRequest);
449
+ options['responseHeaders'] = [''];
450
+ // @ts-ignore
451
+ return this.hcClient.sendRequest(options);
452
+ };
453
+ /**
454
+ * 查询SMN API V2版本信息。
455
+ *
456
+ * 详细说明请参考华为云API Explorer。
457
+ * Please refer to Huawei cloud API Explorer for details.
458
+ *
459
+ * @summary 查询SMN API V2版本信息
460
+ * @param {string} apiVersion 待查询版本号。当前仅支持v2。
461
+ * @param {*} [options] Override http request option.
462
+ * @throws {RequiredError}
463
+ */
464
+ SmnClient.prototype.listVersion = function (listVersionRequest) {
465
+ var options = (0, exports.ParamCreater)().listVersion(listVersionRequest);
466
+ options['responseHeaders'] = [''];
467
+ // @ts-ignore
468
+ return this.hcClient.sendRequest(options);
469
+ };
470
+ /**
471
+ * 查询SMN开放API支持的版本号。
472
+ *
473
+ * 详细说明请参考华为云API Explorer。
474
+ * Please refer to Huawei cloud API Explorer for details.
475
+ *
476
+ * @summary 查询SMN支持的API版本号信息
477
+ * @param {*} [options] Override http request option.
478
+ * @throws {RequiredError}
479
+ */
480
+ SmnClient.prototype.listVersions = function () {
481
+ var options = (0, exports.ParamCreater)().listVersions();
482
+ options['responseHeaders'] = [''];
483
+ // @ts-ignore
484
+ return this.hcClient.sendRequest(options);
485
+ };
486
+ /**
487
+ * 将消息发送给Topic的所有订阅端点。当返回消息ID时,该消息已被保存并开始尝试将其推送给Topic的订阅者。三种消息发送方式
488
+ *
489
+ * message
490
+ *
491
+ * message_structure
492
+ *
493
+ * message_template_name
494
+ *
495
+ * 只需要设置其中一个,如果同时设置,生效的优先级为
496
+ * message_structure > message_template_name > message。
497
+ *
498
+ * 详细说明请参考华为云API Explorer。
499
+ * Please refer to Huawei cloud API Explorer for details.
500
+ *
501
+ * @summary 消息发布
502
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
503
+ * @param {PublishMessageRequestBody} [publishMessageRequestBody]
504
+ * @param {*} [options] Override http request option.
505
+ * @throws {RequiredError}
506
+ */
507
+ SmnClient.prototype.publishMessage = function (publishMessageRequest) {
508
+ var options = (0, exports.ParamCreater)().publishMessage(publishMessageRequest);
509
+ options['responseHeaders'] = [''];
510
+ // @ts-ignore
511
+ return this.hcClient.sendRequest(options);
512
+ };
513
+ /**
514
+ * 修改消息模板的内容。
515
+ *
516
+ * 详细说明请参考华为云API Explorer。
517
+ * Please refer to Huawei cloud API Explorer for details.
518
+ *
519
+ * @summary 更新消息模板
520
+ * @param {string} messageTemplateId 模板唯一的资源标识,可通过查询[消息模板列表](https://support.huaweicloud.com/api-smn/ListMessageTemplates.html)获取该标识。
521
+ * @param {UpdateMessageTemplateRequestBody} [updateMessageTemplateRequestBody]
522
+ * @param {*} [options] Override http request option.
523
+ * @throws {RequiredError}
524
+ */
525
+ SmnClient.prototype.updateMessageTemplate = function (updateMessageTemplateRequest) {
526
+ var options = (0, exports.ParamCreater)().updateMessageTemplate(updateMessageTemplateRequest);
527
+ options['responseHeaders'] = [''];
528
+ // @ts-ignore
529
+ return this.hcClient.sendRequest(options);
530
+ };
531
+ /**
532
+ * 更新显示名。
533
+ *
534
+ * 详细说明请参考华为云API Explorer。
535
+ * Please refer to Huawei cloud API Explorer for details.
536
+ *
537
+ * @summary 更新主题
538
+ * @param {string} topicUrn Topic的唯一的资源标识。可以通过[查看主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
539
+ * @param {UpdateTopicRequestBody} updateTopicRequestBody This is a auto create Body Object
540
+ * @param {*} [options] Override http request option.
541
+ * @throws {RequiredError}
542
+ */
543
+ SmnClient.prototype.updateTopic = function (updateTopicRequest) {
544
+ var options = (0, exports.ParamCreater)().updateTopic(updateTopicRequest);
545
+ options['responseHeaders'] = [''];
546
+ // @ts-ignore
547
+ return this.hcClient.sendRequest(options);
548
+ };
549
+ /**
550
+ * 更新主题的策略信息。
551
+ *
552
+ * 详细说明请参考华为云API Explorer。
553
+ * Please refer to Huawei cloud API Explorer for details.
554
+ *
555
+ * @summary 更新主题策略
556
+ * @param {string} topicUrn Topic的唯一的资源标识,可通过[查询主题列表](https://support.huaweicloud.com/api-smn/smn_api_51004.html)获取该标识。
557
+ * @param {string} name 主题策略名称。 只支持特定的策略名称,请参见[Topic属性表](https://support.huaweicloud.com/intl/zh-cn/api-smn/smn_api_a1000.html)。
558
+ * @param {UpdateTopicAttributeRequestBody} updateTopicAttributeRequestBody This is a auto create Body Object
559
+ * @param {*} [options] Override http request option.
560
+ * @throws {RequiredError}
561
+ */
562
+ SmnClient.prototype.updateTopicAttribute = function (updateTopicAttributeRequest) {
563
+ var options = (0, exports.ParamCreater)().updateTopicAttribute(updateTopicAttributeRequest);
564
+ options['responseHeaders'] = [''];
565
+ // @ts-ignore
566
+ return this.hcClient.sendRequest(options);
567
+ };
568
+ /**
569
+ * 创建平台应用。
570
+ *
571
+ * 详细说明请参考华为云API Explorer。
572
+ * Please refer to Huawei cloud API Explorer for details.
573
+ *
574
+ * @summary 创建Application
575
+ * @param {CreateApplicationRequestBody} [createApplicationRequestBody]
576
+ * @param {*} [options] Override http request option.
577
+ * @throws {RequiredError}
578
+ */
579
+ SmnClient.prototype.createApplication = function (createApplicationRequest) {
580
+ var options = (0, exports.ParamCreater)().createApplication(createApplicationRequest);
581
+ options['responseHeaders'] = [''];
582
+ // @ts-ignore
583
+ return this.hcClient.sendRequest(options);
584
+ };
585
+ /**
586
+ * 删除平台应用。
587
+ *
588
+ * 详细说明请参考华为云API Explorer。
589
+ * Please refer to Huawei cloud API Explorer for details.
590
+ *
591
+ * @summary 删除Application
592
+ * @param {string} applicationUrn Application的唯一资源标识,可通过[查询Application](https://support.huaweicloud.com/api-smn/ListApplications.html)获取该标识。
593
+ * @param {*} [options] Override http request option.
594
+ * @throws {RequiredError}
595
+ */
596
+ SmnClient.prototype.deleteApplication = function (deleteApplicationRequest) {
597
+ var options = (0, exports.ParamCreater)().deleteApplication(deleteApplicationRequest);
598
+ options['responseHeaders'] = [''];
599
+ // @ts-ignore
600
+ return this.hcClient.sendRequest(options);
601
+ };
602
+ /**
603
+ * 获取应用平台属性。
604
+ *
605
+ * 详细说明请参考华为云API Explorer。
606
+ * Please refer to Huawei cloud API Explorer for details.
607
+ *
608
+ * @summary 查询Application属性
609
+ * @param {string} applicationUrn Application的唯一资源标识,可通过[查询Application](https://support.huaweicloud.com/api-smn/ListApplications.html)获取该标识。
610
+ * @param {*} [options] Override http request option.
611
+ * @throws {RequiredError}
612
+ */
613
+ SmnClient.prototype.listApplicationAttributes = function (listApplicationAttributesRequest) {
614
+ var options = (0, exports.ParamCreater)().listApplicationAttributes(listApplicationAttributesRequest);
615
+ options['responseHeaders'] = [''];
616
+ // @ts-ignore
617
+ return this.hcClient.sendRequest(options);
618
+ };
619
+ /**
620
+ * 查询应用平台列表。
621
+ *
622
+ * 详细说明请参考华为云API Explorer。
623
+ * Please refer to Huawei cloud API Explorer for details.
624
+ *
625
+ * @summary 查询Application
626
+ * @param {number} [offset] 偏移量。 偏移量为一个大于0小于资源总个数的整数,表示查询该偏移量后面的所有的资源,默认值为0。
627
+ * @param {number} [limit] 查询的数量限制。 取值范围:1~100,取值一般为10,20,50。功能说明:每页返回的资源个数。默认值为100。
628
+ * @param {string} [name] 检索应用名称。 支持后向模糊匹配,长度不得超过64个字符,只能包含英文字母、下划线和数字。
629
+ * @param {string} [platform] 应用平台。 目前仅支持HMS、APNS、APNS_SANDBOX。 HMS是为开发者提供的消息推送平台。 APNS和APNS_SANDBOX是用于推送iOS消息的服务平台。
630
+ * @param {*} [options] Override http request option.
631
+ * @throws {RequiredError}
632
+ */
633
+ SmnClient.prototype.listApplications = function (listApplicationsRequest) {
634
+ var options = (0, exports.ParamCreater)().listApplications(listApplicationsRequest);
635
+ options['responseHeaders'] = [''];
636
+ // @ts-ignore
637
+ return this.hcClient.sendRequest(options);
638
+ };
639
+ /**
640
+ * 将消息直发给endpoint设备。
641
+ *
642
+ * 详细说明请参考华为云API Explorer。
643
+ * Please refer to Huawei cloud API Explorer for details.
644
+ *
645
+ * @summary App消息发布
646
+ * @param {string} endpointUrn Endpoint的唯一资源标识,可通过[查询Application的Endpoint列表](https://support.huaweicloud.com/api-smn/ListApplicationEndpoints.html)获取该标识
647
+ * @param {PublishAppMessageRequestBody} [publishAppMessageRequestBody]
648
+ * @param {*} [options] Override http request option.
649
+ * @throws {RequiredError}
650
+ */
651
+ SmnClient.prototype.publishAppMessage = function (publishAppMessageRequest) {
652
+ var options = (0, exports.ParamCreater)().publishAppMessage(publishAppMessageRequest);
653
+ options['responseHeaders'] = [''];
654
+ // @ts-ignore
655
+ return this.hcClient.sendRequest(options);
656
+ };
657
+ /**
658
+ * 更新应用平台。
659
+ *
660
+ * 详细说明请参考华为云API Explorer。
661
+ * Please refer to Huawei cloud API Explorer for details.
662
+ *
663
+ * @summary 更新Application
664
+ * @param {string} applicationUrn Application的唯一资源标识,可通过[查询Application](https://support.huaweicloud.com/api-smn/ListApplications.html)获取该标识。
665
+ * @param {UpdateApplicationRequestBody} [updateApplicationRequestBody]
666
+ * @param {*} [options] Override http request option.
667
+ * @throws {RequiredError}
668
+ */
669
+ SmnClient.prototype.updateApplication = function (updateApplicationRequest) {
670
+ var options = (0, exports.ParamCreater)().updateApplication(updateApplicationRequest);
671
+ options['responseHeaders'] = [''];
672
+ // @ts-ignore
673
+ return this.hcClient.sendRequest(options);
674
+ };
675
+ /**
676
+ * 创建应用平台的endpoint终端。
677
+ *
678
+ * 详细说明请参考华为云API Explorer。
679
+ * Please refer to Huawei cloud API Explorer for details.
680
+ *
681
+ * @summary 创建Application endpoint
682
+ * @param {string} applicationUrn Application的唯一资源标识,可通过[查询Application](https://support.huaweicloud.com/api-smn/ListApplications.html)获取该标识。
683
+ * @param {CreateApplicationEndpointRequestBody} [createApplicationEndpointRequestBody]
684
+ * @param {*} [options] Override http request option.
685
+ * @throws {RequiredError}
686
+ */
687
+ SmnClient.prototype.createApplicationEndpoint = function (createApplicationEndpointRequest) {
688
+ var options = (0, exports.ParamCreater)().createApplicationEndpoint(createApplicationEndpointRequest);
689
+ options['responseHeaders'] = [''];
690
+ // @ts-ignore
691
+ return this.hcClient.sendRequest(options);
692
+ };
693
+ /**
694
+ * 删除设备。
695
+ *
696
+ * 详细说明请参考华为云API Explorer。
697
+ * Please refer to Huawei cloud API Explorer for details.
698
+ *
699
+ * @summary 删除Application endpoint
700
+ * @param {string} endpointUrn Endpoint的唯一资源标识,可通过[查询Application的Endpoint列表](https://support.huaweicloud.com/api-smn/ListApplicationEndpoints.html)获取该标识。
701
+ * @param {*} [options] Override http request option.
702
+ * @throws {RequiredError}
703
+ */
704
+ SmnClient.prototype.deleteApplicationEndpoint = function (deleteApplicationEndpointRequest) {
705
+ var options = (0, exports.ParamCreater)().deleteApplicationEndpoint(deleteApplicationEndpointRequest);
706
+ options['responseHeaders'] = [''];
707
+ // @ts-ignore
708
+ return this.hcClient.sendRequest(options);
709
+ };
710
+ /**
711
+ * 获取endpoint的属性。
712
+ *
713
+ * 详细说明请参考华为云API Explorer。
714
+ * Please refer to Huawei cloud API Explorer for details.
715
+ *
716
+ * @summary 查询Application的Endpoint属性
717
+ * @param {string} endpointUrn Endpoint的唯一资源标识,可通过[查询Application的Endpoint列表](https://support.huaweicloud.com/api-smn/ListApplicationEndpoints.html)获取该标识。
718
+ * @param {*} [options] Override http request option.
719
+ * @throws {RequiredError}
720
+ */
721
+ SmnClient.prototype.listApplicationEndpointAttributes = function (listApplicationEndpointAttributesRequest) {
722
+ var options = (0, exports.ParamCreater)().listApplicationEndpointAttributes(listApplicationEndpointAttributesRequest);
723
+ options['responseHeaders'] = [''];
724
+ // @ts-ignore
725
+ return this.hcClient.sendRequest(options);
726
+ };
727
+ /**
728
+ * 查询平台的endpoint列表。
729
+ *
730
+ * 详细说明请参考华为云API Explorer。
731
+ * Please refer to Huawei cloud API Explorer for details.
732
+ *
733
+ * @summary 查询Application的Endpoint列表
734
+ * @param {string} applicationUrn Application的唯一资源标识,可通过[查询Application](https://support.huaweicloud.com/api-smn/ListApplications.html)获取该标识。
735
+ * @param {number} [offset] 偏移量。 偏移量为一个大于0小于资源总个数的整数,表示查询该偏移量后面的所有的资源,默认值为0。
736
+ * @param {number} [limit] 查询的数量限制。 取值范围:1~100,取值一般为10,20,50。功能说明:每页返回的资源个数。默认值为100。
737
+ * @param {string} [enabled] 设备是否可用,值为true或false字符串。
738
+ * @param {string} [token] 设备token,最大长度512个字节。
739
+ * @param {string} [userData] 用户数据,最大长度2048个字节。
740
+ * @param {*} [options] Override http request option.
741
+ * @throws {RequiredError}
742
+ */
743
+ SmnClient.prototype.listApplicationEndpoints = function (listApplicationEndpointsRequest) {
744
+ var options = (0, exports.ParamCreater)().listApplicationEndpoints(listApplicationEndpointsRequest);
745
+ options['responseHeaders'] = [''];
746
+ // @ts-ignore
747
+ return this.hcClient.sendRequest(options);
748
+ };
749
+ /**
750
+ * 更新设备属性。
751
+ *
752
+ * 详细说明请参考华为云API Explorer。
753
+ * Please refer to Huawei cloud API Explorer for details.
754
+ *
755
+ * @summary 更新Application endpoint
756
+ * @param {string} endpointUrn Endpoint的唯一资源标识,可通过[查询Application的Endpoint列表](https://support.huaweicloud.com/api-smn/ListApplicationEndpoints.html)获取该标识。
757
+ * @param {UpdateApplicationEndpointRequestBody} [updateApplicationEndpointRequestBody]
758
+ * @param {*} [options] Override http request option.
759
+ * @throws {RequiredError}
760
+ */
761
+ SmnClient.prototype.updateApplicationEndpoint = function (updateApplicationEndpointRequest) {
762
+ var options = (0, exports.ParamCreater)().updateApplicationEndpoint(updateApplicationEndpointRequest);
763
+ options['responseHeaders'] = [''];
764
+ // @ts-ignore
765
+ return this.hcClient.sendRequest(options);
766
+ };
767
+ return SmnClient;
768
+ }());
769
+ exports.SmnClient = SmnClient;
770
+ var ParamCreater = function () {
771
+ return {
772
+ /**
773
+ * 为指定Topic添加一个订阅者,如果订阅者的状态为未确认,则向订阅者发送一个确认的消息。待订阅者进行ConfirmSubscription确认后,该订阅者才能收到Topic发布的消息。单Topic默认可添加10000个订阅者,高并发场景下,可能会出现订阅者数量超过10000仍添加成功的情况,此为正常现象。接口是幂等的,如果添加已存在的订阅者,则返回成功,且status code为200,否则status code为201。
774
+ *
775
+ * 详细说明请参考华为云API Explorer。
776
+ * Please refer to Huawei cloud API Explorer for details.
777
+ */
778
+ addSubscription: function (addSubscriptionRequest) {
779
+ var options = {
780
+ method: "POST",
781
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}/subscriptions",
782
+ contentType: "application/json;charset=UTF-8",
783
+ queryParams: {},
784
+ pathParams: {},
785
+ headers: {},
786
+ data: {}
787
+ };
788
+ var localVarHeaderParameter = {};
789
+ var body;
790
+ var topicUrn;
791
+ if (addSubscriptionRequest !== null && addSubscriptionRequest !== undefined) {
792
+ if (addSubscriptionRequest instanceof AddSubscriptionRequest_1.AddSubscriptionRequest) {
793
+ topicUrn = addSubscriptionRequest.topicUrn;
794
+ body = addSubscriptionRequest.body;
795
+ }
796
+ else {
797
+ topicUrn = addSubscriptionRequest['topic_urn'];
798
+ body = addSubscriptionRequest['body'];
799
+ }
800
+ }
801
+ if (topicUrn === null || topicUrn === undefined) {
802
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling addSubscription.');
803
+ }
804
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
805
+ options.data = body !== undefined ? body : {};
806
+ options.pathParams = { 'topic_urn': topicUrn, };
807
+ options.headers = localVarHeaderParameter;
808
+ return options;
809
+ },
810
+ /**
811
+ * 为指定实例批量添加或删除标签。一个资源上最多有10个标签。
812
+ * 此接口为幂等接口:创建时如果请求体中存在重复key则报错。
813
+ * 创建时,不允许重复key,如果数据库存在就覆盖。
814
+ * 删除时,如果删除的标签不存在,默认处理成功,删除时不对标签字符集范围做校验。
815
+ *
816
+ * 详细说明请参考华为云API Explorer。
817
+ * Please refer to Huawei cloud API Explorer for details.
818
+ */
819
+ batchCreateOrDeleteResourceTags: function (batchCreateOrDeleteResourceTagsRequest) {
820
+ var options = {
821
+ method: "POST",
822
+ url: "/v2/{project_id}/{resource_type}/{resource_id}/tags/action",
823
+ contentType: "application/json;charset=UTF-8",
824
+ queryParams: {},
825
+ pathParams: {},
826
+ headers: {},
827
+ data: {}
828
+ };
829
+ var localVarHeaderParameter = {};
830
+ var body;
831
+ var resourceType;
832
+ var resourceId;
833
+ if (batchCreateOrDeleteResourceTagsRequest !== null && batchCreateOrDeleteResourceTagsRequest !== undefined) {
834
+ if (batchCreateOrDeleteResourceTagsRequest instanceof BatchCreateOrDeleteResourceTagsRequest_1.BatchCreateOrDeleteResourceTagsRequest) {
835
+ resourceType = batchCreateOrDeleteResourceTagsRequest.resourceType;
836
+ resourceId = batchCreateOrDeleteResourceTagsRequest.resourceId;
837
+ body = batchCreateOrDeleteResourceTagsRequest.body;
838
+ }
839
+ else {
840
+ resourceType = batchCreateOrDeleteResourceTagsRequest['resource_type'];
841
+ resourceId = batchCreateOrDeleteResourceTagsRequest['resource_id'];
842
+ body = batchCreateOrDeleteResourceTagsRequest['body'];
843
+ }
844
+ }
845
+ if (resourceType === null || resourceType === undefined) {
846
+ throw new RequiredError('resourceType', 'Required parameter resourceType was null or undefined when calling batchCreateOrDeleteResourceTags.');
847
+ }
848
+ if (resourceId === null || resourceId === undefined) {
849
+ throw new RequiredError('resourceId', 'Required parameter resourceId was null or undefined when calling batchCreateOrDeleteResourceTags.');
850
+ }
851
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
852
+ options.data = body !== undefined ? body : {};
853
+ options.pathParams = { 'resource_type': resourceType, 'resource_id': resourceId, };
854
+ options.headers = localVarHeaderParameter;
855
+ return options;
856
+ },
857
+ /**
858
+ * 删除指定的订阅者。
859
+ *
860
+ * 详细说明请参考华为云API Explorer。
861
+ * Please refer to Huawei cloud API Explorer for details.
862
+ */
863
+ cancelSubscription: function (cancelSubscriptionRequest) {
864
+ var options = {
865
+ method: "DELETE",
866
+ url: "/v2/{project_id}/notifications/subscriptions/{subscription_urn}",
867
+ contentType: "application/json",
868
+ queryParams: {},
869
+ pathParams: {},
870
+ headers: {},
871
+ data: {}
872
+ };
873
+ var localVarHeaderParameter = {};
874
+ var subscriptionUrn;
875
+ if (cancelSubscriptionRequest !== null && cancelSubscriptionRequest !== undefined) {
876
+ if (cancelSubscriptionRequest instanceof CancelSubscriptionRequest_1.CancelSubscriptionRequest) {
877
+ subscriptionUrn = cancelSubscriptionRequest.subscriptionUrn;
878
+ }
879
+ else {
880
+ subscriptionUrn = cancelSubscriptionRequest['subscription_urn'];
881
+ }
882
+ }
883
+ if (subscriptionUrn === null || subscriptionUrn === undefined) {
884
+ throw new RequiredError('subscriptionUrn', 'Required parameter subscriptionUrn was null or undefined when calling cancelSubscription.');
885
+ }
886
+ options.pathParams = { 'subscription_urn': subscriptionUrn, };
887
+ options.headers = localVarHeaderParameter;
888
+ return options;
889
+ },
890
+ /**
891
+ * 创建一个模板,用户可以按照模板去发送消息,这样可以减少请求的数据量。
892
+ * 单用户默认可创建100个消息模板,高并发场景下,可能会出现消息模板数量超过100仍创建成功的情况,此为正常现象。
893
+ *
894
+ * 详细说明请参考华为云API Explorer。
895
+ * Please refer to Huawei cloud API Explorer for details.
896
+ */
897
+ createMessageTemplate: function (createMessageTemplateRequest) {
898
+ var options = {
899
+ method: "POST",
900
+ url: "/v2/{project_id}/notifications/message_template",
901
+ contentType: "application/json;charset=UTF-8",
902
+ queryParams: {},
903
+ pathParams: {},
904
+ headers: {},
905
+ data: {}
906
+ };
907
+ var localVarHeaderParameter = {};
908
+ var body;
909
+ if (createMessageTemplateRequest !== null && createMessageTemplateRequest !== undefined) {
910
+ if (createMessageTemplateRequest instanceof CreateMessageTemplateRequest_1.CreateMessageTemplateRequest) {
911
+ body = createMessageTemplateRequest.body;
912
+ }
913
+ else {
914
+ body = createMessageTemplateRequest['body'];
915
+ }
916
+ }
917
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
918
+ options.data = body !== undefined ? body : {};
919
+ options.headers = localVarHeaderParameter;
920
+ return options;
921
+ },
922
+ /**
923
+ * 一个资源上最多有10个标签。此接口为幂等接口:创建时,如果创建的标签已经存在(key相同),则覆盖。
924
+ *
925
+ * 详细说明请参考华为云API Explorer。
926
+ * Please refer to Huawei cloud API Explorer for details.
927
+ */
928
+ createResourceTag: function (createResourceTagRequest) {
929
+ var options = {
930
+ method: "POST",
931
+ url: "/v2/{project_id}/{resource_type}/{resource_id}/tags",
932
+ contentType: "application/json;charset=UTF-8",
933
+ queryParams: {},
934
+ pathParams: {},
935
+ headers: {},
936
+ data: {}
937
+ };
938
+ var localVarHeaderParameter = {};
939
+ var body;
940
+ var resourceType;
941
+ var resourceId;
942
+ if (createResourceTagRequest !== null && createResourceTagRequest !== undefined) {
943
+ if (createResourceTagRequest instanceof CreateResourceTagRequest_1.CreateResourceTagRequest) {
944
+ resourceType = createResourceTagRequest.resourceType;
945
+ resourceId = createResourceTagRequest.resourceId;
946
+ body = createResourceTagRequest.body;
947
+ }
948
+ else {
949
+ resourceType = createResourceTagRequest['resource_type'];
950
+ resourceId = createResourceTagRequest['resource_id'];
951
+ body = createResourceTagRequest['body'];
952
+ }
953
+ }
954
+ if (resourceType === null || resourceType === undefined) {
955
+ throw new RequiredError('resourceType', 'Required parameter resourceType was null or undefined when calling createResourceTag.');
956
+ }
957
+ if (resourceId === null || resourceId === undefined) {
958
+ throw new RequiredError('resourceId', 'Required parameter resourceId was null or undefined when calling createResourceTag.');
959
+ }
960
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
961
+ options.data = body !== undefined ? body : {};
962
+ options.pathParams = { 'resource_type': resourceType, 'resource_id': resourceId, };
963
+ options.headers = localVarHeaderParameter;
964
+ return options;
965
+ },
966
+ /**
967
+ * 创建Topic,单用户默认配额为3000。高并发场景下,可能会出现Topic数量超过3000仍创建成功的情况,此为正常现象。
968
+ * 接口是幂等的,接口调用返回成功时,若已存在同名的Topic,返回的status code为200,否则返回的status code为201
969
+ *
970
+ * 详细说明请参考华为云API Explorer。
971
+ * Please refer to Huawei cloud API Explorer for details.
972
+ */
973
+ createTopic: function (createTopicRequest) {
974
+ var options = {
975
+ method: "POST",
976
+ url: "/v2/{project_id}/notifications/topics",
977
+ contentType: "application/json;charset=UTF-8",
978
+ queryParams: {},
979
+ pathParams: {},
980
+ headers: {},
981
+ data: {}
982
+ };
983
+ var localVarHeaderParameter = {};
984
+ var body;
985
+ if (createTopicRequest !== null && createTopicRequest !== undefined) {
986
+ if (createTopicRequest instanceof CreateTopicRequest_1.CreateTopicRequest) {
987
+ body = createTopicRequest.body;
988
+ }
989
+ else {
990
+ body = createTopicRequest['body'];
991
+ }
992
+ }
993
+ if (body === null || body === undefined) {
994
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
995
+ }
996
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
997
+ options.data = body !== undefined ? body : {};
998
+ options.headers = localVarHeaderParameter;
999
+ return options;
1000
+ },
1001
+ /**
1002
+ * 删除消息模板。删除模板之前的消息请求都可以使用该模板发送,删除之后无法再使用该模板发送消息。
1003
+ *
1004
+ * 详细说明请参考华为云API Explorer。
1005
+ * Please refer to Huawei cloud API Explorer for details.
1006
+ */
1007
+ deleteMessageTemplate: function (deleteMessageTemplateRequest) {
1008
+ var options = {
1009
+ method: "DELETE",
1010
+ url: "/v2/{project_id}/notifications/message_template/{message_template_id}",
1011
+ contentType: "application/json",
1012
+ queryParams: {},
1013
+ pathParams: {},
1014
+ headers: {},
1015
+ data: {}
1016
+ };
1017
+ var localVarHeaderParameter = {};
1018
+ var messageTemplateId;
1019
+ if (deleteMessageTemplateRequest !== null && deleteMessageTemplateRequest !== undefined) {
1020
+ if (deleteMessageTemplateRequest instanceof DeleteMessageTemplateRequest_1.DeleteMessageTemplateRequest) {
1021
+ messageTemplateId = deleteMessageTemplateRequest.messageTemplateId;
1022
+ }
1023
+ else {
1024
+ messageTemplateId = deleteMessageTemplateRequest['message_template_id'];
1025
+ }
1026
+ }
1027
+ if (messageTemplateId === null || messageTemplateId === undefined) {
1028
+ throw new RequiredError('messageTemplateId', 'Required parameter messageTemplateId was null or undefined when calling deleteMessageTemplate.');
1029
+ }
1030
+ options.pathParams = { 'message_template_id': messageTemplateId, };
1031
+ options.headers = localVarHeaderParameter;
1032
+ return options;
1033
+ },
1034
+ /**
1035
+ * 幂等接口:删除时,不对标签做校验。删除的key不存在报404,key不能为空或者空字符串。
1036
+ *
1037
+ * 详细说明请参考华为云API Explorer。
1038
+ * Please refer to Huawei cloud API Explorer for details.
1039
+ */
1040
+ deleteResourceTag: function (deleteResourceTagRequest) {
1041
+ var options = {
1042
+ method: "DELETE",
1043
+ url: "/v2/{project_id}/{resource_type}/{resource_id}/tags/{key}",
1044
+ contentType: "application/json",
1045
+ queryParams: {},
1046
+ pathParams: {},
1047
+ headers: {},
1048
+ data: {}
1049
+ };
1050
+ var localVarHeaderParameter = {};
1051
+ var resourceType;
1052
+ var resourceId;
1053
+ var key;
1054
+ if (deleteResourceTagRequest !== null && deleteResourceTagRequest !== undefined) {
1055
+ if (deleteResourceTagRequest instanceof DeleteResourceTagRequest_1.DeleteResourceTagRequest) {
1056
+ resourceType = deleteResourceTagRequest.resourceType;
1057
+ resourceId = deleteResourceTagRequest.resourceId;
1058
+ key = deleteResourceTagRequest.key;
1059
+ }
1060
+ else {
1061
+ resourceType = deleteResourceTagRequest['resource_type'];
1062
+ resourceId = deleteResourceTagRequest['resource_id'];
1063
+ key = deleteResourceTagRequest['key'];
1064
+ }
1065
+ }
1066
+ if (resourceType === null || resourceType === undefined) {
1067
+ throw new RequiredError('resourceType', 'Required parameter resourceType was null or undefined when calling deleteResourceTag.');
1068
+ }
1069
+ if (resourceId === null || resourceId === undefined) {
1070
+ throw new RequiredError('resourceId', 'Required parameter resourceId was null or undefined when calling deleteResourceTag.');
1071
+ }
1072
+ if (key === null || key === undefined) {
1073
+ throw new RequiredError('key', 'Required parameter key was null or undefined when calling deleteResourceTag.');
1074
+ }
1075
+ options.pathParams = { 'resource_type': resourceType, 'resource_id': resourceId, 'key': key, };
1076
+ options.headers = localVarHeaderParameter;
1077
+ return options;
1078
+ },
1079
+ /**
1080
+ * 删除主题。
1081
+ *
1082
+ * 详细说明请参考华为云API Explorer。
1083
+ * Please refer to Huawei cloud API Explorer for details.
1084
+ */
1085
+ deleteTopic: function (deleteTopicRequest) {
1086
+ var options = {
1087
+ method: "DELETE",
1088
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}",
1089
+ contentType: "application/json",
1090
+ queryParams: {},
1091
+ pathParams: {},
1092
+ headers: {},
1093
+ data: {}
1094
+ };
1095
+ var localVarHeaderParameter = {};
1096
+ var topicUrn;
1097
+ if (deleteTopicRequest !== null && deleteTopicRequest !== undefined) {
1098
+ if (deleteTopicRequest instanceof DeleteTopicRequest_1.DeleteTopicRequest) {
1099
+ topicUrn = deleteTopicRequest.topicUrn;
1100
+ }
1101
+ else {
1102
+ topicUrn = deleteTopicRequest['topic_urn'];
1103
+ }
1104
+ }
1105
+ if (topicUrn === null || topicUrn === undefined) {
1106
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling deleteTopic.');
1107
+ }
1108
+ options.pathParams = { 'topic_urn': topicUrn, };
1109
+ options.headers = localVarHeaderParameter;
1110
+ return options;
1111
+ },
1112
+ /**
1113
+ * 删除指定名称的主题策略。
1114
+ *
1115
+ * 详细说明请参考华为云API Explorer。
1116
+ * Please refer to Huawei cloud API Explorer for details.
1117
+ */
1118
+ deleteTopicAttributeByName: function (deleteTopicAttributeByNameRequest) {
1119
+ var options = {
1120
+ method: "DELETE",
1121
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}/attributes/{name}",
1122
+ contentType: "application/json",
1123
+ queryParams: {},
1124
+ pathParams: {},
1125
+ headers: {},
1126
+ data: {}
1127
+ };
1128
+ var localVarHeaderParameter = {};
1129
+ var topicUrn;
1130
+ var name;
1131
+ if (deleteTopicAttributeByNameRequest !== null && deleteTopicAttributeByNameRequest !== undefined) {
1132
+ if (deleteTopicAttributeByNameRequest instanceof DeleteTopicAttributeByNameRequest_1.DeleteTopicAttributeByNameRequest) {
1133
+ topicUrn = deleteTopicAttributeByNameRequest.topicUrn;
1134
+ name = deleteTopicAttributeByNameRequest.name;
1135
+ }
1136
+ else {
1137
+ topicUrn = deleteTopicAttributeByNameRequest['topic_urn'];
1138
+ name = deleteTopicAttributeByNameRequest['name'];
1139
+ }
1140
+ }
1141
+ if (topicUrn === null || topicUrn === undefined) {
1142
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling deleteTopicAttributeByName.');
1143
+ }
1144
+ if (name === null || name === undefined) {
1145
+ throw new RequiredError('name', 'Required parameter name was null or undefined when calling deleteTopicAttributeByName.');
1146
+ }
1147
+ options.pathParams = { 'topic_urn': topicUrn, 'name': name, };
1148
+ options.headers = localVarHeaderParameter;
1149
+ return options;
1150
+ },
1151
+ /**
1152
+ * 删除所有主题策略。
1153
+ *
1154
+ * 详细说明请参考华为云API Explorer。
1155
+ * Please refer to Huawei cloud API Explorer for details.
1156
+ */
1157
+ deleteTopicAttributes: function (deleteTopicAttributesRequest) {
1158
+ var options = {
1159
+ method: "DELETE",
1160
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}/attributes",
1161
+ contentType: "application/json",
1162
+ queryParams: {},
1163
+ pathParams: {},
1164
+ headers: {},
1165
+ data: {}
1166
+ };
1167
+ var localVarHeaderParameter = {};
1168
+ var topicUrn;
1169
+ if (deleteTopicAttributesRequest !== null && deleteTopicAttributesRequest !== undefined) {
1170
+ if (deleteTopicAttributesRequest instanceof DeleteTopicAttributesRequest_1.DeleteTopicAttributesRequest) {
1171
+ topicUrn = deleteTopicAttributesRequest.topicUrn;
1172
+ }
1173
+ else {
1174
+ topicUrn = deleteTopicAttributesRequest['topic_urn'];
1175
+ }
1176
+ }
1177
+ if (topicUrn === null || topicUrn === undefined) {
1178
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling deleteTopicAttributes.');
1179
+ }
1180
+ options.pathParams = { 'topic_urn': topicUrn, };
1181
+ options.headers = localVarHeaderParameter;
1182
+ return options;
1183
+ },
1184
+ /**
1185
+ * 查询模板详情,包括模板内容。
1186
+ *
1187
+ * 详细说明请参考华为云API Explorer。
1188
+ * Please refer to Huawei cloud API Explorer for details.
1189
+ */
1190
+ listMessageTemplateDetails: function (listMessageTemplateDetailsRequest) {
1191
+ var options = {
1192
+ method: "GET",
1193
+ url: "/v2/{project_id}/notifications/message_template/{message_template_id}",
1194
+ contentType: "application/json",
1195
+ queryParams: {},
1196
+ pathParams: {},
1197
+ headers: {},
1198
+ data: {}
1199
+ };
1200
+ var localVarHeaderParameter = {};
1201
+ var messageTemplateId;
1202
+ if (listMessageTemplateDetailsRequest !== null && listMessageTemplateDetailsRequest !== undefined) {
1203
+ if (listMessageTemplateDetailsRequest instanceof ListMessageTemplateDetailsRequest_1.ListMessageTemplateDetailsRequest) {
1204
+ messageTemplateId = listMessageTemplateDetailsRequest.messageTemplateId;
1205
+ }
1206
+ else {
1207
+ messageTemplateId = listMessageTemplateDetailsRequest['message_template_id'];
1208
+ }
1209
+ }
1210
+ if (messageTemplateId === null || messageTemplateId === undefined) {
1211
+ throw new RequiredError('messageTemplateId', 'Required parameter messageTemplateId was null or undefined when calling listMessageTemplateDetails.');
1212
+ }
1213
+ options.pathParams = { 'message_template_id': messageTemplateId, };
1214
+ options.headers = localVarHeaderParameter;
1215
+ return options;
1216
+ },
1217
+ /**
1218
+ * 分页查询模板列表,模板列表按照创建时间进行升序排列。分页查询可以指定offset以及limit。如果不存在模板,则返回空列表。额外的查询参数分别有message_template_name和protocol。
1219
+ *
1220
+ * 详细说明请参考华为云API Explorer。
1221
+ * Please refer to Huawei cloud API Explorer for details.
1222
+ */
1223
+ listMessageTemplates: function (listMessageTemplatesRequest) {
1224
+ var options = {
1225
+ method: "GET",
1226
+ url: "/v2/{project_id}/notifications/message_template",
1227
+ contentType: "application/json",
1228
+ queryParams: {},
1229
+ pathParams: {},
1230
+ headers: {},
1231
+ data: {}
1232
+ };
1233
+ var localVarHeaderParameter = {};
1234
+ var localVarQueryParameter = {};
1235
+ var offset;
1236
+ var limit;
1237
+ var messageTemplateName;
1238
+ var protocol;
1239
+ if (listMessageTemplatesRequest !== null && listMessageTemplatesRequest !== undefined) {
1240
+ if (listMessageTemplatesRequest instanceof ListMessageTemplatesRequest_1.ListMessageTemplatesRequest) {
1241
+ offset = listMessageTemplatesRequest.offset;
1242
+ limit = listMessageTemplatesRequest.limit;
1243
+ messageTemplateName = listMessageTemplatesRequest.messageTemplateName;
1244
+ protocol = listMessageTemplatesRequest.protocol;
1245
+ }
1246
+ else {
1247
+ offset = listMessageTemplatesRequest['offset'];
1248
+ limit = listMessageTemplatesRequest['limit'];
1249
+ messageTemplateName = listMessageTemplatesRequest['message_template_name'];
1250
+ protocol = listMessageTemplatesRequest['protocol'];
1251
+ }
1252
+ }
1253
+ if (offset !== null && offset !== undefined) {
1254
+ localVarQueryParameter['offset'] = offset;
1255
+ }
1256
+ if (limit !== null && limit !== undefined) {
1257
+ localVarQueryParameter['limit'] = limit;
1258
+ }
1259
+ if (messageTemplateName !== null && messageTemplateName !== undefined) {
1260
+ localVarQueryParameter['message_template_name'] = messageTemplateName;
1261
+ }
1262
+ if (protocol !== null && protocol !== undefined) {
1263
+ localVarQueryParameter['protocol'] = protocol;
1264
+ }
1265
+ options.queryParams = localVarQueryParameter;
1266
+ options.headers = localVarHeaderParameter;
1267
+ return options;
1268
+ },
1269
+ /**
1270
+ * 查询租户在指定Region和实例类型的所有标签集合。
1271
+ *
1272
+ * 详细说明请参考华为云API Explorer。
1273
+ * Please refer to Huawei cloud API Explorer for details.
1274
+ */
1275
+ listProjectTags: function (listProjectTagsRequest) {
1276
+ var options = {
1277
+ method: "GET",
1278
+ url: "/v2/{project_id}/{resource_type}/tags",
1279
+ contentType: "application/json",
1280
+ queryParams: {},
1281
+ pathParams: {},
1282
+ headers: {},
1283
+ data: {}
1284
+ };
1285
+ var localVarHeaderParameter = {};
1286
+ var resourceType;
1287
+ if (listProjectTagsRequest !== null && listProjectTagsRequest !== undefined) {
1288
+ if (listProjectTagsRequest instanceof ListProjectTagsRequest_1.ListProjectTagsRequest) {
1289
+ resourceType = listProjectTagsRequest.resourceType;
1290
+ }
1291
+ else {
1292
+ resourceType = listProjectTagsRequest['resource_type'];
1293
+ }
1294
+ }
1295
+ if (resourceType === null || resourceType === undefined) {
1296
+ throw new RequiredError('resourceType', 'Required parameter resourceType was null or undefined when calling listProjectTags.');
1297
+ }
1298
+ options.pathParams = { 'resource_type': resourceType, };
1299
+ options.headers = localVarHeaderParameter;
1300
+ return options;
1301
+ },
1302
+ /**
1303
+ * 使用标签过滤实例。
1304
+ *
1305
+ * 详细说明请参考华为云API Explorer。
1306
+ * Please refer to Huawei cloud API Explorer for details.
1307
+ */
1308
+ listResourceInstances: function (listResourceInstancesRequest) {
1309
+ var options = {
1310
+ method: "POST",
1311
+ url: "/v2/{project_id}/{resource_type}/resource_instances/action",
1312
+ contentType: "application/json;charset=UTF-8",
1313
+ queryParams: {},
1314
+ pathParams: {},
1315
+ headers: {},
1316
+ data: {}
1317
+ };
1318
+ var localVarHeaderParameter = {};
1319
+ var body;
1320
+ var resourceType;
1321
+ if (listResourceInstancesRequest !== null && listResourceInstancesRequest !== undefined) {
1322
+ if (listResourceInstancesRequest instanceof ListResourceInstancesRequest_1.ListResourceInstancesRequest) {
1323
+ resourceType = listResourceInstancesRequest.resourceType;
1324
+ body = listResourceInstancesRequest.body;
1325
+ }
1326
+ else {
1327
+ resourceType = listResourceInstancesRequest['resource_type'];
1328
+ body = listResourceInstancesRequest['body'];
1329
+ }
1330
+ }
1331
+ if (resourceType === null || resourceType === undefined) {
1332
+ throw new RequiredError('resourceType', 'Required parameter resourceType was null or undefined when calling listResourceInstances.');
1333
+ }
1334
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
1335
+ options.data = body !== undefined ? body : {};
1336
+ options.pathParams = { 'resource_type': resourceType, };
1337
+ options.headers = localVarHeaderParameter;
1338
+ return options;
1339
+ },
1340
+ /**
1341
+ * 查询指定实例的标签信息。
1342
+ *
1343
+ * 详细说明请参考华为云API Explorer。
1344
+ * Please refer to Huawei cloud API Explorer for details.
1345
+ */
1346
+ listResourceTags: function (listResourceTagsRequest) {
1347
+ var options = {
1348
+ method: "GET",
1349
+ url: "/v2/{project_id}/{resource_type}/{resource_id}/tags",
1350
+ contentType: "application/json",
1351
+ queryParams: {},
1352
+ pathParams: {},
1353
+ headers: {},
1354
+ data: {}
1355
+ };
1356
+ var localVarHeaderParameter = {};
1357
+ var resourceType;
1358
+ var resourceId;
1359
+ if (listResourceTagsRequest !== null && listResourceTagsRequest !== undefined) {
1360
+ if (listResourceTagsRequest instanceof ListResourceTagsRequest_1.ListResourceTagsRequest) {
1361
+ resourceType = listResourceTagsRequest.resourceType;
1362
+ resourceId = listResourceTagsRequest.resourceId;
1363
+ }
1364
+ else {
1365
+ resourceType = listResourceTagsRequest['resource_type'];
1366
+ resourceId = listResourceTagsRequest['resource_id'];
1367
+ }
1368
+ }
1369
+ if (resourceType === null || resourceType === undefined) {
1370
+ throw new RequiredError('resourceType', 'Required parameter resourceType was null or undefined when calling listResourceTags.');
1371
+ }
1372
+ if (resourceId === null || resourceId === undefined) {
1373
+ throw new RequiredError('resourceId', 'Required parameter resourceId was null or undefined when calling listResourceTags.');
1374
+ }
1375
+ options.pathParams = { 'resource_type': resourceType, 'resource_id': resourceId, };
1376
+ options.headers = localVarHeaderParameter;
1377
+ return options;
1378
+ },
1379
+ /**
1380
+ * 分页返回请求者的所有的订阅列表,订阅列表按照订阅创建时间进行升序排列。分页查询可以指定offset以及limit。如果订阅者不存在,返回空列表。
1381
+ *
1382
+ * 详细说明请参考华为云API Explorer。
1383
+ * Please refer to Huawei cloud API Explorer for details.
1384
+ */
1385
+ listSubscriptions: function (listSubscriptionsRequest) {
1386
+ var options = {
1387
+ method: "GET",
1388
+ url: "/v2/{project_id}/notifications/subscriptions",
1389
+ contentType: "application/json",
1390
+ queryParams: {},
1391
+ pathParams: {},
1392
+ headers: {},
1393
+ data: {}
1394
+ };
1395
+ var localVarHeaderParameter = {};
1396
+ var localVarQueryParameter = {};
1397
+ var offset;
1398
+ var limit;
1399
+ var protocol;
1400
+ var status;
1401
+ var endpoint;
1402
+ if (listSubscriptionsRequest !== null && listSubscriptionsRequest !== undefined) {
1403
+ if (listSubscriptionsRequest instanceof ListSubscriptionsRequest_1.ListSubscriptionsRequest) {
1404
+ offset = listSubscriptionsRequest.offset;
1405
+ limit = listSubscriptionsRequest.limit;
1406
+ protocol = listSubscriptionsRequest.protocol;
1407
+ status = listSubscriptionsRequest.status;
1408
+ endpoint = listSubscriptionsRequest.endpoint;
1409
+ }
1410
+ else {
1411
+ offset = listSubscriptionsRequest['offset'];
1412
+ limit = listSubscriptionsRequest['limit'];
1413
+ protocol = listSubscriptionsRequest['protocol'];
1414
+ status = listSubscriptionsRequest['status'];
1415
+ endpoint = listSubscriptionsRequest['endpoint'];
1416
+ }
1417
+ }
1418
+ if (offset !== null && offset !== undefined) {
1419
+ localVarQueryParameter['offset'] = offset;
1420
+ }
1421
+ if (limit !== null && limit !== undefined) {
1422
+ localVarQueryParameter['limit'] = limit;
1423
+ }
1424
+ if (protocol !== null && protocol !== undefined) {
1425
+ localVarQueryParameter['protocol'] = protocol;
1426
+ }
1427
+ if (status !== null && status !== undefined) {
1428
+ localVarQueryParameter['status'] = status;
1429
+ }
1430
+ if (endpoint !== null && endpoint !== undefined) {
1431
+ localVarQueryParameter['endpoint'] = endpoint;
1432
+ }
1433
+ options.queryParams = localVarQueryParameter;
1434
+ options.headers = localVarHeaderParameter;
1435
+ return options;
1436
+ },
1437
+ /**
1438
+ * 分页获取特定Topic的订阅列表,订阅列表按照订阅创建时间进行升序排列。分页查询可以指定offset以及limit。如果指定Topic不存在订阅者,返回空列表。
1439
+ *
1440
+ * 详细说明请参考华为云API Explorer。
1441
+ * Please refer to Huawei cloud API Explorer for details.
1442
+ */
1443
+ listSubscriptionsByTopic: function (listSubscriptionsByTopicRequest) {
1444
+ var options = {
1445
+ method: "GET",
1446
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}/subscriptions",
1447
+ contentType: "application/json",
1448
+ queryParams: {},
1449
+ pathParams: {},
1450
+ headers: {},
1451
+ data: {}
1452
+ };
1453
+ var localVarHeaderParameter = {};
1454
+ var localVarQueryParameter = {};
1455
+ var topicUrn;
1456
+ var offset;
1457
+ var limit;
1458
+ if (listSubscriptionsByTopicRequest !== null && listSubscriptionsByTopicRequest !== undefined) {
1459
+ if (listSubscriptionsByTopicRequest instanceof ListSubscriptionsByTopicRequest_1.ListSubscriptionsByTopicRequest) {
1460
+ topicUrn = listSubscriptionsByTopicRequest.topicUrn;
1461
+ offset = listSubscriptionsByTopicRequest.offset;
1462
+ limit = listSubscriptionsByTopicRequest.limit;
1463
+ }
1464
+ else {
1465
+ topicUrn = listSubscriptionsByTopicRequest['topic_urn'];
1466
+ offset = listSubscriptionsByTopicRequest['offset'];
1467
+ limit = listSubscriptionsByTopicRequest['limit'];
1468
+ }
1469
+ }
1470
+ if (topicUrn === null || topicUrn === undefined) {
1471
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling listSubscriptionsByTopic.');
1472
+ }
1473
+ if (offset !== null && offset !== undefined) {
1474
+ localVarQueryParameter['offset'] = offset;
1475
+ }
1476
+ if (limit !== null && limit !== undefined) {
1477
+ localVarQueryParameter['limit'] = limit;
1478
+ }
1479
+ options.queryParams = localVarQueryParameter;
1480
+ options.pathParams = { 'topic_urn': topicUrn, };
1481
+ options.headers = localVarHeaderParameter;
1482
+ return options;
1483
+ },
1484
+ /**
1485
+ * 查询主题的策略信息。
1486
+ *
1487
+ * 详细说明请参考华为云API Explorer。
1488
+ * Please refer to Huawei cloud API Explorer for details.
1489
+ */
1490
+ listTopicAttributes: function (listTopicAttributesRequest) {
1491
+ var options = {
1492
+ method: "GET",
1493
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}/attributes",
1494
+ contentType: "application/json",
1495
+ queryParams: {},
1496
+ pathParams: {},
1497
+ headers: {},
1498
+ data: {}
1499
+ };
1500
+ var localVarHeaderParameter = {};
1501
+ var localVarQueryParameter = {};
1502
+ var topicUrn;
1503
+ var name;
1504
+ if (listTopicAttributesRequest !== null && listTopicAttributesRequest !== undefined) {
1505
+ if (listTopicAttributesRequest instanceof ListTopicAttributesRequest_1.ListTopicAttributesRequest) {
1506
+ topicUrn = listTopicAttributesRequest.topicUrn;
1507
+ name = listTopicAttributesRequest.name;
1508
+ }
1509
+ else {
1510
+ topicUrn = listTopicAttributesRequest['topic_urn'];
1511
+ name = listTopicAttributesRequest['name'];
1512
+ }
1513
+ }
1514
+ if (topicUrn === null || topicUrn === undefined) {
1515
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling listTopicAttributes.');
1516
+ }
1517
+ if (name === null || name === undefined) {
1518
+ throw new RequiredError('name', 'Required parameter name was null or undefined when calling listTopicAttributes.');
1519
+ }
1520
+ if (name !== null && name !== undefined) {
1521
+ localVarQueryParameter['name'] = name;
1522
+ }
1523
+ options.queryParams = localVarQueryParameter;
1524
+ options.pathParams = { 'topic_urn': topicUrn, };
1525
+ options.headers = localVarHeaderParameter;
1526
+ return options;
1527
+ },
1528
+ /**
1529
+ * 查询Topic的详细信息。
1530
+ *
1531
+ * 详细说明请参考华为云API Explorer。
1532
+ * Please refer to Huawei cloud API Explorer for details.
1533
+ */
1534
+ listTopicDetails: function (listTopicDetailsRequest) {
1535
+ var options = {
1536
+ method: "GET",
1537
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}",
1538
+ contentType: "application/json",
1539
+ queryParams: {},
1540
+ pathParams: {},
1541
+ headers: {},
1542
+ data: {}
1543
+ };
1544
+ var localVarHeaderParameter = {};
1545
+ var topicUrn;
1546
+ if (listTopicDetailsRequest !== null && listTopicDetailsRequest !== undefined) {
1547
+ if (listTopicDetailsRequest instanceof ListTopicDetailsRequest_1.ListTopicDetailsRequest) {
1548
+ topicUrn = listTopicDetailsRequest.topicUrn;
1549
+ }
1550
+ else {
1551
+ topicUrn = listTopicDetailsRequest['topic_urn'];
1552
+ }
1553
+ }
1554
+ if (topicUrn === null || topicUrn === undefined) {
1555
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling listTopicDetails.');
1556
+ }
1557
+ options.pathParams = { 'topic_urn': topicUrn, };
1558
+ options.headers = localVarHeaderParameter;
1559
+ return options;
1560
+ },
1561
+ /**
1562
+ * 分页查询Topic列表,Topic列表按照Topic创建时间进行降序排列。分页查询可以指定offset以及limit。如果不存在Topic,则返回空列表。
1563
+ *
1564
+ * 详细说明请参考华为云API Explorer。
1565
+ * Please refer to Huawei cloud API Explorer for details.
1566
+ */
1567
+ listTopics: function (listTopicsRequest) {
1568
+ var options = {
1569
+ method: "GET",
1570
+ url: "/v2/{project_id}/notifications/topics",
1571
+ contentType: "application/json",
1572
+ queryParams: {},
1573
+ pathParams: {},
1574
+ headers: {},
1575
+ data: {}
1576
+ };
1577
+ var localVarHeaderParameter = {};
1578
+ var localVarQueryParameter = {};
1579
+ var offset;
1580
+ var limit;
1581
+ var enterpriseProjectId;
1582
+ var name;
1583
+ var fuzzyName;
1584
+ if (listTopicsRequest !== null && listTopicsRequest !== undefined) {
1585
+ if (listTopicsRequest instanceof ListTopicsRequest_1.ListTopicsRequest) {
1586
+ offset = listTopicsRequest.offset;
1587
+ limit = listTopicsRequest.limit;
1588
+ enterpriseProjectId = listTopicsRequest.enterpriseProjectId;
1589
+ name = listTopicsRequest.name;
1590
+ fuzzyName = listTopicsRequest.fuzzyName;
1591
+ }
1592
+ else {
1593
+ offset = listTopicsRequest['offset'];
1594
+ limit = listTopicsRequest['limit'];
1595
+ enterpriseProjectId = listTopicsRequest['enterprise_project_id'];
1596
+ name = listTopicsRequest['name'];
1597
+ fuzzyName = listTopicsRequest['fuzzy_name'];
1598
+ }
1599
+ }
1600
+ if (offset !== null && offset !== undefined) {
1601
+ localVarQueryParameter['offset'] = offset;
1602
+ }
1603
+ if (limit !== null && limit !== undefined) {
1604
+ localVarQueryParameter['limit'] = limit;
1605
+ }
1606
+ if (enterpriseProjectId !== null && enterpriseProjectId !== undefined) {
1607
+ localVarQueryParameter['enterprise_project_id'] = enterpriseProjectId;
1608
+ }
1609
+ if (name !== null && name !== undefined) {
1610
+ localVarQueryParameter['name'] = name;
1611
+ }
1612
+ if (fuzzyName !== null && fuzzyName !== undefined) {
1613
+ localVarQueryParameter['fuzzy_name'] = fuzzyName;
1614
+ }
1615
+ options.queryParams = localVarQueryParameter;
1616
+ options.headers = localVarHeaderParameter;
1617
+ return options;
1618
+ },
1619
+ /**
1620
+ * 查询SMN API V2版本信息。
1621
+ *
1622
+ * 详细说明请参考华为云API Explorer。
1623
+ * Please refer to Huawei cloud API Explorer for details.
1624
+ */
1625
+ listVersion: function (listVersionRequest) {
1626
+ var options = {
1627
+ method: "GET",
1628
+ url: "/{api_version}",
1629
+ contentType: "application/json",
1630
+ queryParams: {},
1631
+ pathParams: {},
1632
+ headers: {},
1633
+ data: {}
1634
+ };
1635
+ var localVarHeaderParameter = {};
1636
+ var apiVersion;
1637
+ if (listVersionRequest !== null && listVersionRequest !== undefined) {
1638
+ if (listVersionRequest instanceof ListVersionRequest_1.ListVersionRequest) {
1639
+ apiVersion = listVersionRequest.apiVersion;
1640
+ }
1641
+ else {
1642
+ apiVersion = listVersionRequest['api_version'];
1643
+ }
1644
+ }
1645
+ if (apiVersion === null || apiVersion === undefined) {
1646
+ throw new RequiredError('apiVersion', 'Required parameter apiVersion was null or undefined when calling listVersion.');
1647
+ }
1648
+ options.pathParams = { 'api_version': apiVersion, };
1649
+ options.headers = localVarHeaderParameter;
1650
+ return options;
1651
+ },
1652
+ /**
1653
+ * 查询SMN开放API支持的版本号。
1654
+ *
1655
+ * 详细说明请参考华为云API Explorer。
1656
+ * Please refer to Huawei cloud API Explorer for details.
1657
+ */
1658
+ listVersions: function () {
1659
+ var options = {
1660
+ method: "GET",
1661
+ url: "/",
1662
+ contentType: "application/json",
1663
+ queryParams: {},
1664
+ pathParams: {},
1665
+ headers: {},
1666
+ data: {}
1667
+ };
1668
+ var localVarHeaderParameter = {};
1669
+ options.headers = localVarHeaderParameter;
1670
+ return options;
1671
+ },
1672
+ /**
1673
+ * 将消息发送给Topic的所有订阅端点。当返回消息ID时,该消息已被保存并开始尝试将其推送给Topic的订阅者。三种消息发送方式
1674
+ *
1675
+ * message
1676
+ *
1677
+ * message_structure
1678
+ *
1679
+ * message_template_name
1680
+ *
1681
+ * 只需要设置其中一个,如果同时设置,生效的优先级为
1682
+ * message_structure > message_template_name > message。
1683
+ *
1684
+ * 详细说明请参考华为云API Explorer。
1685
+ * Please refer to Huawei cloud API Explorer for details.
1686
+ */
1687
+ publishMessage: function (publishMessageRequest) {
1688
+ var options = {
1689
+ method: "POST",
1690
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}/publish",
1691
+ contentType: "application/json;charset=UTF-8",
1692
+ queryParams: {},
1693
+ pathParams: {},
1694
+ headers: {},
1695
+ data: {}
1696
+ };
1697
+ var localVarHeaderParameter = {};
1698
+ var body;
1699
+ var topicUrn;
1700
+ if (publishMessageRequest !== null && publishMessageRequest !== undefined) {
1701
+ if (publishMessageRequest instanceof PublishMessageRequest_1.PublishMessageRequest) {
1702
+ topicUrn = publishMessageRequest.topicUrn;
1703
+ body = publishMessageRequest.body;
1704
+ }
1705
+ else {
1706
+ topicUrn = publishMessageRequest['topic_urn'];
1707
+ body = publishMessageRequest['body'];
1708
+ }
1709
+ }
1710
+ if (topicUrn === null || topicUrn === undefined) {
1711
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling publishMessage.');
1712
+ }
1713
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
1714
+ options.data = body !== undefined ? body : {};
1715
+ options.pathParams = { 'topic_urn': topicUrn, };
1716
+ options.headers = localVarHeaderParameter;
1717
+ return options;
1718
+ },
1719
+ /**
1720
+ * 修改消息模板的内容。
1721
+ *
1722
+ * 详细说明请参考华为云API Explorer。
1723
+ * Please refer to Huawei cloud API Explorer for details.
1724
+ */
1725
+ updateMessageTemplate: function (updateMessageTemplateRequest) {
1726
+ var options = {
1727
+ method: "PUT",
1728
+ url: "/v2/{project_id}/notifications/message_template/{message_template_id}",
1729
+ contentType: "application/json;charset=UTF-8",
1730
+ queryParams: {},
1731
+ pathParams: {},
1732
+ headers: {},
1733
+ data: {}
1734
+ };
1735
+ var localVarHeaderParameter = {};
1736
+ var body;
1737
+ var messageTemplateId;
1738
+ if (updateMessageTemplateRequest !== null && updateMessageTemplateRequest !== undefined) {
1739
+ if (updateMessageTemplateRequest instanceof UpdateMessageTemplateRequest_1.UpdateMessageTemplateRequest) {
1740
+ messageTemplateId = updateMessageTemplateRequest.messageTemplateId;
1741
+ body = updateMessageTemplateRequest.body;
1742
+ }
1743
+ else {
1744
+ messageTemplateId = updateMessageTemplateRequest['message_template_id'];
1745
+ body = updateMessageTemplateRequest['body'];
1746
+ }
1747
+ }
1748
+ if (messageTemplateId === null || messageTemplateId === undefined) {
1749
+ throw new RequiredError('messageTemplateId', 'Required parameter messageTemplateId was null or undefined when calling updateMessageTemplate.');
1750
+ }
1751
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
1752
+ options.data = body !== undefined ? body : {};
1753
+ options.pathParams = { 'message_template_id': messageTemplateId, };
1754
+ options.headers = localVarHeaderParameter;
1755
+ return options;
1756
+ },
1757
+ /**
1758
+ * 更新显示名。
1759
+ *
1760
+ * 详细说明请参考华为云API Explorer。
1761
+ * Please refer to Huawei cloud API Explorer for details.
1762
+ */
1763
+ updateTopic: function (updateTopicRequest) {
1764
+ var options = {
1765
+ method: "PUT",
1766
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}",
1767
+ contentType: "application/json;charset=UTF-8",
1768
+ queryParams: {},
1769
+ pathParams: {},
1770
+ headers: {},
1771
+ data: {}
1772
+ };
1773
+ var localVarHeaderParameter = {};
1774
+ var body;
1775
+ var topicUrn;
1776
+ if (updateTopicRequest !== null && updateTopicRequest !== undefined) {
1777
+ if (updateTopicRequest instanceof UpdateTopicRequest_1.UpdateTopicRequest) {
1778
+ topicUrn = updateTopicRequest.topicUrn;
1779
+ body = updateTopicRequest.body;
1780
+ }
1781
+ else {
1782
+ topicUrn = updateTopicRequest['topic_urn'];
1783
+ body = updateTopicRequest['body'];
1784
+ }
1785
+ }
1786
+ if (topicUrn === null || topicUrn === undefined) {
1787
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling updateTopic.');
1788
+ }
1789
+ if (body === null || body === undefined) {
1790
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
1791
+ }
1792
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
1793
+ options.data = body !== undefined ? body : {};
1794
+ options.pathParams = { 'topic_urn': topicUrn, };
1795
+ options.headers = localVarHeaderParameter;
1796
+ return options;
1797
+ },
1798
+ /**
1799
+ * 更新主题的策略信息。
1800
+ *
1801
+ * 详细说明请参考华为云API Explorer。
1802
+ * Please refer to Huawei cloud API Explorer for details.
1803
+ */
1804
+ updateTopicAttribute: function (updateTopicAttributeRequest) {
1805
+ var options = {
1806
+ method: "PUT",
1807
+ url: "/v2/{project_id}/notifications/topics/{topic_urn}/attributes/{name}",
1808
+ contentType: "application/json;charset=UTF-8",
1809
+ queryParams: {},
1810
+ pathParams: {},
1811
+ headers: {},
1812
+ data: {}
1813
+ };
1814
+ var localVarHeaderParameter = {};
1815
+ var body;
1816
+ var topicUrn;
1817
+ var name;
1818
+ if (updateTopicAttributeRequest !== null && updateTopicAttributeRequest !== undefined) {
1819
+ if (updateTopicAttributeRequest instanceof UpdateTopicAttributeRequest_1.UpdateTopicAttributeRequest) {
1820
+ topicUrn = updateTopicAttributeRequest.topicUrn;
1821
+ name = updateTopicAttributeRequest.name;
1822
+ body = updateTopicAttributeRequest.body;
1823
+ }
1824
+ else {
1825
+ topicUrn = updateTopicAttributeRequest['topic_urn'];
1826
+ name = updateTopicAttributeRequest['name'];
1827
+ body = updateTopicAttributeRequest['body'];
1828
+ }
1829
+ }
1830
+ if (topicUrn === null || topicUrn === undefined) {
1831
+ throw new RequiredError('topicUrn', 'Required parameter topicUrn was null or undefined when calling updateTopicAttribute.');
1832
+ }
1833
+ if (name === null || name === undefined) {
1834
+ throw new RequiredError('name', 'Required parameter name was null or undefined when calling updateTopicAttribute.');
1835
+ }
1836
+ if (body === null || body === undefined) {
1837
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling body.');
1838
+ }
1839
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
1840
+ options.data = body !== undefined ? body : {};
1841
+ options.pathParams = { 'topic_urn': topicUrn, 'name': name, };
1842
+ options.headers = localVarHeaderParameter;
1843
+ return options;
1844
+ },
1845
+ /**
1846
+ * 创建平台应用。
1847
+ *
1848
+ * 详细说明请参考华为云API Explorer。
1849
+ * Please refer to Huawei cloud API Explorer for details.
1850
+ */
1851
+ createApplication: function (createApplicationRequest) {
1852
+ var options = {
1853
+ method: "POST",
1854
+ url: "/v2/{project_id}/notifications/applications",
1855
+ contentType: "application/json;charset=UTF-8",
1856
+ queryParams: {},
1857
+ pathParams: {},
1858
+ headers: {},
1859
+ data: {}
1860
+ };
1861
+ var localVarHeaderParameter = {};
1862
+ var body;
1863
+ if (createApplicationRequest !== null && createApplicationRequest !== undefined) {
1864
+ if (createApplicationRequest instanceof CreateApplicationRequest_1.CreateApplicationRequest) {
1865
+ body = createApplicationRequest.body;
1866
+ }
1867
+ else {
1868
+ body = createApplicationRequest['body'];
1869
+ }
1870
+ }
1871
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
1872
+ options.data = body !== undefined ? body : {};
1873
+ options.headers = localVarHeaderParameter;
1874
+ return options;
1875
+ },
1876
+ /**
1877
+ * 删除平台应用。
1878
+ *
1879
+ * 详细说明请参考华为云API Explorer。
1880
+ * Please refer to Huawei cloud API Explorer for details.
1881
+ */
1882
+ deleteApplication: function (deleteApplicationRequest) {
1883
+ var options = {
1884
+ method: "DELETE",
1885
+ url: "/v2/{project_id}/notifications/applications/{application_urn}",
1886
+ contentType: "application/json",
1887
+ queryParams: {},
1888
+ pathParams: {},
1889
+ headers: {},
1890
+ data: {}
1891
+ };
1892
+ var localVarHeaderParameter = {};
1893
+ var applicationUrn;
1894
+ if (deleteApplicationRequest !== null && deleteApplicationRequest !== undefined) {
1895
+ if (deleteApplicationRequest instanceof DeleteApplicationRequest_1.DeleteApplicationRequest) {
1896
+ applicationUrn = deleteApplicationRequest.applicationUrn;
1897
+ }
1898
+ else {
1899
+ applicationUrn = deleteApplicationRequest['application_urn'];
1900
+ }
1901
+ }
1902
+ if (applicationUrn === null || applicationUrn === undefined) {
1903
+ throw new RequiredError('applicationUrn', 'Required parameter applicationUrn was null or undefined when calling deleteApplication.');
1904
+ }
1905
+ options.pathParams = { 'application_urn': applicationUrn, };
1906
+ options.headers = localVarHeaderParameter;
1907
+ return options;
1908
+ },
1909
+ /**
1910
+ * 获取应用平台属性。
1911
+ *
1912
+ * 详细说明请参考华为云API Explorer。
1913
+ * Please refer to Huawei cloud API Explorer for details.
1914
+ */
1915
+ listApplicationAttributes: function (listApplicationAttributesRequest) {
1916
+ var options = {
1917
+ method: "GET",
1918
+ url: "/v2/{project_id}/notifications/applications/{application_urn}",
1919
+ contentType: "application/json",
1920
+ queryParams: {},
1921
+ pathParams: {},
1922
+ headers: {},
1923
+ data: {}
1924
+ };
1925
+ var localVarHeaderParameter = {};
1926
+ var applicationUrn;
1927
+ if (listApplicationAttributesRequest !== null && listApplicationAttributesRequest !== undefined) {
1928
+ if (listApplicationAttributesRequest instanceof ListApplicationAttributesRequest_1.ListApplicationAttributesRequest) {
1929
+ applicationUrn = listApplicationAttributesRequest.applicationUrn;
1930
+ }
1931
+ else {
1932
+ applicationUrn = listApplicationAttributesRequest['application_urn'];
1933
+ }
1934
+ }
1935
+ if (applicationUrn === null || applicationUrn === undefined) {
1936
+ throw new RequiredError('applicationUrn', 'Required parameter applicationUrn was null or undefined when calling listApplicationAttributes.');
1937
+ }
1938
+ options.pathParams = { 'application_urn': applicationUrn, };
1939
+ options.headers = localVarHeaderParameter;
1940
+ return options;
1941
+ },
1942
+ /**
1943
+ * 查询应用平台列表。
1944
+ *
1945
+ * 详细说明请参考华为云API Explorer。
1946
+ * Please refer to Huawei cloud API Explorer for details.
1947
+ */
1948
+ listApplications: function (listApplicationsRequest) {
1949
+ var options = {
1950
+ method: "GET",
1951
+ url: "/v2/{project_id}/notifications/applications",
1952
+ contentType: "application/json",
1953
+ queryParams: {},
1954
+ pathParams: {},
1955
+ headers: {},
1956
+ data: {}
1957
+ };
1958
+ var localVarHeaderParameter = {};
1959
+ var localVarQueryParameter = {};
1960
+ var offset;
1961
+ var limit;
1962
+ var name;
1963
+ var platform;
1964
+ if (listApplicationsRequest !== null && listApplicationsRequest !== undefined) {
1965
+ if (listApplicationsRequest instanceof ListApplicationsRequest_1.ListApplicationsRequest) {
1966
+ offset = listApplicationsRequest.offset;
1967
+ limit = listApplicationsRequest.limit;
1968
+ name = listApplicationsRequest.name;
1969
+ platform = listApplicationsRequest.platform;
1970
+ }
1971
+ else {
1972
+ offset = listApplicationsRequest['offset'];
1973
+ limit = listApplicationsRequest['limit'];
1974
+ name = listApplicationsRequest['name'];
1975
+ platform = listApplicationsRequest['platform'];
1976
+ }
1977
+ }
1978
+ if (offset !== null && offset !== undefined) {
1979
+ localVarQueryParameter['offset'] = offset;
1980
+ }
1981
+ if (limit !== null && limit !== undefined) {
1982
+ localVarQueryParameter['limit'] = limit;
1983
+ }
1984
+ if (name !== null && name !== undefined) {
1985
+ localVarQueryParameter['name'] = name;
1986
+ }
1987
+ if (platform !== null && platform !== undefined) {
1988
+ localVarQueryParameter['platform'] = platform;
1989
+ }
1990
+ options.queryParams = localVarQueryParameter;
1991
+ options.headers = localVarHeaderParameter;
1992
+ return options;
1993
+ },
1994
+ /**
1995
+ * 将消息直发给endpoint设备。
1996
+ *
1997
+ * 详细说明请参考华为云API Explorer。
1998
+ * Please refer to Huawei cloud API Explorer for details.
1999
+ */
2000
+ publishAppMessage: function (publishAppMessageRequest) {
2001
+ var options = {
2002
+ method: "POST",
2003
+ url: "/v2/{project_id}/notifications/endpoints/{endpoint_urn}/publish",
2004
+ contentType: "application/json;charset=UTF-8",
2005
+ queryParams: {},
2006
+ pathParams: {},
2007
+ headers: {},
2008
+ data: {}
2009
+ };
2010
+ var localVarHeaderParameter = {};
2011
+ var body;
2012
+ var endpointUrn;
2013
+ if (publishAppMessageRequest !== null && publishAppMessageRequest !== undefined) {
2014
+ if (publishAppMessageRequest instanceof PublishAppMessageRequest_1.PublishAppMessageRequest) {
2015
+ endpointUrn = publishAppMessageRequest.endpointUrn;
2016
+ body = publishAppMessageRequest.body;
2017
+ }
2018
+ else {
2019
+ endpointUrn = publishAppMessageRequest['endpoint_urn'];
2020
+ body = publishAppMessageRequest['body'];
2021
+ }
2022
+ }
2023
+ if (endpointUrn === null || endpointUrn === undefined) {
2024
+ throw new RequiredError('endpointUrn', 'Required parameter endpointUrn was null or undefined when calling publishAppMessage.');
2025
+ }
2026
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
2027
+ options.data = body !== undefined ? body : {};
2028
+ options.pathParams = { 'endpoint_urn': endpointUrn, };
2029
+ options.headers = localVarHeaderParameter;
2030
+ return options;
2031
+ },
2032
+ /**
2033
+ * 更新应用平台。
2034
+ *
2035
+ * 详细说明请参考华为云API Explorer。
2036
+ * Please refer to Huawei cloud API Explorer for details.
2037
+ */
2038
+ updateApplication: function (updateApplicationRequest) {
2039
+ var options = {
2040
+ method: "PUT",
2041
+ url: "/v2/{project_id}/notifications/applications/{application_urn}",
2042
+ contentType: "application/json;charset=UTF-8",
2043
+ queryParams: {},
2044
+ pathParams: {},
2045
+ headers: {},
2046
+ data: {}
2047
+ };
2048
+ var localVarHeaderParameter = {};
2049
+ var body;
2050
+ var applicationUrn;
2051
+ if (updateApplicationRequest !== null && updateApplicationRequest !== undefined) {
2052
+ if (updateApplicationRequest instanceof UpdateApplicationRequest_1.UpdateApplicationRequest) {
2053
+ applicationUrn = updateApplicationRequest.applicationUrn;
2054
+ body = updateApplicationRequest.body;
2055
+ }
2056
+ else {
2057
+ applicationUrn = updateApplicationRequest['application_urn'];
2058
+ body = updateApplicationRequest['body'];
2059
+ }
2060
+ }
2061
+ if (applicationUrn === null || applicationUrn === undefined) {
2062
+ throw new RequiredError('applicationUrn', 'Required parameter applicationUrn was null or undefined when calling updateApplication.');
2063
+ }
2064
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
2065
+ options.data = body !== undefined ? body : {};
2066
+ options.pathParams = { 'application_urn': applicationUrn, };
2067
+ options.headers = localVarHeaderParameter;
2068
+ return options;
2069
+ },
2070
+ /**
2071
+ * 创建应用平台的endpoint终端。
2072
+ *
2073
+ * 详细说明请参考华为云API Explorer。
2074
+ * Please refer to Huawei cloud API Explorer for details.
2075
+ */
2076
+ createApplicationEndpoint: function (createApplicationEndpointRequest) {
2077
+ var options = {
2078
+ method: "POST",
2079
+ url: "/v2/{project_id}/notifications/applications/{application_urn}/endpoints",
2080
+ contentType: "application/json;charset=UTF-8",
2081
+ queryParams: {},
2082
+ pathParams: {},
2083
+ headers: {},
2084
+ data: {}
2085
+ };
2086
+ var localVarHeaderParameter = {};
2087
+ var body;
2088
+ var applicationUrn;
2089
+ if (createApplicationEndpointRequest !== null && createApplicationEndpointRequest !== undefined) {
2090
+ if (createApplicationEndpointRequest instanceof CreateApplicationEndpointRequest_1.CreateApplicationEndpointRequest) {
2091
+ applicationUrn = createApplicationEndpointRequest.applicationUrn;
2092
+ body = createApplicationEndpointRequest.body;
2093
+ }
2094
+ else {
2095
+ applicationUrn = createApplicationEndpointRequest['application_urn'];
2096
+ body = createApplicationEndpointRequest['body'];
2097
+ }
2098
+ }
2099
+ if (applicationUrn === null || applicationUrn === undefined) {
2100
+ throw new RequiredError('applicationUrn', 'Required parameter applicationUrn was null or undefined when calling createApplicationEndpoint.');
2101
+ }
2102
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
2103
+ options.data = body !== undefined ? body : {};
2104
+ options.pathParams = { 'application_urn': applicationUrn, };
2105
+ options.headers = localVarHeaderParameter;
2106
+ return options;
2107
+ },
2108
+ /**
2109
+ * 删除设备。
2110
+ *
2111
+ * 详细说明请参考华为云API Explorer。
2112
+ * Please refer to Huawei cloud API Explorer for details.
2113
+ */
2114
+ deleteApplicationEndpoint: function (deleteApplicationEndpointRequest) {
2115
+ var options = {
2116
+ method: "DELETE",
2117
+ url: "/v2/{project_id}/notifications/endpoints/{endpoint_urn}",
2118
+ contentType: "application/json",
2119
+ queryParams: {},
2120
+ pathParams: {},
2121
+ headers: {},
2122
+ data: {}
2123
+ };
2124
+ var localVarHeaderParameter = {};
2125
+ var endpointUrn;
2126
+ if (deleteApplicationEndpointRequest !== null && deleteApplicationEndpointRequest !== undefined) {
2127
+ if (deleteApplicationEndpointRequest instanceof DeleteApplicationEndpointRequest_1.DeleteApplicationEndpointRequest) {
2128
+ endpointUrn = deleteApplicationEndpointRequest.endpointUrn;
2129
+ }
2130
+ else {
2131
+ endpointUrn = deleteApplicationEndpointRequest['endpoint_urn'];
2132
+ }
2133
+ }
2134
+ if (endpointUrn === null || endpointUrn === undefined) {
2135
+ throw new RequiredError('endpointUrn', 'Required parameter endpointUrn was null or undefined when calling deleteApplicationEndpoint.');
2136
+ }
2137
+ options.pathParams = { 'endpoint_urn': endpointUrn, };
2138
+ options.headers = localVarHeaderParameter;
2139
+ return options;
2140
+ },
2141
+ /**
2142
+ * 获取endpoint的属性。
2143
+ *
2144
+ * 详细说明请参考华为云API Explorer。
2145
+ * Please refer to Huawei cloud API Explorer for details.
2146
+ */
2147
+ listApplicationEndpointAttributes: function (listApplicationEndpointAttributesRequest) {
2148
+ var options = {
2149
+ method: "GET",
2150
+ url: "/v2/{project_id}/notifications/endpoints/{endpoint_urn}",
2151
+ contentType: "application/json",
2152
+ queryParams: {},
2153
+ pathParams: {},
2154
+ headers: {},
2155
+ data: {}
2156
+ };
2157
+ var localVarHeaderParameter = {};
2158
+ var endpointUrn;
2159
+ if (listApplicationEndpointAttributesRequest !== null && listApplicationEndpointAttributesRequest !== undefined) {
2160
+ if (listApplicationEndpointAttributesRequest instanceof ListApplicationEndpointAttributesRequest_1.ListApplicationEndpointAttributesRequest) {
2161
+ endpointUrn = listApplicationEndpointAttributesRequest.endpointUrn;
2162
+ }
2163
+ else {
2164
+ endpointUrn = listApplicationEndpointAttributesRequest['endpoint_urn'];
2165
+ }
2166
+ }
2167
+ if (endpointUrn === null || endpointUrn === undefined) {
2168
+ throw new RequiredError('endpointUrn', 'Required parameter endpointUrn was null or undefined when calling listApplicationEndpointAttributes.');
2169
+ }
2170
+ options.pathParams = { 'endpoint_urn': endpointUrn, };
2171
+ options.headers = localVarHeaderParameter;
2172
+ return options;
2173
+ },
2174
+ /**
2175
+ * 查询平台的endpoint列表。
2176
+ *
2177
+ * 详细说明请参考华为云API Explorer。
2178
+ * Please refer to Huawei cloud API Explorer for details.
2179
+ */
2180
+ listApplicationEndpoints: function (listApplicationEndpointsRequest) {
2181
+ var options = {
2182
+ method: "GET",
2183
+ url: "/v2/{project_id}/notifications/applications/{application_urn}/endpoints",
2184
+ contentType: "application/json",
2185
+ queryParams: {},
2186
+ pathParams: {},
2187
+ headers: {},
2188
+ data: {}
2189
+ };
2190
+ var localVarHeaderParameter = {};
2191
+ var localVarQueryParameter = {};
2192
+ var applicationUrn;
2193
+ var offset;
2194
+ var limit;
2195
+ var enabled;
2196
+ var token;
2197
+ var userData;
2198
+ if (listApplicationEndpointsRequest !== null && listApplicationEndpointsRequest !== undefined) {
2199
+ if (listApplicationEndpointsRequest instanceof ListApplicationEndpointsRequest_1.ListApplicationEndpointsRequest) {
2200
+ applicationUrn = listApplicationEndpointsRequest.applicationUrn;
2201
+ offset = listApplicationEndpointsRequest.offset;
2202
+ limit = listApplicationEndpointsRequest.limit;
2203
+ enabled = listApplicationEndpointsRequest.enabled;
2204
+ token = listApplicationEndpointsRequest.token;
2205
+ userData = listApplicationEndpointsRequest.userData;
2206
+ }
2207
+ else {
2208
+ applicationUrn = listApplicationEndpointsRequest['application_urn'];
2209
+ offset = listApplicationEndpointsRequest['offset'];
2210
+ limit = listApplicationEndpointsRequest['limit'];
2211
+ enabled = listApplicationEndpointsRequest['enabled'];
2212
+ token = listApplicationEndpointsRequest['token'];
2213
+ userData = listApplicationEndpointsRequest['user_data'];
2214
+ }
2215
+ }
2216
+ if (applicationUrn === null || applicationUrn === undefined) {
2217
+ throw new RequiredError('applicationUrn', 'Required parameter applicationUrn was null or undefined when calling listApplicationEndpoints.');
2218
+ }
2219
+ if (offset !== null && offset !== undefined) {
2220
+ localVarQueryParameter['offset'] = offset;
2221
+ }
2222
+ if (limit !== null && limit !== undefined) {
2223
+ localVarQueryParameter['limit'] = limit;
2224
+ }
2225
+ if (enabled !== null && enabled !== undefined) {
2226
+ localVarQueryParameter['enabled'] = enabled;
2227
+ }
2228
+ if (token !== null && token !== undefined) {
2229
+ localVarQueryParameter['token'] = token;
2230
+ }
2231
+ if (userData !== null && userData !== undefined) {
2232
+ localVarQueryParameter['user_data'] = userData;
2233
+ }
2234
+ options.queryParams = localVarQueryParameter;
2235
+ options.pathParams = { 'application_urn': applicationUrn, };
2236
+ options.headers = localVarHeaderParameter;
2237
+ return options;
2238
+ },
2239
+ /**
2240
+ * 更新设备属性。
2241
+ *
2242
+ * 详细说明请参考华为云API Explorer。
2243
+ * Please refer to Huawei cloud API Explorer for details.
2244
+ */
2245
+ updateApplicationEndpoint: function (updateApplicationEndpointRequest) {
2246
+ var options = {
2247
+ method: "PUT",
2248
+ url: "/v2/{project_id}/notifications/endpoints/{endpoint_urn}",
2249
+ contentType: "application/json;charset=UTF-8",
2250
+ queryParams: {},
2251
+ pathParams: {},
2252
+ headers: {},
2253
+ data: {}
2254
+ };
2255
+ var localVarHeaderParameter = {};
2256
+ var body;
2257
+ var endpointUrn;
2258
+ if (updateApplicationEndpointRequest !== null && updateApplicationEndpointRequest !== undefined) {
2259
+ if (updateApplicationEndpointRequest instanceof UpdateApplicationEndpointRequest_1.UpdateApplicationEndpointRequest) {
2260
+ endpointUrn = updateApplicationEndpointRequest.endpointUrn;
2261
+ body = updateApplicationEndpointRequest.body;
2262
+ }
2263
+ else {
2264
+ endpointUrn = updateApplicationEndpointRequest['endpoint_urn'];
2265
+ body = updateApplicationEndpointRequest['body'];
2266
+ }
2267
+ }
2268
+ if (endpointUrn === null || endpointUrn === undefined) {
2269
+ throw new RequiredError('endpointUrn', 'Required parameter endpointUrn was null or undefined when calling updateApplicationEndpoint.');
2270
+ }
2271
+ localVarHeaderParameter['Content-Type'] = 'application/json;charset=UTF-8';
2272
+ options.data = body !== undefined ? body : {};
2273
+ options.pathParams = { 'endpoint_urn': endpointUrn, };
2274
+ options.headers = localVarHeaderParameter;
2275
+ return options;
2276
+ },
2277
+ };
2278
+ };
2279
+ exports.ParamCreater = ParamCreater;
2280
+ function newClient(client) {
2281
+ return new SmnClient(client);
2282
+ }
2283
+ /**
2284
+ *
2285
+ * @export
2286
+ * @class RequiredError
2287
+ * @extends {Error}
2288
+ */
2289
+ var RequiredError = /** @class */ (function (_super) {
2290
+ __extends(RequiredError, _super);
2291
+ function RequiredError(field, msg) {
2292
+ var _this = _super.call(this, msg) || this;
2293
+ _this.field = field;
2294
+ _this.name = "RequiredError";
2295
+ return _this;
2296
+ }
2297
+ return RequiredError;
2298
+ }(Error));
2299
+ exports.RequiredError = RequiredError;