peal 0.1.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 (443) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +136 -0
  4. data/LICENSE +202 -0
  5. data/README.md +353 -0
  6. data/Rakefile +10 -0
  7. data/docs/AlreadyMemberEncoded.md +18 -0
  8. data/docs/AltTextTooLongEncoded.md +20 -0
  9. data/docs/AnalyticsApi.md +155 -0
  10. data/docs/AnalyticsSummary.md +30 -0
  11. data/docs/ApiKey.md +28 -0
  12. data/docs/ApiKeyNotFoundEncoded.md +18 -0
  13. data/docs/ApiKeysApi.md +220 -0
  14. data/docs/ApiKeysRevoke404Response.md +18 -0
  15. data/docs/AssistantAction.md +24 -0
  16. data/docs/AssistantActionAnyOf.md +20 -0
  17. data/docs/AssistantActionAnyOf1.md +20 -0
  18. data/docs/AssistantActionAnyOf2.md +20 -0
  19. data/docs/AssistantActionAnyOf3.md +18 -0
  20. data/docs/AssistantApi.md +149 -0
  21. data/docs/AssistantFailedEncoded.md +20 -0
  22. data/docs/AssistantInputRejectedEncoded.md +22 -0
  23. data/docs/AssistantQuotaExceededEncoded.md +22 -0
  24. data/docs/AssistantStatus.md +26 -0
  25. data/docs/AssistantTone.md +15 -0
  26. data/docs/AssistantUnavailableEncoded.md +18 -0
  27. data/docs/AttemptResult.md +15 -0
  28. data/docs/Authorization.md +18 -0
  29. data/docs/Billing.md +28 -0
  30. data/docs/BillingApi.md +77 -0
  31. data/docs/BillingSubscription.md +24 -0
  32. data/docs/Channel.md +30 -0
  33. data/docs/ChannelCannotPostEncoded.md +20 -0
  34. data/docs/ChannelMetrics.md +30 -0
  35. data/docs/ChannelNotFoundEncoded.md +18 -0
  36. data/docs/ChannelOptions.md +20 -0
  37. data/docs/ChannelStatus.md +20 -0
  38. data/docs/ChannelStatusAnyOf.md +18 -0
  39. data/docs/ChannelStatusAnyOf1.md +18 -0
  40. data/docs/ChannelStatusAnyOf2.md +20 -0
  41. data/docs/ChannelsApi.md +512 -0
  42. data/docs/ChannelsCompleteConnect404Response.md +18 -0
  43. data/docs/ChoosableAccount.md +26 -0
  44. data/docs/ChooseAccounts.md +20 -0
  45. data/docs/ConnectCallback.md +24 -0
  46. data/docs/ConnectChannel.md +20 -0
  47. data/docs/ConnectFailedEncoded.md +20 -0
  48. data/docs/ConnectFailureReason.md +15 -0
  49. data/docs/ConnectOutcome.md +26 -0
  50. data/docs/ConnectOutcomeAnyOf.md +20 -0
  51. data/docs/ConnectOutcomeAnyOf1.md +24 -0
  52. data/docs/ConnectablePlatforms.md +18 -0
  53. data/docs/ContentViolation.md +54 -0
  54. data/docs/ContentViolationAnyOf.md +18 -0
  55. data/docs/ContentViolationAnyOf1.md +20 -0
  56. data/docs/ContentViolationAnyOf10.md +26 -0
  57. data/docs/ContentViolationAnyOf11.md +22 -0
  58. data/docs/ContentViolationAnyOf12.md +26 -0
  59. data/docs/ContentViolationAnyOf13.md +26 -0
  60. data/docs/ContentViolationAnyOf14.md +26 -0
  61. data/docs/ContentViolationAnyOf15.md +26 -0
  62. data/docs/ContentViolationAnyOf16.md +22 -0
  63. data/docs/ContentViolationAnyOf17.md +26 -0
  64. data/docs/ContentViolationAnyOf18.md +28 -0
  65. data/docs/ContentViolationAnyOf19.md +28 -0
  66. data/docs/ContentViolationAnyOf2.md +20 -0
  67. data/docs/ContentViolationAnyOf20.md +28 -0
  68. data/docs/ContentViolationAnyOf21.md +28 -0
  69. data/docs/ContentViolationAnyOf22.md +30 -0
  70. data/docs/ContentViolationAnyOf23.md +32 -0
  71. data/docs/ContentViolationAnyOf24.md +32 -0
  72. data/docs/ContentViolationAnyOf24Maximum.md +15 -0
  73. data/docs/ContentViolationAnyOf25.md +28 -0
  74. data/docs/ContentViolationAnyOf3.md +24 -0
  75. data/docs/ContentViolationAnyOf4.md +24 -0
  76. data/docs/ContentViolationAnyOf5.md +28 -0
  77. data/docs/ContentViolationAnyOf6.md +24 -0
  78. data/docs/ContentViolationAnyOf7.md +22 -0
  79. data/docs/ContentViolationAnyOf8.md +28 -0
  80. data/docs/ContentViolationAnyOf9.md +24 -0
  81. data/docs/CreatedApiKey.md +20 -0
  82. data/docs/DatabaseUnavailableEncoded.md +18 -0
  83. data/docs/DraftPage.md +20 -0
  84. data/docs/EffectHttpApiErrorBadRequestEncoded.md +18 -0
  85. data/docs/EngagementDay.md +26 -0
  86. data/docs/FailureReason.md +15 -0
  87. data/docs/ForbiddenEncoded.md +18 -0
  88. data/docs/InvalidDateRangeEncoded.md +18 -0
  89. data/docs/InvalidTimeRangeEncoded.md +18 -0
  90. data/docs/InvalidTimeZoneEncoded.md +20 -0
  91. data/docs/Invitation.md +28 -0
  92. data/docs/InvitationNotFoundEncoded.md +18 -0
  93. data/docs/InvitationsApi.md +220 -0
  94. data/docs/InvitationsCreate409Response.md +18 -0
  95. data/docs/InvitationsRevoke404Response.md +18 -0
  96. data/docs/MarkNoticesRead.md +18 -0
  97. data/docs/Me.md +22 -0
  98. data/docs/MeUser.md +28 -0
  99. data/docs/Media.md +40 -0
  100. data/docs/MediaApi.md +516 -0
  101. data/docs/MediaAttachment.md +20 -0
  102. data/docs/MediaContentType.md +15 -0
  103. data/docs/MediaCreate422Response.md +28 -0
  104. data/docs/MediaDescription.md +18 -0
  105. data/docs/MediaDimensions.md +20 -0
  106. data/docs/MediaGet404Response.md +18 -0
  107. data/docs/MediaInUseEncoded.md +20 -0
  108. data/docs/MediaKind.md +15 -0
  109. data/docs/MediaNotFoundEncoded.md +18 -0
  110. data/docs/MediaPage.md +20 -0
  111. data/docs/MediaStatus.md +22 -0
  112. data/docs/MediaStatusAnyOf.md +18 -0
  113. data/docs/MediaStatusAnyOf1.md +20 -0
  114. data/docs/MediaStatusAnyOf2.md +18 -0
  115. data/docs/MediaStatusAnyOf3.md +20 -0
  116. data/docs/MediaStoreUnavailableEncoded.md +18 -0
  117. data/docs/MediaTooLargeEncoded.md +24 -0
  118. data/docs/MediaUsage.md +20 -0
  119. data/docs/MembersApi.md +77 -0
  120. data/docs/Membership.md +26 -0
  121. data/docs/MetricTotals.md +28 -0
  122. data/docs/MetricsSnapshot.md +20 -0
  123. data/docs/NewApiKey.md +22 -0
  124. data/docs/NewInvitation.md +20 -0
  125. data/docs/NewUpload.md +22 -0
  126. data/docs/NonFiniteNumber.md +15 -0
  127. data/docs/Notice.md +26 -0
  128. data/docs/NoticeChannel.md +20 -0
  129. data/docs/NoticeEvent.md +28 -0
  130. data/docs/NoticeEventAnyOf.md +24 -0
  131. data/docs/NoticeEventAnyOf1.md +24 -0
  132. data/docs/NoticeEventAnyOf2.md +22 -0
  133. data/docs/NoticeEventAnyOf3.md +20 -0
  134. data/docs/NoticeEventAnyOf4.md +22 -0
  135. data/docs/NoticePage.md +20 -0
  136. data/docs/NoticesApi.md +285 -0
  137. data/docs/NotificationPreferences.md +20 -0
  138. data/docs/NotificationPreferencesApi.md +144 -0
  139. data/docs/NotificationPreferencesChange.md +20 -0
  140. data/docs/NotificationPreferencesChangeEmail.md +24 -0
  141. data/docs/NotificationPreferencesEmail.md +24 -0
  142. data/docs/PaidPlan.md +15 -0
  143. data/docs/PeriodUsage.md +20 -0
  144. data/docs/Plan.md +15 -0
  145. data/docs/PlanAllowances.md +24 -0
  146. data/docs/PlanLimit.md +15 -0
  147. data/docs/PlanLimitReachedEncoded.md +22 -0
  148. data/docs/PlanOffer.md +20 -0
  149. data/docs/Platform.md +15 -0
  150. data/docs/PlatformUnreachableEncoded.md +18 -0
  151. data/docs/Post.md +30 -0
  152. data/docs/PostAnalytics.md +20 -0
  153. data/docs/PostContent.md +22 -0
  154. data/docs/PostContentInvalidEncoded.md +20 -0
  155. data/docs/PostDraft.md +22 -0
  156. data/docs/PostMetrics.md +26 -0
  157. data/docs/PostNotFoundEncoded.md +18 -0
  158. data/docs/PostOutcome.md +15 -0
  159. data/docs/PostSchedule.md +20 -0
  160. data/docs/PostStatus.md +15 -0
  161. data/docs/PostStatusConflictEncoded.md +20 -0
  162. data/docs/PostTarget.md +36 -0
  163. data/docs/PostTargetStatus.md +15 -0
  164. data/docs/PostsApi.md +960 -0
  165. data/docs/PostsCreate422Response.md +24 -0
  166. data/docs/PostsGet404Response.md +18 -0
  167. data/docs/PostsRepost409Response.md +20 -0
  168. data/docs/PostsSchedule422Response.md +26 -0
  169. data/docs/PreparedUpload.md +20 -0
  170. data/docs/ProbeState.md +15 -0
  171. data/docs/PublicationAttempt.md +30 -0
  172. data/docs/RejectionReason.md +15 -0
  173. data/docs/Role.md +15 -0
  174. data/docs/ScheduleInPastEncoded.md +18 -0
  175. data/docs/SchedulePost.md +22 -0
  176. data/docs/SessionApi.md +74 -0
  177. data/docs/SignedRequest.md +22 -0
  178. data/docs/SubscriptionStatus.md +15 -0
  179. data/docs/Suggestion.md +22 -0
  180. data/docs/SuggestionAnyOf.md +20 -0
  181. data/docs/SuggestionAnyOf1.md +20 -0
  182. data/docs/SuggestionRequest.md +20 -0
  183. data/docs/SystemApi.md +129 -0
  184. data/docs/TargetConfirmation.md +20 -0
  185. data/docs/TargetConfirmationAnyOf.md +20 -0
  186. data/docs/TargetConfirmationAnyOf1.md +18 -0
  187. data/docs/TargetMetrics.md +32 -0
  188. data/docs/TargetOptions.md +48 -0
  189. data/docs/TargetStatusConflictEncoded.md +20 -0
  190. data/docs/TextOverride.md +20 -0
  191. data/docs/TextUnit.md +15 -0
  192. data/docs/TikTokAccount.md +20 -0
  193. data/docs/TikTokAccountPosting.md +22 -0
  194. data/docs/TikTokAccountPostingAnyOf.md +20 -0
  195. data/docs/TikTokAccountPostingAnyOf1.md +20 -0
  196. data/docs/TikTokBlock.md +15 -0
  197. data/docs/TikTokCreator.md +32 -0
  198. data/docs/TikTokOptions.md +34 -0
  199. data/docs/TikTokPrivacyLevel.md +15 -0
  200. data/docs/TiktokApi.md +79 -0
  201. data/docs/TooManyInvitationsEncoded.md +18 -0
  202. data/docs/TopPost.md +30 -0
  203. data/docs/TranslationLanguage.md +15 -0
  204. data/docs/UnauthenticatedEncoded.md +18 -0
  205. data/docs/UnconfirmedReason.md +15 -0
  206. data/docs/UnknownChannelsEncoded.md +20 -0
  207. data/docs/UnknownMediaEncoded.md +20 -0
  208. data/docs/UnreadNotices.md +18 -0
  209. data/docs/UnsupportedMediaTypeEncoded.md +20 -0
  210. data/docs/UploadIncompleteEncoded.md +18 -0
  211. data/docs/UploadPart.md +22 -0
  212. data/docs/UploadRejectedEncoded.md +20 -0
  213. data/docs/UploadTarget.md +26 -0
  214. data/docs/UploadTargetAnyOf.md +22 -0
  215. data/docs/UploadTargetAnyOf1.md +24 -0
  216. data/docs/Usage.md +24 -0
  217. data/docs/WorkspaceMember.md +26 -0
  218. data/docs/WorkspaceNotFoundEncoded.md +18 -0
  219. data/docs/YouTubeOptions.md +32 -0
  220. data/docs/YouTubePrivacy.md +15 -0
  221. data/lib/peal/api/analytics_api.rb +185 -0
  222. data/lib/peal/api/api_keys_api.rb +228 -0
  223. data/lib/peal/api/assistant_api.rb +159 -0
  224. data/lib/peal/api/billing_api.rb +85 -0
  225. data/lib/peal/api/channels_api.rb +526 -0
  226. data/lib/peal/api/invitations_api.rb +228 -0
  227. data/lib/peal/api/media_api.rb +526 -0
  228. data/lib/peal/api/members_api.rb +85 -0
  229. data/lib/peal/api/notices_api.rb +272 -0
  230. data/lib/peal/api/notification_preferences_api.rb +147 -0
  231. data/lib/peal/api/posts_api.rb +993 -0
  232. data/lib/peal/api/session_api.rb +79 -0
  233. data/lib/peal/api/system_api.rb +134 -0
  234. data/lib/peal/api/tiktok_api.rb +91 -0
  235. data/lib/peal/api_client.rb +441 -0
  236. data/lib/peal/api_error.rb +58 -0
  237. data/lib/peal/api_model_base.rb +88 -0
  238. data/lib/peal/configuration.rb +392 -0
  239. data/lib/peal/models/already_member_encoded.rb +201 -0
  240. data/lib/peal/models/alt_text_too_long_encoded.rb +245 -0
  241. data/lib/peal/models/analytics_summary.rb +361 -0
  242. data/lib/peal/models/api_key.rb +293 -0
  243. data/lib/peal/models/api_key_not_found_encoded.rb +201 -0
  244. data/lib/peal/models/api_keys_revoke404_response.rb +103 -0
  245. data/lib/peal/models/assistant_action.rb +105 -0
  246. data/lib/peal/models/assistant_action_any_of.rb +227 -0
  247. data/lib/peal/models/assistant_action_any_of1.rb +227 -0
  248. data/lib/peal/models/assistant_action_any_of2.rb +227 -0
  249. data/lib/peal/models/assistant_action_any_of3.rb +201 -0
  250. data/lib/peal/models/assistant_failed_encoded.rb +229 -0
  251. data/lib/peal/models/assistant_input_rejected_encoded.rb +273 -0
  252. data/lib/peal/models/assistant_quota_exceeded_encoded.rb +271 -0
  253. data/lib/peal/models/assistant_status.rb +335 -0
  254. data/lib/peal/models/assistant_tone.rb +43 -0
  255. data/lib/peal/models/assistant_unavailable_encoded.rb +201 -0
  256. data/lib/peal/models/attempt_result.rb +50 -0
  257. data/lib/peal/models/authorization.rb +177 -0
  258. data/lib/peal/models/billing.rb +303 -0
  259. data/lib/peal/models/billing_subscription.rb +263 -0
  260. data/lib/peal/models/channel.rb +313 -0
  261. data/lib/peal/models/channel_cannot_post_encoded.rb +229 -0
  262. data/lib/peal/models/channel_metrics.rb +425 -0
  263. data/lib/peal/models/channel_not_found_encoded.rb +201 -0
  264. data/lib/peal/models/channel_options.rb +203 -0
  265. data/lib/peal/models/channel_status.rb +104 -0
  266. data/lib/peal/models/channel_status_any_of.rb +201 -0
  267. data/lib/peal/models/channel_status_any_of1.rb +201 -0
  268. data/lib/peal/models/channel_status_any_of2.rb +227 -0
  269. data/lib/peal/models/channels_complete_connect404_response.rb +103 -0
  270. data/lib/peal/models/choosable_account.rb +253 -0
  271. data/lib/peal/models/choose_accounts.rb +241 -0
  272. data/lib/peal/models/connect_callback.rb +279 -0
  273. data/lib/peal/models/connect_channel.rb +207 -0
  274. data/lib/peal/models/connect_failed_encoded.rb +227 -0
  275. data/lib/peal/models/connect_failure_reason.rb +48 -0
  276. data/lib/peal/models/connect_outcome.rb +103 -0
  277. data/lib/peal/models/connect_outcome_any_of.rb +227 -0
  278. data/lib/peal/models/connect_outcome_any_of1.rb +281 -0
  279. data/lib/peal/models/connectable_platforms.rb +179 -0
  280. data/lib/peal/models/content_violation.rb +127 -0
  281. data/lib/peal/models/content_violation_any_of.rb +201 -0
  282. data/lib/peal/models/content_violation_any_of1.rb +227 -0
  283. data/lib/peal/models/content_violation_any_of10.rb +341 -0
  284. data/lib/peal/models/content_violation_any_of11.rb +253 -0
  285. data/lib/peal/models/content_violation_any_of12.rb +341 -0
  286. data/lib/peal/models/content_violation_any_of13.rb +341 -0
  287. data/lib/peal/models/content_violation_any_of14.rb +341 -0
  288. data/lib/peal/models/content_violation_any_of15.rb +341 -0
  289. data/lib/peal/models/content_violation_any_of16.rb +253 -0
  290. data/lib/peal/models/content_violation_any_of17.rb +305 -0
  291. data/lib/peal/models/content_violation_any_of18.rb +367 -0
  292. data/lib/peal/models/content_violation_any_of19.rb +367 -0
  293. data/lib/peal/models/content_violation_any_of2.rb +227 -0
  294. data/lib/peal/models/content_violation_any_of20.rb +367 -0
  295. data/lib/peal/models/content_violation_any_of21.rb +367 -0
  296. data/lib/peal/models/content_violation_any_of22.rb +411 -0
  297. data/lib/peal/models/content_violation_any_of23.rb +455 -0
  298. data/lib/peal/models/content_violation_any_of24.rb +419 -0
  299. data/lib/peal/models/content_violation_any_of24_maximum.rb +103 -0
  300. data/lib/peal/models/content_violation_any_of25.rb +367 -0
  301. data/lib/peal/models/content_violation_any_of3.rb +279 -0
  302. data/lib/peal/models/content_violation_any_of4.rb +279 -0
  303. data/lib/peal/models/content_violation_any_of5.rb +367 -0
  304. data/lib/peal/models/content_violation_any_of6.rb +279 -0
  305. data/lib/peal/models/content_violation_any_of7.rb +253 -0
  306. data/lib/peal/models/content_violation_any_of8.rb +367 -0
  307. data/lib/peal/models/content_violation_any_of9.rb +281 -0
  308. data/lib/peal/models/created_api_key.rb +203 -0
  309. data/lib/peal/models/database_unavailable_encoded.rb +201 -0
  310. data/lib/peal/models/draft_page.rb +191 -0
  311. data/lib/peal/models/effect_http_api_error_bad_request_encoded.rb +201 -0
  312. data/lib/peal/models/engagement_day.rb +364 -0
  313. data/lib/peal/models/failure_reason.rb +50 -0
  314. data/lib/peal/models/forbidden_encoded.rb +201 -0
  315. data/lib/peal/models/invalid_date_range_encoded.rb +201 -0
  316. data/lib/peal/models/invalid_time_range_encoded.rb +201 -0
  317. data/lib/peal/models/invalid_time_zone_encoded.rb +227 -0
  318. data/lib/peal/models/invitation.rb +307 -0
  319. data/lib/peal/models/invitation_not_found_encoded.rb +201 -0
  320. data/lib/peal/models/invitations_create409_response.rb +103 -0
  321. data/lib/peal/models/invitations_revoke404_response.rb +103 -0
  322. data/lib/peal/models/mark_notices_read.rb +197 -0
  323. data/lib/peal/models/me.rb +217 -0
  324. data/lib/peal/models/me_user.rb +317 -0
  325. data/lib/peal/models/media.rb +457 -0
  326. data/lib/peal/models/media_attachment.rb +212 -0
  327. data/lib/peal/models/media_content_type.rb +44 -0
  328. data/lib/peal/models/media_create422_response.rb +104 -0
  329. data/lib/peal/models/media_description.rb +163 -0
  330. data/lib/peal/models/media_dimensions.rb +239 -0
  331. data/lib/peal/models/media_get404_response.rb +103 -0
  332. data/lib/peal/models/media_in_use_encoded.rb +229 -0
  333. data/lib/peal/models/media_kind.rb +40 -0
  334. data/lib/peal/models/media_not_found_encoded.rb +201 -0
  335. data/lib/peal/models/media_page.rb +191 -0
  336. data/lib/peal/models/media_status.rb +105 -0
  337. data/lib/peal/models/media_status_any_of.rb +201 -0
  338. data/lib/peal/models/media_status_any_of1.rb +227 -0
  339. data/lib/peal/models/media_status_any_of2.rb +201 -0
  340. data/lib/peal/models/media_status_any_of3.rb +227 -0
  341. data/lib/peal/models/media_store_unavailable_encoded.rb +201 -0
  342. data/lib/peal/models/media_too_large_encoded.rb +317 -0
  343. data/lib/peal/models/media_usage.rb +207 -0
  344. data/lib/peal/models/membership.rb +295 -0
  345. data/lib/peal/models/metric_totals.rb +399 -0
  346. data/lib/peal/models/metrics_snapshot.rb +203 -0
  347. data/lib/peal/models/new_api_key.rb +277 -0
  348. data/lib/peal/models/new_invitation.rb +245 -0
  349. data/lib/peal/models/new_upload.rb +231 -0
  350. data/lib/peal/models/non_finite_number.rb +41 -0
  351. data/lib/peal/models/notice.rb +267 -0
  352. data/lib/peal/models/notice_channel.rb +225 -0
  353. data/lib/peal/models/notice_event.rb +106 -0
  354. data/lib/peal/models/notice_event_any_of.rb +251 -0
  355. data/lib/peal/models/notice_event_any_of1.rb +265 -0
  356. data/lib/peal/models/notice_event_any_of2.rb +239 -0
  357. data/lib/peal/models/notice_event_any_of3.rb +227 -0
  358. data/lib/peal/models/notice_event_any_of4.rb +253 -0
  359. data/lib/peal/models/notice_page.rb +191 -0
  360. data/lib/peal/models/notification_preferences.rb +203 -0
  361. data/lib/peal/models/notification_preferences_change.rb +169 -0
  362. data/lib/peal/models/notification_preferences_change_email.rb +187 -0
  363. data/lib/peal/models/notification_preferences_email.rb +255 -0
  364. data/lib/peal/models/paid_plan.rb +40 -0
  365. data/lib/peal/models/period_usage.rb +221 -0
  366. data/lib/peal/models/plan.rb +41 -0
  367. data/lib/peal/models/plan_allowances.rb +295 -0
  368. data/lib/peal/models/plan_limit.rb +42 -0
  369. data/lib/peal/models/plan_limit_reached_encoded.rb +271 -0
  370. data/lib/peal/models/plan_offer.rb +225 -0
  371. data/lib/peal/models/platform.rb +48 -0
  372. data/lib/peal/models/platform_unreachable_encoded.rb +201 -0
  373. data/lib/peal/models/post.rb +315 -0
  374. data/lib/peal/models/post_analytics.rb +205 -0
  375. data/lib/peal/models/post_content.rb +251 -0
  376. data/lib/peal/models/post_content_invalid_encoded.rb +229 -0
  377. data/lib/peal/models/post_draft.rb +216 -0
  378. data/lib/peal/models/post_metrics.rb +355 -0
  379. data/lib/peal/models/post_not_found_encoded.rb +201 -0
  380. data/lib/peal/models/post_outcome.rb +43 -0
  381. data/lib/peal/models/post_schedule.rb +203 -0
  382. data/lib/peal/models/post_status.rb +43 -0
  383. data/lib/peal/models/post_status_conflict_encoded.rb +227 -0
  384. data/lib/peal/models/post_target.rb +364 -0
  385. data/lib/peal/models/post_target_status.rb +44 -0
  386. data/lib/peal/models/posts_create422_response.rb +104 -0
  387. data/lib/peal/models/posts_get404_response.rb +103 -0
  388. data/lib/peal/models/posts_repost409_response.rb +103 -0
  389. data/lib/peal/models/posts_schedule422_response.rb +106 -0
  390. data/lib/peal/models/prepared_upload.rb +203 -0
  391. data/lib/peal/models/probe_state.rb +44 -0
  392. data/lib/peal/models/publication_attempt.rb +377 -0
  393. data/lib/peal/models/rejection_reason.rb +40 -0
  394. data/lib/peal/models/role.rb +43 -0
  395. data/lib/peal/models/schedule_in_past_encoded.rb +201 -0
  396. data/lib/peal/models/schedule_post.rb +240 -0
  397. data/lib/peal/models/signed_request.rb +255 -0
  398. data/lib/peal/models/subscription_status.rb +46 -0
  399. data/lib/peal/models/suggestion.rb +103 -0
  400. data/lib/peal/models/suggestion_any_of.rb +227 -0
  401. data/lib/peal/models/suggestion_any_of1.rb +229 -0
  402. data/lib/peal/models/suggestion_request.rb +212 -0
  403. data/lib/peal/models/target_confirmation.rb +103 -0
  404. data/lib/peal/models/target_confirmation_any_of.rb +228 -0
  405. data/lib/peal/models/target_confirmation_any_of1.rb +201 -0
  406. data/lib/peal/models/target_metrics.rb +319 -0
  407. data/lib/peal/models/target_options.rb +104 -0
  408. data/lib/peal/models/target_status_conflict_encoded.rb +227 -0
  409. data/lib/peal/models/text_override.rb +221 -0
  410. data/lib/peal/models/text_unit.rb +44 -0
  411. data/lib/peal/models/tik_tok_account.rb +203 -0
  412. data/lib/peal/models/tik_tok_account_posting.rb +103 -0
  413. data/lib/peal/models/tik_tok_account_posting_any_of.rb +227 -0
  414. data/lib/peal/models/tik_tok_account_posting_any_of1.rb +227 -0
  415. data/lib/peal/models/tik_tok_block.rb +41 -0
  416. data/lib/peal/models/tik_tok_creator.rb +357 -0
  417. data/lib/peal/models/tik_tok_options.rb +274 -0
  418. data/lib/peal/models/tik_tok_privacy_level.rb +42 -0
  419. data/lib/peal/models/too_many_invitations_encoded.rb +201 -0
  420. data/lib/peal/models/top_post.rb +337 -0
  421. data/lib/peal/models/translation_language.rb +48 -0
  422. data/lib/peal/models/unauthenticated_encoded.rb +201 -0
  423. data/lib/peal/models/unconfirmed_reason.rb +42 -0
  424. data/lib/peal/models/unknown_channels_encoded.rb +229 -0
  425. data/lib/peal/models/unknown_media_encoded.rb +229 -0
  426. data/lib/peal/models/unread_notices.rb +195 -0
  427. data/lib/peal/models/unsupported_media_type_encoded.rb +227 -0
  428. data/lib/peal/models/upload_incomplete_encoded.rb +201 -0
  429. data/lib/peal/models/upload_part.rb +265 -0
  430. data/lib/peal/models/upload_rejected_encoded.rb +227 -0
  431. data/lib/peal/models/upload_target.rb +103 -0
  432. data/lib/peal/models/upload_target_any_of.rb +253 -0
  433. data/lib/peal/models/upload_target_any_of1.rb +299 -0
  434. data/lib/peal/models/usage.rb +291 -0
  435. data/lib/peal/models/workspace_member.rb +281 -0
  436. data/lib/peal/models/workspace_not_found_encoded.rb +201 -0
  437. data/lib/peal/models/you_tube_options.rb +324 -0
  438. data/lib/peal/models/you_tube_privacy.rb +41 -0
  439. data/lib/peal/version.rb +15 -0
  440. data/lib/peal.rb +254 -0
  441. data/peal.gemspec +41 -0
  442. data/project.json +17 -0
  443. metadata +549 -0
@@ -0,0 +1,993 @@
1
+ =begin
2
+ #Peal API
3
+
4
+ #Schedule posts across social platforms, follow how they did, and manage a Peal workspace's channels, media and members.
5
+
6
+ The version of the OpenAPI document: 0.0.1
7
+ Contact: hello@peal.social
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.27.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Peal
16
+ class PostsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List a post's attempts
23
+ # Lists every attempt Peal made at publishing the post, by channel, round and attempt, with how each ended. An attempt still in progress is not listed yet. Needs post:read.
24
+ # @param workspace_id [String]
25
+ # @param post_id [String]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Array<PublicationAttempt>]
28
+ def posts_attempts(workspace_id, post_id, opts = {})
29
+ data, _status_code, _headers = posts_attempts_with_http_info(workspace_id, post_id, opts)
30
+ data
31
+ end
32
+
33
+ # List a post&#39;s attempts
34
+ # Lists every attempt Peal made at publishing the post, by channel, round and attempt, with how each ended. An attempt still in progress is not listed yet. Needs post:read.
35
+ # @param workspace_id [String]
36
+ # @param post_id [String]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(Array<PublicationAttempt>, Integer, Hash)>] Array<PublicationAttempt> data, response status code and response headers
39
+ def posts_attempts_with_http_info(workspace_id, post_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_attempts ...'
42
+ end
43
+ # verify the required parameter 'workspace_id' is set
44
+ if @api_client.config.client_side_validation && workspace_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_attempts"
46
+ end
47
+ # verify the required parameter 'post_id' is set
48
+ if @api_client.config.client_side_validation && post_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_attempts"
50
+ end
51
+ # resource path
52
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}/attempts'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'Array<PublicationAttempt>'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || ['bearer']
73
+
74
+ new_options = opts.merge(
75
+ :operation => :"PostsApi.posts_attempts",
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type
82
+ )
83
+
84
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: PostsApi#posts_attempts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
91
+ # Cancel a post
92
+ # Cancels a draft or a scheduled post. A post already publishing finishes with what its channels did: those not yet sent are cancelled. Needs post:schedule.
93
+ # @param workspace_id [String]
94
+ # @param post_id [String]
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [Post]
97
+ def posts_cancel(workspace_id, post_id, opts = {})
98
+ data, _status_code, _headers = posts_cancel_with_http_info(workspace_id, post_id, opts)
99
+ data
100
+ end
101
+
102
+ # Cancel a post
103
+ # Cancels a draft or a scheduled post. A post already publishing finishes with what its channels did: those not yet sent are cancelled. Needs post:schedule.
104
+ # @param workspace_id [String]
105
+ # @param post_id [String]
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
108
+ def posts_cancel_with_http_info(workspace_id, post_id, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_cancel ...'
111
+ end
112
+ # verify the required parameter 'workspace_id' is set
113
+ if @api_client.config.client_side_validation && workspace_id.nil?
114
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_cancel"
115
+ end
116
+ # verify the required parameter 'post_id' is set
117
+ if @api_client.config.client_side_validation && post_id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_cancel"
119
+ end
120
+ # resource path
121
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}/cancel'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
122
+
123
+ # query parameters
124
+ query_params = opts[:query_params] || {}
125
+
126
+ # header parameters
127
+ header_params = opts[:header_params] || {}
128
+ # HTTP header 'Accept' (if needed)
129
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
130
+
131
+ # form parameters
132
+ form_params = opts[:form_params] || {}
133
+
134
+ # http body (model)
135
+ post_body = opts[:debug_body]
136
+
137
+ # return_type
138
+ return_type = opts[:debug_return_type] || 'Post'
139
+
140
+ # auth_names
141
+ auth_names = opts[:debug_auth_names] || ['bearer']
142
+
143
+ new_options = opts.merge(
144
+ :operation => :"PostsApi.posts_cancel",
145
+ :header_params => header_params,
146
+ :query_params => query_params,
147
+ :form_params => form_params,
148
+ :body => post_body,
149
+ :auth_names => auth_names,
150
+ :return_type => return_type
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: PostsApi#posts_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
160
+ # Confirm a post on a channel
161
+ # Says what you found on the platform for a post unconfirmed on one channel: `published`, with its address if you have it, or `notPublished`, which fails it there so it can be reposted. Its notifications are marked read. Needs post:schedule.
162
+ # @param workspace_id [String]
163
+ # @param post_id [String]
164
+ # @param target_id [String]
165
+ # @param target_confirmation [TargetConfirmation]
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Post]
168
+ def posts_confirm(workspace_id, post_id, target_id, target_confirmation, opts = {})
169
+ data, _status_code, _headers = posts_confirm_with_http_info(workspace_id, post_id, target_id, target_confirmation, opts)
170
+ data
171
+ end
172
+
173
+ # Confirm a post on a channel
174
+ # Says what you found on the platform for a post unconfirmed on one channel: &#x60;published&#x60;, with its address if you have it, or &#x60;notPublished&#x60;, which fails it there so it can be reposted. Its notifications are marked read. Needs post:schedule.
175
+ # @param workspace_id [String]
176
+ # @param post_id [String]
177
+ # @param target_id [String]
178
+ # @param target_confirmation [TargetConfirmation]
179
+ # @param [Hash] opts the optional parameters
180
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
181
+ def posts_confirm_with_http_info(workspace_id, post_id, target_id, target_confirmation, opts = {})
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_confirm ...'
184
+ end
185
+ # verify the required parameter 'workspace_id' is set
186
+ if @api_client.config.client_side_validation && workspace_id.nil?
187
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_confirm"
188
+ end
189
+ # verify the required parameter 'post_id' is set
190
+ if @api_client.config.client_side_validation && post_id.nil?
191
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_confirm"
192
+ end
193
+ # verify the required parameter 'target_id' is set
194
+ if @api_client.config.client_side_validation && target_id.nil?
195
+ fail ArgumentError, "Missing the required parameter 'target_id' when calling PostsApi.posts_confirm"
196
+ end
197
+ # verify the required parameter 'target_confirmation' is set
198
+ if @api_client.config.client_side_validation && target_confirmation.nil?
199
+ fail ArgumentError, "Missing the required parameter 'target_confirmation' when calling PostsApi.posts_confirm"
200
+ end
201
+ # resource path
202
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}/targets/{targetId}/confirm'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s)).sub('{targetId}', CGI.escape(target_id.to_s))
203
+
204
+ # query parameters
205
+ query_params = opts[:query_params] || {}
206
+
207
+ # header parameters
208
+ header_params = opts[:header_params] || {}
209
+ # HTTP header 'Accept' (if needed)
210
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
211
+ # HTTP header 'Content-Type'
212
+ content_type = @api_client.select_header_content_type(['application/json'])
213
+ if !content_type.nil?
214
+ header_params['Content-Type'] = content_type
215
+ end
216
+
217
+ # form parameters
218
+ form_params = opts[:form_params] || {}
219
+
220
+ # http body (model)
221
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(target_confirmation)
222
+
223
+ # return_type
224
+ return_type = opts[:debug_return_type] || 'Post'
225
+
226
+ # auth_names
227
+ auth_names = opts[:debug_auth_names] || ['bearer']
228
+
229
+ new_options = opts.merge(
230
+ :operation => :"PostsApi.posts_confirm",
231
+ :header_params => header_params,
232
+ :query_params => query_params,
233
+ :form_params => form_params,
234
+ :body => post_body,
235
+ :auth_names => auth_names,
236
+ :return_type => return_type
237
+ )
238
+
239
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug "API called: PostsApi#posts_confirm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
242
+ end
243
+ return data, status_code, headers
244
+ end
245
+
246
+ # Create a draft
247
+ # Creates a draft for some of the workspace's channels, possibly none yet, with options on those whose platform takes them (`TargetOptions`, of the channel's platform). Its media must be the workspace's, and ready. Its text, media and options are checked against each platform's rules when it is scheduled, not before. Needs post:create, channel:read, and media:read when it shows media.
248
+ # @param workspace_id [String]
249
+ # @param post_draft [PostDraft]
250
+ # @param [Hash] opts the optional parameters
251
+ # @return [Post]
252
+ def posts_create(workspace_id, post_draft, opts = {})
253
+ data, _status_code, _headers = posts_create_with_http_info(workspace_id, post_draft, opts)
254
+ data
255
+ end
256
+
257
+ # Create a draft
258
+ # Creates a draft for some of the workspace&#39;s channels, possibly none yet, with options on those whose platform takes them (&#x60;TargetOptions&#x60;, of the channel&#39;s platform). Its media must be the workspace&#39;s, and ready. Its text, media and options are checked against each platform&#39;s rules when it is scheduled, not before. Needs post:create, channel:read, and media:read when it shows media.
259
+ # @param workspace_id [String]
260
+ # @param post_draft [PostDraft]
261
+ # @param [Hash] opts the optional parameters
262
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
263
+ def posts_create_with_http_info(workspace_id, post_draft, opts = {})
264
+ if @api_client.config.debugging
265
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_create ...'
266
+ end
267
+ # verify the required parameter 'workspace_id' is set
268
+ if @api_client.config.client_side_validation && workspace_id.nil?
269
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_create"
270
+ end
271
+ # verify the required parameter 'post_draft' is set
272
+ if @api_client.config.client_side_validation && post_draft.nil?
273
+ fail ArgumentError, "Missing the required parameter 'post_draft' when calling PostsApi.posts_create"
274
+ end
275
+ # resource path
276
+ local_var_path = '/api/workspaces/{workspaceId}/posts'.sub('{workspaceId}', CGI.escape(workspace_id.to_s))
277
+
278
+ # query parameters
279
+ query_params = opts[:query_params] || {}
280
+
281
+ # header parameters
282
+ header_params = opts[:header_params] || {}
283
+ # HTTP header 'Accept' (if needed)
284
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
285
+ # HTTP header 'Content-Type'
286
+ content_type = @api_client.select_header_content_type(['application/json'])
287
+ if !content_type.nil?
288
+ header_params['Content-Type'] = content_type
289
+ end
290
+
291
+ # form parameters
292
+ form_params = opts[:form_params] || {}
293
+
294
+ # http body (model)
295
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_draft)
296
+
297
+ # return_type
298
+ return_type = opts[:debug_return_type] || 'Post'
299
+
300
+ # auth_names
301
+ auth_names = opts[:debug_auth_names] || ['bearer']
302
+
303
+ new_options = opts.merge(
304
+ :operation => :"PostsApi.posts_create",
305
+ :header_params => header_params,
306
+ :query_params => query_params,
307
+ :form_params => form_params,
308
+ :body => post_body,
309
+ :auth_names => auth_names,
310
+ :return_type => return_type
311
+ )
312
+
313
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
314
+ if @api_client.config.debugging
315
+ @api_client.config.logger.debug "API called: PostsApi#posts_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
316
+ end
317
+ return data, status_code, headers
318
+ end
319
+
320
+ # Discard a draft
321
+ # Deletes a draft. A post scheduled or sent is a conflict: cancel it instead. Needs post:delete, or post:update for the user who created the draft.
322
+ # @param workspace_id [String]
323
+ # @param post_id [String]
324
+ # @param [Hash] opts the optional parameters
325
+ # @return [nil]
326
+ def posts_discard(workspace_id, post_id, opts = {})
327
+ posts_discard_with_http_info(workspace_id, post_id, opts)
328
+ nil
329
+ end
330
+
331
+ # Discard a draft
332
+ # Deletes a draft. A post scheduled or sent is a conflict: cancel it instead. Needs post:delete, or post:update for the user who created the draft.
333
+ # @param workspace_id [String]
334
+ # @param post_id [String]
335
+ # @param [Hash] opts the optional parameters
336
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
337
+ def posts_discard_with_http_info(workspace_id, post_id, opts = {})
338
+ if @api_client.config.debugging
339
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_discard ...'
340
+ end
341
+ # verify the required parameter 'workspace_id' is set
342
+ if @api_client.config.client_side_validation && workspace_id.nil?
343
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_discard"
344
+ end
345
+ # verify the required parameter 'post_id' is set
346
+ if @api_client.config.client_side_validation && post_id.nil?
347
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_discard"
348
+ end
349
+ # resource path
350
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
351
+
352
+ # query parameters
353
+ query_params = opts[:query_params] || {}
354
+
355
+ # header parameters
356
+ header_params = opts[:header_params] || {}
357
+ # HTTP header 'Accept' (if needed)
358
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
359
+
360
+ # form parameters
361
+ form_params = opts[:form_params] || {}
362
+
363
+ # http body (model)
364
+ post_body = opts[:debug_body]
365
+
366
+ # return_type
367
+ return_type = opts[:debug_return_type]
368
+
369
+ # auth_names
370
+ auth_names = opts[:debug_auth_names] || ['bearer']
371
+
372
+ new_options = opts.merge(
373
+ :operation => :"PostsApi.posts_discard",
374
+ :header_params => header_params,
375
+ :query_params => query_params,
376
+ :form_params => form_params,
377
+ :body => post_body,
378
+ :auth_names => auth_names,
379
+ :return_type => return_type
380
+ )
381
+
382
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
383
+ if @api_client.config.debugging
384
+ @api_client.config.logger.debug "API called: PostsApi#posts_discard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
385
+ end
386
+ return data, status_code, headers
387
+ end
388
+
389
+ # List drafts
390
+ # Lists the workspace's drafts, newest first, 20 a page unless `limit` (at most 50) says otherwise. Pass the page's `nextCursor` as `cursor` for the next one. Needs post:read.
391
+ # @param workspace_id [String]
392
+ # @param [Hash] opts the optional parameters
393
+ # @option opts [String] :cursor
394
+ # @option opts [String] :limit
395
+ # @return [DraftPage]
396
+ def posts_drafts(workspace_id, opts = {})
397
+ data, _status_code, _headers = posts_drafts_with_http_info(workspace_id, opts)
398
+ data
399
+ end
400
+
401
+ # List drafts
402
+ # Lists the workspace&#39;s drafts, newest first, 20 a page unless &#x60;limit&#x60; (at most 50) says otherwise. Pass the page&#39;s &#x60;nextCursor&#x60; as &#x60;cursor&#x60; for the next one. Needs post:read.
403
+ # @param workspace_id [String]
404
+ # @param [Hash] opts the optional parameters
405
+ # @option opts [String] :cursor
406
+ # @option opts [String] :limit
407
+ # @return [Array<(DraftPage, Integer, Hash)>] DraftPage data, response status code and response headers
408
+ def posts_drafts_with_http_info(workspace_id, opts = {})
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_drafts ...'
411
+ end
412
+ # verify the required parameter 'workspace_id' is set
413
+ if @api_client.config.client_side_validation && workspace_id.nil?
414
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_drafts"
415
+ end
416
+ pattern = Regexp.new(/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[Ee][+-]?\d+)?$/)
417
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] !~ pattern
418
+ fail ArgumentError, "invalid value for 'opts[:\"limit\"]' when calling PostsApi.posts_drafts, must conform to the pattern #{pattern}."
419
+ end
420
+
421
+ # resource path
422
+ local_var_path = '/api/workspaces/{workspaceId}/posts/drafts'.sub('{workspaceId}', CGI.escape(workspace_id.to_s))
423
+
424
+ # query parameters
425
+ query_params = opts[:query_params] || {}
426
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
427
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
428
+
429
+ # header parameters
430
+ header_params = opts[:header_params] || {}
431
+ # HTTP header 'Accept' (if needed)
432
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
433
+
434
+ # form parameters
435
+ form_params = opts[:form_params] || {}
436
+
437
+ # http body (model)
438
+ post_body = opts[:debug_body]
439
+
440
+ # return_type
441
+ return_type = opts[:debug_return_type] || 'DraftPage'
442
+
443
+ # auth_names
444
+ auth_names = opts[:debug_auth_names] || ['bearer']
445
+
446
+ new_options = opts.merge(
447
+ :operation => :"PostsApi.posts_drafts",
448
+ :header_params => header_params,
449
+ :query_params => query_params,
450
+ :form_params => form_params,
451
+ :body => post_body,
452
+ :auth_names => auth_names,
453
+ :return_type => return_type
454
+ )
455
+
456
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
457
+ if @api_client.config.debugging
458
+ @api_client.config.logger.debug "API called: PostsApi#posts_drafts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
459
+ end
460
+ return data, status_code, headers
461
+ end
462
+
463
+ # Get a post
464
+ # Answers with a post of the workspace. Needs post:read.
465
+ # @param workspace_id [String]
466
+ # @param post_id [String]
467
+ # @param [Hash] opts the optional parameters
468
+ # @return [Post]
469
+ def posts_get(workspace_id, post_id, opts = {})
470
+ data, _status_code, _headers = posts_get_with_http_info(workspace_id, post_id, opts)
471
+ data
472
+ end
473
+
474
+ # Get a post
475
+ # Answers with a post of the workspace. Needs post:read.
476
+ # @param workspace_id [String]
477
+ # @param post_id [String]
478
+ # @param [Hash] opts the optional parameters
479
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
480
+ def posts_get_with_http_info(workspace_id, post_id, opts = {})
481
+ if @api_client.config.debugging
482
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_get ...'
483
+ end
484
+ # verify the required parameter 'workspace_id' is set
485
+ if @api_client.config.client_side_validation && workspace_id.nil?
486
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_get"
487
+ end
488
+ # verify the required parameter 'post_id' is set
489
+ if @api_client.config.client_side_validation && post_id.nil?
490
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_get"
491
+ end
492
+ # resource path
493
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
494
+
495
+ # query parameters
496
+ query_params = opts[:query_params] || {}
497
+
498
+ # header parameters
499
+ header_params = opts[:header_params] || {}
500
+ # HTTP header 'Accept' (if needed)
501
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
502
+
503
+ # form parameters
504
+ form_params = opts[:form_params] || {}
505
+
506
+ # http body (model)
507
+ post_body = opts[:debug_body]
508
+
509
+ # return_type
510
+ return_type = opts[:debug_return_type] || 'Post'
511
+
512
+ # auth_names
513
+ auth_names = opts[:debug_auth_names] || ['bearer']
514
+
515
+ new_options = opts.merge(
516
+ :operation => :"PostsApi.posts_get",
517
+ :header_params => header_params,
518
+ :query_params => query_params,
519
+ :form_params => form_params,
520
+ :body => post_body,
521
+ :auth_names => auth_names,
522
+ :return_type => return_type
523
+ )
524
+
525
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
526
+ if @api_client.config.debugging
527
+ @api_client.config.logger.debug "API called: PostsApi#posts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
528
+ end
529
+ return data, status_code, headers
530
+ end
531
+
532
+ # List scheduled posts
533
+ # Lists the posts scheduled from `from` (included) to `to` (excluded), at most 62 days apart, by scheduled instant, with their channels and how each went. Drafts have no time and are not listed; cancelled posts are, with the time they had. Needs post:read.
534
+ # @param workspace_id [String]
535
+ # @param from [String]
536
+ # @param to [String]
537
+ # @param [Hash] opts the optional parameters
538
+ # @return [Array<Post>]
539
+ def posts_list(workspace_id, from, to, opts = {})
540
+ data, _status_code, _headers = posts_list_with_http_info(workspace_id, from, to, opts)
541
+ data
542
+ end
543
+
544
+ # List scheduled posts
545
+ # Lists the posts scheduled from &#x60;from&#x60; (included) to &#x60;to&#x60; (excluded), at most 62 days apart, by scheduled instant, with their channels and how each went. Drafts have no time and are not listed; cancelled posts are, with the time they had. Needs post:read.
546
+ # @param workspace_id [String]
547
+ # @param from [String]
548
+ # @param to [String]
549
+ # @param [Hash] opts the optional parameters
550
+ # @return [Array<(Array<Post>, Integer, Hash)>] Array<Post> data, response status code and response headers
551
+ def posts_list_with_http_info(workspace_id, from, to, opts = {})
552
+ if @api_client.config.debugging
553
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_list ...'
554
+ end
555
+ # verify the required parameter 'workspace_id' is set
556
+ if @api_client.config.client_side_validation && workspace_id.nil?
557
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_list"
558
+ end
559
+ # verify the required parameter 'from' is set
560
+ if @api_client.config.client_side_validation && from.nil?
561
+ fail ArgumentError, "Missing the required parameter 'from' when calling PostsApi.posts_list"
562
+ end
563
+ # verify the required parameter 'to' is set
564
+ if @api_client.config.client_side_validation && to.nil?
565
+ fail ArgumentError, "Missing the required parameter 'to' when calling PostsApi.posts_list"
566
+ end
567
+ # resource path
568
+ local_var_path = '/api/workspaces/{workspaceId}/posts'.sub('{workspaceId}', CGI.escape(workspace_id.to_s))
569
+
570
+ # query parameters
571
+ query_params = opts[:query_params] || {}
572
+ query_params[:'from'] = from
573
+ query_params[:'to'] = to
574
+
575
+ # header parameters
576
+ header_params = opts[:header_params] || {}
577
+ # HTTP header 'Accept' (if needed)
578
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
579
+
580
+ # form parameters
581
+ form_params = opts[:form_params] || {}
582
+
583
+ # http body (model)
584
+ post_body = opts[:debug_body]
585
+
586
+ # return_type
587
+ return_type = opts[:debug_return_type] || 'Array<Post>'
588
+
589
+ # auth_names
590
+ auth_names = opts[:debug_auth_names] || ['bearer']
591
+
592
+ new_options = opts.merge(
593
+ :operation => :"PostsApi.posts_list",
594
+ :header_params => header_params,
595
+ :query_params => query_params,
596
+ :form_params => form_params,
597
+ :body => post_body,
598
+ :auth_names => auth_names,
599
+ :return_type => return_type
600
+ )
601
+
602
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
603
+ if @api_client.config.debugging
604
+ @api_client.config.logger.debug "API called: PostsApi#posts_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
605
+ end
606
+ return data, status_code, headers
607
+ end
608
+
609
+ # Repost on a channel
610
+ # Sends the post again, now, on one channel where it failed or is unconfirmed: a new round, with its own attempts. Check the platform first when it is unconfirmed, as it may be live already. Needs post:schedule.
611
+ # @param workspace_id [String]
612
+ # @param post_id [String]
613
+ # @param target_id [String]
614
+ # @param [Hash] opts the optional parameters
615
+ # @return [Post]
616
+ def posts_repost(workspace_id, post_id, target_id, opts = {})
617
+ data, _status_code, _headers = posts_repost_with_http_info(workspace_id, post_id, target_id, opts)
618
+ data
619
+ end
620
+
621
+ # Repost on a channel
622
+ # Sends the post again, now, on one channel where it failed or is unconfirmed: a new round, with its own attempts. Check the platform first when it is unconfirmed, as it may be live already. Needs post:schedule.
623
+ # @param workspace_id [String]
624
+ # @param post_id [String]
625
+ # @param target_id [String]
626
+ # @param [Hash] opts the optional parameters
627
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
628
+ def posts_repost_with_http_info(workspace_id, post_id, target_id, opts = {})
629
+ if @api_client.config.debugging
630
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_repost ...'
631
+ end
632
+ # verify the required parameter 'workspace_id' is set
633
+ if @api_client.config.client_side_validation && workspace_id.nil?
634
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_repost"
635
+ end
636
+ # verify the required parameter 'post_id' is set
637
+ if @api_client.config.client_side_validation && post_id.nil?
638
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_repost"
639
+ end
640
+ # verify the required parameter 'target_id' is set
641
+ if @api_client.config.client_side_validation && target_id.nil?
642
+ fail ArgumentError, "Missing the required parameter 'target_id' when calling PostsApi.posts_repost"
643
+ end
644
+ # resource path
645
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}/targets/{targetId}/repost'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s)).sub('{targetId}', CGI.escape(target_id.to_s))
646
+
647
+ # query parameters
648
+ query_params = opts[:query_params] || {}
649
+
650
+ # header parameters
651
+ header_params = opts[:header_params] || {}
652
+ # HTTP header 'Accept' (if needed)
653
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
654
+
655
+ # form parameters
656
+ form_params = opts[:form_params] || {}
657
+
658
+ # http body (model)
659
+ post_body = opts[:debug_body]
660
+
661
+ # return_type
662
+ return_type = opts[:debug_return_type] || 'Post'
663
+
664
+ # auth_names
665
+ auth_names = opts[:debug_auth_names] || ['bearer']
666
+
667
+ new_options = opts.merge(
668
+ :operation => :"PostsApi.posts_repost",
669
+ :header_params => header_params,
670
+ :query_params => query_params,
671
+ :form_params => form_params,
672
+ :body => post_body,
673
+ :auth_names => auth_names,
674
+ :return_type => return_type
675
+ )
676
+
677
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
678
+ if @api_client.config.debugging
679
+ @api_client.config.logger.debug "API called: PostsApi#posts_repost\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
680
+ end
681
+ return data, status_code, headers
682
+ end
683
+
684
+ # Reschedule a post
685
+ # Moves a scheduled post to another instant, or schedules a draft on the channels it has. Moved to another month, or scheduled, it must fit that month's posts in the workspace's plan (PlanLimitReached). Needs post:schedule, and channel:read for a draft.
686
+ # @param workspace_id [String]
687
+ # @param post_id [String]
688
+ # @param post_schedule [PostSchedule]
689
+ # @param [Hash] opts the optional parameters
690
+ # @return [Post]
691
+ def posts_reschedule(workspace_id, post_id, post_schedule, opts = {})
692
+ data, _status_code, _headers = posts_reschedule_with_http_info(workspace_id, post_id, post_schedule, opts)
693
+ data
694
+ end
695
+
696
+ # Reschedule a post
697
+ # Moves a scheduled post to another instant, or schedules a draft on the channels it has. Moved to another month, or scheduled, it must fit that month&#39;s posts in the workspace&#39;s plan (PlanLimitReached). Needs post:schedule, and channel:read for a draft.
698
+ # @param workspace_id [String]
699
+ # @param post_id [String]
700
+ # @param post_schedule [PostSchedule]
701
+ # @param [Hash] opts the optional parameters
702
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
703
+ def posts_reschedule_with_http_info(workspace_id, post_id, post_schedule, opts = {})
704
+ if @api_client.config.debugging
705
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_reschedule ...'
706
+ end
707
+ # verify the required parameter 'workspace_id' is set
708
+ if @api_client.config.client_side_validation && workspace_id.nil?
709
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_reschedule"
710
+ end
711
+ # verify the required parameter 'post_id' is set
712
+ if @api_client.config.client_side_validation && post_id.nil?
713
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_reschedule"
714
+ end
715
+ # verify the required parameter 'post_schedule' is set
716
+ if @api_client.config.client_side_validation && post_schedule.nil?
717
+ fail ArgumentError, "Missing the required parameter 'post_schedule' when calling PostsApi.posts_reschedule"
718
+ end
719
+ # resource path
720
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}/reschedule'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
721
+
722
+ # query parameters
723
+ query_params = opts[:query_params] || {}
724
+
725
+ # header parameters
726
+ header_params = opts[:header_params] || {}
727
+ # HTTP header 'Accept' (if needed)
728
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
729
+ # HTTP header 'Content-Type'
730
+ content_type = @api_client.select_header_content_type(['application/json'])
731
+ if !content_type.nil?
732
+ header_params['Content-Type'] = content_type
733
+ end
734
+
735
+ # form parameters
736
+ form_params = opts[:form_params] || {}
737
+
738
+ # http body (model)
739
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_schedule)
740
+
741
+ # return_type
742
+ return_type = opts[:debug_return_type] || 'Post'
743
+
744
+ # auth_names
745
+ auth_names = opts[:debug_auth_names] || ['bearer']
746
+
747
+ new_options = opts.merge(
748
+ :operation => :"PostsApi.posts_reschedule",
749
+ :header_params => header_params,
750
+ :query_params => query_params,
751
+ :form_params => form_params,
752
+ :body => post_body,
753
+ :auth_names => auth_names,
754
+ :return_type => return_type
755
+ )
756
+
757
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug "API called: PostsApi#posts_reschedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
760
+ end
761
+ return data, status_code, headers
762
+ end
763
+
764
+ # Schedule a draft
765
+ # Schedules a draft on some of the workspace's channels at an instant, kept with the IANA time zone it was chosen in. The content must fit each platform's rules, its media included: file types, sizes, durations, dimensions, alt text, how many videos, and whether images and videos go together. A channel whose platform takes options needs those it requires, as the draft gives them on that channel: a channel the draft was not for has none yet. A time up to a minute ago publishes now. On a server that bills, the posts going out in that month (UTC) must fit the workspace's plan (PlanLimitReached). Needs post:schedule and channel:read, and media:read when it shows media.
766
+ # @param workspace_id [String]
767
+ # @param post_id [String]
768
+ # @param schedule_post [SchedulePost]
769
+ # @param [Hash] opts the optional parameters
770
+ # @return [Post]
771
+ def posts_schedule(workspace_id, post_id, schedule_post, opts = {})
772
+ data, _status_code, _headers = posts_schedule_with_http_info(workspace_id, post_id, schedule_post, opts)
773
+ data
774
+ end
775
+
776
+ # Schedule a draft
777
+ # Schedules a draft on some of the workspace&#39;s channels at an instant, kept with the IANA time zone it was chosen in. The content must fit each platform&#39;s rules, its media included: file types, sizes, durations, dimensions, alt text, how many videos, and whether images and videos go together. A channel whose platform takes options needs those it requires, as the draft gives them on that channel: a channel the draft was not for has none yet. A time up to a minute ago publishes now. On a server that bills, the posts going out in that month (UTC) must fit the workspace&#39;s plan (PlanLimitReached). Needs post:schedule and channel:read, and media:read when it shows media.
778
+ # @param workspace_id [String]
779
+ # @param post_id [String]
780
+ # @param schedule_post [SchedulePost]
781
+ # @param [Hash] opts the optional parameters
782
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
783
+ def posts_schedule_with_http_info(workspace_id, post_id, schedule_post, opts = {})
784
+ if @api_client.config.debugging
785
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_schedule ...'
786
+ end
787
+ # verify the required parameter 'workspace_id' is set
788
+ if @api_client.config.client_side_validation && workspace_id.nil?
789
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_schedule"
790
+ end
791
+ # verify the required parameter 'post_id' is set
792
+ if @api_client.config.client_side_validation && post_id.nil?
793
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_schedule"
794
+ end
795
+ # verify the required parameter 'schedule_post' is set
796
+ if @api_client.config.client_side_validation && schedule_post.nil?
797
+ fail ArgumentError, "Missing the required parameter 'schedule_post' when calling PostsApi.posts_schedule"
798
+ end
799
+ # resource path
800
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}/schedule'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
801
+
802
+ # query parameters
803
+ query_params = opts[:query_params] || {}
804
+
805
+ # header parameters
806
+ header_params = opts[:header_params] || {}
807
+ # HTTP header 'Accept' (if needed)
808
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
809
+ # HTTP header 'Content-Type'
810
+ content_type = @api_client.select_header_content_type(['application/json'])
811
+ if !content_type.nil?
812
+ header_params['Content-Type'] = content_type
813
+ end
814
+
815
+ # form parameters
816
+ form_params = opts[:form_params] || {}
817
+
818
+ # http body (model)
819
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(schedule_post)
820
+
821
+ # return_type
822
+ return_type = opts[:debug_return_type] || 'Post'
823
+
824
+ # auth_names
825
+ auth_names = opts[:debug_auth_names] || ['bearer']
826
+
827
+ new_options = opts.merge(
828
+ :operation => :"PostsApi.posts_schedule",
829
+ :header_params => header_params,
830
+ :query_params => query_params,
831
+ :form_params => form_params,
832
+ :body => post_body,
833
+ :auth_names => auth_names,
834
+ :return_type => return_type
835
+ )
836
+
837
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
838
+ if @api_client.config.debugging
839
+ @api_client.config.logger.debug "API called: PostsApi#posts_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
840
+ end
841
+ return data, status_code, headers
842
+ end
843
+
844
+ # Unschedule a post
845
+ # Takes a scheduled post back to draft, so its text and media can change: it goes out at no time until it is scheduled again. A post already publishing is a conflict. Needs post:schedule.
846
+ # @param workspace_id [String]
847
+ # @param post_id [String]
848
+ # @param [Hash] opts the optional parameters
849
+ # @return [Post]
850
+ def posts_unschedule(workspace_id, post_id, opts = {})
851
+ data, _status_code, _headers = posts_unschedule_with_http_info(workspace_id, post_id, opts)
852
+ data
853
+ end
854
+
855
+ # Unschedule a post
856
+ # Takes a scheduled post back to draft, so its text and media can change: it goes out at no time until it is scheduled again. A post already publishing is a conflict. Needs post:schedule.
857
+ # @param workspace_id [String]
858
+ # @param post_id [String]
859
+ # @param [Hash] opts the optional parameters
860
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
861
+ def posts_unschedule_with_http_info(workspace_id, post_id, opts = {})
862
+ if @api_client.config.debugging
863
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_unschedule ...'
864
+ end
865
+ # verify the required parameter 'workspace_id' is set
866
+ if @api_client.config.client_side_validation && workspace_id.nil?
867
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_unschedule"
868
+ end
869
+ # verify the required parameter 'post_id' is set
870
+ if @api_client.config.client_side_validation && post_id.nil?
871
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_unschedule"
872
+ end
873
+ # resource path
874
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}/unschedule'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
875
+
876
+ # query parameters
877
+ query_params = opts[:query_params] || {}
878
+
879
+ # header parameters
880
+ header_params = opts[:header_params] || {}
881
+ # HTTP header 'Accept' (if needed)
882
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
883
+
884
+ # form parameters
885
+ form_params = opts[:form_params] || {}
886
+
887
+ # http body (model)
888
+ post_body = opts[:debug_body]
889
+
890
+ # return_type
891
+ return_type = opts[:debug_return_type] || 'Post'
892
+
893
+ # auth_names
894
+ auth_names = opts[:debug_auth_names] || ['bearer']
895
+
896
+ new_options = opts.merge(
897
+ :operation => :"PostsApi.posts_unschedule",
898
+ :header_params => header_params,
899
+ :query_params => query_params,
900
+ :form_params => form_params,
901
+ :body => post_body,
902
+ :auth_names => auth_names,
903
+ :return_type => return_type
904
+ )
905
+
906
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
907
+ if @api_client.config.debugging
908
+ @api_client.config.logger.debug "API called: PostsApi#posts_unschedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
909
+ end
910
+ return data, status_code, headers
911
+ end
912
+
913
+ # Update a draft
914
+ # Replaces a draft's content, channels and options: options left out are removed. A post that is no longer a draft is a conflict. Needs post:update, channel:read, and media:read when it shows media.
915
+ # @param workspace_id [String]
916
+ # @param post_id [String]
917
+ # @param post_draft [PostDraft]
918
+ # @param [Hash] opts the optional parameters
919
+ # @return [Post]
920
+ def posts_update(workspace_id, post_id, post_draft, opts = {})
921
+ data, _status_code, _headers = posts_update_with_http_info(workspace_id, post_id, post_draft, opts)
922
+ data
923
+ end
924
+
925
+ # Update a draft
926
+ # Replaces a draft&#39;s content, channels and options: options left out are removed. A post that is no longer a draft is a conflict. Needs post:update, channel:read, and media:read when it shows media.
927
+ # @param workspace_id [String]
928
+ # @param post_id [String]
929
+ # @param post_draft [PostDraft]
930
+ # @param [Hash] opts the optional parameters
931
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
932
+ def posts_update_with_http_info(workspace_id, post_id, post_draft, opts = {})
933
+ if @api_client.config.debugging
934
+ @api_client.config.logger.debug 'Calling API: PostsApi.posts_update ...'
935
+ end
936
+ # verify the required parameter 'workspace_id' is set
937
+ if @api_client.config.client_side_validation && workspace_id.nil?
938
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PostsApi.posts_update"
939
+ end
940
+ # verify the required parameter 'post_id' is set
941
+ if @api_client.config.client_side_validation && post_id.nil?
942
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.posts_update"
943
+ end
944
+ # verify the required parameter 'post_draft' is set
945
+ if @api_client.config.client_side_validation && post_draft.nil?
946
+ fail ArgumentError, "Missing the required parameter 'post_draft' when calling PostsApi.posts_update"
947
+ end
948
+ # resource path
949
+ local_var_path = '/api/workspaces/{workspaceId}/posts/{postId}'.sub('{workspaceId}', CGI.escape(workspace_id.to_s)).sub('{postId}', CGI.escape(post_id.to_s))
950
+
951
+ # query parameters
952
+ query_params = opts[:query_params] || {}
953
+
954
+ # header parameters
955
+ header_params = opts[:header_params] || {}
956
+ # HTTP header 'Accept' (if needed)
957
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
958
+ # HTTP header 'Content-Type'
959
+ content_type = @api_client.select_header_content_type(['application/json'])
960
+ if !content_type.nil?
961
+ header_params['Content-Type'] = content_type
962
+ end
963
+
964
+ # form parameters
965
+ form_params = opts[:form_params] || {}
966
+
967
+ # http body (model)
968
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_draft)
969
+
970
+ # return_type
971
+ return_type = opts[:debug_return_type] || 'Post'
972
+
973
+ # auth_names
974
+ auth_names = opts[:debug_auth_names] || ['bearer']
975
+
976
+ new_options = opts.merge(
977
+ :operation => :"PostsApi.posts_update",
978
+ :header_params => header_params,
979
+ :query_params => query_params,
980
+ :form_params => form_params,
981
+ :body => post_body,
982
+ :auth_names => auth_names,
983
+ :return_type => return_type
984
+ )
985
+
986
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
987
+ if @api_client.config.debugging
988
+ @api_client.config.logger.debug "API called: PostsApi#posts_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
989
+ end
990
+ return data, status_code, headers
991
+ end
992
+ end
993
+ end