postboost 1.7.0 → 1.14.0

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 (288) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +26 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +11 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +14 -0
  4. package/.github/pull_request_template.md +6 -0
  5. package/CODE_OF_CONDUCT.md +7 -0
  6. package/CONTRIBUTING.md +31 -0
  7. package/README.md +46 -2
  8. package/SECURITY.md +9 -0
  9. package/api/aIApi.ts +460 -2
  10. package/api/accountGroupsApi.ts +501 -0
  11. package/api/accountsApi.ts +266 -4
  12. package/api/activityApi.ts +188 -0
  13. package/api/agentsApi.ts +918 -0
  14. package/api/analyticsApi.ts +1102 -0
  15. package/api/apis.ts +23 -1
  16. package/api/competitorsApi.ts +412 -0
  17. package/api/hashtagGroupsApi.ts +501 -0
  18. package/api/inboxApi.ts +957 -0
  19. package/api/mediaApi.ts +474 -13
  20. package/api/mentionsApi.ts +509 -0
  21. package/api/postingScheduleApi.ts +497 -0
  22. package/api/postsApi.ts +1375 -65
  23. package/api/receiptsApi.ts +2 -2
  24. package/api/subscriptionsApi.ts +10 -5
  25. package/api/tagsApi.ts +5 -3
  26. package/api/templatesApi.ts +501 -0
  27. package/api/usersApi.ts +2 -2
  28. package/api/webhooksApi.ts +327 -0
  29. package/api/workspacesApi.ts +603 -3
  30. package/model/aICredits.ts +52 -0
  31. package/model/aIUsage.ts +39 -0
  32. package/model/aIUsageText.ts +52 -0
  33. package/model/account.ts +59 -4
  34. package/model/accountAnalytics.ts +73 -0
  35. package/model/accountAnalyticsInitialSync.ts +37 -0
  36. package/model/accountConnectionHealth.ts +124 -0
  37. package/model/accountErrorsInner.ts +50 -0
  38. package/model/accountErrorsInnerOneOf.ts +49 -0
  39. package/model/accountGroup.ts +49 -0
  40. package/model/accountGroupInput.ts +40 -0
  41. package/model/accountHealth.ts +90 -0
  42. package/model/accountHealthDailyCap.ts +43 -0
  43. package/model/accountSchedule.ts +49 -0
  44. package/model/addCompetitor202Response.ts +43 -0
  45. package/model/addCompetitor409Response.ts +37 -0
  46. package/model/addGenericSubscriptionRequest.ts +2 -2
  47. package/model/addPostToQueueRequest.ts +34 -0
  48. package/model/agentPageMeta.ts +49 -0
  49. package/model/agentProposal.ts +137 -0
  50. package/model/agentProposalDecision.ts +31 -0
  51. package/model/agentRun.ts +129 -0
  52. package/model/analyticsPeriod.ts +52 -0
  53. package/model/analyticsSummary.ts +39 -0
  54. package/model/analyticsSummaryData.ts +100 -0
  55. package/model/apiActivity.ts +94 -0
  56. package/model/apiActivityOutcome.ts +27 -0
  57. package/model/apiKey.ts +77 -0
  58. package/model/apiKeyAbility.ts +21 -0
  59. package/model/apiKeyInput.ts +56 -0
  60. package/model/approveAgentProposal200Response.ts +32 -0
  61. package/model/approveAgentProposal409Response.ts +38 -0
  62. package/model/approveInboxReplyDraft403Response.ts +43 -0
  63. package/model/approvePostRequest.ts +62 -0
  64. package/model/bestPostingTimes.ts +41 -0
  65. package/model/bestPostingTimesTimesInner.ts +49 -0
  66. package/model/blogToSocial200Response.ts +9 -2
  67. package/model/blogToSocial429Response.ts +2 -2
  68. package/model/blogToSocialCaption.ts +2 -2
  69. package/model/blogToSocialInput.ts +11 -2
  70. package/model/blogToSocialMedia.ts +2 -2
  71. package/model/blogToSocialResponse.ts +2 -2
  72. package/model/brandVoice.ts +136 -0
  73. package/model/brandVoiceInput.ts +142 -0
  74. package/model/brandVoiceMeta.ts +34 -0
  75. package/model/cancelSubscription422Response.ts +38 -0
  76. package/model/cancelSubscription422ResponseErrors.ts +31 -0
  77. package/model/cancelSubscriptionRequest.ts +34 -0
  78. package/model/changeSubscriptionPlanRequest.ts +2 -2
  79. package/model/channelAccount.ts +101 -0
  80. package/model/checkoutSubscription200Response.ts +2 -2
  81. package/model/checkoutSubscriptionRequest.ts +2 -2
  82. package/model/codedError.ts +46 -0
  83. package/model/competitor.ts +82 -0
  84. package/model/competitorDetail.ts +96 -0
  85. package/model/competitorInput.ts +43 -0
  86. package/model/competitorMedia.ts +61 -0
  87. package/model/competitorSnapshot.ts +43 -0
  88. package/model/completeChunkedUploadRequest.ts +40 -0
  89. package/model/connectChannelInput.ts +64 -0
  90. package/model/createAccountGroup201Response.ts +32 -0
  91. package/model/createAgent201Response.ts +32 -0
  92. package/model/createApiKey201Response.ts +32 -0
  93. package/model/createApiKey201ResponseData.ts +86 -0
  94. package/model/createHashtagGroup201Response.ts +32 -0
  95. package/model/createInboxReplyDraft201Response.ts +32 -0
  96. package/model/createMediaFolderRequest.ts +43 -0
  97. package/model/createMention201Response.ts +32 -0
  98. package/model/createRecyclingRule201Response.ts +32 -0
  99. package/model/createReportExport201Response.ts +32 -0
  100. package/model/createResellerClient201Response.ts +32 -0
  101. package/model/createRssFeed201Response.ts +32 -0
  102. package/model/createTemplate201Response.ts +32 -0
  103. package/model/createWebhookSubscription201Response.ts +32 -0
  104. package/model/createWebhookSubscription201ResponseData.ts +70 -0
  105. package/model/deleteAgent200Response.ts +31 -0
  106. package/model/deleteMediaBulkRequest.ts +6 -5
  107. package/model/deleteMediaBulkRequestItemsInner.ts +26 -0
  108. package/model/deleteMediaFolderRequest.ts +31 -0
  109. package/model/deleteMode.ts +2 -2
  110. package/model/deletePostRequest.ts +2 -2
  111. package/model/deletePostsBulkRequest.ts +2 -2
  112. package/model/deleteReceiptsBulkRequest.ts +2 -2
  113. package/model/deleteResult.ts +2 -2
  114. package/model/deleteUser400Response.ts +2 -2
  115. package/model/deleteUsersBulkRequest.ts +2 -2
  116. package/model/deleteWorkspacesBulkRequest.ts +2 -2
  117. package/model/getAccountHealth200Response.ts +32 -0
  118. package/model/getBrandVoice200Response.ts +32 -0
  119. package/model/getCompetitor200Response.ts +32 -0
  120. package/model/getInboxConversation200Response.ts +32 -0
  121. package/model/getPostingSchedule200Response.ts +32 -0
  122. package/model/getRemoteUploadStatus200Response.ts +2 -2
  123. package/model/getReportBranding200Response.ts +32 -0
  124. package/model/guardrailError.ts +82 -0
  125. package/model/hashtagGroup.ts +46 -0
  126. package/model/hashtagGroupInput.ts +37 -0
  127. package/model/imageAltText200Response.ts +2 -2
  128. package/model/imageAltTextInput.ts +2 -2
  129. package/model/imageAltTextResponse.ts +2 -2
  130. package/model/imageCreditBalance.ts +67 -0
  131. package/model/imageEditInput.ts +11 -2
  132. package/model/imageGenerate200Response.ts +9 -2
  133. package/model/imageGenerate429Response.ts +2 -2
  134. package/model/imageGenerateInput.ts +14 -2
  135. package/model/imageGenerationResponse.ts +2 -2
  136. package/model/imagePrompt200Response.ts +9 -2
  137. package/model/imagePrompt429Response.ts +2 -2
  138. package/model/imagePromptInput.ts +14 -2
  139. package/model/imagePromptResponse.ts +2 -2
  140. package/model/imageVariations200Response.ts +2 -2
  141. package/model/imageVariationsInput.ts +2 -2
  142. package/model/imageVariationsResponse.ts +2 -2
  143. package/model/inboxAuthor.ts +43 -0
  144. package/model/inboxConversation.ts +139 -0
  145. package/model/inboxConversationAccount.ts +49 -0
  146. package/model/inboxConversationUpdate.ts +43 -0
  147. package/model/inboxMessage.ts +95 -0
  148. package/model/inboxMessageAuthor.ts +43 -0
  149. package/model/inboxReplyDraft.ts +132 -0
  150. package/model/inboxReplyDraftApprove.ts +34 -0
  151. package/model/inboxReplyDraftEdit.ts +31 -0
  152. package/model/inboxReplyDraftInput.ts +43 -0
  153. package/model/initiateChunkedUpload201Response.ts +2 -2
  154. package/model/initiateChunkedUploadRequest.ts +2 -2
  155. package/model/initiateRemoteUpload201Response.ts +60 -2
  156. package/model/initiateRemoteUpload201ResponseOneOf.ts +2 -2
  157. package/model/initiateRemoteUploadRequest.ts +11 -2
  158. package/model/learnBrandVoiceInput.ts +61 -0
  159. package/model/learnBrandVoiceResponse.ts +39 -0
  160. package/model/learnBrandVoiceResponseMeta.ts +55 -0
  161. package/model/listAccountGroups200Response.ts +46 -0
  162. package/model/listAccounts200Response.ts +2 -2
  163. package/model/listAgentProposals200Response.ts +39 -0
  164. package/model/listAgentRuns200Response.ts +39 -0
  165. package/model/listAgents200Response.ts +32 -0
  166. package/model/listApiActivity200Response.ts +46 -0
  167. package/model/listApiKeys200Response.ts +32 -0
  168. package/model/listCompetitors200Response.ts +32 -0
  169. package/model/listHashtagGroups200Response.ts +46 -0
  170. package/model/listInboxConversations200Response.ts +46 -0
  171. package/model/listInboxReplyDrafts200Response.ts +46 -0
  172. package/model/listMedia200Response.ts +2 -2
  173. package/model/listMediaFolders200Response.ts +32 -0
  174. package/model/listMentions200Response.ts +46 -0
  175. package/model/listMyWorkspaces200Response.ts +32 -0
  176. package/model/listPosts200Response.ts +2 -2
  177. package/model/listReceipts200Response.ts +2 -2
  178. package/model/listRecyclingRules200Response.ts +32 -0
  179. package/model/listRecyclingRuns200Response.ts +32 -0
  180. package/model/listReportExports200Response.ts +32 -0
  181. package/model/listResellerClients200Response.ts +39 -0
  182. package/model/listRssFeeds200Response.ts +32 -0
  183. package/model/listTags200Response.ts +2 -2
  184. package/model/listTemplates200Response.ts +46 -0
  185. package/model/listUsers200Response.ts +2 -2
  186. package/model/listWebhookSubscriptions200Response.ts +32 -0
  187. package/model/listWorkspaces200Response.ts +2 -2
  188. package/model/media.ts +60 -2
  189. package/model/mediaBase64Input.ts +61 -0
  190. package/model/mediaFolder.ts +55 -0
  191. package/model/mediaFolderInput.ts +43 -0
  192. package/model/mediaFolderRef.ts +37 -0
  193. package/model/mention.ts +65 -0
  194. package/model/mentionIdentity.ts +55 -0
  195. package/model/mentionIdentityInput.ts +67 -0
  196. package/model/mentionInput.ts +44 -0
  197. package/model/messageOnly.ts +31 -0
  198. package/model/models.ts +600 -0
  199. package/model/paginationMeta.ts +2 -2
  200. package/model/paginationMetaLinks.ts +4 -4
  201. package/model/paginationMetaMeta.ts +4 -4
  202. package/model/pollRssFeed200Response.ts +50 -0
  203. package/model/post.ts +12 -2
  204. package/model/postAnalytics.ts +46 -0
  205. package/model/postContent.ts +6 -3
  206. package/model/postInput.ts +33 -2
  207. package/model/postOptionsInstagram.ts +59 -0
  208. package/model/postOptionsTikTok.ts +97 -0
  209. package/model/postOptionsYoutube.ts +62 -0
  210. package/model/postStatus.ts +9 -3
  211. package/model/postVersion.ts +16 -6
  212. package/model/postVersionOptions.ts +55 -0
  213. package/model/postingSchedule.ts +74 -0
  214. package/model/postingScheduleDay.ts +50 -0
  215. package/model/postingScheduleDayTimesInner.ts +34 -0
  216. package/model/postingScheduleInput.ts +53 -0
  217. package/model/postingTimeSlot.ts +51 -0
  218. package/model/postingTimes.ts +88 -0
  219. package/model/postingTimesBestInner.ts +49 -0
  220. package/model/postingTimesDayIntervalsInnerInner.ts +69 -0
  221. package/model/postingTimesDaysInner.ts +57 -0
  222. package/model/preflightResult.ts +69 -0
  223. package/model/publicWorkspace.ts +50 -0
  224. package/model/publicWorkspacePivot.ts +53 -0
  225. package/model/publishProgress.ts +46 -0
  226. package/model/queueSlots.ts +43 -0
  227. package/model/receipt.ts +2 -2
  228. package/model/receiptInput.ts +2 -2
  229. package/model/receiptUpdateInput.ts +2 -2
  230. package/model/recommendedPostingTimes.ts +61 -0
  231. package/model/reconnectLink.ts +46 -0
  232. package/model/recyclingRule.ts +117 -0
  233. package/model/recyclingRuleInput.ts +114 -0
  234. package/model/recyclingRuleSettings.ts +83 -0
  235. package/model/recyclingRuleUpdate.ts +71 -0
  236. package/model/recyclingRun.ts +71 -0
  237. package/model/removeGenericSubscription422Response.ts +31 -0
  238. package/model/removeUserFromWorkspaceRequest.ts +2 -2
  239. package/model/reportBranding.ts +61 -0
  240. package/model/reportBrandingInput.ts +55 -0
  241. package/model/reportExport.ts +121 -0
  242. package/model/reportExportInput.ts +91 -0
  243. package/model/repurposeContent200Response.ts +39 -0
  244. package/model/repurposeInput.ts +213 -0
  245. package/model/repurposeInputTheme.ts +46 -0
  246. package/model/repurposeResult.ts +89 -0
  247. package/model/repurposeResultMedia.ts +40 -0
  248. package/model/repurposeResultSource.ts +51 -0
  249. package/model/repurposeSlide.ts +43 -0
  250. package/model/resellerClient.ts +82 -0
  251. package/model/resellerClientInput.ts +31 -0
  252. package/model/resellerClientUsage.ts +43 -0
  253. package/model/retryPostAccountResult.ts +47 -0
  254. package/model/rssFeed.ts +100 -0
  255. package/model/rssFeedInput.ts +79 -0
  256. package/model/rssFeedUpdate.ts +73 -0
  257. package/model/runAgent202Response.ts +32 -0
  258. package/model/schedulePostRequest.ts +39 -2
  259. package/model/scheduleResult.ts +11 -2
  260. package/model/subscription.ts +2 -2
  261. package/model/subscriptionInput.ts +2 -2
  262. package/model/subscriptionStatus.ts +2 -2
  263. package/model/subscriptionUpdateInput.ts +2 -2
  264. package/model/tag.ts +2 -2
  265. package/model/tagInput.ts +2 -2
  266. package/model/template.ts +47 -0
  267. package/model/templateContentItem.ts +40 -0
  268. package/model/templateInput.ts +41 -0
  269. package/model/templateInputContentInner.ts +40 -0
  270. package/model/updateMediaRequest.ts +18 -3
  271. package/model/uploadChunk201Response.ts +2 -2
  272. package/model/user.ts +11 -2
  273. package/model/userInput.ts +2 -2
  274. package/model/userUpdateInput.ts +2 -2
  275. package/model/webhookEventName.ts +31 -0
  276. package/model/webhookEventPayload.ts +43 -0
  277. package/model/webhookSubscription.ts +61 -0
  278. package/model/webhookSubscriptionInput.ts +67 -0
  279. package/model/workspace.ts +17 -3
  280. package/model/workspaceAgent.ts +91 -0
  281. package/model/workspaceAgentInput.ts +67 -0
  282. package/model/workspaceAgentSettings.ts +70 -0
  283. package/model/workspaceAgentUpdate.ts +58 -0
  284. package/model/workspaceInput.ts +8 -3
  285. package/model/workspaceUserInput.ts +2 -2
  286. package/model/xUsage.ts +68 -0
  287. package/model/xUsageCounter.ts +40 -0
  288. package/package.json +1 -1
package/api/postsApi.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * PostBoost API
3
- * The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
3
+ * The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Plan access Every workspace-scoped endpoint returns `403` when the workspace\'s plan does not include API access (capability `api`). ## Dates and times Post dates and times (`date`, `time`, `accounts_schedule`) are read in the request\'s `timezone` when one is given, otherwise in the workspace timezone. ## Idempotent requests Send an `Idempotency-Key` header (any unique string, for example a UUID) with a `POST`. Repeating the request with the same key within 24 hours returns the stored response with `Idempotent-Replayed: true` and creates nothing new. Reusing a key with a different body returns `422`; a request still in progress with the same key returns `409`. `5xx` and `429` responses are not stored, so they can be retried with the same key. ## Guardrails for automated clients Create and update requests are checked before anything is written: a post whose content matches one created for the same account in the last 24 hours returns `409` (`code: duplicate_post`, override with `allow_duplicate: true`), scheduling past an account\'s daily cap returns `429` (`code: account_daily_cap_reached`), and scheduling to an account that must be reconnected returns `422` (`code: account_unauthorized` or `account_token_missing`). Use `POST /{workspaceUuid}/posts/validate` for a dry run and `GET /{workspaceUuid}/activity` to review what API clients did. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
4
4
  *
5
- * The version of the OpenAPI document: 1.0.0
5
+ * The version of the OpenAPI document: 1.14.0
6
6
  * Contact: hi@postboost.co
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -15,12 +15,30 @@ import localVarRequest from 'request';
15
15
  import http from 'http';
16
16
 
17
17
  /* tslint:disable:no-unused-locals */
18
+ import { AddPostToQueueRequest } from '../model/addPostToQueueRequest';
19
+ import { ApprovePostRequest } from '../model/approvePostRequest';
20
+ import { CreateRecyclingRule201Response } from '../model/createRecyclingRule201Response';
21
+ import { CreateRssFeed201Response } from '../model/createRssFeed201Response';
18
22
  import { DeletePostRequest } from '../model/deletePostRequest';
19
23
  import { DeletePostsBulkRequest } from '../model/deletePostsBulkRequest';
20
24
  import { DeleteResult } from '../model/deleteResult';
25
+ import { GuardrailError } from '../model/guardrailError';
21
26
  import { ListPosts200Response } from '../model/listPosts200Response';
27
+ import { ListRecyclingRules200Response } from '../model/listRecyclingRules200Response';
28
+ import { ListRecyclingRuns200Response } from '../model/listRecyclingRuns200Response';
29
+ import { ListRssFeeds200Response } from '../model/listRssFeeds200Response';
30
+ import { MessageOnly } from '../model/messageOnly';
31
+ import { PollRssFeed200Response } from '../model/pollRssFeed200Response';
22
32
  import { Post } from '../model/post';
33
+ import { PostAnalytics } from '../model/postAnalytics';
23
34
  import { PostInput } from '../model/postInput';
35
+ import { PreflightResult } from '../model/preflightResult';
36
+ import { RecyclingRuleInput } from '../model/recyclingRuleInput';
37
+ import { RecyclingRuleSettings } from '../model/recyclingRuleSettings';
38
+ import { RecyclingRuleUpdate } from '../model/recyclingRuleUpdate';
39
+ import { RetryPostAccountResult } from '../model/retryPostAccountResult';
40
+ import { RssFeedInput } from '../model/rssFeedInput';
41
+ import { RssFeedUpdate } from '../model/rssFeedUpdate';
24
42
  import { SchedulePostRequest } from '../model/schedulePostRequest';
25
43
  import { ScheduleResult } from '../model/scheduleResult';
26
44
 
@@ -100,12 +118,14 @@ export class PostsApi {
100
118
  }
101
119
 
102
120
  /**
103
- * Add an existing post to the smart publishing queue.
121
+ * Add an existing post to the smart publishing queue. Each account of the post gets its own next free queue slot. Returns `422` when the post has no accounts, the posting schedule has no available times, or provider requirements are not met.
104
122
  * @summary Add post to queue
105
123
  * @param workspaceUuid UUID of the workspace.
106
124
  * @param postUuid UUID of the post.
125
+ * @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with `Idempotent-Replayed: true` and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
126
+ * @param addPostToQueueRequest
107
127
  */
108
- public async addPostToQueue (workspaceUuid: string, postUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ScheduleResult; }> {
128
+ public async addPostToQueue (workspaceUuid: string, postUuid: string, idempotencyKey?: string, addPostToQueueRequest?: AddPostToQueueRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ScheduleResult; }> {
109
129
  const localVarPath = this.basePath + '/{workspaceUuid}/posts/add-to-queue/{postUuid}'
110
130
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
111
131
  .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
@@ -130,6 +150,7 @@ export class PostsApi {
130
150
  throw new Error('Required parameter postUuid was null or undefined when calling addPostToQueue.');
131
151
  }
132
152
 
153
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
133
154
  (<any>Object).assign(localVarHeaderParams, options.headers);
134
155
 
135
156
  let localVarUseFormData = false;
@@ -141,6 +162,7 @@ export class PostsApi {
141
162
  uri: localVarPath,
142
163
  useQuerystring: this._useQuerystring,
143
164
  json: true,
165
+ body: ObjectSerializer.serialize(addPostToQueueRequest, "AddPostToQueueRequest")
144
166
  };
145
167
 
146
168
  let authenticationPromise = Promise.resolve();
@@ -179,12 +201,14 @@ export class PostsApi {
179
201
  });
180
202
  }
181
203
  /**
182
- * Approve a post that is pending review.
204
+ * Approve a post that is pending review. The approver may move the post with `date`/`time` (read in `timezone`) and set per-account times with `accounts_schedule`; without them the post keeps the time it was submitted with. Provider requirements are validated and reported as `422`.
183
205
  * @summary Approve post
184
206
  * @param workspaceUuid UUID of the workspace.
185
207
  * @param postUuid UUID of the post.
208
+ * @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with &#x60;Idempotent-Replayed: true&#x60; and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
209
+ * @param approvePostRequest
186
210
  */
187
- public async approvePost (workspaceUuid: string, postUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ScheduleResult; }> {
211
+ public async approvePost (workspaceUuid: string, postUuid: string, idempotencyKey?: string, approvePostRequest?: ApprovePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ScheduleResult; }> {
188
212
  const localVarPath = this.basePath + '/{workspaceUuid}/posts/approve/{postUuid}'
189
213
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
190
214
  .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
@@ -209,6 +233,7 @@ export class PostsApi {
209
233
  throw new Error('Required parameter postUuid was null or undefined when calling approvePost.');
210
234
  }
211
235
 
236
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
212
237
  (<any>Object).assign(localVarHeaderParams, options.headers);
213
238
 
214
239
  let localVarUseFormData = false;
@@ -220,6 +245,7 @@ export class PostsApi {
220
245
  uri: localVarPath,
221
246
  useQuerystring: this._useQuerystring,
222
247
  json: true,
248
+ body: ObjectSerializer.serialize(approvePostRequest, "ApprovePostRequest")
223
249
  };
224
250
 
225
251
  let authenticationPromise = Promise.resolve();
@@ -258,12 +284,13 @@ export class PostsApi {
258
284
  });
259
285
  }
260
286
  /**
261
- * Create a new post. Use `schedule: true` with `date` and `time` to schedule, `schedule_now: true` to publish immediately, or `queue: true` to add to the smart publishing queue.
287
+ * Create a new post. Use `schedule: true` with `date` and `time` to schedule, `schedule_now: true` to publish immediately, or `queue: true` to add to the smart publishing queue (each account gets its own queue slot). `date`, `time` and `accounts_schedule` are read in `timezone` when given, otherwise in the workspace timezone. Use `accounts_schedule` to give individual accounts their own departure time. Post bodies may reference mentions with `{{mention:<reference>}}` (see the Mentions endpoints). When the post is scheduled, provider requirements (for example a network that requires media) are validated up front and reported as `422`. **First comment and threads.** A version\'s `content` is an ordered array. Item 0 is the post. Add a second item to publish a first comment on Facebook Page, Instagram and LinkedIn, or to continue a thread on X, Threads, Bluesky, Mastodon and Pixelfed: ```json { \"accounts\": [12], \"schedule_now\": true, \"versions\": [{ \"account_id\": 0, \"is_original\": true, \"content\": [ { \"body\": \"Our API 1.8 is live.\", \"media\": [345] }, { \"body\": \"Full changelog: https://postboost.co/docs/changelog/\" } ] }] } ``` The comment is posted right after the post goes live. If the comment fails, the post stays published and the account\'s entry on the post reports the error.
262
288
  * @summary Create post
263
289
  * @param workspaceUuid UUID of the workspace.
264
290
  * @param postInput
291
+ * @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with &#x60;Idempotent-Replayed: true&#x60; and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
265
292
  */
266
- public async createPost (workspaceUuid: string, postInput: PostInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Post; }> {
293
+ public async createPost (workspaceUuid: string, postInput: PostInput, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Post; }> {
267
294
  const localVarPath = this.basePath + '/{workspaceUuid}/posts'
268
295
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
269
296
  let localVarQueryParameters: any = {};
@@ -287,6 +314,7 @@ export class PostsApi {
287
314
  throw new Error('Required parameter postInput was null or undefined when calling createPost.');
288
315
  }
289
316
 
317
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
290
318
  (<any>Object).assign(localVarHeaderParams, options.headers);
291
319
 
292
320
  let localVarUseFormData = false;
@@ -336,6 +364,164 @@ export class PostsApi {
336
364
  });
337
365
  });
338
366
  }
367
+ /**
368
+ * Recycles one post (`post_uuid`) or a tag pool (`type: tag_pool` + `tag_uuid`) every `interval_days`. The first run is `start_at`, or one interval from now. Copies are never published immediately: `placement: queue` (default) takes each account\'s next free queue slot, `same_time` schedules at the source post\'s time of day, `draft` leaves a draft. Copies pass the same guardrails as posts created through the API (duplicate guard, per-account daily caps, disconnected accounts, X monthly allowance). A refused copy is not created; the run is logged with the guard\'s code (see the runs endpoint). X accounts are left out of copies because X rejects repeated text. Admins and members only.
369
+ * @summary Create a recycling rule
370
+ * @param workspaceUuid UUID of the workspace.
371
+ * @param recyclingRuleInput
372
+ */
373
+ public async createRecyclingRule (workspaceUuid: string, recyclingRuleInput: RecyclingRuleInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }> {
374
+ const localVarPath = this.basePath + '/{workspaceUuid}/recycling-rules'
375
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
376
+ let localVarQueryParameters: any = {};
377
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
378
+ const produces = ['application/json'];
379
+ // give precedence to 'application/json'
380
+ if (produces.indexOf('application/json') >= 0) {
381
+ localVarHeaderParams.Accept = 'application/json';
382
+ } else {
383
+ localVarHeaderParams.Accept = produces.join(',');
384
+ }
385
+ let localVarFormParams: any = {};
386
+
387
+ // verify required parameter 'workspaceUuid' is not null or undefined
388
+ if (workspaceUuid === null || workspaceUuid === undefined) {
389
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling createRecyclingRule.');
390
+ }
391
+
392
+ // verify required parameter 'recyclingRuleInput' is not null or undefined
393
+ if (recyclingRuleInput === null || recyclingRuleInput === undefined) {
394
+ throw new Error('Required parameter recyclingRuleInput was null or undefined when calling createRecyclingRule.');
395
+ }
396
+
397
+ (<any>Object).assign(localVarHeaderParams, options.headers);
398
+
399
+ let localVarUseFormData = false;
400
+
401
+ let localVarRequestOptions: localVarRequest.Options = {
402
+ method: 'POST',
403
+ qs: localVarQueryParameters,
404
+ headers: localVarHeaderParams,
405
+ uri: localVarPath,
406
+ useQuerystring: this._useQuerystring,
407
+ json: true,
408
+ body: ObjectSerializer.serialize(recyclingRuleInput, "RecyclingRuleInput")
409
+ };
410
+
411
+ let authenticationPromise = Promise.resolve();
412
+ if (this.authentications.bearerAuth.accessToken) {
413
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
414
+ }
415
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
416
+
417
+ let interceptorPromise = authenticationPromise;
418
+ for (const interceptor of this.interceptors) {
419
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
420
+ }
421
+
422
+ return interceptorPromise.then(() => {
423
+ if (Object.keys(localVarFormParams).length) {
424
+ if (localVarUseFormData) {
425
+ (<any>localVarRequestOptions).formData = localVarFormParams;
426
+ } else {
427
+ localVarRequestOptions.form = localVarFormParams;
428
+ }
429
+ }
430
+ return new Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }>((resolve, reject) => {
431
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
432
+ if (error) {
433
+ reject(error);
434
+ } else {
435
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
436
+ body = ObjectSerializer.deserialize(body, "CreateRecyclingRule201Response");
437
+ resolve({ response: response, body: body });
438
+ } else {
439
+ reject(new HttpError(response, body, response.statusCode));
440
+ }
441
+ }
442
+ });
443
+ });
444
+ });
445
+ }
446
+ /**
447
+ * Checks the feed every 30 minutes and turns each item published after the feed was added into a post for `account_ids`: a draft (`mode: draft`, default) or a queued post (`mode: queue`). The text comes from `template` with `{title}`, `{link}` and `{summary}` placeholders. Each item becomes at most one post, at most `max_items_per_run` per check and 20 per workspace per day. Posts pass the same guardrails as API-created posts. Only public http(s) URLs are accepted. Admins and members only.
448
+ * @summary Add an RSS feed
449
+ * @param workspaceUuid UUID of the workspace.
450
+ * @param rssFeedInput
451
+ */
452
+ public async createRssFeed (workspaceUuid: string, rssFeedInput: RssFeedInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateRssFeed201Response; }> {
453
+ const localVarPath = this.basePath + '/{workspaceUuid}/rss-feeds'
454
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
455
+ let localVarQueryParameters: any = {};
456
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
457
+ const produces = ['application/json'];
458
+ // give precedence to 'application/json'
459
+ if (produces.indexOf('application/json') >= 0) {
460
+ localVarHeaderParams.Accept = 'application/json';
461
+ } else {
462
+ localVarHeaderParams.Accept = produces.join(',');
463
+ }
464
+ let localVarFormParams: any = {};
465
+
466
+ // verify required parameter 'workspaceUuid' is not null or undefined
467
+ if (workspaceUuid === null || workspaceUuid === undefined) {
468
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling createRssFeed.');
469
+ }
470
+
471
+ // verify required parameter 'rssFeedInput' is not null or undefined
472
+ if (rssFeedInput === null || rssFeedInput === undefined) {
473
+ throw new Error('Required parameter rssFeedInput was null or undefined when calling createRssFeed.');
474
+ }
475
+
476
+ (<any>Object).assign(localVarHeaderParams, options.headers);
477
+
478
+ let localVarUseFormData = false;
479
+
480
+ let localVarRequestOptions: localVarRequest.Options = {
481
+ method: 'POST',
482
+ qs: localVarQueryParameters,
483
+ headers: localVarHeaderParams,
484
+ uri: localVarPath,
485
+ useQuerystring: this._useQuerystring,
486
+ json: true,
487
+ body: ObjectSerializer.serialize(rssFeedInput, "RssFeedInput")
488
+ };
489
+
490
+ let authenticationPromise = Promise.resolve();
491
+ if (this.authentications.bearerAuth.accessToken) {
492
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
493
+ }
494
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
495
+
496
+ let interceptorPromise = authenticationPromise;
497
+ for (const interceptor of this.interceptors) {
498
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
499
+ }
500
+
501
+ return interceptorPromise.then(() => {
502
+ if (Object.keys(localVarFormParams).length) {
503
+ if (localVarUseFormData) {
504
+ (<any>localVarRequestOptions).formData = localVarFormParams;
505
+ } else {
506
+ localVarRequestOptions.form = localVarFormParams;
507
+ }
508
+ }
509
+ return new Promise<{ response: http.IncomingMessage; body: CreateRssFeed201Response; }>((resolve, reject) => {
510
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
511
+ if (error) {
512
+ reject(error);
513
+ } else {
514
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
515
+ body = ObjectSerializer.deserialize(body, "CreateRssFeed201Response");
516
+ resolve({ response: response, body: body });
517
+ } else {
518
+ reject(new HttpError(response, body, response.statusCode));
519
+ }
520
+ }
521
+ });
522
+ });
523
+ });
524
+ }
339
525
  /**
340
526
  * Deletes a post. Use `delete_mode` to control whether to also remove the published content from social platforms.
341
527
  * @summary Delete post
@@ -497,15 +683,15 @@ export class PostsApi {
497
683
  });
498
684
  }
499
685
  /**
500
- * Returns a single post with all its versions and associated accounts.
501
- * @summary Get post
686
+ * Deletes the rule and its run log. Copies it already created stay. Admins and members only.
687
+ * @summary Delete a recycling rule
502
688
  * @param workspaceUuid UUID of the workspace.
503
- * @param postUuid UUID of the post.
689
+ * @param ruleUuid UUID of the recycling rule.
504
690
  */
505
- public async getPost (workspaceUuid: string, postUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Post; }> {
506
- const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}'
691
+ public async deleteRecyclingRule (workspaceUuid: string, ruleUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
692
+ const localVarPath = this.basePath + '/{workspaceUuid}/recycling-rules/{ruleUuid}'
507
693
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
508
- .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
694
+ .replace('{' + 'ruleUuid' + '}', encodeURIComponent(String(ruleUuid)));
509
695
  let localVarQueryParameters: any = {};
510
696
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
511
697
  const produces = ['application/json'];
@@ -519,12 +705,12 @@ export class PostsApi {
519
705
 
520
706
  // verify required parameter 'workspaceUuid' is not null or undefined
521
707
  if (workspaceUuid === null || workspaceUuid === undefined) {
522
- throw new Error('Required parameter workspaceUuid was null or undefined when calling getPost.');
708
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteRecyclingRule.');
523
709
  }
524
710
 
525
- // verify required parameter 'postUuid' is not null or undefined
526
- if (postUuid === null || postUuid === undefined) {
527
- throw new Error('Required parameter postUuid was null or undefined when calling getPost.');
711
+ // verify required parameter 'ruleUuid' is not null or undefined
712
+ if (ruleUuid === null || ruleUuid === undefined) {
713
+ throw new Error('Required parameter ruleUuid was null or undefined when calling deleteRecyclingRule.');
528
714
  }
529
715
 
530
716
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -532,7 +718,7 @@ export class PostsApi {
532
718
  let localVarUseFormData = false;
533
719
 
534
720
  let localVarRequestOptions: localVarRequest.Options = {
535
- method: 'GET',
721
+ method: 'DELETE',
536
722
  qs: localVarQueryParameters,
537
723
  headers: localVarHeaderParams,
538
724
  uri: localVarPath,
@@ -559,13 +745,13 @@ export class PostsApi {
559
745
  localVarRequestOptions.form = localVarFormParams;
560
746
  }
561
747
  }
562
- return new Promise<{ response: http.IncomingMessage; body: Post; }>((resolve, reject) => {
748
+ return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
563
749
  localVarRequest(localVarRequestOptions, (error, response, body) => {
564
750
  if (error) {
565
751
  reject(error);
566
752
  } else {
567
753
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
568
- body = ObjectSerializer.deserialize(body, "Post");
754
+ body = ObjectSerializer.deserialize(body, "object");
569
755
  resolve({ response: response, body: body });
570
756
  } else {
571
757
  reject(new HttpError(response, body, response.statusCode));
@@ -576,14 +762,15 @@ export class PostsApi {
576
762
  });
577
763
  }
578
764
  /**
579
- * Returns a paginated list of posts in the workspace.
580
- * @summary List posts
765
+ * Stops the feed. Posts it already created stay. Admins and members only.
766
+ * @summary Delete an RSS feed
581
767
  * @param workspaceUuid UUID of the workspace.
582
- * @param page
768
+ * @param feedUuid UUID of the RSS feed.
583
769
  */
584
- public async listPosts (workspaceUuid: string, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListPosts200Response; }> {
585
- const localVarPath = this.basePath + '/{workspaceUuid}/posts'
586
- .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
770
+ public async deleteRssFeed (workspaceUuid: string, feedUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
771
+ const localVarPath = this.basePath + '/{workspaceUuid}/rss-feeds/{feedUuid}'
772
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
773
+ .replace('{' + 'feedUuid' + '}', encodeURIComponent(String(feedUuid)));
587
774
  let localVarQueryParameters: any = {};
588
775
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
589
776
  const produces = ['application/json'];
@@ -597,11 +784,12 @@ export class PostsApi {
597
784
 
598
785
  // verify required parameter 'workspaceUuid' is not null or undefined
599
786
  if (workspaceUuid === null || workspaceUuid === undefined) {
600
- throw new Error('Required parameter workspaceUuid was null or undefined when calling listPosts.');
787
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteRssFeed.');
601
788
  }
602
789
 
603
- if (page !== undefined) {
604
- localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
790
+ // verify required parameter 'feedUuid' is not null or undefined
791
+ if (feedUuid === null || feedUuid === undefined) {
792
+ throw new Error('Required parameter feedUuid was null or undefined when calling deleteRssFeed.');
605
793
  }
606
794
 
607
795
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -609,7 +797,7 @@ export class PostsApi {
609
797
  let localVarUseFormData = false;
610
798
 
611
799
  let localVarRequestOptions: localVarRequest.Options = {
612
- method: 'GET',
800
+ method: 'DELETE',
613
801
  qs: localVarQueryParameters,
614
802
  headers: localVarHeaderParams,
615
803
  uri: localVarPath,
@@ -636,13 +824,13 @@ export class PostsApi {
636
824
  localVarRequestOptions.form = localVarFormParams;
637
825
  }
638
826
  }
639
- return new Promise<{ response: http.IncomingMessage; body: ListPosts200Response; }>((resolve, reject) => {
827
+ return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
640
828
  localVarRequest(localVarRequestOptions, (error, response, body) => {
641
829
  if (error) {
642
830
  reject(error);
643
831
  } else {
644
832
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
645
- body = ObjectSerializer.deserialize(body, "ListPosts200Response");
833
+ body = ObjectSerializer.deserialize(body, "object");
646
834
  resolve({ response: response, body: body });
647
835
  } else {
648
836
  reject(new HttpError(response, body, response.statusCode));
@@ -653,14 +841,13 @@ export class PostsApi {
653
841
  });
654
842
  }
655
843
  /**
656
- * Schedule an existing post. Set `postNow: true` to publish immediately.
657
- * @summary Schedule post
844
+ * Returns a single post with all its versions and associated accounts.
845
+ * @summary Get post
658
846
  * @param workspaceUuid UUID of the workspace.
659
847
  * @param postUuid UUID of the post.
660
- * @param schedulePostRequest
661
848
  */
662
- public async schedulePost (workspaceUuid: string, postUuid: string, schedulePostRequest: SchedulePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ScheduleResult; }> {
663
- const localVarPath = this.basePath + '/{workspaceUuid}/posts/schedule/{postUuid}'
849
+ public async getPost (workspaceUuid: string, postUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Post; }> {
850
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}'
664
851
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
665
852
  .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
666
853
  let localVarQueryParameters: any = {};
@@ -676,17 +863,12 @@ export class PostsApi {
676
863
 
677
864
  // verify required parameter 'workspaceUuid' is not null or undefined
678
865
  if (workspaceUuid === null || workspaceUuid === undefined) {
679
- throw new Error('Required parameter workspaceUuid was null or undefined when calling schedulePost.');
866
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getPost.');
680
867
  }
681
868
 
682
869
  // verify required parameter 'postUuid' is not null or undefined
683
870
  if (postUuid === null || postUuid === undefined) {
684
- throw new Error('Required parameter postUuid was null or undefined when calling schedulePost.');
685
- }
686
-
687
- // verify required parameter 'schedulePostRequest' is not null or undefined
688
- if (schedulePostRequest === null || schedulePostRequest === undefined) {
689
- throw new Error('Required parameter schedulePostRequest was null or undefined when calling schedulePost.');
871
+ throw new Error('Required parameter postUuid was null or undefined when calling getPost.');
690
872
  }
691
873
 
692
874
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -694,13 +876,12 @@ export class PostsApi {
694
876
  let localVarUseFormData = false;
695
877
 
696
878
  let localVarRequestOptions: localVarRequest.Options = {
697
- method: 'POST',
879
+ method: 'GET',
698
880
  qs: localVarQueryParameters,
699
881
  headers: localVarHeaderParams,
700
882
  uri: localVarPath,
701
883
  useQuerystring: this._useQuerystring,
702
884
  json: true,
703
- body: ObjectSerializer.serialize(schedulePostRequest, "SchedulePostRequest")
704
885
  };
705
886
 
706
887
  let authenticationPromise = Promise.resolve();
@@ -722,13 +903,13 @@ export class PostsApi {
722
903
  localVarRequestOptions.form = localVarFormParams;
723
904
  }
724
905
  }
725
- return new Promise<{ response: http.IncomingMessage; body: ScheduleResult; }>((resolve, reject) => {
906
+ return new Promise<{ response: http.IncomingMessage; body: Post; }>((resolve, reject) => {
726
907
  localVarRequest(localVarRequestOptions, (error, response, body) => {
727
908
  if (error) {
728
909
  reject(error);
729
910
  } else {
730
911
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
731
- body = ObjectSerializer.deserialize(body, "ScheduleResult");
912
+ body = ObjectSerializer.deserialize(body, "Post");
732
913
  resolve({ response: response, body: body });
733
914
  } else {
734
915
  reject(new HttpError(response, body, response.statusCode));
@@ -739,14 +920,13 @@ export class PostsApi {
739
920
  });
740
921
  }
741
922
  /**
742
- * Replaces a post\'s versions, accounts, tags, and scheduling options. The post must not be in a published state.
743
- * @summary Update post
923
+ * Engagement metrics for a published post across its accounts (also works for trashed posts), with totals, trends and the best-performing account.
924
+ * @summary Get post analytics
744
925
  * @param workspaceUuid UUID of the workspace.
745
926
  * @param postUuid UUID of the post.
746
- * @param postInput
747
927
  */
748
- public async updatePost (workspaceUuid: string, postUuid: string, postInput: PostInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
749
- const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}'
928
+ public async getPostAnalytics (workspaceUuid: string, postUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PostAnalytics; }> {
929
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}/analytics'
750
930
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
751
931
  .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
752
932
  let localVarQueryParameters: any = {};
@@ -762,17 +942,12 @@ export class PostsApi {
762
942
 
763
943
  // verify required parameter 'workspaceUuid' is not null or undefined
764
944
  if (workspaceUuid === null || workspaceUuid === undefined) {
765
- throw new Error('Required parameter workspaceUuid was null or undefined when calling updatePost.');
945
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getPostAnalytics.');
766
946
  }
767
947
 
768
948
  // verify required parameter 'postUuid' is not null or undefined
769
949
  if (postUuid === null || postUuid === undefined) {
770
- throw new Error('Required parameter postUuid was null or undefined when calling updatePost.');
771
- }
772
-
773
- // verify required parameter 'postInput' is not null or undefined
774
- if (postInput === null || postInput === undefined) {
775
- throw new Error('Required parameter postInput was null or undefined when calling updatePost.');
950
+ throw new Error('Required parameter postUuid was null or undefined when calling getPostAnalytics.');
776
951
  }
777
952
 
778
953
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -780,13 +955,12 @@ export class PostsApi {
780
955
  let localVarUseFormData = false;
781
956
 
782
957
  let localVarRequestOptions: localVarRequest.Options = {
783
- method: 'PUT',
958
+ method: 'GET',
784
959
  qs: localVarQueryParameters,
785
960
  headers: localVarHeaderParams,
786
961
  uri: localVarPath,
787
962
  useQuerystring: this._useQuerystring,
788
963
  json: true,
789
- body: ObjectSerializer.serialize(postInput, "PostInput")
790
964
  };
791
965
 
792
966
  let authenticationPromise = Promise.resolve();
@@ -808,13 +982,1149 @@ export class PostsApi {
808
982
  localVarRequestOptions.form = localVarFormParams;
809
983
  }
810
984
  }
811
- return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
985
+ return new Promise<{ response: http.IncomingMessage; body: PostAnalytics; }>((resolve, reject) => {
812
986
  localVarRequest(localVarRequestOptions, (error, response, body) => {
813
987
  if (error) {
814
988
  reject(error);
815
989
  } else {
816
990
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
817
- body = ObjectSerializer.deserialize(body, "object");
991
+ body = ObjectSerializer.deserialize(body, "PostAnalytics");
992
+ resolve({ response: response, body: body });
993
+ } else {
994
+ reject(new HttpError(response, body, response.statusCode));
995
+ }
996
+ }
997
+ });
998
+ });
999
+ });
1000
+ }
1001
+ /**
1002
+ *
1003
+ * @summary Get a recycling rule
1004
+ * @param workspaceUuid UUID of the workspace.
1005
+ * @param ruleUuid UUID of the recycling rule.
1006
+ */
1007
+ public async getRecyclingRule (workspaceUuid: string, ruleUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }> {
1008
+ const localVarPath = this.basePath + '/{workspaceUuid}/recycling-rules/{ruleUuid}'
1009
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1010
+ .replace('{' + 'ruleUuid' + '}', encodeURIComponent(String(ruleUuid)));
1011
+ let localVarQueryParameters: any = {};
1012
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1013
+ const produces = ['application/json'];
1014
+ // give precedence to 'application/json'
1015
+ if (produces.indexOf('application/json') >= 0) {
1016
+ localVarHeaderParams.Accept = 'application/json';
1017
+ } else {
1018
+ localVarHeaderParams.Accept = produces.join(',');
1019
+ }
1020
+ let localVarFormParams: any = {};
1021
+
1022
+ // verify required parameter 'workspaceUuid' is not null or undefined
1023
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1024
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getRecyclingRule.');
1025
+ }
1026
+
1027
+ // verify required parameter 'ruleUuid' is not null or undefined
1028
+ if (ruleUuid === null || ruleUuid === undefined) {
1029
+ throw new Error('Required parameter ruleUuid was null or undefined when calling getRecyclingRule.');
1030
+ }
1031
+
1032
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1033
+
1034
+ let localVarUseFormData = false;
1035
+
1036
+ let localVarRequestOptions: localVarRequest.Options = {
1037
+ method: 'GET',
1038
+ qs: localVarQueryParameters,
1039
+ headers: localVarHeaderParams,
1040
+ uri: localVarPath,
1041
+ useQuerystring: this._useQuerystring,
1042
+ json: true,
1043
+ };
1044
+
1045
+ let authenticationPromise = Promise.resolve();
1046
+ if (this.authentications.bearerAuth.accessToken) {
1047
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1048
+ }
1049
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1050
+
1051
+ let interceptorPromise = authenticationPromise;
1052
+ for (const interceptor of this.interceptors) {
1053
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1054
+ }
1055
+
1056
+ return interceptorPromise.then(() => {
1057
+ if (Object.keys(localVarFormParams).length) {
1058
+ if (localVarUseFormData) {
1059
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1060
+ } else {
1061
+ localVarRequestOptions.form = localVarFormParams;
1062
+ }
1063
+ }
1064
+ return new Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }>((resolve, reject) => {
1065
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1066
+ if (error) {
1067
+ reject(error);
1068
+ } else {
1069
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1070
+ body = ObjectSerializer.deserialize(body, "CreateRecyclingRule201Response");
1071
+ resolve({ response: response, body: body });
1072
+ } else {
1073
+ reject(new HttpError(response, body, response.statusCode));
1074
+ }
1075
+ }
1076
+ });
1077
+ });
1078
+ });
1079
+ }
1080
+ /**
1081
+ *
1082
+ * @summary Get an RSS feed
1083
+ * @param workspaceUuid UUID of the workspace.
1084
+ * @param feedUuid UUID of the RSS feed.
1085
+ */
1086
+ public async getRssFeed (workspaceUuid: string, feedUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateRssFeed201Response; }> {
1087
+ const localVarPath = this.basePath + '/{workspaceUuid}/rss-feeds/{feedUuid}'
1088
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1089
+ .replace('{' + 'feedUuid' + '}', encodeURIComponent(String(feedUuid)));
1090
+ let localVarQueryParameters: any = {};
1091
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1092
+ const produces = ['application/json'];
1093
+ // give precedence to 'application/json'
1094
+ if (produces.indexOf('application/json') >= 0) {
1095
+ localVarHeaderParams.Accept = 'application/json';
1096
+ } else {
1097
+ localVarHeaderParams.Accept = produces.join(',');
1098
+ }
1099
+ let localVarFormParams: any = {};
1100
+
1101
+ // verify required parameter 'workspaceUuid' is not null or undefined
1102
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1103
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getRssFeed.');
1104
+ }
1105
+
1106
+ // verify required parameter 'feedUuid' is not null or undefined
1107
+ if (feedUuid === null || feedUuid === undefined) {
1108
+ throw new Error('Required parameter feedUuid was null or undefined when calling getRssFeed.');
1109
+ }
1110
+
1111
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1112
+
1113
+ let localVarUseFormData = false;
1114
+
1115
+ let localVarRequestOptions: localVarRequest.Options = {
1116
+ method: 'GET',
1117
+ qs: localVarQueryParameters,
1118
+ headers: localVarHeaderParams,
1119
+ uri: localVarPath,
1120
+ useQuerystring: this._useQuerystring,
1121
+ json: true,
1122
+ };
1123
+
1124
+ let authenticationPromise = Promise.resolve();
1125
+ if (this.authentications.bearerAuth.accessToken) {
1126
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1127
+ }
1128
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1129
+
1130
+ let interceptorPromise = authenticationPromise;
1131
+ for (const interceptor of this.interceptors) {
1132
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1133
+ }
1134
+
1135
+ return interceptorPromise.then(() => {
1136
+ if (Object.keys(localVarFormParams).length) {
1137
+ if (localVarUseFormData) {
1138
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1139
+ } else {
1140
+ localVarRequestOptions.form = localVarFormParams;
1141
+ }
1142
+ }
1143
+ return new Promise<{ response: http.IncomingMessage; body: CreateRssFeed201Response; }>((resolve, reject) => {
1144
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1145
+ if (error) {
1146
+ reject(error);
1147
+ } else {
1148
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1149
+ body = ObjectSerializer.deserialize(body, "CreateRssFeed201Response");
1150
+ resolve({ response: response, body: body });
1151
+ } else {
1152
+ reject(new HttpError(response, body, response.statusCode));
1153
+ }
1154
+ }
1155
+ });
1156
+ });
1157
+ });
1158
+ }
1159
+ /**
1160
+ * Returns a paginated list of posts in the workspace.
1161
+ * @summary List posts
1162
+ * @param workspaceUuid UUID of the workspace.
1163
+ * @param page
1164
+ */
1165
+ public async listPosts (workspaceUuid: string, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListPosts200Response; }> {
1166
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts'
1167
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
1168
+ let localVarQueryParameters: any = {};
1169
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1170
+ const produces = ['application/json'];
1171
+ // give precedence to 'application/json'
1172
+ if (produces.indexOf('application/json') >= 0) {
1173
+ localVarHeaderParams.Accept = 'application/json';
1174
+ } else {
1175
+ localVarHeaderParams.Accept = produces.join(',');
1176
+ }
1177
+ let localVarFormParams: any = {};
1178
+
1179
+ // verify required parameter 'workspaceUuid' is not null or undefined
1180
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1181
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling listPosts.');
1182
+ }
1183
+
1184
+ if (page !== undefined) {
1185
+ localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
1186
+ }
1187
+
1188
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1189
+
1190
+ let localVarUseFormData = false;
1191
+
1192
+ let localVarRequestOptions: localVarRequest.Options = {
1193
+ method: 'GET',
1194
+ qs: localVarQueryParameters,
1195
+ headers: localVarHeaderParams,
1196
+ uri: localVarPath,
1197
+ useQuerystring: this._useQuerystring,
1198
+ json: true,
1199
+ };
1200
+
1201
+ let authenticationPromise = Promise.resolve();
1202
+ if (this.authentications.bearerAuth.accessToken) {
1203
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1204
+ }
1205
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1206
+
1207
+ let interceptorPromise = authenticationPromise;
1208
+ for (const interceptor of this.interceptors) {
1209
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1210
+ }
1211
+
1212
+ return interceptorPromise.then(() => {
1213
+ if (Object.keys(localVarFormParams).length) {
1214
+ if (localVarUseFormData) {
1215
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1216
+ } else {
1217
+ localVarRequestOptions.form = localVarFormParams;
1218
+ }
1219
+ }
1220
+ return new Promise<{ response: http.IncomingMessage; body: ListPosts200Response; }>((resolve, reject) => {
1221
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1222
+ if (error) {
1223
+ reject(error);
1224
+ } else {
1225
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1226
+ body = ObjectSerializer.deserialize(body, "ListPosts200Response");
1227
+ resolve({ response: response, body: body });
1228
+ } else {
1229
+ reject(new HttpError(response, body, response.statusCode));
1230
+ }
1231
+ }
1232
+ });
1233
+ });
1234
+ });
1235
+ }
1236
+ /**
1237
+ * Evergreen recycling rules of the workspace, newest first. A rule copies a post (or the least recently recycled published post with a tag) every `interval_days` and places the copy in the queue. Copies are ordinary posts: they show in the calendar and the queue.
1238
+ * @summary List recycling rules
1239
+ * @param workspaceUuid UUID of the workspace.
1240
+ */
1241
+ public async listRecyclingRules (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListRecyclingRules200Response; }> {
1242
+ const localVarPath = this.basePath + '/{workspaceUuid}/recycling-rules'
1243
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
1244
+ let localVarQueryParameters: any = {};
1245
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1246
+ const produces = ['application/json'];
1247
+ // give precedence to 'application/json'
1248
+ if (produces.indexOf('application/json') >= 0) {
1249
+ localVarHeaderParams.Accept = 'application/json';
1250
+ } else {
1251
+ localVarHeaderParams.Accept = produces.join(',');
1252
+ }
1253
+ let localVarFormParams: any = {};
1254
+
1255
+ // verify required parameter 'workspaceUuid' is not null or undefined
1256
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1257
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling listRecyclingRules.');
1258
+ }
1259
+
1260
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1261
+
1262
+ let localVarUseFormData = false;
1263
+
1264
+ let localVarRequestOptions: localVarRequest.Options = {
1265
+ method: 'GET',
1266
+ qs: localVarQueryParameters,
1267
+ headers: localVarHeaderParams,
1268
+ uri: localVarPath,
1269
+ useQuerystring: this._useQuerystring,
1270
+ json: true,
1271
+ };
1272
+
1273
+ let authenticationPromise = Promise.resolve();
1274
+ if (this.authentications.bearerAuth.accessToken) {
1275
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1276
+ }
1277
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1278
+
1279
+ let interceptorPromise = authenticationPromise;
1280
+ for (const interceptor of this.interceptors) {
1281
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1282
+ }
1283
+
1284
+ return interceptorPromise.then(() => {
1285
+ if (Object.keys(localVarFormParams).length) {
1286
+ if (localVarUseFormData) {
1287
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1288
+ } else {
1289
+ localVarRequestOptions.form = localVarFormParams;
1290
+ }
1291
+ }
1292
+ return new Promise<{ response: http.IncomingMessage; body: ListRecyclingRules200Response; }>((resolve, reject) => {
1293
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1294
+ if (error) {
1295
+ reject(error);
1296
+ } else {
1297
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1298
+ body = ObjectSerializer.deserialize(body, "ListRecyclingRules200Response");
1299
+ resolve({ response: response, body: body });
1300
+ } else {
1301
+ reject(new HttpError(response, body, response.statusCode));
1302
+ }
1303
+ }
1304
+ });
1305
+ });
1306
+ });
1307
+ }
1308
+ /**
1309
+ * The latest 100 runs of the rule, newest first: the copy each run created, or why it skipped (`source_unavailable`, `no_eligible_post`, `no_accounts`, `queue_full`, `x_skipped_identical_text`, or a guardrail code such as `duplicate_post` or `account_daily_cap_reached`).
1310
+ * @summary List a recycling rule\'s runs
1311
+ * @param workspaceUuid UUID of the workspace.
1312
+ * @param ruleUuid UUID of the recycling rule.
1313
+ */
1314
+ public async listRecyclingRuns (workspaceUuid: string, ruleUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListRecyclingRuns200Response; }> {
1315
+ const localVarPath = this.basePath + '/{workspaceUuid}/recycling-rules/{ruleUuid}/runs'
1316
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1317
+ .replace('{' + 'ruleUuid' + '}', encodeURIComponent(String(ruleUuid)));
1318
+ let localVarQueryParameters: any = {};
1319
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1320
+ const produces = ['application/json'];
1321
+ // give precedence to 'application/json'
1322
+ if (produces.indexOf('application/json') >= 0) {
1323
+ localVarHeaderParams.Accept = 'application/json';
1324
+ } else {
1325
+ localVarHeaderParams.Accept = produces.join(',');
1326
+ }
1327
+ let localVarFormParams: any = {};
1328
+
1329
+ // verify required parameter 'workspaceUuid' is not null or undefined
1330
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1331
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling listRecyclingRuns.');
1332
+ }
1333
+
1334
+ // verify required parameter 'ruleUuid' is not null or undefined
1335
+ if (ruleUuid === null || ruleUuid === undefined) {
1336
+ throw new Error('Required parameter ruleUuid was null or undefined when calling listRecyclingRuns.');
1337
+ }
1338
+
1339
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1340
+
1341
+ let localVarUseFormData = false;
1342
+
1343
+ let localVarRequestOptions: localVarRequest.Options = {
1344
+ method: 'GET',
1345
+ qs: localVarQueryParameters,
1346
+ headers: localVarHeaderParams,
1347
+ uri: localVarPath,
1348
+ useQuerystring: this._useQuerystring,
1349
+ json: true,
1350
+ };
1351
+
1352
+ let authenticationPromise = Promise.resolve();
1353
+ if (this.authentications.bearerAuth.accessToken) {
1354
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1355
+ }
1356
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1357
+
1358
+ let interceptorPromise = authenticationPromise;
1359
+ for (const interceptor of this.interceptors) {
1360
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1361
+ }
1362
+
1363
+ return interceptorPromise.then(() => {
1364
+ if (Object.keys(localVarFormParams).length) {
1365
+ if (localVarUseFormData) {
1366
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1367
+ } else {
1368
+ localVarRequestOptions.form = localVarFormParams;
1369
+ }
1370
+ }
1371
+ return new Promise<{ response: http.IncomingMessage; body: ListRecyclingRuns200Response; }>((resolve, reject) => {
1372
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1373
+ if (error) {
1374
+ reject(error);
1375
+ } else {
1376
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1377
+ body = ObjectSerializer.deserialize(body, "ListRecyclingRuns200Response");
1378
+ resolve({ response: response, body: body });
1379
+ } else {
1380
+ reject(new HttpError(response, body, response.statusCode));
1381
+ }
1382
+ }
1383
+ });
1384
+ });
1385
+ });
1386
+ }
1387
+ /**
1388
+ * RSS and Atom feeds whose new items become posts, newest first.
1389
+ * @summary List RSS feeds
1390
+ * @param workspaceUuid UUID of the workspace.
1391
+ */
1392
+ public async listRssFeeds (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListRssFeeds200Response; }> {
1393
+ const localVarPath = this.basePath + '/{workspaceUuid}/rss-feeds'
1394
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
1395
+ let localVarQueryParameters: any = {};
1396
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1397
+ const produces = ['application/json'];
1398
+ // give precedence to 'application/json'
1399
+ if (produces.indexOf('application/json') >= 0) {
1400
+ localVarHeaderParams.Accept = 'application/json';
1401
+ } else {
1402
+ localVarHeaderParams.Accept = produces.join(',');
1403
+ }
1404
+ let localVarFormParams: any = {};
1405
+
1406
+ // verify required parameter 'workspaceUuid' is not null or undefined
1407
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1408
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling listRssFeeds.');
1409
+ }
1410
+
1411
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1412
+
1413
+ let localVarUseFormData = false;
1414
+
1415
+ let localVarRequestOptions: localVarRequest.Options = {
1416
+ method: 'GET',
1417
+ qs: localVarQueryParameters,
1418
+ headers: localVarHeaderParams,
1419
+ uri: localVarPath,
1420
+ useQuerystring: this._useQuerystring,
1421
+ json: true,
1422
+ };
1423
+
1424
+ let authenticationPromise = Promise.resolve();
1425
+ if (this.authentications.bearerAuth.accessToken) {
1426
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1427
+ }
1428
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1429
+
1430
+ let interceptorPromise = authenticationPromise;
1431
+ for (const interceptor of this.interceptors) {
1432
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1433
+ }
1434
+
1435
+ return interceptorPromise.then(() => {
1436
+ if (Object.keys(localVarFormParams).length) {
1437
+ if (localVarUseFormData) {
1438
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1439
+ } else {
1440
+ localVarRequestOptions.form = localVarFormParams;
1441
+ }
1442
+ }
1443
+ return new Promise<{ response: http.IncomingMessage; body: ListRssFeeds200Response; }>((resolve, reject) => {
1444
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1445
+ if (error) {
1446
+ reject(error);
1447
+ } else {
1448
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1449
+ body = ObjectSerializer.deserialize(body, "ListRssFeeds200Response");
1450
+ resolve({ response: response, body: body });
1451
+ } else {
1452
+ reject(new HttpError(response, body, response.statusCode));
1453
+ }
1454
+ }
1455
+ });
1456
+ });
1457
+ });
1458
+ }
1459
+ /**
1460
+ * Reads the feed immediately instead of waiting for the next check. Limited to 6 calls per minute. Admins and members only.
1461
+ * @summary Check an RSS feed now
1462
+ * @param workspaceUuid UUID of the workspace.
1463
+ * @param feedUuid UUID of the RSS feed.
1464
+ */
1465
+ public async pollRssFeed (workspaceUuid: string, feedUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PollRssFeed200Response; }> {
1466
+ const localVarPath = this.basePath + '/{workspaceUuid}/rss-feeds/{feedUuid}/poll'
1467
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1468
+ .replace('{' + 'feedUuid' + '}', encodeURIComponent(String(feedUuid)));
1469
+ let localVarQueryParameters: any = {};
1470
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1471
+ const produces = ['application/json'];
1472
+ // give precedence to 'application/json'
1473
+ if (produces.indexOf('application/json') >= 0) {
1474
+ localVarHeaderParams.Accept = 'application/json';
1475
+ } else {
1476
+ localVarHeaderParams.Accept = produces.join(',');
1477
+ }
1478
+ let localVarFormParams: any = {};
1479
+
1480
+ // verify required parameter 'workspaceUuid' is not null or undefined
1481
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1482
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling pollRssFeed.');
1483
+ }
1484
+
1485
+ // verify required parameter 'feedUuid' is not null or undefined
1486
+ if (feedUuid === null || feedUuid === undefined) {
1487
+ throw new Error('Required parameter feedUuid was null or undefined when calling pollRssFeed.');
1488
+ }
1489
+
1490
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1491
+
1492
+ let localVarUseFormData = false;
1493
+
1494
+ let localVarRequestOptions: localVarRequest.Options = {
1495
+ method: 'POST',
1496
+ qs: localVarQueryParameters,
1497
+ headers: localVarHeaderParams,
1498
+ uri: localVarPath,
1499
+ useQuerystring: this._useQuerystring,
1500
+ json: true,
1501
+ };
1502
+
1503
+ let authenticationPromise = Promise.resolve();
1504
+ if (this.authentications.bearerAuth.accessToken) {
1505
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1506
+ }
1507
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1508
+
1509
+ let interceptorPromise = authenticationPromise;
1510
+ for (const interceptor of this.interceptors) {
1511
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1512
+ }
1513
+
1514
+ return interceptorPromise.then(() => {
1515
+ if (Object.keys(localVarFormParams).length) {
1516
+ if (localVarUseFormData) {
1517
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1518
+ } else {
1519
+ localVarRequestOptions.form = localVarFormParams;
1520
+ }
1521
+ }
1522
+ return new Promise<{ response: http.IncomingMessage; body: PollRssFeed200Response; }>((resolve, reject) => {
1523
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1524
+ if (error) {
1525
+ reject(error);
1526
+ } else {
1527
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1528
+ body = ObjectSerializer.deserialize(body, "PollRssFeed200Response");
1529
+ resolve({ response: response, body: body });
1530
+ } else {
1531
+ reject(new HttpError(response, body, response.statusCode));
1532
+ }
1533
+ }
1534
+ });
1535
+ });
1536
+ });
1537
+ }
1538
+ /**
1539
+ * Shortcut for creating a `post` recycling rule for this post. Same body as `createRecyclingRule` without `type`, `post_uuid` and `tag_uuid`. Admins and members only.
1540
+ * @summary Recycle a post on an interval
1541
+ * @param workspaceUuid UUID of the workspace.
1542
+ * @param postUuid UUID of the post.
1543
+ * @param recyclingRuleSettings
1544
+ */
1545
+ public async recyclePost (workspaceUuid: string, postUuid: string, recyclingRuleSettings: RecyclingRuleSettings, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }> {
1546
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}/recycle'
1547
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1548
+ .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
1549
+ let localVarQueryParameters: any = {};
1550
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1551
+ const produces = ['application/json'];
1552
+ // give precedence to 'application/json'
1553
+ if (produces.indexOf('application/json') >= 0) {
1554
+ localVarHeaderParams.Accept = 'application/json';
1555
+ } else {
1556
+ localVarHeaderParams.Accept = produces.join(',');
1557
+ }
1558
+ let localVarFormParams: any = {};
1559
+
1560
+ // verify required parameter 'workspaceUuid' is not null or undefined
1561
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1562
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling recyclePost.');
1563
+ }
1564
+
1565
+ // verify required parameter 'postUuid' is not null or undefined
1566
+ if (postUuid === null || postUuid === undefined) {
1567
+ throw new Error('Required parameter postUuid was null or undefined when calling recyclePost.');
1568
+ }
1569
+
1570
+ // verify required parameter 'recyclingRuleSettings' is not null or undefined
1571
+ if (recyclingRuleSettings === null || recyclingRuleSettings === undefined) {
1572
+ throw new Error('Required parameter recyclingRuleSettings was null or undefined when calling recyclePost.');
1573
+ }
1574
+
1575
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1576
+
1577
+ let localVarUseFormData = false;
1578
+
1579
+ let localVarRequestOptions: localVarRequest.Options = {
1580
+ method: 'POST',
1581
+ qs: localVarQueryParameters,
1582
+ headers: localVarHeaderParams,
1583
+ uri: localVarPath,
1584
+ useQuerystring: this._useQuerystring,
1585
+ json: true,
1586
+ body: ObjectSerializer.serialize(recyclingRuleSettings, "RecyclingRuleSettings")
1587
+ };
1588
+
1589
+ let authenticationPromise = Promise.resolve();
1590
+ if (this.authentications.bearerAuth.accessToken) {
1591
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1592
+ }
1593
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1594
+
1595
+ let interceptorPromise = authenticationPromise;
1596
+ for (const interceptor of this.interceptors) {
1597
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1598
+ }
1599
+
1600
+ return interceptorPromise.then(() => {
1601
+ if (Object.keys(localVarFormParams).length) {
1602
+ if (localVarUseFormData) {
1603
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1604
+ } else {
1605
+ localVarRequestOptions.form = localVarFormParams;
1606
+ }
1607
+ }
1608
+ return new Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }>((resolve, reject) => {
1609
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1610
+ if (error) {
1611
+ reject(error);
1612
+ } else {
1613
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1614
+ body = ObjectSerializer.deserialize(body, "CreateRecyclingRule201Response");
1615
+ resolve({ response: response, body: body });
1616
+ } else {
1617
+ reject(new HttpError(response, body, response.statusCode));
1618
+ }
1619
+ }
1620
+ });
1621
+ });
1622
+ });
1623
+ }
1624
+ /**
1625
+ * Re-publishes a post to a single account whose publishing failed. Returns `422` when the account is not on the post, the post is still publishing, or the account did not fail.
1626
+ * @summary Retry publishing to one account
1627
+ * @param workspaceUuid UUID of the workspace.
1628
+ * @param postUuid UUID of the post.
1629
+ * @param accountUuid UUID of the social media account.
1630
+ * @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with &#x60;Idempotent-Replayed: true&#x60; and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
1631
+ */
1632
+ public async retryPostAccount (workspaceUuid: string, postUuid: string, accountUuid: string, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RetryPostAccountResult; }> {
1633
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts/retry/{postUuid}/{accountUuid}'
1634
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1635
+ .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)))
1636
+ .replace('{' + 'accountUuid' + '}', encodeURIComponent(String(accountUuid)));
1637
+ let localVarQueryParameters: any = {};
1638
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1639
+ const produces = ['application/json'];
1640
+ // give precedence to 'application/json'
1641
+ if (produces.indexOf('application/json') >= 0) {
1642
+ localVarHeaderParams.Accept = 'application/json';
1643
+ } else {
1644
+ localVarHeaderParams.Accept = produces.join(',');
1645
+ }
1646
+ let localVarFormParams: any = {};
1647
+
1648
+ // verify required parameter 'workspaceUuid' is not null or undefined
1649
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1650
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling retryPostAccount.');
1651
+ }
1652
+
1653
+ // verify required parameter 'postUuid' is not null or undefined
1654
+ if (postUuid === null || postUuid === undefined) {
1655
+ throw new Error('Required parameter postUuid was null or undefined when calling retryPostAccount.');
1656
+ }
1657
+
1658
+ // verify required parameter 'accountUuid' is not null or undefined
1659
+ if (accountUuid === null || accountUuid === undefined) {
1660
+ throw new Error('Required parameter accountUuid was null or undefined when calling retryPostAccount.');
1661
+ }
1662
+
1663
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
1664
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1665
+
1666
+ let localVarUseFormData = false;
1667
+
1668
+ let localVarRequestOptions: localVarRequest.Options = {
1669
+ method: 'POST',
1670
+ qs: localVarQueryParameters,
1671
+ headers: localVarHeaderParams,
1672
+ uri: localVarPath,
1673
+ useQuerystring: this._useQuerystring,
1674
+ json: true,
1675
+ };
1676
+
1677
+ let authenticationPromise = Promise.resolve();
1678
+ if (this.authentications.bearerAuth.accessToken) {
1679
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1680
+ }
1681
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1682
+
1683
+ let interceptorPromise = authenticationPromise;
1684
+ for (const interceptor of this.interceptors) {
1685
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1686
+ }
1687
+
1688
+ return interceptorPromise.then(() => {
1689
+ if (Object.keys(localVarFormParams).length) {
1690
+ if (localVarUseFormData) {
1691
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1692
+ } else {
1693
+ localVarRequestOptions.form = localVarFormParams;
1694
+ }
1695
+ }
1696
+ return new Promise<{ response: http.IncomingMessage; body: RetryPostAccountResult; }>((resolve, reject) => {
1697
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1698
+ if (error) {
1699
+ reject(error);
1700
+ } else {
1701
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1702
+ body = ObjectSerializer.deserialize(body, "RetryPostAccountResult");
1703
+ resolve({ response: response, body: body });
1704
+ } else {
1705
+ reject(new HttpError(response, body, response.statusCode));
1706
+ }
1707
+ }
1708
+ });
1709
+ });
1710
+ });
1711
+ }
1712
+ /**
1713
+ * Schedule an existing post. Optionally move it with `date`/`time` (read in `timezone`) and give accounts their own times with `accounts_schedule`. Set `postNow: true` to publish immediately; publishing starts within the request and any per-account times are dropped. Provider requirements are validated and reported as `422`.
1714
+ * @summary Schedule post
1715
+ * @param workspaceUuid UUID of the workspace.
1716
+ * @param postUuid UUID of the post.
1717
+ * @param schedulePostRequest
1718
+ * @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with &#x60;Idempotent-Replayed: true&#x60; and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
1719
+ */
1720
+ public async schedulePost (workspaceUuid: string, postUuid: string, schedulePostRequest: SchedulePostRequest, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ScheduleResult; }> {
1721
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts/schedule/{postUuid}'
1722
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1723
+ .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
1724
+ let localVarQueryParameters: any = {};
1725
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1726
+ const produces = ['application/json'];
1727
+ // give precedence to 'application/json'
1728
+ if (produces.indexOf('application/json') >= 0) {
1729
+ localVarHeaderParams.Accept = 'application/json';
1730
+ } else {
1731
+ localVarHeaderParams.Accept = produces.join(',');
1732
+ }
1733
+ let localVarFormParams: any = {};
1734
+
1735
+ // verify required parameter 'workspaceUuid' is not null or undefined
1736
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1737
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling schedulePost.');
1738
+ }
1739
+
1740
+ // verify required parameter 'postUuid' is not null or undefined
1741
+ if (postUuid === null || postUuid === undefined) {
1742
+ throw new Error('Required parameter postUuid was null or undefined when calling schedulePost.');
1743
+ }
1744
+
1745
+ // verify required parameter 'schedulePostRequest' is not null or undefined
1746
+ if (schedulePostRequest === null || schedulePostRequest === undefined) {
1747
+ throw new Error('Required parameter schedulePostRequest was null or undefined when calling schedulePost.');
1748
+ }
1749
+
1750
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
1751
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1752
+
1753
+ let localVarUseFormData = false;
1754
+
1755
+ let localVarRequestOptions: localVarRequest.Options = {
1756
+ method: 'POST',
1757
+ qs: localVarQueryParameters,
1758
+ headers: localVarHeaderParams,
1759
+ uri: localVarPath,
1760
+ useQuerystring: this._useQuerystring,
1761
+ json: true,
1762
+ body: ObjectSerializer.serialize(schedulePostRequest, "SchedulePostRequest")
1763
+ };
1764
+
1765
+ let authenticationPromise = Promise.resolve();
1766
+ if (this.authentications.bearerAuth.accessToken) {
1767
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1768
+ }
1769
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1770
+
1771
+ let interceptorPromise = authenticationPromise;
1772
+ for (const interceptor of this.interceptors) {
1773
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1774
+ }
1775
+
1776
+ return interceptorPromise.then(() => {
1777
+ if (Object.keys(localVarFormParams).length) {
1778
+ if (localVarUseFormData) {
1779
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1780
+ } else {
1781
+ localVarRequestOptions.form = localVarFormParams;
1782
+ }
1783
+ }
1784
+ return new Promise<{ response: http.IncomingMessage; body: ScheduleResult; }>((resolve, reject) => {
1785
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1786
+ if (error) {
1787
+ reject(error);
1788
+ } else {
1789
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1790
+ body = ObjectSerializer.deserialize(body, "ScheduleResult");
1791
+ resolve({ response: response, body: body });
1792
+ } else {
1793
+ reject(new HttpError(response, body, response.statusCode));
1794
+ }
1795
+ }
1796
+ });
1797
+ });
1798
+ });
1799
+ }
1800
+ /**
1801
+ * Replaces a post\'s versions, accounts, tags, and scheduling options. The post must not be in a published state. `timezone` is honoured: `date`, `time` and `accounts_schedule` are read in it. When the post stays scheduled, provider requirements are validated and reported as `422`.
1802
+ * @summary Update post
1803
+ * @param workspaceUuid UUID of the workspace.
1804
+ * @param postUuid UUID of the post.
1805
+ * @param postInput
1806
+ */
1807
+ public async updatePost (workspaceUuid: string, postUuid: string, postInput: PostInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
1808
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}'
1809
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1810
+ .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
1811
+ let localVarQueryParameters: any = {};
1812
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1813
+ const produces = ['application/json'];
1814
+ // give precedence to 'application/json'
1815
+ if (produces.indexOf('application/json') >= 0) {
1816
+ localVarHeaderParams.Accept = 'application/json';
1817
+ } else {
1818
+ localVarHeaderParams.Accept = produces.join(',');
1819
+ }
1820
+ let localVarFormParams: any = {};
1821
+
1822
+ // verify required parameter 'workspaceUuid' is not null or undefined
1823
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1824
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling updatePost.');
1825
+ }
1826
+
1827
+ // verify required parameter 'postUuid' is not null or undefined
1828
+ if (postUuid === null || postUuid === undefined) {
1829
+ throw new Error('Required parameter postUuid was null or undefined when calling updatePost.');
1830
+ }
1831
+
1832
+ // verify required parameter 'postInput' is not null or undefined
1833
+ if (postInput === null || postInput === undefined) {
1834
+ throw new Error('Required parameter postInput was null or undefined when calling updatePost.');
1835
+ }
1836
+
1837
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1838
+
1839
+ let localVarUseFormData = false;
1840
+
1841
+ let localVarRequestOptions: localVarRequest.Options = {
1842
+ method: 'PUT',
1843
+ qs: localVarQueryParameters,
1844
+ headers: localVarHeaderParams,
1845
+ uri: localVarPath,
1846
+ useQuerystring: this._useQuerystring,
1847
+ json: true,
1848
+ body: ObjectSerializer.serialize(postInput, "PostInput")
1849
+ };
1850
+
1851
+ let authenticationPromise = Promise.resolve();
1852
+ if (this.authentications.bearerAuth.accessToken) {
1853
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1854
+ }
1855
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1856
+
1857
+ let interceptorPromise = authenticationPromise;
1858
+ for (const interceptor of this.interceptors) {
1859
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1860
+ }
1861
+
1862
+ return interceptorPromise.then(() => {
1863
+ if (Object.keys(localVarFormParams).length) {
1864
+ if (localVarUseFormData) {
1865
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1866
+ } else {
1867
+ localVarRequestOptions.form = localVarFormParams;
1868
+ }
1869
+ }
1870
+ return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
1871
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1872
+ if (error) {
1873
+ reject(error);
1874
+ } else {
1875
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1876
+ body = ObjectSerializer.deserialize(body, "object");
1877
+ resolve({ response: response, body: body });
1878
+ } else {
1879
+ reject(new HttpError(response, body, response.statusCode));
1880
+ }
1881
+ }
1882
+ });
1883
+ });
1884
+ });
1885
+ }
1886
+ /**
1887
+ * Changes the interval, limit, placement or accounts, or pauses (`active: false`) and resumes the rule. Fields you leave out keep their value. A rule that reached `max_runs` resumes only with a higher `max_runs`. Admins and members only.
1888
+ * @summary Update, pause or resume a recycling rule
1889
+ * @param workspaceUuid UUID of the workspace.
1890
+ * @param ruleUuid UUID of the recycling rule.
1891
+ * @param recyclingRuleUpdate
1892
+ */
1893
+ public async updateRecyclingRule (workspaceUuid: string, ruleUuid: string, recyclingRuleUpdate: RecyclingRuleUpdate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }> {
1894
+ const localVarPath = this.basePath + '/{workspaceUuid}/recycling-rules/{ruleUuid}'
1895
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1896
+ .replace('{' + 'ruleUuid' + '}', encodeURIComponent(String(ruleUuid)));
1897
+ let localVarQueryParameters: any = {};
1898
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1899
+ const produces = ['application/json'];
1900
+ // give precedence to 'application/json'
1901
+ if (produces.indexOf('application/json') >= 0) {
1902
+ localVarHeaderParams.Accept = 'application/json';
1903
+ } else {
1904
+ localVarHeaderParams.Accept = produces.join(',');
1905
+ }
1906
+ let localVarFormParams: any = {};
1907
+
1908
+ // verify required parameter 'workspaceUuid' is not null or undefined
1909
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1910
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling updateRecyclingRule.');
1911
+ }
1912
+
1913
+ // verify required parameter 'ruleUuid' is not null or undefined
1914
+ if (ruleUuid === null || ruleUuid === undefined) {
1915
+ throw new Error('Required parameter ruleUuid was null or undefined when calling updateRecyclingRule.');
1916
+ }
1917
+
1918
+ // verify required parameter 'recyclingRuleUpdate' is not null or undefined
1919
+ if (recyclingRuleUpdate === null || recyclingRuleUpdate === undefined) {
1920
+ throw new Error('Required parameter recyclingRuleUpdate was null or undefined when calling updateRecyclingRule.');
1921
+ }
1922
+
1923
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1924
+
1925
+ let localVarUseFormData = false;
1926
+
1927
+ let localVarRequestOptions: localVarRequest.Options = {
1928
+ method: 'PUT',
1929
+ qs: localVarQueryParameters,
1930
+ headers: localVarHeaderParams,
1931
+ uri: localVarPath,
1932
+ useQuerystring: this._useQuerystring,
1933
+ json: true,
1934
+ body: ObjectSerializer.serialize(recyclingRuleUpdate, "RecyclingRuleUpdate")
1935
+ };
1936
+
1937
+ let authenticationPromise = Promise.resolve();
1938
+ if (this.authentications.bearerAuth.accessToken) {
1939
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1940
+ }
1941
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1942
+
1943
+ let interceptorPromise = authenticationPromise;
1944
+ for (const interceptor of this.interceptors) {
1945
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1946
+ }
1947
+
1948
+ return interceptorPromise.then(() => {
1949
+ if (Object.keys(localVarFormParams).length) {
1950
+ if (localVarUseFormData) {
1951
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1952
+ } else {
1953
+ localVarRequestOptions.form = localVarFormParams;
1954
+ }
1955
+ }
1956
+ return new Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }>((resolve, reject) => {
1957
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1958
+ if (error) {
1959
+ reject(error);
1960
+ } else {
1961
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1962
+ body = ObjectSerializer.deserialize(body, "CreateRecyclingRule201Response");
1963
+ resolve({ response: response, body: body });
1964
+ } else {
1965
+ reject(new HttpError(response, body, response.statusCode));
1966
+ }
1967
+ }
1968
+ });
1969
+ });
1970
+ });
1971
+ }
1972
+ /**
1973
+ * Fields you leave out keep their value. Resuming (`active: true`) clears the error backoff. Admins and members only.
1974
+ * @summary Update, pause or resume an RSS feed
1975
+ * @param workspaceUuid UUID of the workspace.
1976
+ * @param feedUuid UUID of the RSS feed.
1977
+ * @param rssFeedUpdate
1978
+ */
1979
+ public async updateRssFeed (workspaceUuid: string, feedUuid: string, rssFeedUpdate: RssFeedUpdate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateRssFeed201Response; }> {
1980
+ const localVarPath = this.basePath + '/{workspaceUuid}/rss-feeds/{feedUuid}'
1981
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
1982
+ .replace('{' + 'feedUuid' + '}', encodeURIComponent(String(feedUuid)));
1983
+ let localVarQueryParameters: any = {};
1984
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1985
+ const produces = ['application/json'];
1986
+ // give precedence to 'application/json'
1987
+ if (produces.indexOf('application/json') >= 0) {
1988
+ localVarHeaderParams.Accept = 'application/json';
1989
+ } else {
1990
+ localVarHeaderParams.Accept = produces.join(',');
1991
+ }
1992
+ let localVarFormParams: any = {};
1993
+
1994
+ // verify required parameter 'workspaceUuid' is not null or undefined
1995
+ if (workspaceUuid === null || workspaceUuid === undefined) {
1996
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling updateRssFeed.');
1997
+ }
1998
+
1999
+ // verify required parameter 'feedUuid' is not null or undefined
2000
+ if (feedUuid === null || feedUuid === undefined) {
2001
+ throw new Error('Required parameter feedUuid was null or undefined when calling updateRssFeed.');
2002
+ }
2003
+
2004
+ // verify required parameter 'rssFeedUpdate' is not null or undefined
2005
+ if (rssFeedUpdate === null || rssFeedUpdate === undefined) {
2006
+ throw new Error('Required parameter rssFeedUpdate was null or undefined when calling updateRssFeed.');
2007
+ }
2008
+
2009
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2010
+
2011
+ let localVarUseFormData = false;
2012
+
2013
+ let localVarRequestOptions: localVarRequest.Options = {
2014
+ method: 'PUT',
2015
+ qs: localVarQueryParameters,
2016
+ headers: localVarHeaderParams,
2017
+ uri: localVarPath,
2018
+ useQuerystring: this._useQuerystring,
2019
+ json: true,
2020
+ body: ObjectSerializer.serialize(rssFeedUpdate, "RssFeedUpdate")
2021
+ };
2022
+
2023
+ let authenticationPromise = Promise.resolve();
2024
+ if (this.authentications.bearerAuth.accessToken) {
2025
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
2026
+ }
2027
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2028
+
2029
+ let interceptorPromise = authenticationPromise;
2030
+ for (const interceptor of this.interceptors) {
2031
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
2032
+ }
2033
+
2034
+ return interceptorPromise.then(() => {
2035
+ if (Object.keys(localVarFormParams).length) {
2036
+ if (localVarUseFormData) {
2037
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2038
+ } else {
2039
+ localVarRequestOptions.form = localVarFormParams;
2040
+ }
2041
+ }
2042
+ return new Promise<{ response: http.IncomingMessage; body: CreateRssFeed201Response; }>((resolve, reject) => {
2043
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
2044
+ if (error) {
2045
+ reject(error);
2046
+ } else {
2047
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2048
+ body = ObjectSerializer.deserialize(body, "CreateRssFeed201Response");
2049
+ resolve({ response: response, body: body });
2050
+ } else {
2051
+ reject(new HttpError(response, body, response.statusCode));
2052
+ }
2053
+ }
2054
+ });
2055
+ });
2056
+ });
2057
+ }
2058
+ /**
2059
+ * Runs everything create-post checks without creating anything: request validation, network requirements (text length, media count and type, links) for every given account, whether or not the post is scheduled, and the guardrails (duplicate content, daily caps, account health). Always answers `200`; read `valid`. Any workspace member, including viewers, may call it. Recommended agent loop: account health, validate, then create.
2060
+ * @summary Validate post (dry run)
2061
+ * @param workspaceUuid UUID of the workspace.
2062
+ * @param postInput
2063
+ */
2064
+ public async validatePost (workspaceUuid: string, postInput: PostInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PreflightResult; }> {
2065
+ const localVarPath = this.basePath + '/{workspaceUuid}/posts/validate'
2066
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
2067
+ let localVarQueryParameters: any = {};
2068
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
2069
+ const produces = ['application/json'];
2070
+ // give precedence to 'application/json'
2071
+ if (produces.indexOf('application/json') >= 0) {
2072
+ localVarHeaderParams.Accept = 'application/json';
2073
+ } else {
2074
+ localVarHeaderParams.Accept = produces.join(',');
2075
+ }
2076
+ let localVarFormParams: any = {};
2077
+
2078
+ // verify required parameter 'workspaceUuid' is not null or undefined
2079
+ if (workspaceUuid === null || workspaceUuid === undefined) {
2080
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling validatePost.');
2081
+ }
2082
+
2083
+ // verify required parameter 'postInput' is not null or undefined
2084
+ if (postInput === null || postInput === undefined) {
2085
+ throw new Error('Required parameter postInput was null or undefined when calling validatePost.');
2086
+ }
2087
+
2088
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2089
+
2090
+ let localVarUseFormData = false;
2091
+
2092
+ let localVarRequestOptions: localVarRequest.Options = {
2093
+ method: 'POST',
2094
+ qs: localVarQueryParameters,
2095
+ headers: localVarHeaderParams,
2096
+ uri: localVarPath,
2097
+ useQuerystring: this._useQuerystring,
2098
+ json: true,
2099
+ body: ObjectSerializer.serialize(postInput, "PostInput")
2100
+ };
2101
+
2102
+ let authenticationPromise = Promise.resolve();
2103
+ if (this.authentications.bearerAuth.accessToken) {
2104
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
2105
+ }
2106
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2107
+
2108
+ let interceptorPromise = authenticationPromise;
2109
+ for (const interceptor of this.interceptors) {
2110
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
2111
+ }
2112
+
2113
+ return interceptorPromise.then(() => {
2114
+ if (Object.keys(localVarFormParams).length) {
2115
+ if (localVarUseFormData) {
2116
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2117
+ } else {
2118
+ localVarRequestOptions.form = localVarFormParams;
2119
+ }
2120
+ }
2121
+ return new Promise<{ response: http.IncomingMessage; body: PreflightResult; }>((resolve, reject) => {
2122
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
2123
+ if (error) {
2124
+ reject(error);
2125
+ } else {
2126
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2127
+ body = ObjectSerializer.deserialize(body, "PreflightResult");
818
2128
  resolve({ response: response, body: body });
819
2129
  } else {
820
2130
  reject(new HttpError(response, body, response.statusCode));