postboost 1.8.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 +244 -2
  12. package/api/activityApi.ts +188 -0
  13. package/api/agentsApi.ts +918 -0
  14. package/api/analyticsApi.ts +551 -2
  15. package/api/apis.ts +19 -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 +97 -7
  20. package/api/mentionsApi.ts +5 -3
  21. package/api/postingScheduleApi.ts +497 -0
  22. package/api/postsApi.ts +1236 -99
  23. package/api/receiptsApi.ts +2 -2
  24. package/api/subscriptionsApi.ts +2 -2
  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 +463 -2
  30. package/model/aICredits.ts +2 -2
  31. package/model/aIUsage.ts +39 -0
  32. package/model/aIUsageText.ts +52 -0
  33. package/model/account.ts +26 -4
  34. package/model/accountAnalytics.ts +2 -2
  35. package/model/accountAnalyticsInitialSync.ts +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  53. package/model/analyticsSummary.ts +2 -2
  54. package/model/analyticsSummaryData.ts +2 -2
  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 +2 -2
  64. package/model/bestPostingTimes.ts +2 -2
  65. package/model/bestPostingTimesTimesInner.ts +2 -2
  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 +2 -2
  76. package/model/cancelSubscription422ResponseErrors.ts +2 -2
  77. package/model/cancelSubscriptionRequest.ts +2 -2
  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 +2 -2
  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 +2 -2
  97. package/model/createMention201Response.ts +2 -2
  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 +2 -2
  107. package/model/deleteMediaBulkRequestItemsInner.ts +2 -2
  108. package/model/deleteMediaFolderRequest.ts +2 -2
  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 +2 -2
  156. package/model/initiateRemoteUpload201ResponseOneOf.ts +2 -2
  157. package/model/initiateRemoteUploadRequest.ts +2 -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 +2 -2
  174. package/model/listMentions200Response.ts +2 -2
  175. package/model/listMyWorkspaces200Response.ts +2 -2
  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 +2 -2
  189. package/model/mediaBase64Input.ts +61 -0
  190. package/model/mediaFolder.ts +2 -2
  191. package/model/mediaFolderInput.ts +2 -2
  192. package/model/mediaFolderRef.ts +2 -2
  193. package/model/mention.ts +2 -2
  194. package/model/mentionIdentity.ts +2 -2
  195. package/model/mentionIdentityInput.ts +2 -2
  196. package/model/mentionInput.ts +2 -2
  197. package/model/messageOnly.ts +31 -0
  198. package/model/models.ts +475 -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 +2 -2
  204. package/model/postAnalytics.ts +2 -2
  205. package/model/postContent.ts +6 -3
  206. package/model/postInput.ts +20 -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 +2 -2
  211. package/model/postVersion.ts +7 -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 +2 -2
  218. package/model/postingTimes.ts +2 -2
  219. package/model/postingTimesBestInner.ts +2 -2
  220. package/model/postingTimesDayIntervalsInnerInner.ts +2 -2
  221. package/model/postingTimesDaysInner.ts +2 -2
  222. package/model/preflightResult.ts +69 -0
  223. package/model/publicWorkspace.ts +2 -2
  224. package/model/publicWorkspacePivot.ts +2 -2
  225. package/model/publishProgress.ts +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  259. package/model/scheduleResult.ts +2 -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 +2 -2
  271. package/model/uploadChunk201Response.ts +2 -2
  272. package/model/user.ts +2 -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 +2 -2
  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 +2 -2
  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`. ## 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. ## 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.8.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).
@@ -17,14 +17,28 @@ import http from 'http';
17
17
  /* tslint:disable:no-unused-locals */
18
18
  import { AddPostToQueueRequest } from '../model/addPostToQueueRequest';
19
19
  import { ApprovePostRequest } from '../model/approvePostRequest';
20
+ import { CreateRecyclingRule201Response } from '../model/createRecyclingRule201Response';
21
+ import { CreateRssFeed201Response } from '../model/createRssFeed201Response';
20
22
  import { DeletePostRequest } from '../model/deletePostRequest';
21
23
  import { DeletePostsBulkRequest } from '../model/deletePostsBulkRequest';
22
24
  import { DeleteResult } from '../model/deleteResult';
25
+ import { GuardrailError } from '../model/guardrailError';
23
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';
24
32
  import { Post } from '../model/post';
25
33
  import { PostAnalytics } from '../model/postAnalytics';
26
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';
27
39
  import { RetryPostAccountResult } from '../model/retryPostAccountResult';
40
+ import { RssFeedInput } from '../model/rssFeedInput';
41
+ import { RssFeedUpdate } from '../model/rssFeedUpdate';
28
42
  import { SchedulePostRequest } from '../model/schedulePostRequest';
29
43
  import { ScheduleResult } from '../model/scheduleResult';
30
44
 
@@ -108,9 +122,10 @@ export class PostsApi {
108
122
  * @summary Add post to queue
109
123
  * @param workspaceUuid UUID of the workspace.
110
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.
111
126
  * @param addPostToQueueRequest
112
127
  */
113
- public async addPostToQueue (workspaceUuid: string, postUuid: string, addPostToQueueRequest?: AddPostToQueueRequest, 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; }> {
114
129
  const localVarPath = this.basePath + '/{workspaceUuid}/posts/add-to-queue/{postUuid}'
115
130
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
116
131
  .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
@@ -135,6 +150,7 @@ export class PostsApi {
135
150
  throw new Error('Required parameter postUuid was null or undefined when calling addPostToQueue.');
136
151
  }
137
152
 
153
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
138
154
  (<any>Object).assign(localVarHeaderParams, options.headers);
139
155
 
140
156
  let localVarUseFormData = false;
@@ -189,9 +205,10 @@ export class PostsApi {
189
205
  * @summary Approve post
190
206
  * @param workspaceUuid UUID of the workspace.
191
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.
192
209
  * @param approvePostRequest
193
210
  */
194
- public async approvePost (workspaceUuid: string, postUuid: string, approvePostRequest?: ApprovePostRequest, 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; }> {
195
212
  const localVarPath = this.basePath + '/{workspaceUuid}/posts/approve/{postUuid}'
196
213
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
197
214
  .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
@@ -216,6 +233,7 @@ export class PostsApi {
216
233
  throw new Error('Required parameter postUuid was null or undefined when calling approvePost.');
217
234
  }
218
235
 
236
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
219
237
  (<any>Object).assign(localVarHeaderParams, options.headers);
220
238
 
221
239
  let localVarUseFormData = false;
@@ -266,12 +284,13 @@ export class PostsApi {
266
284
  });
267
285
  }
268
286
  /**
269
- * 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`.
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.
270
288
  * @summary Create post
271
289
  * @param workspaceUuid UUID of the workspace.
272
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.
273
292
  */
274
- 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; }> {
275
294
  const localVarPath = this.basePath + '/{workspaceUuid}/posts'
276
295
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
277
296
  let localVarQueryParameters: any = {};
@@ -295,6 +314,7 @@ export class PostsApi {
295
314
  throw new Error('Required parameter postInput was null or undefined when calling createPost.');
296
315
  }
297
316
 
317
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
298
318
  (<any>Object).assign(localVarHeaderParams, options.headers);
299
319
 
300
320
  let localVarUseFormData = false;
@@ -344,6 +364,164 @@ export class PostsApi {
344
364
  });
345
365
  });
346
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
+ }
347
525
  /**
348
526
  * Deletes a post. Use `delete_mode` to control whether to also remove the published content from social platforms.
349
527
  * @summary Delete post
@@ -505,15 +683,15 @@ export class PostsApi {
505
683
  });
506
684
  }
507
685
  /**
508
- * Returns a single post with all its versions and associated accounts.
509
- * @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
510
688
  * @param workspaceUuid UUID of the workspace.
511
- * @param postUuid UUID of the post.
689
+ * @param ruleUuid UUID of the recycling rule.
512
690
  */
513
- public async getPost (workspaceUuid: string, postUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Post; }> {
514
- 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}'
515
693
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
516
- .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
694
+ .replace('{' + 'ruleUuid' + '}', encodeURIComponent(String(ruleUuid)));
517
695
  let localVarQueryParameters: any = {};
518
696
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
519
697
  const produces = ['application/json'];
@@ -527,12 +705,12 @@ export class PostsApi {
527
705
 
528
706
  // verify required parameter 'workspaceUuid' is not null or undefined
529
707
  if (workspaceUuid === null || workspaceUuid === undefined) {
530
- 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.');
531
709
  }
532
710
 
533
- // verify required parameter 'postUuid' is not null or undefined
534
- if (postUuid === null || postUuid === undefined) {
535
- 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.');
536
714
  }
537
715
 
538
716
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -540,7 +718,7 @@ export class PostsApi {
540
718
  let localVarUseFormData = false;
541
719
 
542
720
  let localVarRequestOptions: localVarRequest.Options = {
543
- method: 'GET',
721
+ method: 'DELETE',
544
722
  qs: localVarQueryParameters,
545
723
  headers: localVarHeaderParams,
546
724
  uri: localVarPath,
@@ -567,13 +745,13 @@ export class PostsApi {
567
745
  localVarRequestOptions.form = localVarFormParams;
568
746
  }
569
747
  }
570
- return new Promise<{ response: http.IncomingMessage; body: Post; }>((resolve, reject) => {
748
+ return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
571
749
  localVarRequest(localVarRequestOptions, (error, response, body) => {
572
750
  if (error) {
573
751
  reject(error);
574
752
  } else {
575
753
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
576
- body = ObjectSerializer.deserialize(body, "Post");
754
+ body = ObjectSerializer.deserialize(body, "object");
577
755
  resolve({ response: response, body: body });
578
756
  } else {
579
757
  reject(new HttpError(response, body, response.statusCode));
@@ -584,15 +762,15 @@ export class PostsApi {
584
762
  });
585
763
  }
586
764
  /**
587
- * Engagement metrics for a published post across its accounts (also works for trashed posts), with totals, trends and the best-performing account.
588
- * @summary Get post analytics
765
+ * Stops the feed. Posts it already created stay. Admins and members only.
766
+ * @summary Delete an RSS feed
589
767
  * @param workspaceUuid UUID of the workspace.
590
- * @param postUuid UUID of the post.
768
+ * @param feedUuid UUID of the RSS feed.
591
769
  */
592
- public async getPostAnalytics (workspaceUuid: string, postUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PostAnalytics; }> {
593
- const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}/analytics'
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}'
594
772
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
595
- .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
773
+ .replace('{' + 'feedUuid' + '}', encodeURIComponent(String(feedUuid)));
596
774
  let localVarQueryParameters: any = {};
597
775
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
598
776
  const produces = ['application/json'];
@@ -606,12 +784,12 @@ export class PostsApi {
606
784
 
607
785
  // verify required parameter 'workspaceUuid' is not null or undefined
608
786
  if (workspaceUuid === null || workspaceUuid === undefined) {
609
- throw new Error('Required parameter workspaceUuid was null or undefined when calling getPostAnalytics.');
787
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteRssFeed.');
610
788
  }
611
789
 
612
- // verify required parameter 'postUuid' is not null or undefined
613
- if (postUuid === null || postUuid === undefined) {
614
- throw new Error('Required parameter postUuid was null or undefined when calling getPostAnalytics.');
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.');
615
793
  }
616
794
 
617
795
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -619,7 +797,7 @@ export class PostsApi {
619
797
  let localVarUseFormData = false;
620
798
 
621
799
  let localVarRequestOptions: localVarRequest.Options = {
622
- method: 'GET',
800
+ method: 'DELETE',
623
801
  qs: localVarQueryParameters,
624
802
  headers: localVarHeaderParams,
625
803
  uri: localVarPath,
@@ -646,13 +824,13 @@ export class PostsApi {
646
824
  localVarRequestOptions.form = localVarFormParams;
647
825
  }
648
826
  }
649
- return new Promise<{ response: http.IncomingMessage; body: PostAnalytics; }>((resolve, reject) => {
827
+ return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
650
828
  localVarRequest(localVarRequestOptions, (error, response, body) => {
651
829
  if (error) {
652
830
  reject(error);
653
831
  } else {
654
832
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
655
- body = ObjectSerializer.deserialize(body, "PostAnalytics");
833
+ body = ObjectSerializer.deserialize(body, "object");
656
834
  resolve({ response: response, body: body });
657
835
  } else {
658
836
  reject(new HttpError(response, body, response.statusCode));
@@ -663,14 +841,15 @@ export class PostsApi {
663
841
  });
664
842
  }
665
843
  /**
666
- * Returns a paginated list of posts in the workspace.
667
- * @summary List posts
844
+ * Returns a single post with all its versions and associated accounts.
845
+ * @summary Get post
668
846
  * @param workspaceUuid UUID of the workspace.
669
- * @param page
847
+ * @param postUuid UUID of the post.
670
848
  */
671
- public async listPosts (workspaceUuid: string, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListPosts200Response; }> {
672
- const localVarPath = this.basePath + '/{workspaceUuid}/posts'
673
- .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
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}'
851
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
852
+ .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
674
853
  let localVarQueryParameters: any = {};
675
854
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
676
855
  const produces = ['application/json'];
@@ -684,11 +863,12 @@ export class PostsApi {
684
863
 
685
864
  // verify required parameter 'workspaceUuid' is not null or undefined
686
865
  if (workspaceUuid === null || workspaceUuid === undefined) {
687
- throw new Error('Required parameter workspaceUuid was null or undefined when calling listPosts.');
866
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getPost.');
688
867
  }
689
868
 
690
- if (page !== undefined) {
691
- localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
869
+ // verify required parameter 'postUuid' is not null or undefined
870
+ if (postUuid === null || postUuid === undefined) {
871
+ throw new Error('Required parameter postUuid was null or undefined when calling getPost.');
692
872
  }
693
873
 
694
874
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -723,13 +903,13 @@ export class PostsApi {
723
903
  localVarRequestOptions.form = localVarFormParams;
724
904
  }
725
905
  }
726
- return new Promise<{ response: http.IncomingMessage; body: ListPosts200Response; }>((resolve, reject) => {
906
+ return new Promise<{ response: http.IncomingMessage; body: Post; }>((resolve, reject) => {
727
907
  localVarRequest(localVarRequestOptions, (error, response, body) => {
728
908
  if (error) {
729
909
  reject(error);
730
910
  } else {
731
911
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
732
- body = ObjectSerializer.deserialize(body, "ListPosts200Response");
912
+ body = ObjectSerializer.deserialize(body, "Post");
733
913
  resolve({ response: response, body: body });
734
914
  } else {
735
915
  reject(new HttpError(response, body, response.statusCode));
@@ -740,17 +920,15 @@ export class PostsApi {
740
920
  });
741
921
  }
742
922
  /**
743
- * 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.
744
- * @summary Retry publishing to one account
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
745
925
  * @param workspaceUuid UUID of the workspace.
746
926
  * @param postUuid UUID of the post.
747
- * @param accountUuid UUID of the social media account.
748
927
  */
749
- public async retryPostAccount (workspaceUuid: string, postUuid: string, accountUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RetryPostAccountResult; }> {
750
- const localVarPath = this.basePath + '/{workspaceUuid}/posts/retry/{postUuid}/{accountUuid}'
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'
751
930
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
752
- .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)))
753
- .replace('{' + 'accountUuid' + '}', encodeURIComponent(String(accountUuid)));
931
+ .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
754
932
  let localVarQueryParameters: any = {};
755
933
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
756
934
  const produces = ['application/json'];
@@ -764,17 +942,12 @@ export class PostsApi {
764
942
 
765
943
  // verify required parameter 'workspaceUuid' is not null or undefined
766
944
  if (workspaceUuid === null || workspaceUuid === undefined) {
767
- throw new Error('Required parameter workspaceUuid was null or undefined when calling retryPostAccount.');
945
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getPostAnalytics.');
768
946
  }
769
947
 
770
948
  // verify required parameter 'postUuid' is not null or undefined
771
949
  if (postUuid === null || postUuid === undefined) {
772
- throw new Error('Required parameter postUuid was null or undefined when calling retryPostAccount.');
773
- }
774
-
775
- // verify required parameter 'accountUuid' is not null or undefined
776
- if (accountUuid === null || accountUuid === undefined) {
777
- throw new Error('Required parameter accountUuid was null or undefined when calling retryPostAccount.');
950
+ throw new Error('Required parameter postUuid was null or undefined when calling getPostAnalytics.');
778
951
  }
779
952
 
780
953
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -782,7 +955,7 @@ export class PostsApi {
782
955
  let localVarUseFormData = false;
783
956
 
784
957
  let localVarRequestOptions: localVarRequest.Options = {
785
- method: 'POST',
958
+ method: 'GET',
786
959
  qs: localVarQueryParameters,
787
960
  headers: localVarHeaderParams,
788
961
  uri: localVarPath,
@@ -809,13 +982,13 @@ export class PostsApi {
809
982
  localVarRequestOptions.form = localVarFormParams;
810
983
  }
811
984
  }
812
- return new Promise<{ response: http.IncomingMessage; body: RetryPostAccountResult; }>((resolve, reject) => {
985
+ return new Promise<{ response: http.IncomingMessage; body: PostAnalytics; }>((resolve, reject) => {
813
986
  localVarRequest(localVarRequestOptions, (error, response, body) => {
814
987
  if (error) {
815
988
  reject(error);
816
989
  } else {
817
990
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
818
- body = ObjectSerializer.deserialize(body, "RetryPostAccountResult");
991
+ body = ObjectSerializer.deserialize(body, "PostAnalytics");
819
992
  resolve({ response: response, body: body });
820
993
  } else {
821
994
  reject(new HttpError(response, body, response.statusCode));
@@ -826,16 +999,15 @@ export class PostsApi {
826
999
  });
827
1000
  }
828
1001
  /**
829
- * 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`.
830
- * @summary Schedule post
1002
+ *
1003
+ * @summary Get a recycling rule
831
1004
  * @param workspaceUuid UUID of the workspace.
832
- * @param postUuid UUID of the post.
833
- * @param schedulePostRequest
1005
+ * @param ruleUuid UUID of the recycling rule.
834
1006
  */
835
- public async schedulePost (workspaceUuid: string, postUuid: string, schedulePostRequest: SchedulePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ScheduleResult; }> {
836
- const localVarPath = this.basePath + '/{workspaceUuid}/posts/schedule/{postUuid}'
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}'
837
1009
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
838
- .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
1010
+ .replace('{' + 'ruleUuid' + '}', encodeURIComponent(String(ruleUuid)));
839
1011
  let localVarQueryParameters: any = {};
840
1012
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
841
1013
  const produces = ['application/json'];
@@ -849,17 +1021,12 @@ export class PostsApi {
849
1021
 
850
1022
  // verify required parameter 'workspaceUuid' is not null or undefined
851
1023
  if (workspaceUuid === null || workspaceUuid === undefined) {
852
- throw new Error('Required parameter workspaceUuid was null or undefined when calling schedulePost.');
853
- }
854
-
855
- // verify required parameter 'postUuid' is not null or undefined
856
- if (postUuid === null || postUuid === undefined) {
857
- throw new Error('Required parameter postUuid was null or undefined when calling schedulePost.');
1024
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getRecyclingRule.');
858
1025
  }
859
1026
 
860
- // verify required parameter 'schedulePostRequest' is not null or undefined
861
- if (schedulePostRequest === null || schedulePostRequest === undefined) {
862
- throw new Error('Required parameter schedulePostRequest was null or undefined when calling schedulePost.');
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.');
863
1030
  }
864
1031
 
865
1032
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -867,13 +1034,12 @@ export class PostsApi {
867
1034
  let localVarUseFormData = false;
868
1035
 
869
1036
  let localVarRequestOptions: localVarRequest.Options = {
870
- method: 'POST',
1037
+ method: 'GET',
871
1038
  qs: localVarQueryParameters,
872
1039
  headers: localVarHeaderParams,
873
1040
  uri: localVarPath,
874
1041
  useQuerystring: this._useQuerystring,
875
1042
  json: true,
876
- body: ObjectSerializer.serialize(schedulePostRequest, "SchedulePostRequest")
877
1043
  };
878
1044
 
879
1045
  let authenticationPromise = Promise.resolve();
@@ -895,13 +1061,13 @@ export class PostsApi {
895
1061
  localVarRequestOptions.form = localVarFormParams;
896
1062
  }
897
1063
  }
898
- return new Promise<{ response: http.IncomingMessage; body: ScheduleResult; }>((resolve, reject) => {
1064
+ return new Promise<{ response: http.IncomingMessage; body: CreateRecyclingRule201Response; }>((resolve, reject) => {
899
1065
  localVarRequest(localVarRequestOptions, (error, response, body) => {
900
1066
  if (error) {
901
1067
  reject(error);
902
1068
  } else {
903
1069
  if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
904
- body = ObjectSerializer.deserialize(body, "ScheduleResult");
1070
+ body = ObjectSerializer.deserialize(body, "CreateRecyclingRule201Response");
905
1071
  resolve({ response: response, body: body });
906
1072
  } else {
907
1073
  reject(new HttpError(response, body, response.statusCode));
@@ -912,16 +1078,15 @@ export class PostsApi {
912
1078
  });
913
1079
  }
914
1080
  /**
915
- * 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`.
916
- * @summary Update post
1081
+ *
1082
+ * @summary Get an RSS feed
917
1083
  * @param workspaceUuid UUID of the workspace.
918
- * @param postUuid UUID of the post.
919
- * @param postInput
1084
+ * @param feedUuid UUID of the RSS feed.
920
1085
  */
921
- public async updatePost (workspaceUuid: string, postUuid: string, postInput: PostInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
922
- const localVarPath = this.basePath + '/{workspaceUuid}/posts/{postUuid}'
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}'
923
1088
  .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
924
- .replace('{' + 'postUuid' + '}', encodeURIComponent(String(postUuid)));
1089
+ .replace('{' + 'feedUuid' + '}', encodeURIComponent(String(feedUuid)));
925
1090
  let localVarQueryParameters: any = {};
926
1091
  let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
927
1092
  const produces = ['application/json'];
@@ -935,17 +1100,12 @@ export class PostsApi {
935
1100
 
936
1101
  // verify required parameter 'workspaceUuid' is not null or undefined
937
1102
  if (workspaceUuid === null || workspaceUuid === undefined) {
938
- throw new Error('Required parameter workspaceUuid was null or undefined when calling updatePost.');
939
- }
940
-
941
- // verify required parameter 'postUuid' is not null or undefined
942
- if (postUuid === null || postUuid === undefined) {
943
- throw new Error('Required parameter postUuid was null or undefined when calling updatePost.');
1103
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getRssFeed.');
944
1104
  }
945
1105
 
946
- // verify required parameter 'postInput' is not null or undefined
947
- if (postInput === null || postInput === undefined) {
948
- throw new Error('Required parameter postInput was null or undefined when calling updatePost.');
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.');
949
1109
  }
950
1110
 
951
1111
  (<any>Object).assign(localVarHeaderParams, options.headers);
@@ -953,13 +1113,12 @@ export class PostsApi {
953
1113
  let localVarUseFormData = false;
954
1114
 
955
1115
  let localVarRequestOptions: localVarRequest.Options = {
956
- method: 'PUT',
1116
+ method: 'GET',
957
1117
  qs: localVarQueryParameters,
958
1118
  headers: localVarHeaderParams,
959
1119
  uri: localVarPath,
960
1120
  useQuerystring: this._useQuerystring,
961
1121
  json: true,
962
- body: ObjectSerializer.serialize(postInput, "PostInput")
963
1122
  };
964
1123
 
965
1124
  let authenticationPromise = Promise.resolve();
@@ -981,7 +1140,734 @@ export class PostsApi {
981
1140
  localVarRequestOptions.form = localVarFormParams;
982
1141
  }
983
1142
  }
984
- return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
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) => {
985
1871
  localVarRequest(localVarRequestOptions, (error, response, body) => {
986
1872
  if (error) {
987
1873
  reject(error);
@@ -997,4 +1883,255 @@ export class PostsApi {
997
1883
  });
998
1884
  });
999
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");
2128
+ resolve({ response: response, body: body });
2129
+ } else {
2130
+ reject(new HttpError(response, body, response.statusCode));
2131
+ }
2132
+ }
2133
+ });
2134
+ });
2135
+ });
2136
+ }
1000
2137
  }