postboost 1.0.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 (206) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +0 -0
  5. data/Rakefile +10 -0
  6. data/docs/Account.md +34 -0
  7. data/docs/AccountsApi.md +149 -0
  8. data/docs/AddGenericSubscriptionRequest.md +22 -0
  9. data/docs/ChangeSubscriptionPlanRequest.md +24 -0
  10. data/docs/CheckoutSubscription200Response.md +18 -0
  11. data/docs/CheckoutSubscriptionRequest.md +22 -0
  12. data/docs/DeleteMediaBulkRequest.md +18 -0
  13. data/docs/DeleteMode.md +15 -0
  14. data/docs/DeletePostRequest.md +20 -0
  15. data/docs/DeletePostsBulkRequest.md +22 -0
  16. data/docs/DeleteReceiptsBulkRequest.md +18 -0
  17. data/docs/DeleteResult.md +22 -0
  18. data/docs/DeleteUser400Response.md +20 -0
  19. data/docs/DeleteUsersBulkRequest.md +18 -0
  20. data/docs/DeleteWorkspacesBulkRequest.md +18 -0
  21. data/docs/GetRemoteUploadStatus200Response.md +20 -0
  22. data/docs/InitiateChunkedUpload200Response.md +22 -0
  23. data/docs/InitiateChunkedUploadRequest.md +22 -0
  24. data/docs/InitiateRemoteUpload200Response.md +49 -0
  25. data/docs/InitiateRemoteUpload200ResponseOneOf.md +18 -0
  26. data/docs/InitiateRemoteUploadRequest.md +20 -0
  27. data/docs/ListAccounts200Response.md +18 -0
  28. data/docs/ListMedia200Response.md +22 -0
  29. data/docs/ListPosts200Response.md +22 -0
  30. data/docs/ListReceipts200Response.md +22 -0
  31. data/docs/ListTags200Response.md +18 -0
  32. data/docs/ListUsers200Response.md +22 -0
  33. data/docs/ListWorkspaces200Response.md +22 -0
  34. data/docs/Media.md +34 -0
  35. data/docs/MediaApi.md +810 -0
  36. data/docs/PaginationMeta.md +20 -0
  37. data/docs/PaginationMetaLinks.md +24 -0
  38. data/docs/PaginationMetaMeta.md +28 -0
  39. data/docs/Post.md +36 -0
  40. data/docs/PostContent.md +24 -0
  41. data/docs/PostInput.md +34 -0
  42. data/docs/PostStatus.md +15 -0
  43. data/docs/PostVersion.md +24 -0
  44. data/docs/PostsApi.md +659 -0
  45. data/docs/Receipt.md +36 -0
  46. data/docs/ReceiptInput.md +34 -0
  47. data/docs/ReceiptUpdateInput.md +32 -0
  48. data/docs/ReceiptsApi.md +421 -0
  49. data/docs/RemoveUserFromWorkspaceRequest.md +18 -0
  50. data/docs/SchedulePostRequest.md +18 -0
  51. data/docs/ScheduleResult.md +20 -0
  52. data/docs/Subscription.md +32 -0
  53. data/docs/SubscriptionInput.md +24 -0
  54. data/docs/SubscriptionStatus.md +15 -0
  55. data/docs/SubscriptionUpdateInput.md +24 -0
  56. data/docs/SubscriptionsApi.md +699 -0
  57. data/docs/Tag.md +24 -0
  58. data/docs/TagInput.md +20 -0
  59. data/docs/TagsApi.md +357 -0
  60. data/docs/UpdateMediaRequest.md +18 -0
  61. data/docs/UploadChunk200Response.md +18 -0
  62. data/docs/User.md +28 -0
  63. data/docs/UserInput.md +26 -0
  64. data/docs/UserUpdateInput.md +26 -0
  65. data/docs/UsersApi.md +419 -0
  66. data/docs/Workspace.md +28 -0
  67. data/docs/WorkspaceInput.md +24 -0
  68. data/docs/WorkspaceUserInput.md +24 -0
  69. data/docs/WorkspacesApi.md +637 -0
  70. data/git_push.sh +57 -0
  71. data/lib/postboost/api/accounts_api.rb +154 -0
  72. data/lib/postboost/api/media_api.rb +836 -0
  73. data/lib/postboost/api/posts_api.rb +673 -0
  74. data/lib/postboost/api/receipts_api.rb +409 -0
  75. data/lib/postboost/api/subscriptions_api.rb +689 -0
  76. data/lib/postboost/api/tags_api.rb +367 -0
  77. data/lib/postboost/api/users_api.rb +406 -0
  78. data/lib/postboost/api/workspaces_api.rb +640 -0
  79. data/lib/postboost/api_client.rb +394 -0
  80. data/lib/postboost/api_error.rb +58 -0
  81. data/lib/postboost/configuration.rb +308 -0
  82. data/lib/postboost/models/account.rb +321 -0
  83. data/lib/postboost/models/add_generic_subscription_request.rb +274 -0
  84. data/lib/postboost/models/change_subscription_plan_request.rb +303 -0
  85. data/lib/postboost/models/checkout_subscription200_response.rb +214 -0
  86. data/lib/postboost/models/checkout_subscription_request.rb +280 -0
  87. data/lib/postboost/models/delete_media_bulk_request.rb +224 -0
  88. data/lib/postboost/models/delete_mode.rb +41 -0
  89. data/lib/postboost/models/delete_post_request.rb +249 -0
  90. data/lib/postboost/models/delete_posts_bulk_request.rb +269 -0
  91. data/lib/postboost/models/delete_receipts_bulk_request.rb +223 -0
  92. data/lib/postboost/models/delete_result.rb +232 -0
  93. data/lib/postboost/models/delete_user400_response.rb +223 -0
  94. data/lib/postboost/models/delete_users_bulk_request.rb +223 -0
  95. data/lib/postboost/models/delete_workspaces_bulk_request.rb +223 -0
  96. data/lib/postboost/models/get_remote_upload_status200_response.rb +258 -0
  97. data/lib/postboost/models/initiate_chunked_upload200_response.rb +232 -0
  98. data/lib/postboost/models/initiate_chunked_upload_request.rb +273 -0
  99. data/lib/postboost/models/initiate_remote_upload200_response.rb +105 -0
  100. data/lib/postboost/models/initiate_remote_upload200_response_one_of.rb +214 -0
  101. data/lib/postboost/models/initiate_remote_upload_request.rb +250 -0
  102. data/lib/postboost/models/list_accounts200_response.rb +216 -0
  103. data/lib/postboost/models/list_media200_response.rb +241 -0
  104. data/lib/postboost/models/list_posts200_response.rb +241 -0
  105. data/lib/postboost/models/list_receipts200_response.rb +241 -0
  106. data/lib/postboost/models/list_tags200_response.rb +216 -0
  107. data/lib/postboost/models/list_users200_response.rb +241 -0
  108. data/lib/postboost/models/list_workspaces200_response.rb +241 -0
  109. data/lib/postboost/models/media.rb +320 -0
  110. data/lib/postboost/models/pagination_meta.rb +223 -0
  111. data/lib/postboost/models/pagination_meta_links.rb +241 -0
  112. data/lib/postboost/models/pagination_meta_meta.rb +259 -0
  113. data/lib/postboost/models/post.rb +323 -0
  114. data/lib/postboost/models/post_content.rb +247 -0
  115. data/lib/postboost/models/post_input.rb +324 -0
  116. data/lib/postboost/models/post_status.rb +41 -0
  117. data/lib/postboost/models/post_version.rb +267 -0
  118. data/lib/postboost/models/receipt.rb +295 -0
  119. data/lib/postboost/models/receipt_input.rb +335 -0
  120. data/lib/postboost/models/receipt_update_input.rb +312 -0
  121. data/lib/postboost/models/remove_user_from_workspace_request.rb +221 -0
  122. data/lib/postboost/models/schedule_post_request.rb +221 -0
  123. data/lib/postboost/models/schedule_result.rb +223 -0
  124. data/lib/postboost/models/subscription.rb +299 -0
  125. data/lib/postboost/models/subscription_input.rb +285 -0
  126. data/lib/postboost/models/subscription_status.rb +44 -0
  127. data/lib/postboost/models/subscription_update_input.rb +279 -0
  128. data/lib/postboost/models/tag.rb +241 -0
  129. data/lib/postboost/models/tag_input.rb +237 -0
  130. data/lib/postboost/models/update_media_request.rb +222 -0
  131. data/lib/postboost/models/upload_chunk200_response.rb +215 -0
  132. data/lib/postboost/models/user.rb +259 -0
  133. data/lib/postboost/models/user_input.rb +304 -0
  134. data/lib/postboost/models/user_update_input.rb +272 -0
  135. data/lib/postboost/models/workspace.rb +293 -0
  136. data/lib/postboost/models/workspace_input.rb +315 -0
  137. data/lib/postboost/models/workspace_user_input.rb +303 -0
  138. data/lib/postboost/version.rb +15 -0
  139. data/lib/postboost.rb +103 -0
  140. data/postboost.gemspec +39 -0
  141. data/spec/api/accounts_api_spec.rb +60 -0
  142. data/spec/api/media_api_spec.rb +182 -0
  143. data/spec/api/posts_api_spec.rb +152 -0
  144. data/spec/api/receipts_api_spec.rb +103 -0
  145. data/spec/api/subscriptions_api_spec.rb +151 -0
  146. data/spec/api/tags_api_spec.rb +95 -0
  147. data/spec/api/users_api_spec.rb +102 -0
  148. data/spec/api/workspaces_api_spec.rb +142 -0
  149. data/spec/models/account_spec.rb +88 -0
  150. data/spec/models/add_generic_subscription_request_spec.rb +48 -0
  151. data/spec/models/change_subscription_plan_request_spec.rb +58 -0
  152. data/spec/models/checkout_subscription200_response_spec.rb +36 -0
  153. data/spec/models/checkout_subscription_request_spec.rb +52 -0
  154. data/spec/models/delete_media_bulk_request_spec.rb +36 -0
  155. data/spec/models/delete_mode_spec.rb +30 -0
  156. data/spec/models/delete_post_request_spec.rb +42 -0
  157. data/spec/models/delete_posts_bulk_request_spec.rb +48 -0
  158. data/spec/models/delete_receipts_bulk_request_spec.rb +36 -0
  159. data/spec/models/delete_result_spec.rb +48 -0
  160. data/spec/models/delete_user400_response_spec.rb +42 -0
  161. data/spec/models/delete_users_bulk_request_spec.rb +36 -0
  162. data/spec/models/delete_workspaces_bulk_request_spec.rb +36 -0
  163. data/spec/models/get_remote_upload_status200_response_spec.rb +46 -0
  164. data/spec/models/initiate_chunked_upload200_response_spec.rb +48 -0
  165. data/spec/models/initiate_chunked_upload_request_spec.rb +48 -0
  166. data/spec/models/initiate_remote_upload200_response_one_of_spec.rb +36 -0
  167. data/spec/models/initiate_remote_upload200_response_spec.rb +32 -0
  168. data/spec/models/initiate_remote_upload_request_spec.rb +42 -0
  169. data/spec/models/list_accounts200_response_spec.rb +36 -0
  170. data/spec/models/list_media200_response_spec.rb +48 -0
  171. data/spec/models/list_posts200_response_spec.rb +48 -0
  172. data/spec/models/list_receipts200_response_spec.rb +48 -0
  173. data/spec/models/list_tags200_response_spec.rb +36 -0
  174. data/spec/models/list_users200_response_spec.rb +48 -0
  175. data/spec/models/list_workspaces200_response_spec.rb +48 -0
  176. data/spec/models/media_spec.rb +88 -0
  177. data/spec/models/pagination_meta_links_spec.rb +54 -0
  178. data/spec/models/pagination_meta_meta_spec.rb +66 -0
  179. data/spec/models/pagination_meta_spec.rb +42 -0
  180. data/spec/models/post_content_spec.rb +54 -0
  181. data/spec/models/post_input_spec.rb +84 -0
  182. data/spec/models/post_spec.rb +90 -0
  183. data/spec/models/post_status_spec.rb +30 -0
  184. data/spec/models/post_version_spec.rb +54 -0
  185. data/spec/models/receipt_input_spec.rb +84 -0
  186. data/spec/models/receipt_spec.rb +90 -0
  187. data/spec/models/receipt_update_input_spec.rb +78 -0
  188. data/spec/models/remove_user_from_workspace_request_spec.rb +36 -0
  189. data/spec/models/schedule_post_request_spec.rb +36 -0
  190. data/spec/models/schedule_result_spec.rb +42 -0
  191. data/spec/models/subscription_input_spec.rb +54 -0
  192. data/spec/models/subscription_spec.rb +78 -0
  193. data/spec/models/subscription_status_spec.rb +30 -0
  194. data/spec/models/subscription_update_input_spec.rb +54 -0
  195. data/spec/models/tag_input_spec.rb +42 -0
  196. data/spec/models/tag_spec.rb +54 -0
  197. data/spec/models/update_media_request_spec.rb +36 -0
  198. data/spec/models/upload_chunk200_response_spec.rb +36 -0
  199. data/spec/models/user_input_spec.rb +60 -0
  200. data/spec/models/user_spec.rb +66 -0
  201. data/spec/models/user_update_input_spec.rb +60 -0
  202. data/spec/models/workspace_input_spec.rb +58 -0
  203. data/spec/models/workspace_spec.rb +70 -0
  204. data/spec/models/workspace_user_input_spec.rb +58 -0
  205. data/spec/spec_helper.rb +111 -0
  206. metadata +358 -0
@@ -0,0 +1,673 @@
1
+ =begin
2
+ #PostBoost API
3
+
4
+ #The PostBoost REST API lets you publish, schedule, and analyze social media posts across 8+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: hi@postboost.co
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module PostBoost
16
+ class PostsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add post to queue
23
+ # Add an existing post to the smart publishing queue.
24
+ # @param workspace_uuid [String] UUID of the workspace.
25
+ # @param post_uuid [String] UUID of the post.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [ScheduleResult]
28
+ def add_post_to_queue(workspace_uuid, post_uuid, opts = {})
29
+ data, _status_code, _headers = add_post_to_queue_with_http_info(workspace_uuid, post_uuid, opts)
30
+ data
31
+ end
32
+
33
+ # Add post to queue
34
+ # Add an existing post to the smart publishing queue.
35
+ # @param workspace_uuid [String] UUID of the workspace.
36
+ # @param post_uuid [String] UUID of the post.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(ScheduleResult, Integer, Hash)>] ScheduleResult data, response status code and response headers
39
+ def add_post_to_queue_with_http_info(workspace_uuid, post_uuid, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: PostsApi.add_post_to_queue ...'
42
+ end
43
+ # verify the required parameter 'workspace_uuid' is set
44
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
45
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.add_post_to_queue"
46
+ end
47
+ # verify the required parameter 'post_uuid' is set
48
+ if @api_client.config.client_side_validation && post_uuid.nil?
49
+ fail ArgumentError, "Missing the required parameter 'post_uuid' when calling PostsApi.add_post_to_queue"
50
+ end
51
+ # resource path
52
+ local_var_path = '/{workspaceUuid}/posts/add-to-queue/{postUuid}'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'postUuid' + '}', CGI.escape(post_uuid.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] || 'ScheduleResult'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
73
+
74
+ new_options = opts.merge(
75
+ :operation => :"PostsApi.add_post_to_queue",
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(:POST, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: PostsApi#add_post_to_queue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
91
+ # Approve post
92
+ # Approve a post that is pending review.
93
+ # @param workspace_uuid [String] UUID of the workspace.
94
+ # @param post_uuid [String] UUID of the post.
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [ScheduleResult]
97
+ def approve_post(workspace_uuid, post_uuid, opts = {})
98
+ data, _status_code, _headers = approve_post_with_http_info(workspace_uuid, post_uuid, opts)
99
+ data
100
+ end
101
+
102
+ # Approve post
103
+ # Approve a post that is pending review.
104
+ # @param workspace_uuid [String] UUID of the workspace.
105
+ # @param post_uuid [String] UUID of the post.
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [Array<(ScheduleResult, Integer, Hash)>] ScheduleResult data, response status code and response headers
108
+ def approve_post_with_http_info(workspace_uuid, post_uuid, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: PostsApi.approve_post ...'
111
+ end
112
+ # verify the required parameter 'workspace_uuid' is set
113
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
114
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.approve_post"
115
+ end
116
+ # verify the required parameter 'post_uuid' is set
117
+ if @api_client.config.client_side_validation && post_uuid.nil?
118
+ fail ArgumentError, "Missing the required parameter 'post_uuid' when calling PostsApi.approve_post"
119
+ end
120
+ # resource path
121
+ local_var_path = '/{workspaceUuid}/posts/approve/{postUuid}'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'postUuid' + '}', CGI.escape(post_uuid.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] || 'ScheduleResult'
139
+
140
+ # auth_names
141
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
142
+
143
+ new_options = opts.merge(
144
+ :operation => :"PostsApi.approve_post",
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#approve_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
160
+ # Create post
161
+ # 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.
162
+ # @param workspace_uuid [String] UUID of the workspace.
163
+ # @param post_input [PostInput]
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [Post]
166
+ def create_post(workspace_uuid, post_input, opts = {})
167
+ data, _status_code, _headers = create_post_with_http_info(workspace_uuid, post_input, opts)
168
+ data
169
+ end
170
+
171
+ # Create post
172
+ # Create a new post. Use &#x60;schedule: true&#x60; with &#x60;date&#x60; and &#x60;time&#x60; to schedule, &#x60;schedule_now: true&#x60; to publish immediately, or &#x60;queue: true&#x60; to add to the smart publishing queue.
173
+ # @param workspace_uuid [String] UUID of the workspace.
174
+ # @param post_input [PostInput]
175
+ # @param [Hash] opts the optional parameters
176
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
177
+ def create_post_with_http_info(workspace_uuid, post_input, opts = {})
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug 'Calling API: PostsApi.create_post ...'
180
+ end
181
+ # verify the required parameter 'workspace_uuid' is set
182
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
183
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.create_post"
184
+ end
185
+ # verify the required parameter 'post_input' is set
186
+ if @api_client.config.client_side_validation && post_input.nil?
187
+ fail ArgumentError, "Missing the required parameter 'post_input' when calling PostsApi.create_post"
188
+ end
189
+ # resource path
190
+ local_var_path = '/{workspaceUuid}/posts'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
191
+
192
+ # query parameters
193
+ query_params = opts[:query_params] || {}
194
+
195
+ # header parameters
196
+ header_params = opts[:header_params] || {}
197
+ # HTTP header 'Accept' (if needed)
198
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
199
+ # HTTP header 'Content-Type'
200
+ content_type = @api_client.select_header_content_type(['application/json'])
201
+ if !content_type.nil?
202
+ header_params['Content-Type'] = content_type
203
+ end
204
+
205
+ # form parameters
206
+ form_params = opts[:form_params] || {}
207
+
208
+ # http body (model)
209
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_input)
210
+
211
+ # return_type
212
+ return_type = opts[:debug_return_type] || 'Post'
213
+
214
+ # auth_names
215
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
216
+
217
+ new_options = opts.merge(
218
+ :operation => :"PostsApi.create_post",
219
+ :header_params => header_params,
220
+ :query_params => query_params,
221
+ :form_params => form_params,
222
+ :body => post_body,
223
+ :auth_names => auth_names,
224
+ :return_type => return_type
225
+ )
226
+
227
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug "API called: PostsApi#create_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
230
+ end
231
+ return data, status_code, headers
232
+ end
233
+
234
+ # Delete post
235
+ # @param workspace_uuid [String] UUID of the workspace.
236
+ # @param post_uuid [String] UUID of the post.
237
+ # @param [Hash] opts the optional parameters
238
+ # @option opts [DeletePostRequest] :delete_post_request
239
+ # @return [DeleteResult]
240
+ def delete_post(workspace_uuid, post_uuid, opts = {})
241
+ data, _status_code, _headers = delete_post_with_http_info(workspace_uuid, post_uuid, opts)
242
+ data
243
+ end
244
+
245
+ # Delete post
246
+ # @param workspace_uuid [String] UUID of the workspace.
247
+ # @param post_uuid [String] UUID of the post.
248
+ # @param [Hash] opts the optional parameters
249
+ # @option opts [DeletePostRequest] :delete_post_request
250
+ # @return [Array<(DeleteResult, Integer, Hash)>] DeleteResult data, response status code and response headers
251
+ def delete_post_with_http_info(workspace_uuid, post_uuid, opts = {})
252
+ if @api_client.config.debugging
253
+ @api_client.config.logger.debug 'Calling API: PostsApi.delete_post ...'
254
+ end
255
+ # verify the required parameter 'workspace_uuid' is set
256
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
257
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.delete_post"
258
+ end
259
+ # verify the required parameter 'post_uuid' is set
260
+ if @api_client.config.client_side_validation && post_uuid.nil?
261
+ fail ArgumentError, "Missing the required parameter 'post_uuid' when calling PostsApi.delete_post"
262
+ end
263
+ # resource path
264
+ local_var_path = '/{workspaceUuid}/posts/{postUuid}'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'postUuid' + '}', CGI.escape(post_uuid.to_s))
265
+
266
+ # query parameters
267
+ query_params = opts[:query_params] || {}
268
+
269
+ # header parameters
270
+ header_params = opts[:header_params] || {}
271
+ # HTTP header 'Accept' (if needed)
272
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
273
+ # HTTP header 'Content-Type'
274
+ content_type = @api_client.select_header_content_type(['application/json'])
275
+ if !content_type.nil?
276
+ header_params['Content-Type'] = content_type
277
+ end
278
+
279
+ # form parameters
280
+ form_params = opts[:form_params] || {}
281
+
282
+ # http body (model)
283
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'delete_post_request'])
284
+
285
+ # return_type
286
+ return_type = opts[:debug_return_type] || 'DeleteResult'
287
+
288
+ # auth_names
289
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
290
+
291
+ new_options = opts.merge(
292
+ :operation => :"PostsApi.delete_post",
293
+ :header_params => header_params,
294
+ :query_params => query_params,
295
+ :form_params => form_params,
296
+ :body => post_body,
297
+ :auth_names => auth_names,
298
+ :return_type => return_type
299
+ )
300
+
301
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
302
+ if @api_client.config.debugging
303
+ @api_client.config.logger.debug "API called: PostsApi#delete_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
304
+ end
305
+ return data, status_code, headers
306
+ end
307
+
308
+ # Delete posts (bulk)
309
+ # Delete multiple posts at once.
310
+ # @param workspace_uuid [String] UUID of the workspace.
311
+ # @param delete_posts_bulk_request [DeletePostsBulkRequest]
312
+ # @param [Hash] opts the optional parameters
313
+ # @return [DeleteResult]
314
+ def delete_posts_bulk(workspace_uuid, delete_posts_bulk_request, opts = {})
315
+ data, _status_code, _headers = delete_posts_bulk_with_http_info(workspace_uuid, delete_posts_bulk_request, opts)
316
+ data
317
+ end
318
+
319
+ # Delete posts (bulk)
320
+ # Delete multiple posts at once.
321
+ # @param workspace_uuid [String] UUID of the workspace.
322
+ # @param delete_posts_bulk_request [DeletePostsBulkRequest]
323
+ # @param [Hash] opts the optional parameters
324
+ # @return [Array<(DeleteResult, Integer, Hash)>] DeleteResult data, response status code and response headers
325
+ def delete_posts_bulk_with_http_info(workspace_uuid, delete_posts_bulk_request, opts = {})
326
+ if @api_client.config.debugging
327
+ @api_client.config.logger.debug 'Calling API: PostsApi.delete_posts_bulk ...'
328
+ end
329
+ # verify the required parameter 'workspace_uuid' is set
330
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
331
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.delete_posts_bulk"
332
+ end
333
+ # verify the required parameter 'delete_posts_bulk_request' is set
334
+ if @api_client.config.client_side_validation && delete_posts_bulk_request.nil?
335
+ fail ArgumentError, "Missing the required parameter 'delete_posts_bulk_request' when calling PostsApi.delete_posts_bulk"
336
+ end
337
+ # resource path
338
+ local_var_path = '/{workspaceUuid}/posts'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
339
+
340
+ # query parameters
341
+ query_params = opts[:query_params] || {}
342
+
343
+ # header parameters
344
+ header_params = opts[:header_params] || {}
345
+ # HTTP header 'Accept' (if needed)
346
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
347
+ # HTTP header 'Content-Type'
348
+ content_type = @api_client.select_header_content_type(['application/json'])
349
+ if !content_type.nil?
350
+ header_params['Content-Type'] = content_type
351
+ end
352
+
353
+ # form parameters
354
+ form_params = opts[:form_params] || {}
355
+
356
+ # http body (model)
357
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(delete_posts_bulk_request)
358
+
359
+ # return_type
360
+ return_type = opts[:debug_return_type] || 'DeleteResult'
361
+
362
+ # auth_names
363
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
364
+
365
+ new_options = opts.merge(
366
+ :operation => :"PostsApi.delete_posts_bulk",
367
+ :header_params => header_params,
368
+ :query_params => query_params,
369
+ :form_params => form_params,
370
+ :body => post_body,
371
+ :auth_names => auth_names,
372
+ :return_type => return_type
373
+ )
374
+
375
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
376
+ if @api_client.config.debugging
377
+ @api_client.config.logger.debug "API called: PostsApi#delete_posts_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
378
+ end
379
+ return data, status_code, headers
380
+ end
381
+
382
+ # Get post
383
+ # @param workspace_uuid [String] UUID of the workspace.
384
+ # @param post_uuid [String] UUID of the post.
385
+ # @param [Hash] opts the optional parameters
386
+ # @return [Post]
387
+ def get_post(workspace_uuid, post_uuid, opts = {})
388
+ data, _status_code, _headers = get_post_with_http_info(workspace_uuid, post_uuid, opts)
389
+ data
390
+ end
391
+
392
+ # Get post
393
+ # @param workspace_uuid [String] UUID of the workspace.
394
+ # @param post_uuid [String] UUID of the post.
395
+ # @param [Hash] opts the optional parameters
396
+ # @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
397
+ def get_post_with_http_info(workspace_uuid, post_uuid, opts = {})
398
+ if @api_client.config.debugging
399
+ @api_client.config.logger.debug 'Calling API: PostsApi.get_post ...'
400
+ end
401
+ # verify the required parameter 'workspace_uuid' is set
402
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
403
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.get_post"
404
+ end
405
+ # verify the required parameter 'post_uuid' is set
406
+ if @api_client.config.client_side_validation && post_uuid.nil?
407
+ fail ArgumentError, "Missing the required parameter 'post_uuid' when calling PostsApi.get_post"
408
+ end
409
+ # resource path
410
+ local_var_path = '/{workspaceUuid}/posts/{postUuid}'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'postUuid' + '}', CGI.escape(post_uuid.to_s))
411
+
412
+ # query parameters
413
+ query_params = opts[:query_params] || {}
414
+
415
+ # header parameters
416
+ header_params = opts[:header_params] || {}
417
+ # HTTP header 'Accept' (if needed)
418
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
419
+
420
+ # form parameters
421
+ form_params = opts[:form_params] || {}
422
+
423
+ # http body (model)
424
+ post_body = opts[:debug_body]
425
+
426
+ # return_type
427
+ return_type = opts[:debug_return_type] || 'Post'
428
+
429
+ # auth_names
430
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
431
+
432
+ new_options = opts.merge(
433
+ :operation => :"PostsApi.get_post",
434
+ :header_params => header_params,
435
+ :query_params => query_params,
436
+ :form_params => form_params,
437
+ :body => post_body,
438
+ :auth_names => auth_names,
439
+ :return_type => return_type
440
+ )
441
+
442
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
443
+ if @api_client.config.debugging
444
+ @api_client.config.logger.debug "API called: PostsApi#get_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
445
+ end
446
+ return data, status_code, headers
447
+ end
448
+
449
+ # List posts
450
+ # Returns a paginated list of posts in the workspace.
451
+ # @param workspace_uuid [String] UUID of the workspace.
452
+ # @param [Hash] opts the optional parameters
453
+ # @option opts [Integer] :page (default to 1)
454
+ # @return [ListPosts200Response]
455
+ def list_posts(workspace_uuid, opts = {})
456
+ data, _status_code, _headers = list_posts_with_http_info(workspace_uuid, opts)
457
+ data
458
+ end
459
+
460
+ # List posts
461
+ # Returns a paginated list of posts in the workspace.
462
+ # @param workspace_uuid [String] UUID of the workspace.
463
+ # @param [Hash] opts the optional parameters
464
+ # @option opts [Integer] :page (default to 1)
465
+ # @return [Array<(ListPosts200Response, Integer, Hash)>] ListPosts200Response data, response status code and response headers
466
+ def list_posts_with_http_info(workspace_uuid, opts = {})
467
+ if @api_client.config.debugging
468
+ @api_client.config.logger.debug 'Calling API: PostsApi.list_posts ...'
469
+ end
470
+ # verify the required parameter 'workspace_uuid' is set
471
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
472
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.list_posts"
473
+ end
474
+ # resource path
475
+ local_var_path = '/{workspaceUuid}/posts'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
476
+
477
+ # query parameters
478
+ query_params = opts[:query_params] || {}
479
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
480
+
481
+ # header parameters
482
+ header_params = opts[:header_params] || {}
483
+ # HTTP header 'Accept' (if needed)
484
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
485
+
486
+ # form parameters
487
+ form_params = opts[:form_params] || {}
488
+
489
+ # http body (model)
490
+ post_body = opts[:debug_body]
491
+
492
+ # return_type
493
+ return_type = opts[:debug_return_type] || 'ListPosts200Response'
494
+
495
+ # auth_names
496
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
497
+
498
+ new_options = opts.merge(
499
+ :operation => :"PostsApi.list_posts",
500
+ :header_params => header_params,
501
+ :query_params => query_params,
502
+ :form_params => form_params,
503
+ :body => post_body,
504
+ :auth_names => auth_names,
505
+ :return_type => return_type
506
+ )
507
+
508
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
509
+ if @api_client.config.debugging
510
+ @api_client.config.logger.debug "API called: PostsApi#list_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
511
+ end
512
+ return data, status_code, headers
513
+ end
514
+
515
+ # Schedule post
516
+ # Schedule an existing post. Set `postNow: true` to publish immediately.
517
+ # @param workspace_uuid [String] UUID of the workspace.
518
+ # @param post_uuid [String] UUID of the post.
519
+ # @param schedule_post_request [SchedulePostRequest]
520
+ # @param [Hash] opts the optional parameters
521
+ # @return [ScheduleResult]
522
+ def schedule_post(workspace_uuid, post_uuid, schedule_post_request, opts = {})
523
+ data, _status_code, _headers = schedule_post_with_http_info(workspace_uuid, post_uuid, schedule_post_request, opts)
524
+ data
525
+ end
526
+
527
+ # Schedule post
528
+ # Schedule an existing post. Set &#x60;postNow: true&#x60; to publish immediately.
529
+ # @param workspace_uuid [String] UUID of the workspace.
530
+ # @param post_uuid [String] UUID of the post.
531
+ # @param schedule_post_request [SchedulePostRequest]
532
+ # @param [Hash] opts the optional parameters
533
+ # @return [Array<(ScheduleResult, Integer, Hash)>] ScheduleResult data, response status code and response headers
534
+ def schedule_post_with_http_info(workspace_uuid, post_uuid, schedule_post_request, opts = {})
535
+ if @api_client.config.debugging
536
+ @api_client.config.logger.debug 'Calling API: PostsApi.schedule_post ...'
537
+ end
538
+ # verify the required parameter 'workspace_uuid' is set
539
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
540
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.schedule_post"
541
+ end
542
+ # verify the required parameter 'post_uuid' is set
543
+ if @api_client.config.client_side_validation && post_uuid.nil?
544
+ fail ArgumentError, "Missing the required parameter 'post_uuid' when calling PostsApi.schedule_post"
545
+ end
546
+ # verify the required parameter 'schedule_post_request' is set
547
+ if @api_client.config.client_side_validation && schedule_post_request.nil?
548
+ fail ArgumentError, "Missing the required parameter 'schedule_post_request' when calling PostsApi.schedule_post"
549
+ end
550
+ # resource path
551
+ local_var_path = '/{workspaceUuid}/posts/schedule/{postUuid}'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'postUuid' + '}', CGI.escape(post_uuid.to_s))
552
+
553
+ # query parameters
554
+ query_params = opts[:query_params] || {}
555
+
556
+ # header parameters
557
+ header_params = opts[:header_params] || {}
558
+ # HTTP header 'Accept' (if needed)
559
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
560
+ # HTTP header 'Content-Type'
561
+ content_type = @api_client.select_header_content_type(['application/json'])
562
+ if !content_type.nil?
563
+ header_params['Content-Type'] = content_type
564
+ end
565
+
566
+ # form parameters
567
+ form_params = opts[:form_params] || {}
568
+
569
+ # http body (model)
570
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(schedule_post_request)
571
+
572
+ # return_type
573
+ return_type = opts[:debug_return_type] || 'ScheduleResult'
574
+
575
+ # auth_names
576
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
577
+
578
+ new_options = opts.merge(
579
+ :operation => :"PostsApi.schedule_post",
580
+ :header_params => header_params,
581
+ :query_params => query_params,
582
+ :form_params => form_params,
583
+ :body => post_body,
584
+ :auth_names => auth_names,
585
+ :return_type => return_type
586
+ )
587
+
588
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
589
+ if @api_client.config.debugging
590
+ @api_client.config.logger.debug "API called: PostsApi#schedule_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
591
+ end
592
+ return data, status_code, headers
593
+ end
594
+
595
+ # Update post
596
+ # @param workspace_uuid [String] UUID of the workspace.
597
+ # @param post_uuid [String] UUID of the post.
598
+ # @param post_input [PostInput]
599
+ # @param [Hash] opts the optional parameters
600
+ # @return [Object]
601
+ def update_post(workspace_uuid, post_uuid, post_input, opts = {})
602
+ data, _status_code, _headers = update_post_with_http_info(workspace_uuid, post_uuid, post_input, opts)
603
+ data
604
+ end
605
+
606
+ # Update post
607
+ # @param workspace_uuid [String] UUID of the workspace.
608
+ # @param post_uuid [String] UUID of the post.
609
+ # @param post_input [PostInput]
610
+ # @param [Hash] opts the optional parameters
611
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
612
+ def update_post_with_http_info(workspace_uuid, post_uuid, post_input, opts = {})
613
+ if @api_client.config.debugging
614
+ @api_client.config.logger.debug 'Calling API: PostsApi.update_post ...'
615
+ end
616
+ # verify the required parameter 'workspace_uuid' is set
617
+ if @api_client.config.client_side_validation && workspace_uuid.nil?
618
+ fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling PostsApi.update_post"
619
+ end
620
+ # verify the required parameter 'post_uuid' is set
621
+ if @api_client.config.client_side_validation && post_uuid.nil?
622
+ fail ArgumentError, "Missing the required parameter 'post_uuid' when calling PostsApi.update_post"
623
+ end
624
+ # verify the required parameter 'post_input' is set
625
+ if @api_client.config.client_side_validation && post_input.nil?
626
+ fail ArgumentError, "Missing the required parameter 'post_input' when calling PostsApi.update_post"
627
+ end
628
+ # resource path
629
+ local_var_path = '/{workspaceUuid}/posts/{postUuid}'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'postUuid' + '}', CGI.escape(post_uuid.to_s))
630
+
631
+ # query parameters
632
+ query_params = opts[:query_params] || {}
633
+
634
+ # header parameters
635
+ header_params = opts[:header_params] || {}
636
+ # HTTP header 'Accept' (if needed)
637
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
638
+ # HTTP header 'Content-Type'
639
+ content_type = @api_client.select_header_content_type(['application/json'])
640
+ if !content_type.nil?
641
+ header_params['Content-Type'] = content_type
642
+ end
643
+
644
+ # form parameters
645
+ form_params = opts[:form_params] || {}
646
+
647
+ # http body (model)
648
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_input)
649
+
650
+ # return_type
651
+ return_type = opts[:debug_return_type] || 'Object'
652
+
653
+ # auth_names
654
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
655
+
656
+ new_options = opts.merge(
657
+ :operation => :"PostsApi.update_post",
658
+ :header_params => header_params,
659
+ :query_params => query_params,
660
+ :form_params => form_params,
661
+ :body => post_body,
662
+ :auth_names => auth_names,
663
+ :return_type => return_type
664
+ )
665
+
666
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
667
+ if @api_client.config.debugging
668
+ @api_client.config.logger.debug "API called: PostsApi#update_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
669
+ end
670
+ return data, status_code, headers
671
+ end
672
+ end
673
+ end