Skip to content

Commit ec791da

Browse files
James RobertsonJames Robertson
authored andcommitted
Introduce announcement API + Introduce metadata API + Ensure all moderation paths are under Moderation API
1 parent 88efb82 commit ec791da

File tree

804 files changed

+32093
-17962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

804 files changed

+32093
-17962
lines changed

.openapi-generator/FILES

Lines changed: 337 additions & 18 deletions
Large diffs are not rendered by default.

dist/ApiClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
2121

2222
/**
2323
* @module ApiClient
24-
* @version 1.0.0
24+
* @version 1.0.3
2525
*/
2626

2727
/**
@@ -61,7 +61,7 @@ var ApiClient = /*#__PURE__*/function () {
6161
*/
6262

6363
this.defaultHeaders = {
64-
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript'
64+
'User-Agent': 'OpenAPI-Generator/1.0.3/Javascript'
6565
};
6666
/**
6767
* The default HTTP timeout for all API calls.

dist/api/AdvancedAnalyticsApi.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
2020
/**
2121
* AdvancedAnalytics service.
2222
* @module api/AdvancedAnalyticsApi
23-
* @version 1.0.0
23+
* @version 1.0.1
2424
*/
2525
var AdvancedAnalyticsApi = /*#__PURE__*/function () {
2626
/**
@@ -38,21 +38,24 @@ var AdvancedAnalyticsApi = /*#__PURE__*/function () {
3838
/**
3939
* Retrieve Advanced analytics metrics
4040
* ## Retrieve Advanced analytics metrics Retrieves Advanced analytics metrics based on the specified parameters. You can retrieve either daily or monthly metrics using the time_dimension parameter. >__Note__: Daily metrics are calculated and updated every three hours, starting at 1 a.m. in UTC. Meanwhile, monthly metrics are calculated after the last day of the month. https://sendbird.com/docs/chat/v3/platform-api/guides/advanced-analytics#2-retrieve-advanced-analytics-metrics ----------------------------
41-
* @param {Object} opts Optional parameters
42-
* @param {String} opts.apiToken
41+
* @param {String} apiToken
4342
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RetrieveAdvancedAnalyticsMetricsResponse} and HTTP response
4443
*/
4544

4645

4746
_createClass(AdvancedAnalyticsApi, [{
4847
key: "retrieveAdvancedAnalyticsMetricsWithHttpInfo",
49-
value: function retrieveAdvancedAnalyticsMetricsWithHttpInfo(opts) {
50-
opts = opts || {};
51-
var postBody = null;
48+
value: function retrieveAdvancedAnalyticsMetricsWithHttpInfo(apiToken) {
49+
var postBody = null; // verify the required parameter 'apiToken' is set
50+
51+
if (apiToken === undefined || apiToken === null) {
52+
throw new Error("Missing the required parameter 'apiToken' when calling retrieveAdvancedAnalyticsMetrics");
53+
}
54+
5255
var pathParams = {};
5356
var queryParams = {};
5457
var headerParams = {
55-
'Api-Token': opts['apiToken']
58+
'Api-Token': apiToken
5659
};
5760
var formParams = {};
5861
var authNames = [];
@@ -64,15 +67,14 @@ var AdvancedAnalyticsApi = /*#__PURE__*/function () {
6467
/**
6568
* Retrieve Advanced analytics metrics
6669
* ## Retrieve Advanced analytics metrics Retrieves Advanced analytics metrics based on the specified parameters. You can retrieve either daily or monthly metrics using the time_dimension parameter. >__Note__: Daily metrics are calculated and updated every three hours, starting at 1 a.m. in UTC. Meanwhile, monthly metrics are calculated after the last day of the month. https://sendbird.com/docs/chat/v3/platform-api/guides/advanced-analytics#2-retrieve-advanced-analytics-metrics ----------------------------
67-
* @param {Object} opts Optional parameters
68-
* @param {String} opts.apiToken
70+
* @param {String} apiToken
6971
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RetrieveAdvancedAnalyticsMetricsResponse}
7072
*/
7173

7274
}, {
7375
key: "retrieveAdvancedAnalyticsMetrics",
74-
value: function retrieveAdvancedAnalyticsMetrics(opts) {
75-
return this.retrieveAdvancedAnalyticsMetricsWithHttpInfo(opts).then(function (response_and_data) {
76+
value: function retrieveAdvancedAnalyticsMetrics(apiToken) {
77+
return this.retrieveAdvancedAnalyticsMetricsWithHttpInfo(apiToken).then(function (response_and_data) {
7678
return response_and_data.data;
7779
});
7880
}

dist/api/AnnouncementApi.js

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
"use strict";
2+
3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
6+
exports["default"] = void 0;
7+
8+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
9+
10+
var _GetDetailedOpenRateOfAnnouncementByIdResponse = _interopRequireDefault(require("../model/GetDetailedOpenRateOfAnnouncementByIdResponse"));
11+
12+
var _GetDetailedOpenRateOfAnnouncementGroupResponse = _interopRequireDefault(require("../model/GetDetailedOpenRateOfAnnouncementGroupResponse"));
13+
14+
var _GetDetailedOpenStatusOfAnnouncementByIdResponse = _interopRequireDefault(require("../model/GetDetailedOpenStatusOfAnnouncementByIdResponse"));
15+
16+
var _ViewAnnouncementByIdResponse = _interopRequireDefault(require("../model/ViewAnnouncementByIdResponse"));
17+
18+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19+
20+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21+
22+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23+
24+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25+
26+
/**
27+
* Announcement service.
28+
* @module api/AnnouncementApi
29+
* @version 1.0.3
30+
*/
31+
var AnnouncementApi = /*#__PURE__*/function () {
32+
/**
33+
* Constructs a new AnnouncementApi.
34+
* @alias module:api/AnnouncementApi
35+
* @class
36+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
37+
* default to {@link module:ApiClient#instance} if unspecified.
38+
*/
39+
function AnnouncementApi(apiClient) {
40+
_classCallCheck(this, AnnouncementApi);
41+
42+
this.apiClient = apiClient || _ApiClient["default"].instance;
43+
}
44+
/**
45+
* Get detailed open rate of an announcement
46+
* ## Get detailed open rate of an announcement Retrieves the detailed open rate information of an announcement. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-get-detailed-open-rate-of-an-announcement ---------------------------- `unique_id` Type: string Description: Specifies the unique ID of the announcement to get its open rate.
47+
* @param {String} apiToken
48+
* @param {String} uniqueId
49+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetDetailedOpenRateOfAnnouncementByIdResponse} and HTTP response
50+
*/
51+
52+
53+
_createClass(AnnouncementApi, [{
54+
key: "getDetailedOpenRateOfAnnouncementByIdWithHttpInfo",
55+
value: function getDetailedOpenRateOfAnnouncementByIdWithHttpInfo(apiToken, uniqueId) {
56+
var postBody = null; // verify the required parameter 'apiToken' is set
57+
58+
if (apiToken === undefined || apiToken === null) {
59+
throw new Error("Missing the required parameter 'apiToken' when calling getDetailedOpenRateOfAnnouncementById");
60+
} // verify the required parameter 'uniqueId' is set
61+
62+
63+
if (uniqueId === undefined || uniqueId === null) {
64+
throw new Error("Missing the required parameter 'uniqueId' when calling getDetailedOpenRateOfAnnouncementById");
65+
}
66+
67+
var pathParams = {
68+
'unique_id': uniqueId
69+
};
70+
var queryParams = {};
71+
var headerParams = {
72+
'Api-Token': apiToken
73+
};
74+
var formParams = {};
75+
var authNames = [];
76+
var contentTypes = [];
77+
var accepts = ['application/json'];
78+
var returnType = _GetDetailedOpenRateOfAnnouncementByIdResponse["default"];
79+
return this.apiClient.callApi('/v3/announcement_open_rate/{unique_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
80+
}
81+
/**
82+
* Get detailed open rate of an announcement
83+
* ## Get detailed open rate of an announcement Retrieves the detailed open rate information of an announcement. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-get-detailed-open-rate-of-an-announcement ---------------------------- `unique_id` Type: string Description: Specifies the unique ID of the announcement to get its open rate.
84+
* @param {String} apiToken
85+
* @param {String} uniqueId
86+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetDetailedOpenRateOfAnnouncementByIdResponse}
87+
*/
88+
89+
}, {
90+
key: "getDetailedOpenRateOfAnnouncementById",
91+
value: function getDetailedOpenRateOfAnnouncementById(apiToken, uniqueId) {
92+
return this.getDetailedOpenRateOfAnnouncementByIdWithHttpInfo(apiToken, uniqueId).then(function (response_and_data) {
93+
return response_and_data.data;
94+
});
95+
}
96+
/**
97+
* Get detailed open rate of an announcement group
98+
* ## Get detailed open rate of an announcement group Retrieves the detailed open rate information of an announcement group. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-get-detailed-open-rate-of-an-announcement-group ----------------------------
99+
* @param {String} apiToken
100+
* @param {String} announcementGroup
101+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetDetailedOpenRateOfAnnouncementGroupResponse} and HTTP response
102+
*/
103+
104+
}, {
105+
key: "getDetailedOpenRateOfAnnouncementGroupWithHttpInfo",
106+
value: function getDetailedOpenRateOfAnnouncementGroupWithHttpInfo(apiToken, announcementGroup) {
107+
var postBody = null; // verify the required parameter 'apiToken' is set
108+
109+
if (apiToken === undefined || apiToken === null) {
110+
throw new Error("Missing the required parameter 'apiToken' when calling getDetailedOpenRateOfAnnouncementGroup");
111+
} // verify the required parameter 'announcementGroup' is set
112+
113+
114+
if (announcementGroup === undefined || announcementGroup === null) {
115+
throw new Error("Missing the required parameter 'announcementGroup' when calling getDetailedOpenRateOfAnnouncementGroup");
116+
}
117+
118+
var pathParams = {
119+
'announcement_group': announcementGroup
120+
};
121+
var queryParams = {};
122+
var headerParams = {
123+
'Api-Token': apiToken
124+
};
125+
var formParams = {};
126+
var authNames = [];
127+
var contentTypes = [];
128+
var accepts = ['application/json'];
129+
var returnType = _GetDetailedOpenRateOfAnnouncementGroupResponse["default"];
130+
return this.apiClient.callApi('/v3/announcement_open_rate_by_group/{announcement_group}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
131+
}
132+
/**
133+
* Get detailed open rate of an announcement group
134+
* ## Get detailed open rate of an announcement group Retrieves the detailed open rate information of an announcement group. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-get-detailed-open-rate-of-an-announcement-group ----------------------------
135+
* @param {String} apiToken
136+
* @param {String} announcementGroup
137+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetDetailedOpenRateOfAnnouncementGroupResponse}
138+
*/
139+
140+
}, {
141+
key: "getDetailedOpenRateOfAnnouncementGroup",
142+
value: function getDetailedOpenRateOfAnnouncementGroup(apiToken, announcementGroup) {
143+
return this.getDetailedOpenRateOfAnnouncementGroupWithHttpInfo(apiToken, announcementGroup).then(function (response_and_data) {
144+
return response_and_data.data;
145+
});
146+
}
147+
/**
148+
* Get detailed open status of an announcement
149+
* ## Get detailed open status of an announcement Retrieves the detailed open status information of a specific announcement. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-get-detailed-open-status-of-an-announcement ----------------------------
150+
* @param {String} apiToken
151+
* @param {String} uniqueId
152+
* @param {Object} opts Optional parameters
153+
* @param {Number} opts.limit
154+
* @param {String} opts.next
155+
* @param {Array.<String>} opts.uniqueIds
156+
* @param {Array.<String>} opts.channelUrls
157+
* @param {Boolean} opts.hasOpened
158+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetDetailedOpenStatusOfAnnouncementByIdResponse} and HTTP response
159+
*/
160+
161+
}, {
162+
key: "getDetailedOpenStatusOfAnnouncementByIdWithHttpInfo",
163+
value: function getDetailedOpenStatusOfAnnouncementByIdWithHttpInfo(apiToken, uniqueId, opts) {
164+
opts = opts || {};
165+
var postBody = null; // verify the required parameter 'apiToken' is set
166+
167+
if (apiToken === undefined || apiToken === null) {
168+
throw new Error("Missing the required parameter 'apiToken' when calling getDetailedOpenStatusOfAnnouncementById");
169+
} // verify the required parameter 'uniqueId' is set
170+
171+
172+
if (uniqueId === undefined || uniqueId === null) {
173+
throw new Error("Missing the required parameter 'uniqueId' when calling getDetailedOpenStatusOfAnnouncementById");
174+
}
175+
176+
var pathParams = {
177+
'unique_id': uniqueId
178+
};
179+
var queryParams = {
180+
'limit': opts['limit'],
181+
'next': opts['next'],
182+
'unique_ids': this.apiClient.buildCollectionParam(opts['uniqueIds'], 'multi'),
183+
'channel_urls': this.apiClient.buildCollectionParam(opts['channelUrls'], 'multi'),
184+
'has_opened': opts['hasOpened']
185+
};
186+
var headerParams = {
187+
'Api-Token': apiToken
188+
};
189+
var formParams = {};
190+
var authNames = [];
191+
var contentTypes = [];
192+
var accepts = ['application/json'];
193+
var returnType = _GetDetailedOpenStatusOfAnnouncementByIdResponse["default"];
194+
return this.apiClient.callApi('/v3/announcement_open_status/{unique_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
195+
}
196+
/**
197+
* Get detailed open status of an announcement
198+
* ## Get detailed open status of an announcement Retrieves the detailed open status information of a specific announcement. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-get-detailed-open-status-of-an-announcement ----------------------------
199+
* @param {String} apiToken
200+
* @param {String} uniqueId
201+
* @param {Object} opts Optional parameters
202+
* @param {Number} opts.limit
203+
* @param {String} opts.next
204+
* @param {Array.<String>} opts.uniqueIds
205+
* @param {Array.<String>} opts.channelUrls
206+
* @param {Boolean} opts.hasOpened
207+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetDetailedOpenStatusOfAnnouncementByIdResponse}
208+
*/
209+
210+
}, {
211+
key: "getDetailedOpenStatusOfAnnouncementById",
212+
value: function getDetailedOpenStatusOfAnnouncementById(apiToken, uniqueId, opts) {
213+
return this.getDetailedOpenStatusOfAnnouncementByIdWithHttpInfo(apiToken, uniqueId, opts).then(function (response_and_data) {
214+
return response_and_data.data;
215+
});
216+
}
217+
/**
218+
* View an announcement
219+
* ## View an announcement Retrieves information on a specific announcement. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-view-an-announcement ----------------------------
220+
* @param {String} apiToken
221+
* @param {String} uniqueId
222+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ViewAnnouncementByIdResponse} and HTTP response
223+
*/
224+
225+
}, {
226+
key: "viewAnnouncementByIdWithHttpInfo",
227+
value: function viewAnnouncementByIdWithHttpInfo(apiToken, uniqueId) {
228+
var postBody = null; // verify the required parameter 'apiToken' is set
229+
230+
if (apiToken === undefined || apiToken === null) {
231+
throw new Error("Missing the required parameter 'apiToken' when calling viewAnnouncementById");
232+
} // verify the required parameter 'uniqueId' is set
233+
234+
235+
if (uniqueId === undefined || uniqueId === null) {
236+
throw new Error("Missing the required parameter 'uniqueId' when calling viewAnnouncementById");
237+
}
238+
239+
var pathParams = {
240+
'unique_id': uniqueId
241+
};
242+
var queryParams = {};
243+
var headerParams = {
244+
'Api-Token': apiToken
245+
};
246+
var formParams = {};
247+
var authNames = [];
248+
var contentTypes = [];
249+
var accepts = ['application/json'];
250+
var returnType = _ViewAnnouncementByIdResponse["default"];
251+
return this.apiClient.callApi('/v3/announcements/{unique_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
252+
}
253+
/**
254+
* View an announcement
255+
* ## View an announcement Retrieves information on a specific announcement. https://sendbird.com/docs/chat/v3/platform-api/guides/announcements#2-view-an-announcement ----------------------------
256+
* @param {String} apiToken
257+
* @param {String} uniqueId
258+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ViewAnnouncementByIdResponse}
259+
*/
260+
261+
}, {
262+
key: "viewAnnouncementById",
263+
value: function viewAnnouncementById(apiToken, uniqueId) {
264+
return this.viewAnnouncementByIdWithHttpInfo(apiToken, uniqueId).then(function (response_and_data) {
265+
return response_and_data.data;
266+
});
267+
}
268+
}]);
269+
270+
return AnnouncementApi;
271+
}();
272+
273+
exports["default"] = AnnouncementApi;

0 commit comments

Comments
 (0)