postboost 1.0.0 → 1.8.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.
- checksums.yaml +4 -4
- data/README.md +119 -0
- data/docs/AIApi.md +439 -0
- data/docs/AICredits.md +22 -0
- data/docs/Account.md +14 -8
- data/docs/AccountAnalytics.md +28 -0
- data/docs/AccountAnalyticsInitialSync.md +20 -0
- data/docs/AccountSchedule.md +22 -0
- data/docs/AccountsApi.md +15 -5
- data/docs/AddPostToQueueRequest.md +18 -0
- data/docs/AnalyticsApi.md +401 -0
- data/docs/AnalyticsPeriod.md +24 -0
- data/docs/AnalyticsSummary.md +20 -0
- data/docs/AnalyticsSummaryData.md +38 -0
- data/docs/ApprovePostRequest.md +24 -0
- data/docs/BestPostingTimes.md +20 -0
- data/docs/BestPostingTimesTimesInner.md +24 -0
- data/docs/BlogToSocial200Response.md +18 -0
- data/docs/BlogToSocial429Response.md +18 -0
- data/docs/BlogToSocialCaption.md +28 -0
- data/docs/BlogToSocialInput.md +42 -0
- data/docs/BlogToSocialMedia.md +20 -0
- data/docs/BlogToSocialResponse.md +30 -0
- data/docs/CancelSubscription422Response.md +20 -0
- data/docs/CancelSubscription422ResponseErrors.md +18 -0
- data/docs/CancelSubscriptionRequest.md +18 -0
- data/docs/CompleteChunkedUploadRequest.md +20 -0
- data/docs/CreateMediaFolderRequest.md +20 -0
- data/docs/CreateMention201Response.md +18 -0
- data/docs/DeleteMediaBulkRequest.md +1 -1
- data/docs/DeleteMediaBulkRequestItemsInner.md +49 -0
- data/docs/DeleteMediaFolderRequest.md +18 -0
- data/docs/DeleteResult.md +3 -3
- data/docs/ImageAltText200Response.md +18 -0
- data/docs/ImageAltTextInput.md +18 -0
- data/docs/ImageAltTextResponse.md +24 -0
- data/docs/ImageEditInput.md +28 -0
- data/docs/ImageGenerate200Response.md +18 -0
- data/docs/ImageGenerate429Response.md +18 -0
- data/docs/ImageGenerateInput.md +36 -0
- data/docs/ImageGenerationResponse.md +30 -0
- data/docs/ImagePrompt200Response.md +18 -0
- data/docs/ImagePrompt429Response.md +18 -0
- data/docs/ImagePromptInput.md +28 -0
- data/docs/ImagePromptResponse.md +18 -0
- data/docs/ImageVariations200Response.md +18 -0
- data/docs/ImageVariationsInput.md +24 -0
- data/docs/ImageVariationsResponse.md +26 -0
- data/docs/{InitiateChunkedUpload200Response.md → InitiateChunkedUpload201Response.md} +2 -2
- data/docs/{InitiateRemoteUpload200Response.md → InitiateRemoteUpload201Response.md} +7 -7
- data/docs/{InitiateRemoteUpload200ResponseOneOf.md → InitiateRemoteUpload201ResponseOneOf.md} +2 -2
- data/docs/InitiateRemoteUploadRequest.md +3 -1
- data/docs/ListMediaFolders200Response.md +18 -0
- data/docs/ListMentions200Response.md +22 -0
- data/docs/ListMyWorkspaces200Response.md +18 -0
- data/docs/Media.md +22 -8
- data/docs/MediaApi.md +340 -26
- data/docs/MediaFolder.md +24 -0
- data/docs/MediaFolderInput.md +20 -0
- data/docs/MediaFolderRef.md +20 -0
- data/docs/Mention.md +28 -0
- data/docs/MentionIdentity.md +24 -0
- data/docs/MentionIdentityInput.md +26 -0
- data/docs/MentionInput.md +22 -0
- data/docs/MentionsApi.md +375 -0
- data/docs/Post.md +10 -8
- data/docs/PostAnalytics.md +22 -0
- data/docs/PostInput.md +3 -1
- data/docs/PostVersion.md +2 -0
- data/docs/PostingTimeSlot.md +22 -0
- data/docs/PostingTimes.md +32 -0
- data/docs/PostingTimesBestInner.md +24 -0
- data/docs/PostingTimesDayIntervalsInnerInner.md +28 -0
- data/docs/PostingTimesDaysInner.md +24 -0
- data/docs/PostsApi.md +174 -14
- data/docs/PublicWorkspace.md +24 -0
- data/docs/PublicWorkspacePivot.md +22 -0
- data/docs/PublishProgress.md +22 -0
- data/docs/Receipt.md +8 -8
- data/docs/ReceiptsApi.md +15 -1
- data/docs/RemoveGenericSubscription422Response.md +18 -0
- data/docs/RetryPostAccountResult.md +22 -0
- data/docs/SchedulePostRequest.md +9 -1
- data/docs/ScheduleResult.md +4 -2
- data/docs/Subscription.md +5 -5
- data/docs/SubscriptionsApi.md +27 -5
- data/docs/Tag.md +4 -4
- data/docs/TagsApi.md +10 -0
- data/docs/UpdateMediaRequest.md +6 -2
- data/docs/{UploadChunk200Response.md → UploadChunk201Response.md} +2 -2
- data/docs/User.md +7 -5
- data/docs/UsersApi.md +15 -1
- data/docs/Workspace.md +8 -6
- data/docs/WorkspaceInput.md +1 -1
- data/docs/WorkspacesApi.md +156 -3
- data/lib/postboost/api/accounts_api.rb +16 -4
- data/lib/postboost/api/ai_api.rb +466 -0
- data/lib/postboost/api/analytics_api.rb +425 -0
- data/lib/postboost/api/media_api.rb +365 -22
- data/lib/postboost/api/mentions_api.rb +386 -0
- data/lib/postboost/api/posts_api.rb +176 -12
- data/lib/postboost/api/receipts_api.rb +17 -2
- data/lib/postboost/api/subscriptions_api.rb +28 -3
- data/lib/postboost/api/tags_api.rb +12 -2
- data/lib/postboost/api/users_api.rb +17 -2
- data/lib/postboost/api/workspaces_api.rb +139 -2
- data/lib/postboost/api_client.rb +2 -2
- data/lib/postboost/api_error.rb +2 -2
- data/lib/postboost/configuration.rb +2 -2
- data/lib/postboost/models/account.rb +120 -3
- data/lib/postboost/models/account_analytics.rb +308 -0
- data/lib/postboost/models/account_analytics_initial_sync.rb +231 -0
- data/lib/postboost/models/account_schedule.rb +255 -0
- data/lib/postboost/models/add_generic_subscription_request.rb +2 -2
- data/lib/postboost/models/add_post_to_queue_request.rb +215 -0
- data/lib/postboost/models/ai_credits.rb +256 -0
- data/lib/postboost/models/analytics_period.rb +270 -0
- data/lib/postboost/models/analytics_summary.rb +237 -0
- data/lib/postboost/models/analytics_summary_data.rb +327 -0
- data/lib/postboost/models/approve_post_request.rb +247 -0
- data/lib/postboost/models/best_posting_times.rb +240 -0
- data/lib/postboost/models/best_posting_times_times_inner.rb +269 -0
- data/lib/postboost/models/blog_to_social200_response.rb +214 -0
- data/lib/postboost/models/blog_to_social429_response.rb +214 -0
- data/lib/postboost/models/blog_to_social_caption.rb +265 -0
- data/lib/postboost/models/blog_to_social_input.rb +536 -0
- data/lib/postboost/models/blog_to_social_media.rb +226 -0
- data/lib/postboost/models/blog_to_social_response.rb +276 -0
- data/lib/postboost/models/cancel_subscription422_response.rb +223 -0
- data/lib/postboost/models/cancel_subscription422_response_errors.rb +216 -0
- data/lib/postboost/models/cancel_subscription_request.rb +217 -0
- data/lib/postboost/models/change_subscription_plan_request.rb +2 -2
- data/lib/postboost/models/checkout_subscription200_response.rb +2 -2
- data/lib/postboost/models/checkout_subscription_request.rb +2 -2
- data/lib/postboost/models/complete_chunked_upload_request.rb +243 -0
- data/lib/postboost/models/create_media_folder_request.rb +258 -0
- data/lib/postboost/models/create_mention201_response.rb +214 -0
- data/lib/postboost/models/delete_media_bulk_request.rb +23 -4
- data/lib/postboost/models/{initiate_remote_upload200_response.rb → delete_media_bulk_request_items_inner.rb} +5 -5
- data/lib/postboost/models/delete_media_folder_request.rb +216 -0
- data/lib/postboost/models/delete_mode.rb +2 -2
- data/lib/postboost/models/delete_post_request.rb +2 -2
- data/lib/postboost/models/delete_posts_bulk_request.rb +2 -2
- data/lib/postboost/models/delete_receipts_bulk_request.rb +2 -2
- data/lib/postboost/models/delete_result.rb +23 -2
- data/lib/postboost/models/delete_user400_response.rb +2 -2
- data/lib/postboost/models/delete_users_bulk_request.rb +2 -2
- data/lib/postboost/models/delete_workspaces_bulk_request.rb +2 -2
- data/lib/postboost/models/get_remote_upload_status200_response.rb +2 -2
- data/lib/postboost/models/image_alt_text200_response.rb +221 -0
- data/lib/postboost/models/image_alt_text_input.rb +221 -0
- data/lib/postboost/models/image_alt_text_response.rb +262 -0
- data/lib/postboost/models/image_edit_input.rb +375 -0
- data/lib/postboost/models/image_generate200_response.rb +221 -0
- data/lib/postboost/models/image_generate429_response.rb +214 -0
- data/lib/postboost/models/image_generate_input.rb +447 -0
- data/lib/postboost/models/image_generation_response.rb +305 -0
- data/lib/postboost/models/image_prompt200_response.rb +221 -0
- data/lib/postboost/models/image_prompt429_response.rb +214 -0
- data/lib/postboost/models/image_prompt_input.rb +345 -0
- data/lib/postboost/models/image_prompt_response.rb +221 -0
- data/lib/postboost/models/image_variations200_response.rb +221 -0
- data/lib/postboost/models/image_variations_input.rb +328 -0
- data/lib/postboost/models/image_variations_response.rb +280 -0
- data/lib/postboost/models/{initiate_chunked_upload200_response.rb → initiate_chunked_upload201_response.rb} +5 -5
- data/lib/postboost/models/initiate_chunked_upload_request.rb +2 -2
- data/lib/postboost/models/initiate_remote_upload201_response.rb +105 -0
- data/lib/postboost/models/{initiate_remote_upload200_response_one_of.rb → initiate_remote_upload201_response_one_of.rb} +5 -5
- data/lib/postboost/models/initiate_remote_upload_request.rb +16 -6
- data/lib/postboost/models/list_accounts200_response.rb +2 -2
- data/lib/postboost/models/list_media200_response.rb +2 -2
- data/lib/postboost/models/list_media_folders200_response.rb +216 -0
- data/lib/postboost/models/list_mentions200_response.rb +241 -0
- data/lib/postboost/models/list_my_workspaces200_response.rb +216 -0
- data/lib/postboost/models/list_posts200_response.rb +2 -2
- data/lib/postboost/models/list_receipts200_response.rb +2 -2
- data/lib/postboost/models/list_tags200_response.rb +2 -2
- data/lib/postboost/models/list_users200_response.rb +2 -2
- data/lib/postboost/models/list_workspaces200_response.rb +2 -2
- data/lib/postboost/models/media.rb +128 -3
- data/lib/postboost/models/media_folder.rb +271 -0
- data/lib/postboost/models/media_folder_input.rb +244 -0
- data/lib/postboost/models/media_folder_ref.rb +237 -0
- data/lib/postboost/models/mention.rb +290 -0
- data/lib/postboost/models/mention_identity.rb +257 -0
- data/lib/postboost/models/mention_identity_input.rb +325 -0
- data/lib/postboost/models/mention_input.rb +279 -0
- data/lib/postboost/models/pagination_meta.rb +2 -2
- data/lib/postboost/models/pagination_meta_links.rb +2 -2
- data/lib/postboost/models/pagination_meta_meta.rb +2 -2
- data/lib/postboost/models/post.rb +69 -3
- data/lib/postboost/models/post_analytics.rb +252 -0
- data/lib/postboost/models/post_content.rb +2 -2
- data/lib/postboost/models/post_input.rb +16 -3
- data/lib/postboost/models/post_status.rb +6 -3
- data/lib/postboost/models/post_version.rb +32 -3
- data/lib/postboost/models/posting_time_slot.rb +315 -0
- data/lib/postboost/models/posting_times.rb +362 -0
- data/lib/postboost/models/posting_times_best_inner.rb +269 -0
- data/lib/postboost/models/posting_times_day_intervals_inner_inner.rb +370 -0
- data/lib/postboost/models/posting_times_days_inner.rb +366 -0
- data/lib/postboost/models/public_workspace.rb +262 -0
- data/lib/postboost/models/public_workspace_pivot.rb +267 -0
- data/lib/postboost/models/publish_progress.rb +254 -0
- data/lib/postboost/models/receipt.rb +58 -2
- data/lib/postboost/models/receipt_input.rb +2 -2
- data/lib/postboost/models/receipt_update_input.rb +2 -2
- data/lib/postboost/models/remove_generic_subscription422_response.rb +214 -0
- data/lib/postboost/models/remove_user_from_workspace_request.rb +2 -2
- data/lib/postboost/models/retry_post_account_result.rb +275 -0
- data/lib/postboost/models/schedule_post_request.rb +48 -6
- data/lib/postboost/models/schedule_result.rb +23 -6
- data/lib/postboost/models/subscription.rb +37 -2
- data/lib/postboost/models/subscription_input.rb +2 -2
- data/lib/postboost/models/subscription_status.rb +2 -2
- data/lib/postboost/models/subscription_update_input.rb +2 -2
- data/lib/postboost/models/tag.rb +30 -2
- data/lib/postboost/models/tag_input.rb +2 -2
- data/lib/postboost/models/update_media_request.rb +61 -11
- data/lib/postboost/models/{upload_chunk200_response.rb → upload_chunk201_response.rb} +5 -5
- data/lib/postboost/models/user.rb +48 -3
- data/lib/postboost/models/user_input.rb +2 -2
- data/lib/postboost/models/user_update_input.rb +2 -2
- data/lib/postboost/models/workspace.rb +42 -3
- data/lib/postboost/models/workspace_input.rb +3 -9
- data/lib/postboost/models/workspace_user_input.rb +2 -2
- data/lib/postboost/version.rb +3 -3
- data/lib/postboost.rb +70 -6
- data/postboost.gemspec +3 -3
- data/spec/api/accounts_api_spec.rb +7 -3
- data/spec/api/ai_api_spec.rb +113 -0
- data/spec/api/analytics_api_spec.rb +113 -0
- data/spec/api/media_api_spec.rb +73 -10
- data/spec/api/mentions_api_spec.rb +103 -0
- data/spec/api/posts_api_spec.rb +38 -6
- data/spec/api/receipts_api_spec.rb +9 -2
- data/spec/api/subscriptions_api_spec.rb +12 -2
- data/spec/api/tags_api_spec.rb +7 -2
- data/spec/api/users_api_spec.rb +9 -2
- data/spec/api/workspaces_api_spec.rb +33 -2
- data/spec/models/account_analytics_initial_sync_spec.rb +42 -0
- data/spec/models/account_analytics_spec.rb +66 -0
- data/spec/models/account_schedule_spec.rb +48 -0
- data/spec/models/account_spec.rb +24 -2
- data/spec/models/add_generic_subscription_request_spec.rb +2 -2
- data/spec/models/add_post_to_queue_request_spec.rb +36 -0
- data/spec/models/ai_credits_spec.rb +48 -0
- data/spec/models/analytics_period_spec.rb +54 -0
- data/spec/models/analytics_summary_data_spec.rb +96 -0
- data/spec/models/analytics_summary_spec.rb +42 -0
- data/spec/models/approve_post_request_spec.rb +54 -0
- data/spec/models/best_posting_times_spec.rb +42 -0
- data/spec/models/best_posting_times_times_inner_spec.rb +54 -0
- data/spec/models/blog_to_social200_response_spec.rb +36 -0
- data/spec/models/blog_to_social429_response_spec.rb +36 -0
- data/spec/models/blog_to_social_caption_spec.rb +66 -0
- data/spec/models/blog_to_social_input_spec.rb +128 -0
- data/spec/models/blog_to_social_media_spec.rb +42 -0
- data/spec/models/blog_to_social_response_spec.rb +72 -0
- data/spec/models/cancel_subscription422_response_errors_spec.rb +36 -0
- data/spec/models/cancel_subscription422_response_spec.rb +42 -0
- data/spec/models/cancel_subscription_request_spec.rb +36 -0
- data/spec/models/change_subscription_plan_request_spec.rb +2 -2
- data/spec/models/checkout_subscription200_response_spec.rb +2 -2
- data/spec/models/checkout_subscription_request_spec.rb +2 -2
- data/spec/models/complete_chunked_upload_request_spec.rb +42 -0
- data/spec/models/create_media_folder_request_spec.rb +42 -0
- data/spec/models/create_mention201_response_spec.rb +36 -0
- data/spec/models/delete_media_bulk_request_items_inner_spec.rb +32 -0
- data/spec/models/delete_media_bulk_request_spec.rb +2 -2
- data/spec/models/delete_media_folder_request_spec.rb +36 -0
- data/spec/models/delete_mode_spec.rb +2 -2
- data/spec/models/delete_post_request_spec.rb +2 -2
- data/spec/models/delete_posts_bulk_request_spec.rb +2 -2
- data/spec/models/delete_receipts_bulk_request_spec.rb +2 -2
- data/spec/models/delete_result_spec.rb +2 -2
- data/spec/models/delete_user400_response_spec.rb +2 -2
- data/spec/models/delete_users_bulk_request_spec.rb +2 -2
- data/spec/models/delete_workspaces_bulk_request_spec.rb +2 -2
- data/spec/models/get_remote_upload_status200_response_spec.rb +2 -2
- data/spec/models/image_alt_text200_response_spec.rb +36 -0
- data/spec/models/image_alt_text_input_spec.rb +36 -0
- data/spec/models/image_alt_text_response_spec.rb +54 -0
- data/spec/models/image_edit_input_spec.rb +74 -0
- data/spec/models/image_generate200_response_spec.rb +36 -0
- data/spec/models/image_generate429_response_spec.rb +36 -0
- data/spec/models/image_generate_input_spec.rb +102 -0
- data/spec/models/image_generation_response_spec.rb +72 -0
- data/spec/models/image_prompt200_response_spec.rb +36 -0
- data/spec/models/image_prompt429_response_spec.rb +36 -0
- data/spec/models/image_prompt_input_spec.rb +70 -0
- data/spec/models/image_prompt_response_spec.rb +36 -0
- data/spec/models/image_variations200_response_spec.rb +36 -0
- data/spec/models/image_variations_input_spec.rb +62 -0
- data/spec/models/image_variations_response_spec.rb +60 -0
- data/spec/models/initiate_chunked_upload201_response_spec.rb +48 -0
- data/spec/models/initiate_chunked_upload_request_spec.rb +2 -2
- data/spec/models/initiate_remote_upload201_response_one_of_spec.rb +36 -0
- data/spec/models/initiate_remote_upload201_response_spec.rb +32 -0
- data/spec/models/initiate_remote_upload_request_spec.rb +8 -2
- data/spec/models/list_accounts200_response_spec.rb +2 -2
- data/spec/models/list_media200_response_spec.rb +2 -2
- data/spec/models/list_media_folders200_response_spec.rb +36 -0
- data/spec/models/list_mentions200_response_spec.rb +48 -0
- data/spec/models/list_my_workspaces200_response_spec.rb +36 -0
- data/spec/models/list_posts200_response_spec.rb +2 -2
- data/spec/models/list_receipts200_response_spec.rb +2 -2
- data/spec/models/list_tags200_response_spec.rb +2 -2
- data/spec/models/list_users200_response_spec.rb +2 -2
- data/spec/models/list_workspaces200_response_spec.rb +2 -2
- data/spec/models/media_folder_input_spec.rb +42 -0
- data/spec/models/media_folder_ref_spec.rb +42 -0
- data/spec/models/media_folder_spec.rb +54 -0
- data/spec/models/media_spec.rb +44 -2
- data/spec/models/mention_identity_input_spec.rb +60 -0
- data/spec/models/mention_identity_spec.rb +54 -0
- data/spec/models/mention_input_spec.rb +48 -0
- data/spec/models/mention_spec.rb +66 -0
- data/spec/models/pagination_meta_links_spec.rb +2 -2
- data/spec/models/pagination_meta_meta_spec.rb +2 -2
- data/spec/models/pagination_meta_spec.rb +2 -2
- data/spec/models/post_analytics_spec.rb +48 -0
- data/spec/models/post_content_spec.rb +2 -2
- data/spec/models/post_input_spec.rb +8 -2
- data/spec/models/post_spec.rb +8 -2
- data/spec/models/post_status_spec.rb +2 -2
- data/spec/models/post_version_spec.rb +8 -2
- data/spec/models/posting_time_slot_spec.rb +52 -0
- data/spec/models/posting_times_best_inner_spec.rb +54 -0
- data/spec/models/posting_times_day_intervals_inner_inner_spec.rb +70 -0
- data/spec/models/posting_times_days_inner_spec.rb +58 -0
- data/spec/models/posting_times_spec.rb +78 -0
- data/spec/models/public_workspace_pivot_spec.rb +52 -0
- data/spec/models/public_workspace_spec.rb +54 -0
- data/spec/models/publish_progress_spec.rb +48 -0
- data/spec/models/receipt_input_spec.rb +2 -2
- data/spec/models/receipt_spec.rb +2 -2
- data/spec/models/receipt_update_input_spec.rb +2 -2
- data/spec/models/remove_generic_subscription422_response_spec.rb +36 -0
- data/spec/models/remove_user_from_workspace_request_spec.rb +2 -2
- data/spec/models/retry_post_account_result_spec.rb +48 -0
- data/spec/models/schedule_post_request_spec.rb +26 -2
- data/spec/models/schedule_result_spec.rb +8 -2
- data/spec/models/subscription_input_spec.rb +2 -2
- data/spec/models/subscription_spec.rb +2 -2
- data/spec/models/subscription_status_spec.rb +2 -2
- data/spec/models/subscription_update_input_spec.rb +2 -2
- data/spec/models/tag_input_spec.rb +2 -2
- data/spec/models/tag_spec.rb +2 -2
- data/spec/models/update_media_request_spec.rb +14 -2
- data/spec/models/upload_chunk201_response_spec.rb +36 -0
- data/spec/models/user_input_spec.rb +2 -2
- data/spec/models/user_spec.rb +8 -2
- data/spec/models/user_update_input_spec.rb +2 -2
- data/spec/models/workspace_input_spec.rb +2 -2
- data/spec/models/workspace_spec.rb +8 -2
- data/spec/models/workspace_user_input_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- metadata +331 -75
- data/git_push.sh +0 -57
- data/spec/models/initiate_chunked_upload200_response_spec.rb +0 -48
- data/spec/models/initiate_remote_upload200_response_one_of_spec.rb +0 -36
- data/spec/models/initiate_remote_upload200_response_spec.rb +0 -32
- data/spec/models/upload_chunk200_response_spec.rb +0 -36
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PostBoost API
|
|
3
|
+
|
|
4
|
+
#The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Plan access Every workspace-scoped endpoint returns `403` when the workspace's plan does not include API access (capability `api`). ## Dates and times Post dates and times (`date`, `time`, `accounts_schedule`) are read in the request's `timezone` when one is given, otherwise in the workspace timezone. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.8.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 AnalyticsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get account analytics
|
|
23
|
+
# Analytics for one account. `type` selects one of the tabs the account supports (listed in `tabs` of the response); returns `422` when the account does not support analytics.
|
|
24
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
25
|
+
# @param account_uuid [String] UUID of the social media account.
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @option opts [String] :period Preset reporting period. Ignored when `date_from` and `date_to` are given. (default to 'this_month')
|
|
28
|
+
# @option opts [Date] :date_from Start of a custom range (Y-m-d). Required with `date_to`; the range may span at most 366 days.
|
|
29
|
+
# @option opts [Date] :date_to End of a custom range (Y-m-d). Required with `date_from`; must not be before it.
|
|
30
|
+
# @option opts [String] :type Analytics tab. Defaults to the account's default tab.
|
|
31
|
+
# @option opts [Integer] :page Page for list-style tabs (for example per-post metrics). (default to 1)
|
|
32
|
+
# @option opts [Integer] :per_page
|
|
33
|
+
# @option opts [String] :sort_by
|
|
34
|
+
# @option opts [String] :sort_dir (default to 'desc')
|
|
35
|
+
# @return [AccountAnalytics]
|
|
36
|
+
def get_account_analytics(workspace_uuid, account_uuid, opts = {})
|
|
37
|
+
data, _status_code, _headers = get_account_analytics_with_http_info(workspace_uuid, account_uuid, opts)
|
|
38
|
+
data
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Get account analytics
|
|
42
|
+
# Analytics for one account. `type` selects one of the tabs the account supports (listed in `tabs` of the response); returns `422` when the account does not support analytics.
|
|
43
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
44
|
+
# @param account_uuid [String] UUID of the social media account.
|
|
45
|
+
# @param [Hash] opts the optional parameters
|
|
46
|
+
# @option opts [String] :period Preset reporting period. Ignored when `date_from` and `date_to` are given. (default to 'this_month')
|
|
47
|
+
# @option opts [Date] :date_from Start of a custom range (Y-m-d). Required with `date_to`; the range may span at most 366 days.
|
|
48
|
+
# @option opts [Date] :date_to End of a custom range (Y-m-d). Required with `date_from`; must not be before it.
|
|
49
|
+
# @option opts [String] :type Analytics tab. Defaults to the account's default tab.
|
|
50
|
+
# @option opts [Integer] :page Page for list-style tabs (for example per-post metrics). (default to 1)
|
|
51
|
+
# @option opts [Integer] :per_page
|
|
52
|
+
# @option opts [String] :sort_by
|
|
53
|
+
# @option opts [String] :sort_dir (default to 'desc')
|
|
54
|
+
# @return [Array<(AccountAnalytics, Integer, Hash)>] AccountAnalytics data, response status code and response headers
|
|
55
|
+
def get_account_analytics_with_http_info(workspace_uuid, account_uuid, opts = {})
|
|
56
|
+
if @api_client.config.debugging
|
|
57
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.get_account_analytics ...'
|
|
58
|
+
end
|
|
59
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
60
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
61
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AnalyticsApi.get_account_analytics"
|
|
62
|
+
end
|
|
63
|
+
# verify the required parameter 'account_uuid' is set
|
|
64
|
+
if @api_client.config.client_side_validation && account_uuid.nil?
|
|
65
|
+
fail ArgumentError, "Missing the required parameter 'account_uuid' when calling AnalyticsApi.get_account_analytics"
|
|
66
|
+
end
|
|
67
|
+
allowable_values = ["this_week", "last_week", "this_month", "last_month", "last_3_months", "this_year"]
|
|
68
|
+
if @api_client.config.client_side_validation && opts[:'period'] && !allowable_values.include?(opts[:'period'])
|
|
69
|
+
fail ArgumentError, "invalid value for \"period\", must be one of #{allowable_values}"
|
|
70
|
+
end
|
|
71
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
72
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AnalyticsApi.get_account_analytics, must be greater than or equal to 1.'
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 50
|
|
76
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AnalyticsApi.get_account_analytics, must be smaller than or equal to 50.'
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
|
80
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AnalyticsApi.get_account_analytics, must be greater than or equal to 1.'
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if @api_client.config.client_side_validation && !opts[:'sort_by'].nil? && opts[:'sort_by'].to_s.length > 64
|
|
84
|
+
fail ArgumentError, 'invalid value for "opts[:"sort_by"]" when calling AnalyticsApi.get_account_analytics, the character length must be smaller than or equal to 64.'
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
allowable_values = ["asc", "desc"]
|
|
88
|
+
if @api_client.config.client_side_validation && opts[:'sort_dir'] && !allowable_values.include?(opts[:'sort_dir'])
|
|
89
|
+
fail ArgumentError, "invalid value for \"sort_dir\", must be one of #{allowable_values}"
|
|
90
|
+
end
|
|
91
|
+
# resource path
|
|
92
|
+
local_var_path = '/{workspaceUuid}/analytics/accounts/{accountUuid}'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'accountUuid' + '}', CGI.escape(account_uuid.to_s))
|
|
93
|
+
|
|
94
|
+
# query parameters
|
|
95
|
+
query_params = opts[:query_params] || {}
|
|
96
|
+
query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
|
|
97
|
+
query_params[:'date_from'] = opts[:'date_from'] if !opts[:'date_from'].nil?
|
|
98
|
+
query_params[:'date_to'] = opts[:'date_to'] if !opts[:'date_to'].nil?
|
|
99
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
|
100
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
101
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
102
|
+
query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
|
|
103
|
+
query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?
|
|
104
|
+
|
|
105
|
+
# header parameters
|
|
106
|
+
header_params = opts[:header_params] || {}
|
|
107
|
+
# HTTP header 'Accept' (if needed)
|
|
108
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
109
|
+
|
|
110
|
+
# form parameters
|
|
111
|
+
form_params = opts[:form_params] || {}
|
|
112
|
+
|
|
113
|
+
# http body (model)
|
|
114
|
+
post_body = opts[:debug_body]
|
|
115
|
+
|
|
116
|
+
# return_type
|
|
117
|
+
return_type = opts[:debug_return_type] || 'AccountAnalytics'
|
|
118
|
+
|
|
119
|
+
# auth_names
|
|
120
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
121
|
+
|
|
122
|
+
new_options = opts.merge(
|
|
123
|
+
:operation => :"AnalyticsApi.get_account_analytics",
|
|
124
|
+
:header_params => header_params,
|
|
125
|
+
:query_params => query_params,
|
|
126
|
+
:form_params => form_params,
|
|
127
|
+
:body => post_body,
|
|
128
|
+
:auth_names => auth_names,
|
|
129
|
+
:return_type => return_type
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
133
|
+
if @api_client.config.debugging
|
|
134
|
+
@api_client.config.logger.debug "API called: AnalyticsApi#get_account_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
135
|
+
end
|
|
136
|
+
return data, status_code, headers
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Get analytics summary
|
|
140
|
+
# Cross-platform summary (followers, growth, posts, leaderboard, posting streak) over every account that supports analytics, for a preset period or a custom date range.
|
|
141
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
142
|
+
# @param [Hash] opts the optional parameters
|
|
143
|
+
# @option opts [String] :period Preset reporting period. Ignored when `date_from` and `date_to` are given. (default to 'this_month')
|
|
144
|
+
# @option opts [Date] :date_from Start of a custom range (Y-m-d). Required with `date_to`; the range may span at most 366 days.
|
|
145
|
+
# @option opts [Date] :date_to End of a custom range (Y-m-d). Required with `date_from`; must not be before it.
|
|
146
|
+
# @return [AnalyticsSummary]
|
|
147
|
+
def get_analytics_summary(workspace_uuid, opts = {})
|
|
148
|
+
data, _status_code, _headers = get_analytics_summary_with_http_info(workspace_uuid, opts)
|
|
149
|
+
data
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Get analytics summary
|
|
153
|
+
# Cross-platform summary (followers, growth, posts, leaderboard, posting streak) over every account that supports analytics, for a preset period or a custom date range.
|
|
154
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
155
|
+
# @param [Hash] opts the optional parameters
|
|
156
|
+
# @option opts [String] :period Preset reporting period. Ignored when `date_from` and `date_to` are given. (default to 'this_month')
|
|
157
|
+
# @option opts [Date] :date_from Start of a custom range (Y-m-d). Required with `date_to`; the range may span at most 366 days.
|
|
158
|
+
# @option opts [Date] :date_to End of a custom range (Y-m-d). Required with `date_from`; must not be before it.
|
|
159
|
+
# @return [Array<(AnalyticsSummary, Integer, Hash)>] AnalyticsSummary data, response status code and response headers
|
|
160
|
+
def get_analytics_summary_with_http_info(workspace_uuid, opts = {})
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.get_analytics_summary ...'
|
|
163
|
+
end
|
|
164
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
165
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
166
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AnalyticsApi.get_analytics_summary"
|
|
167
|
+
end
|
|
168
|
+
allowable_values = ["this_week", "last_week", "this_month", "last_month", "last_3_months", "this_year"]
|
|
169
|
+
if @api_client.config.client_side_validation && opts[:'period'] && !allowable_values.include?(opts[:'period'])
|
|
170
|
+
fail ArgumentError, "invalid value for \"period\", must be one of #{allowable_values}"
|
|
171
|
+
end
|
|
172
|
+
# resource path
|
|
173
|
+
local_var_path = '/{workspaceUuid}/analytics'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
174
|
+
|
|
175
|
+
# query parameters
|
|
176
|
+
query_params = opts[:query_params] || {}
|
|
177
|
+
query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
|
|
178
|
+
query_params[:'date_from'] = opts[:'date_from'] if !opts[:'date_from'].nil?
|
|
179
|
+
query_params[:'date_to'] = opts[:'date_to'] if !opts[:'date_to'].nil?
|
|
180
|
+
|
|
181
|
+
# header parameters
|
|
182
|
+
header_params = opts[:header_params] || {}
|
|
183
|
+
# HTTP header 'Accept' (if needed)
|
|
184
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
185
|
+
|
|
186
|
+
# form parameters
|
|
187
|
+
form_params = opts[:form_params] || {}
|
|
188
|
+
|
|
189
|
+
# http body (model)
|
|
190
|
+
post_body = opts[:debug_body]
|
|
191
|
+
|
|
192
|
+
# return_type
|
|
193
|
+
return_type = opts[:debug_return_type] || 'AnalyticsSummary'
|
|
194
|
+
|
|
195
|
+
# auth_names
|
|
196
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
197
|
+
|
|
198
|
+
new_options = opts.merge(
|
|
199
|
+
:operation => :"AnalyticsApi.get_analytics_summary",
|
|
200
|
+
:header_params => header_params,
|
|
201
|
+
:query_params => query_params,
|
|
202
|
+
:form_params => form_params,
|
|
203
|
+
:body => post_body,
|
|
204
|
+
:auth_names => auth_names,
|
|
205
|
+
:return_type => return_type
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
209
|
+
if @api_client.config.debugging
|
|
210
|
+
@api_client.config.logger.debug "API called: AnalyticsApi#get_analytics_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
211
|
+
end
|
|
212
|
+
return data, status_code, headers
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Get best posting times
|
|
216
|
+
# The next recommended date and time per account, on or after `from` (never in the past), within the next 14 days.
|
|
217
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
218
|
+
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @option opts [Array<String>] :accounts Account UUIDs. Defaults to every account in the workspace.
|
|
220
|
+
# @option opts [Date] :from Earliest date to recommend (Y-m-d). Defaults to now.
|
|
221
|
+
# @option opts [String] :timezone Timezone for `from` and the returned times. Defaults to the workspace timezone.
|
|
222
|
+
# @return [BestPostingTimes]
|
|
223
|
+
def get_best_posting_times(workspace_uuid, opts = {})
|
|
224
|
+
data, _status_code, _headers = get_best_posting_times_with_http_info(workspace_uuid, opts)
|
|
225
|
+
data
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Get best posting times
|
|
229
|
+
# The next recommended date and time per account, on or after `from` (never in the past), within the next 14 days.
|
|
230
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
231
|
+
# @param [Hash] opts the optional parameters
|
|
232
|
+
# @option opts [Array<String>] :accounts Account UUIDs. Defaults to every account in the workspace.
|
|
233
|
+
# @option opts [Date] :from Earliest date to recommend (Y-m-d). Defaults to now.
|
|
234
|
+
# @option opts [String] :timezone Timezone for `from` and the returned times. Defaults to the workspace timezone.
|
|
235
|
+
# @return [Array<(BestPostingTimes, Integer, Hash)>] BestPostingTimes data, response status code and response headers
|
|
236
|
+
def get_best_posting_times_with_http_info(workspace_uuid, opts = {})
|
|
237
|
+
if @api_client.config.debugging
|
|
238
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.get_best_posting_times ...'
|
|
239
|
+
end
|
|
240
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
241
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
242
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AnalyticsApi.get_best_posting_times"
|
|
243
|
+
end
|
|
244
|
+
# resource path
|
|
245
|
+
local_var_path = '/{workspaceUuid}/analytics/best-times'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
246
|
+
|
|
247
|
+
# query parameters
|
|
248
|
+
query_params = opts[:query_params] || {}
|
|
249
|
+
query_params[:'accounts[]'] = @api_client.build_collection_param(opts[:'accounts'], :multi) if !opts[:'accounts'].nil?
|
|
250
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
|
251
|
+
query_params[:'timezone'] = opts[:'timezone'] if !opts[:'timezone'].nil?
|
|
252
|
+
|
|
253
|
+
# header parameters
|
|
254
|
+
header_params = opts[:header_params] || {}
|
|
255
|
+
# HTTP header 'Accept' (if needed)
|
|
256
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
257
|
+
|
|
258
|
+
# form parameters
|
|
259
|
+
form_params = opts[:form_params] || {}
|
|
260
|
+
|
|
261
|
+
# http body (model)
|
|
262
|
+
post_body = opts[:debug_body]
|
|
263
|
+
|
|
264
|
+
# return_type
|
|
265
|
+
return_type = opts[:debug_return_type] || 'BestPostingTimes'
|
|
266
|
+
|
|
267
|
+
# auth_names
|
|
268
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
269
|
+
|
|
270
|
+
new_options = opts.merge(
|
|
271
|
+
:operation => :"AnalyticsApi.get_best_posting_times",
|
|
272
|
+
:header_params => header_params,
|
|
273
|
+
:query_params => query_params,
|
|
274
|
+
:form_params => form_params,
|
|
275
|
+
:body => post_body,
|
|
276
|
+
:auth_names => auth_names,
|
|
277
|
+
:return_type => return_type
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
281
|
+
if @api_client.config.debugging
|
|
282
|
+
@api_client.config.logger.debug "API called: AnalyticsApi#get_best_posting_times\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
283
|
+
end
|
|
284
|
+
return data, status_code, headers
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Get post analytics
|
|
288
|
+
# Engagement metrics for a published post across its accounts (also works for trashed posts), with totals, trends and the best-performing account.
|
|
289
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
290
|
+
# @param post_uuid [String] UUID of the post.
|
|
291
|
+
# @param [Hash] opts the optional parameters
|
|
292
|
+
# @return [PostAnalytics]
|
|
293
|
+
def get_post_analytics_0(workspace_uuid, post_uuid, opts = {})
|
|
294
|
+
data, _status_code, _headers = get_post_analytics_0_with_http_info(workspace_uuid, post_uuid, opts)
|
|
295
|
+
data
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Get post analytics
|
|
299
|
+
# Engagement metrics for a published post across its accounts (also works for trashed posts), with totals, trends and the best-performing account.
|
|
300
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
301
|
+
# @param post_uuid [String] UUID of the post.
|
|
302
|
+
# @param [Hash] opts the optional parameters
|
|
303
|
+
# @return [Array<(PostAnalytics, Integer, Hash)>] PostAnalytics data, response status code and response headers
|
|
304
|
+
def get_post_analytics_0_with_http_info(workspace_uuid, post_uuid, opts = {})
|
|
305
|
+
if @api_client.config.debugging
|
|
306
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.get_post_analytics_0 ...'
|
|
307
|
+
end
|
|
308
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
309
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
310
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AnalyticsApi.get_post_analytics_0"
|
|
311
|
+
end
|
|
312
|
+
# verify the required parameter 'post_uuid' is set
|
|
313
|
+
if @api_client.config.client_side_validation && post_uuid.nil?
|
|
314
|
+
fail ArgumentError, "Missing the required parameter 'post_uuid' when calling AnalyticsApi.get_post_analytics_0"
|
|
315
|
+
end
|
|
316
|
+
# resource path
|
|
317
|
+
local_var_path = '/{workspaceUuid}/posts/{postUuid}/analytics'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s)).sub('{' + 'postUuid' + '}', CGI.escape(post_uuid.to_s))
|
|
318
|
+
|
|
319
|
+
# query parameters
|
|
320
|
+
query_params = opts[:query_params] || {}
|
|
321
|
+
|
|
322
|
+
# header parameters
|
|
323
|
+
header_params = opts[:header_params] || {}
|
|
324
|
+
# HTTP header 'Accept' (if needed)
|
|
325
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
326
|
+
|
|
327
|
+
# form parameters
|
|
328
|
+
form_params = opts[:form_params] || {}
|
|
329
|
+
|
|
330
|
+
# http body (model)
|
|
331
|
+
post_body = opts[:debug_body]
|
|
332
|
+
|
|
333
|
+
# return_type
|
|
334
|
+
return_type = opts[:debug_return_type] || 'PostAnalytics'
|
|
335
|
+
|
|
336
|
+
# auth_names
|
|
337
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
338
|
+
|
|
339
|
+
new_options = opts.merge(
|
|
340
|
+
:operation => :"AnalyticsApi.get_post_analytics_0",
|
|
341
|
+
:header_params => header_params,
|
|
342
|
+
:query_params => query_params,
|
|
343
|
+
:form_params => form_params,
|
|
344
|
+
:body => post_body,
|
|
345
|
+
:auth_names => auth_names,
|
|
346
|
+
:return_type => return_type
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
350
|
+
if @api_client.config.debugging
|
|
351
|
+
@api_client.config.logger.debug "API called: AnalyticsApi#get_post_analytics_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
352
|
+
end
|
|
353
|
+
return data, status_code, headers
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Get posting times heatmap
|
|
357
|
+
# Engagement scores per weekday and hour, merged across the given accounts (all accounts when none is given), in the requested timezone. Also returns up to three recommended slots.
|
|
358
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
359
|
+
# @param [Hash] opts the optional parameters
|
|
360
|
+
# @option opts [Array<String>] :accounts Account UUIDs. Defaults to every account in the workspace.
|
|
361
|
+
# @option opts [String] :timezone Timezone the grid is expressed in. Defaults to the workspace timezone.
|
|
362
|
+
# @return [PostingTimes]
|
|
363
|
+
def get_posting_times(workspace_uuid, opts = {})
|
|
364
|
+
data, _status_code, _headers = get_posting_times_with_http_info(workspace_uuid, opts)
|
|
365
|
+
data
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Get posting times heatmap
|
|
369
|
+
# Engagement scores per weekday and hour, merged across the given accounts (all accounts when none is given), in the requested timezone. Also returns up to three recommended slots.
|
|
370
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
371
|
+
# @param [Hash] opts the optional parameters
|
|
372
|
+
# @option opts [Array<String>] :accounts Account UUIDs. Defaults to every account in the workspace.
|
|
373
|
+
# @option opts [String] :timezone Timezone the grid is expressed in. Defaults to the workspace timezone.
|
|
374
|
+
# @return [Array<(PostingTimes, Integer, Hash)>] PostingTimes data, response status code and response headers
|
|
375
|
+
def get_posting_times_with_http_info(workspace_uuid, opts = {})
|
|
376
|
+
if @api_client.config.debugging
|
|
377
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.get_posting_times ...'
|
|
378
|
+
end
|
|
379
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
380
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
381
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AnalyticsApi.get_posting_times"
|
|
382
|
+
end
|
|
383
|
+
# resource path
|
|
384
|
+
local_var_path = '/{workspaceUuid}/analytics/posting-times'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
385
|
+
|
|
386
|
+
# query parameters
|
|
387
|
+
query_params = opts[:query_params] || {}
|
|
388
|
+
query_params[:'accounts[]'] = @api_client.build_collection_param(opts[:'accounts'], :multi) if !opts[:'accounts'].nil?
|
|
389
|
+
query_params[:'timezone'] = opts[:'timezone'] if !opts[:'timezone'].nil?
|
|
390
|
+
|
|
391
|
+
# header parameters
|
|
392
|
+
header_params = opts[:header_params] || {}
|
|
393
|
+
# HTTP header 'Accept' (if needed)
|
|
394
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
395
|
+
|
|
396
|
+
# form parameters
|
|
397
|
+
form_params = opts[:form_params] || {}
|
|
398
|
+
|
|
399
|
+
# http body (model)
|
|
400
|
+
post_body = opts[:debug_body]
|
|
401
|
+
|
|
402
|
+
# return_type
|
|
403
|
+
return_type = opts[:debug_return_type] || 'PostingTimes'
|
|
404
|
+
|
|
405
|
+
# auth_names
|
|
406
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
407
|
+
|
|
408
|
+
new_options = opts.merge(
|
|
409
|
+
:operation => :"AnalyticsApi.get_posting_times",
|
|
410
|
+
:header_params => header_params,
|
|
411
|
+
:query_params => query_params,
|
|
412
|
+
:form_params => form_params,
|
|
413
|
+
:body => post_body,
|
|
414
|
+
:auth_names => auth_names,
|
|
415
|
+
:return_type => return_type
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
419
|
+
if @api_client.config.debugging
|
|
420
|
+
@api_client.config.logger.debug "API called: AnalyticsApi#get_posting_times\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
421
|
+
end
|
|
422
|
+
return data, status_code, headers
|
|
423
|
+
end
|
|
424
|
+
end
|
|
425
|
+
end
|