@foru-ms/sdk 2.1.14 → 2.1.16

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 (76) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/tags/client/Client.d.ts +37 -0
  3. package/dist/cjs/api/resources/tags/client/Client.js +126 -0
  4. package/dist/cjs/api/resources/tags/client/requests/CreateSubscriberTagsRequest.d.ts +12 -0
  5. package/dist/cjs/api/resources/tags/client/requests/CreateSubscriberTagsRequest.js +3 -0
  6. package/dist/cjs/api/resources/tags/client/requests/UnsubscribeTagsRequest.d.ts +10 -0
  7. package/dist/cjs/api/resources/tags/client/requests/UnsubscribeTagsRequest.js +3 -0
  8. package/dist/cjs/api/resources/tags/client/requests/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/tags/types/UnsubscribeTagsResponse.d.ts +8 -0
  10. package/dist/cjs/api/resources/tags/types/UnsubscribeTagsResponse.js +3 -0
  11. package/dist/cjs/api/resources/tags/types/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/tags/types/index.js +1 -0
  13. package/dist/cjs/api/resources/threads/client/Client.d.ts +73 -0
  14. package/dist/cjs/api/resources/threads/client/Client.js +249 -0
  15. package/dist/cjs/api/resources/threads/client/requests/CreatePollVoteThreadsRequest.d.ts +15 -0
  16. package/dist/cjs/api/resources/threads/client/requests/CreatePollVoteThreadsRequest.js +3 -0
  17. package/dist/cjs/api/resources/threads/client/requests/DeleteOwnPollVoteThreadsRequest.d.ts +10 -0
  18. package/dist/cjs/api/resources/threads/client/requests/DeleteOwnPollVoteThreadsRequest.js +3 -0
  19. package/dist/cjs/api/resources/threads/client/requests/DeletePollVoteThreadsRequest.d.ts +13 -0
  20. package/dist/cjs/api/resources/threads/client/requests/DeletePollVoteThreadsRequest.js +3 -0
  21. package/dist/cjs/api/resources/threads/client/requests/UnsubscribeThreadsRequest.d.ts +10 -0
  22. package/dist/cjs/api/resources/threads/client/requests/UnsubscribeThreadsRequest.js +3 -0
  23. package/dist/cjs/api/resources/threads/client/requests/index.d.ts +4 -0
  24. package/dist/cjs/api/resources/threads/types/DeleteOwnPollVoteThreadsResponse.d.ts +8 -0
  25. package/dist/cjs/api/resources/threads/types/DeleteOwnPollVoteThreadsResponse.js +3 -0
  26. package/dist/cjs/api/resources/threads/types/UnsubscribeThreadsResponse.d.ts +8 -0
  27. package/dist/cjs/api/resources/threads/types/UnsubscribeThreadsResponse.js +3 -0
  28. package/dist/cjs/api/resources/threads/types/index.d.ts +2 -0
  29. package/dist/cjs/api/resources/threads/types/index.js +2 -0
  30. package/dist/cjs/api/types/PollVoteResponse.d.ts +12 -0
  31. package/dist/cjs/api/types/PollVoteResponse.js +3 -0
  32. package/dist/cjs/api/types/TagSubscriberCreate.d.ts +4 -0
  33. package/dist/cjs/api/types/TagSubscriberCreate.js +3 -0
  34. package/dist/cjs/api/types/index.d.ts +2 -0
  35. package/dist/cjs/api/types/index.js +2 -0
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/esm/BaseClient.mjs +2 -2
  39. package/dist/esm/api/resources/tags/client/Client.d.mts +37 -0
  40. package/dist/esm/api/resources/tags/client/Client.mjs +126 -0
  41. package/dist/esm/api/resources/tags/client/requests/CreateSubscriberTagsRequest.d.mts +12 -0
  42. package/dist/esm/api/resources/tags/client/requests/CreateSubscriberTagsRequest.mjs +2 -0
  43. package/dist/esm/api/resources/tags/client/requests/UnsubscribeTagsRequest.d.mts +10 -0
  44. package/dist/esm/api/resources/tags/client/requests/UnsubscribeTagsRequest.mjs +2 -0
  45. package/dist/esm/api/resources/tags/client/requests/index.d.mts +2 -0
  46. package/dist/esm/api/resources/tags/types/UnsubscribeTagsResponse.d.mts +8 -0
  47. package/dist/esm/api/resources/tags/types/UnsubscribeTagsResponse.mjs +2 -0
  48. package/dist/esm/api/resources/tags/types/index.d.mts +1 -0
  49. package/dist/esm/api/resources/tags/types/index.mjs +1 -0
  50. package/dist/esm/api/resources/threads/client/Client.d.mts +73 -0
  51. package/dist/esm/api/resources/threads/client/Client.mjs +249 -0
  52. package/dist/esm/api/resources/threads/client/requests/CreatePollVoteThreadsRequest.d.mts +15 -0
  53. package/dist/esm/api/resources/threads/client/requests/CreatePollVoteThreadsRequest.mjs +2 -0
  54. package/dist/esm/api/resources/threads/client/requests/DeleteOwnPollVoteThreadsRequest.d.mts +10 -0
  55. package/dist/esm/api/resources/threads/client/requests/DeleteOwnPollVoteThreadsRequest.mjs +2 -0
  56. package/dist/esm/api/resources/threads/client/requests/DeletePollVoteThreadsRequest.d.mts +13 -0
  57. package/dist/esm/api/resources/threads/client/requests/DeletePollVoteThreadsRequest.mjs +2 -0
  58. package/dist/esm/api/resources/threads/client/requests/UnsubscribeThreadsRequest.d.mts +10 -0
  59. package/dist/esm/api/resources/threads/client/requests/UnsubscribeThreadsRequest.mjs +2 -0
  60. package/dist/esm/api/resources/threads/client/requests/index.d.mts +4 -0
  61. package/dist/esm/api/resources/threads/types/DeleteOwnPollVoteThreadsResponse.d.mts +8 -0
  62. package/dist/esm/api/resources/threads/types/DeleteOwnPollVoteThreadsResponse.mjs +2 -0
  63. package/dist/esm/api/resources/threads/types/UnsubscribeThreadsResponse.d.mts +8 -0
  64. package/dist/esm/api/resources/threads/types/UnsubscribeThreadsResponse.mjs +2 -0
  65. package/dist/esm/api/resources/threads/types/index.d.mts +2 -0
  66. package/dist/esm/api/resources/threads/types/index.mjs +2 -0
  67. package/dist/esm/api/types/PollVoteResponse.d.mts +12 -0
  68. package/dist/esm/api/types/PollVoteResponse.mjs +2 -0
  69. package/dist/esm/api/types/TagSubscriberCreate.d.mts +4 -0
  70. package/dist/esm/api/types/TagSubscriberCreate.mjs +2 -0
  71. package/dist/esm/api/types/index.d.mts +2 -0
  72. package/dist/esm/api/types/index.mjs +2 -0
  73. package/dist/esm/version.d.mts +1 -1
  74. package/dist/esm/version.mjs +1 -1
  75. package/package.json +1 -1
  76. package/reference.md +378 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id",
5
+ * nestedId: "nestedId"
6
+ * }
7
+ */
8
+ export interface DeletePollVoteThreadsRequest {
9
+ /** Thread ID */
10
+ id: string;
11
+ /** Vote ID */
12
+ nestedId: string;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface UnsubscribeThreadsRequest {
8
+ /** Thread ID to unsubscribe from */
9
+ id: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,9 @@
1
1
  export type { CreatePollThreadsRequest } from "./CreatePollThreadsRequest.js";
2
+ export type { CreatePollVoteThreadsRequest } from "./CreatePollVoteThreadsRequest.js";
2
3
  export { CreateReactionThreadsRequest } from "./CreateReactionThreadsRequest.js";
3
4
  export type { CreateThreadsRequest } from "./CreateThreadsRequest.js";
5
+ export type { DeleteOwnPollVoteThreadsRequest } from "./DeleteOwnPollVoteThreadsRequest.js";
6
+ export type { DeletePollVoteThreadsRequest } from "./DeletePollVoteThreadsRequest.js";
4
7
  export type { DeletePostThreadsRequest } from "./DeletePostThreadsRequest.js";
5
8
  export type { DeleteReactionThreadsRequest } from "./DeleteReactionThreadsRequest.js";
6
9
  export type { DeleteSubscriberThreadsRequest } from "./DeleteSubscriberThreadsRequest.js";
@@ -14,5 +17,6 @@ export type { RetrievePostThreadsRequest } from "./RetrievePostThreadsRequest.js
14
17
  export type { RetrieveReactionThreadsRequest } from "./RetrieveReactionThreadsRequest.js";
15
18
  export type { RetrieveSubscriberThreadsRequest } from "./RetrieveSubscriberThreadsRequest.js";
16
19
  export type { RetrieveThreadsRequest } from "./RetrieveThreadsRequest.js";
20
+ export type { UnsubscribeThreadsRequest } from "./UnsubscribeThreadsRequest.js";
17
21
  export type { UpdatePollThreadsRequest } from "./UpdatePollThreadsRequest.js";
18
22
  export type { UpdateThreadsRequest } from "./UpdateThreadsRequest.js";
@@ -0,0 +1,8 @@
1
+ export interface DeleteOwnPollVoteThreadsResponse {
2
+ data: DeleteOwnPollVoteThreadsResponse.Data;
3
+ }
4
+ export declare namespace DeleteOwnPollVoteThreadsResponse {
5
+ interface Data {
6
+ success: boolean;
7
+ }
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface UnsubscribeThreadsResponse {
2
+ data: UnsubscribeThreadsResponse.Data;
3
+ }
4
+ export declare namespace UnsubscribeThreadsResponse {
5
+ interface Data {
6
+ success: boolean;
7
+ }
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ export * from "./DeleteOwnPollVoteThreadsResponse.js";
1
2
  export * from "./DeleteReactionThreadsResponse.js";
2
3
  export * from "./ListPostsThreadsRequestSort.js";
3
4
  export * from "./ListPostsThreadsRequestType.js";
@@ -6,4 +7,5 @@ export * from "./ListThreadsRequestSort.js";
6
7
  export * from "./RetrievePostThreadsResponse.js";
7
8
  export * from "./RetrieveReactionThreadsResponse.js";
8
9
  export * from "./RetrieveSubscriberThreadsResponse.js";
10
+ export * from "./UnsubscribeThreadsResponse.js";
9
11
  export * from "./UpdateThreadsResponse.js";
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DeleteOwnPollVoteThreadsResponse.js"), exports);
17
18
  __exportStar(require("./DeleteReactionThreadsResponse.js"), exports);
18
19
  __exportStar(require("./ListPostsThreadsRequestSort.js"), exports);
19
20
  __exportStar(require("./ListPostsThreadsRequestType.js"), exports);
@@ -22,4 +23,5 @@ __exportStar(require("./ListThreadsRequestSort.js"), exports);
22
23
  __exportStar(require("./RetrievePostThreadsResponse.js"), exports);
23
24
  __exportStar(require("./RetrieveReactionThreadsResponse.js"), exports);
24
25
  __exportStar(require("./RetrieveSubscriberThreadsResponse.js"), exports);
26
+ __exportStar(require("./UnsubscribeThreadsResponse.js"), exports);
25
27
  __exportStar(require("./UpdateThreadsResponse.js"), exports);
@@ -0,0 +1,12 @@
1
+ export interface PollVoteResponse {
2
+ data: PollVoteResponse.Data;
3
+ }
4
+ export declare namespace PollVoteResponse {
5
+ interface Data {
6
+ id: string;
7
+ pollId: string;
8
+ optionId: string;
9
+ userId: string;
10
+ createdAt: string;
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface TagSubscriberCreate {
2
+ /** Optional custom data */
3
+ extendedData?: Record<string, unknown>;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -24,6 +24,7 @@ export * from "./NotificationListResponse.js";
24
24
  export * from "./NotificationResponse.js";
25
25
  export * from "./NotificationUpdate.js";
26
26
  export * from "./OwnershipInfo.js";
27
+ export * from "./PollVoteResponse.js";
27
28
  export * from "./Post.js";
28
29
  export * from "./PostCreate.js";
29
30
  export * from "./PostList.js";
@@ -78,6 +79,7 @@ export * from "./TagList.js";
78
79
  export * from "./TagListResponse.js";
79
80
  export * from "./TagResponse.js";
80
81
  export * from "./TagSubscriber.js";
82
+ export * from "./TagSubscriberCreate.js";
81
83
  export * from "./TagSubscriberListResponse.js";
82
84
  export * from "./TagSubscriberResponse.js";
83
85
  export * from "./TagUpdate.js";
@@ -40,6 +40,7 @@ __exportStar(require("./NotificationListResponse.js"), exports);
40
40
  __exportStar(require("./NotificationResponse.js"), exports);
41
41
  __exportStar(require("./NotificationUpdate.js"), exports);
42
42
  __exportStar(require("./OwnershipInfo.js"), exports);
43
+ __exportStar(require("./PollVoteResponse.js"), exports);
43
44
  __exportStar(require("./Post.js"), exports);
44
45
  __exportStar(require("./PostCreate.js"), exports);
45
46
  __exportStar(require("./PostList.js"), exports);
@@ -94,6 +95,7 @@ __exportStar(require("./TagList.js"), exports);
94
95
  __exportStar(require("./TagListResponse.js"), exports);
95
96
  __exportStar(require("./TagResponse.js"), exports);
96
97
  __exportStar(require("./TagSubscriber.js"), exports);
98
+ __exportStar(require("./TagSubscriberCreate.js"), exports);
97
99
  __exportStar(require("./TagSubscriberListResponse.js"), exports);
98
100
  __exportStar(require("./TagSubscriberResponse.js"), exports);
99
101
  __exportStar(require("./TagUpdate.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.14";
1
+ export declare const SDK_VERSION = "2.1.16";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.1.14";
4
+ exports.SDK_VERSION = "2.1.16";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@foru-ms/sdk",
9
- "X-Fern-SDK-Version": "2.1.14",
10
- "User-Agent": "@foru-ms/sdk/2.1.14",
9
+ "X-Fern-SDK-Version": "2.1.16",
10
+ "User-Agent": "@foru-ms/sdk/2.1.16",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -124,6 +124,43 @@ export declare class TagsClient {
124
124
  */
125
125
  listSubscribers(request: Forum.ListSubscribersTagsRequest, requestOptions?: TagsClient.RequestOptions): core.HttpResponsePromise<Forum.TagSubscriberListResponse>;
126
126
  private __listSubscribers;
127
+ /**
128
+ * Create a Subscriber in Tag.
129
+ *
130
+ * @param {Forum.CreateSubscriberTagsRequest} request
131
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @throws {@link Forum.BadRequestError}
134
+ * @throws {@link Forum.UnauthorizedError}
135
+ * @throws {@link Forum.NotFoundError}
136
+ * @throws {@link Forum.TooManyRequestsError}
137
+ * @throws {@link Forum.InternalServerError}
138
+ *
139
+ * @example
140
+ * await client.tags.createSubscriber({
141
+ * id: "id"
142
+ * })
143
+ */
144
+ createSubscriber(request: Forum.CreateSubscriberTagsRequest, requestOptions?: TagsClient.RequestOptions): core.HttpResponsePromise<Forum.TagSubscriberResponse>;
145
+ private __createSubscriber;
146
+ /**
147
+ * Unsubscribe from this tag. Removes the authenticated user's subscription. No subId needed.
148
+ *
149
+ * @param {Forum.UnsubscribeTagsRequest} request
150
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
151
+ *
152
+ * @throws {@link Forum.UnauthorizedError}
153
+ * @throws {@link Forum.NotFoundError}
154
+ * @throws {@link Forum.TooManyRequestsError}
155
+ * @throws {@link Forum.InternalServerError}
156
+ *
157
+ * @example
158
+ * await client.tags.unsubscribe({
159
+ * id: "id"
160
+ * })
161
+ */
162
+ unsubscribe(request: Forum.UnsubscribeTagsRequest, requestOptions?: TagsClient.RequestOptions): core.HttpResponsePromise<Forum.UnsubscribeTagsResponse>;
163
+ private __unsubscribe;
127
164
  /**
128
165
  * @param {Forum.RetrieveSubscriberTagsRequest} request
129
166
  * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -420,6 +420,132 @@ export class TagsClient {
420
420
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/tags/{id}/subscribers");
421
421
  });
422
422
  }
423
+ /**
424
+ * Create a Subscriber in Tag.
425
+ *
426
+ * @param {Forum.CreateSubscriberTagsRequest} request
427
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
428
+ *
429
+ * @throws {@link Forum.BadRequestError}
430
+ * @throws {@link Forum.UnauthorizedError}
431
+ * @throws {@link Forum.NotFoundError}
432
+ * @throws {@link Forum.TooManyRequestsError}
433
+ * @throws {@link Forum.InternalServerError}
434
+ *
435
+ * @example
436
+ * await client.tags.createSubscriber({
437
+ * id: "id"
438
+ * })
439
+ */
440
+ createSubscriber(request, requestOptions) {
441
+ return core.HttpResponsePromise.fromPromise(this.__createSubscriber(request, requestOptions));
442
+ }
443
+ __createSubscriber(request, requestOptions) {
444
+ return __awaiter(this, void 0, void 0, function* () {
445
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
446
+ const { id } = request, _body = __rest(request, ["id"]);
447
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
448
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
449
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
450
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `tags/${core.url.encodePathParam(id)}/subscribers`),
451
+ method: "POST",
452
+ headers: _headers,
453
+ contentType: "application/json",
454
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
455
+ requestType: "json",
456
+ body: _body,
457
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
458
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
459
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
460
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
461
+ logging: this._options.logging,
462
+ });
463
+ if (_response.ok) {
464
+ return { data: _response.body, rawResponse: _response.rawResponse };
465
+ }
466
+ if (_response.error.reason === "status-code") {
467
+ switch (_response.error.statusCode) {
468
+ case 400:
469
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
470
+ case 401:
471
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
472
+ case 404:
473
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
474
+ case 429:
475
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
476
+ case 500:
477
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
478
+ default:
479
+ throw new errors.ForumError({
480
+ statusCode: _response.error.statusCode,
481
+ body: _response.error.body,
482
+ rawResponse: _response.rawResponse,
483
+ });
484
+ }
485
+ }
486
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/tags/{id}/subscribers");
487
+ });
488
+ }
489
+ /**
490
+ * Unsubscribe from this tag. Removes the authenticated user's subscription. No subId needed.
491
+ *
492
+ * @param {Forum.UnsubscribeTagsRequest} request
493
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
494
+ *
495
+ * @throws {@link Forum.UnauthorizedError}
496
+ * @throws {@link Forum.NotFoundError}
497
+ * @throws {@link Forum.TooManyRequestsError}
498
+ * @throws {@link Forum.InternalServerError}
499
+ *
500
+ * @example
501
+ * await client.tags.unsubscribe({
502
+ * id: "id"
503
+ * })
504
+ */
505
+ unsubscribe(request, requestOptions) {
506
+ return core.HttpResponsePromise.fromPromise(this.__unsubscribe(request, requestOptions));
507
+ }
508
+ __unsubscribe(request, requestOptions) {
509
+ return __awaiter(this, void 0, void 0, function* () {
510
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
511
+ const { id } = request;
512
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
513
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
514
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
515
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `tags/${core.url.encodePathParam(id)}/subscribers`),
516
+ method: "DELETE",
517
+ headers: _headers,
518
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
519
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
520
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
521
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
522
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
523
+ logging: this._options.logging,
524
+ });
525
+ if (_response.ok) {
526
+ return { data: _response.body, rawResponse: _response.rawResponse };
527
+ }
528
+ if (_response.error.reason === "status-code") {
529
+ switch (_response.error.statusCode) {
530
+ case 401:
531
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
532
+ case 404:
533
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
534
+ case 429:
535
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
536
+ case 500:
537
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
538
+ default:
539
+ throw new errors.ForumError({
540
+ statusCode: _response.error.statusCode,
541
+ body: _response.error.body,
542
+ rawResponse: _response.rawResponse,
543
+ });
544
+ }
545
+ }
546
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/tags/{id}/subscribers");
547
+ });
548
+ }
423
549
  /**
424
550
  * @param {Forum.RetrieveSubscriberTagsRequest} request
425
551
  * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface CreateSubscriberTagsRequest {
8
+ /** Tag ID */
9
+ id: string;
10
+ /** Optional custom data */
11
+ extendedData?: Record<string, unknown>;
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface UnsubscribeTagsRequest {
8
+ /** Tag ID to unsubscribe from */
9
+ id: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,3 +1,4 @@
1
+ export type { CreateSubscriberTagsRequest } from "./CreateSubscriberTagsRequest.mjs";
1
2
  export type { CreateTagsRequest } from "./CreateTagsRequest.mjs";
2
3
  export type { DeleteSubscriberTagsRequest } from "./DeleteSubscriberTagsRequest.mjs";
3
4
  export type { DeleteTagsRequest } from "./DeleteTagsRequest.mjs";
@@ -5,4 +6,5 @@ export type { ListSubscribersTagsRequest } from "./ListSubscribersTagsRequest.mj
5
6
  export type { ListTagsRequest } from "./ListTagsRequest.mjs";
6
7
  export type { RetrieveSubscriberTagsRequest } from "./RetrieveSubscriberTagsRequest.mjs";
7
8
  export type { RetrieveTagsRequest } from "./RetrieveTagsRequest.mjs";
9
+ export type { UnsubscribeTagsRequest } from "./UnsubscribeTagsRequest.mjs";
8
10
  export type { UpdateTagsRequest } from "./UpdateTagsRequest.mjs";
@@ -0,0 +1,8 @@
1
+ export interface UnsubscribeTagsResponse {
2
+ data: UnsubscribeTagsResponse.Data;
3
+ }
4
+ export declare namespace UnsubscribeTagsResponse {
5
+ interface Data {
6
+ success: boolean;
7
+ }
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from "./RetrieveSubscriberTagsResponse.mjs";
2
+ export * from "./UnsubscribeTagsResponse.mjs";
2
3
  export * from "./UpdateTagsResponse.mjs";
@@ -1,2 +1,3 @@
1
1
  export * from "./RetrieveSubscriberTagsResponse.mjs";
2
+ export * from "./UnsubscribeTagsResponse.mjs";
2
3
  export * from "./UpdateTagsResponse.mjs";
@@ -249,6 +249,24 @@ export declare class ThreadsClient {
249
249
  */
250
250
  listSubscribers(request: Forum.ListSubscribersThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.ThreadSubscriberListResponse>;
251
251
  private __listSubscribers;
252
+ /**
253
+ * Unsubscribe from this thread. Removes the authenticated user's subscription. No subId needed.
254
+ *
255
+ * @param {Forum.UnsubscribeThreadsRequest} request
256
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
257
+ *
258
+ * @throws {@link Forum.UnauthorizedError}
259
+ * @throws {@link Forum.NotFoundError}
260
+ * @throws {@link Forum.TooManyRequestsError}
261
+ * @throws {@link Forum.InternalServerError}
262
+ *
263
+ * @example
264
+ * await client.threads.unsubscribe({
265
+ * id: "id"
266
+ * })
267
+ */
268
+ unsubscribe(request: Forum.UnsubscribeThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.UnsubscribeThreadsResponse>;
269
+ private __unsubscribe;
252
270
  /**
253
271
  * @param {Forum.RetrieveSubscriberThreadsRequest} request
254
272
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -337,4 +355,59 @@ export declare class ThreadsClient {
337
355
  */
338
356
  updatePoll(request: Forum.UpdatePollThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.ThreadPollResponse>;
339
357
  private __updatePoll;
358
+ /**
359
+ * Create a Vote in the Thread's Poll.
360
+ *
361
+ * @param {Forum.CreatePollVoteThreadsRequest} request
362
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
363
+ *
364
+ * @throws {@link Forum.BadRequestError}
365
+ * @throws {@link Forum.UnauthorizedError}
366
+ * @throws {@link Forum.NotFoundError}
367
+ * @throws {@link Forum.TooManyRequestsError}
368
+ * @throws {@link Forum.InternalServerError}
369
+ *
370
+ * @example
371
+ * await client.threads.createPollVote({
372
+ * id: "id",
373
+ * optionId: "optionId"
374
+ * })
375
+ */
376
+ createPollVote(request: Forum.CreatePollVoteThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.PollVoteResponse>;
377
+ private __createPollVote;
378
+ /**
379
+ * Removes the authenticated user's Vote. No ID needed.
380
+ *
381
+ * @param {Forum.DeleteOwnPollVoteThreadsRequest} request
382
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
383
+ *
384
+ * @throws {@link Forum.UnauthorizedError}
385
+ * @throws {@link Forum.NotFoundError}
386
+ * @throws {@link Forum.TooManyRequestsError}
387
+ * @throws {@link Forum.InternalServerError}
388
+ *
389
+ * @example
390
+ * await client.threads.deleteOwnPollVote({
391
+ * id: "id"
392
+ * })
393
+ */
394
+ deleteOwnPollVote(request: Forum.DeleteOwnPollVoteThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.DeleteOwnPollVoteThreadsResponse>;
395
+ private __deleteOwnPollVote;
396
+ /**
397
+ * @param {Forum.DeletePollVoteThreadsRequest} request
398
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
399
+ *
400
+ * @throws {@link Forum.UnauthorizedError}
401
+ * @throws {@link Forum.NotFoundError}
402
+ * @throws {@link Forum.TooManyRequestsError}
403
+ * @throws {@link Forum.InternalServerError}
404
+ *
405
+ * @example
406
+ * await client.threads.deletePollVote({
407
+ * id: "id",
408
+ * nestedId: "nestedId"
409
+ * })
410
+ */
411
+ deletePollVote(request: Forum.DeletePollVoteThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.SuccessResponse>;
412
+ private __deletePollVote;
340
413
  }