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,466 @@
|
|
|
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 AIApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Generate social media captions from a blog post
|
|
23
|
+
# Generates platform-specific social media captions from a blog post URL or directly provided title and excerpt. Each platform generates one caption, which consumes one AI credit from the workspace's monthly allowance. **Input modes** (at least one required): - **URL mode**: provide `url` and the API scrapes the blog content automatically, including detecting the featured image via `og:image`. - **Direct mode**: provide `title` and `excerpt` directly (no scraping). If both are provided, direct values take priority. When `create_post` is `true`, a draft post is created in the workspace with per-account caption versions. If an image is available (from `image_url` or the scraped `og:image`), it is imported into the workspace media library and attached to the draft post.
|
|
24
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
25
|
+
# @param blog_to_social_input [BlogToSocialInput]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [BlogToSocial200Response]
|
|
28
|
+
def blog_to_social(workspace_uuid, blog_to_social_input, opts = {})
|
|
29
|
+
data, _status_code, _headers = blog_to_social_with_http_info(workspace_uuid, blog_to_social_input, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Generate social media captions from a blog post
|
|
34
|
+
# Generates platform-specific social media captions from a blog post URL or directly provided title and excerpt. Each platform generates one caption, which consumes one AI credit from the workspace's monthly allowance. **Input modes** (at least one required): - **URL mode**: provide `url` and the API scrapes the blog content automatically, including detecting the featured image via `og:image`. - **Direct mode**: provide `title` and `excerpt` directly (no scraping). If both are provided, direct values take priority. When `create_post` is `true`, a draft post is created in the workspace with per-account caption versions. If an image is available (from `image_url` or the scraped `og:image`), it is imported into the workspace media library and attached to the draft post.
|
|
35
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
36
|
+
# @param blog_to_social_input [BlogToSocialInput]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(BlogToSocial200Response, Integer, Hash)>] BlogToSocial200Response data, response status code and response headers
|
|
39
|
+
def blog_to_social_with_http_info(workspace_uuid, blog_to_social_input, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: AIApi.blog_to_social ...'
|
|
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 AIApi.blog_to_social"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'blog_to_social_input' is set
|
|
48
|
+
if @api_client.config.client_side_validation && blog_to_social_input.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'blog_to_social_input' when calling AIApi.blog_to_social"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/{workspaceUuid}/ai/blog-to-social'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_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
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(blog_to_social_input)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'BlogToSocial200Response'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"AIApi.blog_to_social",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: AIApi#blog_to_social\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Generate alt text for a media image using AI
|
|
97
|
+
# Analyzes an existing workspace media item and generates accessible alt text. The alt text is saved back to the media record. Costs 1 AI credit per call.
|
|
98
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
99
|
+
# @param image_alt_text_input [ImageAltTextInput]
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @return [ImageAltText200Response]
|
|
102
|
+
def image_alt_text(workspace_uuid, image_alt_text_input, opts = {})
|
|
103
|
+
data, _status_code, _headers = image_alt_text_with_http_info(workspace_uuid, image_alt_text_input, opts)
|
|
104
|
+
data
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Generate alt text for a media image using AI
|
|
108
|
+
# Analyzes an existing workspace media item and generates accessible alt text. The alt text is saved back to the media record. Costs 1 AI credit per call.
|
|
109
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
110
|
+
# @param image_alt_text_input [ImageAltTextInput]
|
|
111
|
+
# @param [Hash] opts the optional parameters
|
|
112
|
+
# @return [Array<(ImageAltText200Response, Integer, Hash)>] ImageAltText200Response data, response status code and response headers
|
|
113
|
+
def image_alt_text_with_http_info(workspace_uuid, image_alt_text_input, opts = {})
|
|
114
|
+
if @api_client.config.debugging
|
|
115
|
+
@api_client.config.logger.debug 'Calling API: AIApi.image_alt_text ...'
|
|
116
|
+
end
|
|
117
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
118
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
119
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AIApi.image_alt_text"
|
|
120
|
+
end
|
|
121
|
+
# verify the required parameter 'image_alt_text_input' is set
|
|
122
|
+
if @api_client.config.client_side_validation && image_alt_text_input.nil?
|
|
123
|
+
fail ArgumentError, "Missing the required parameter 'image_alt_text_input' when calling AIApi.image_alt_text"
|
|
124
|
+
end
|
|
125
|
+
# resource path
|
|
126
|
+
local_var_path = '/{workspaceUuid}/ai/image-alt-text'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
127
|
+
|
|
128
|
+
# query parameters
|
|
129
|
+
query_params = opts[:query_params] || {}
|
|
130
|
+
|
|
131
|
+
# header parameters
|
|
132
|
+
header_params = opts[:header_params] || {}
|
|
133
|
+
# HTTP header 'Accept' (if needed)
|
|
134
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
135
|
+
# HTTP header 'Content-Type'
|
|
136
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
137
|
+
if !content_type.nil?
|
|
138
|
+
header_params['Content-Type'] = content_type
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# form parameters
|
|
142
|
+
form_params = opts[:form_params] || {}
|
|
143
|
+
|
|
144
|
+
# http body (model)
|
|
145
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(image_alt_text_input)
|
|
146
|
+
|
|
147
|
+
# return_type
|
|
148
|
+
return_type = opts[:debug_return_type] || 'ImageAltText200Response'
|
|
149
|
+
|
|
150
|
+
# auth_names
|
|
151
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
152
|
+
|
|
153
|
+
new_options = opts.merge(
|
|
154
|
+
:operation => :"AIApi.image_alt_text",
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => return_type
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "API called: AIApi#image_alt_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
166
|
+
end
|
|
167
|
+
return data, status_code, headers
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Edit an existing media image using AI
|
|
171
|
+
# Edits an existing workspace media item using the source image and a text prompt. Optionally accepts a mask (transparent areas are replaced). Saves results to the media library. Credits: `count × credit_weight`.
|
|
172
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
173
|
+
# @param image_edit_input [ImageEditInput]
|
|
174
|
+
# @param [Hash] opts the optional parameters
|
|
175
|
+
# @return [ImageGenerate200Response]
|
|
176
|
+
def image_edit(workspace_uuid, image_edit_input, opts = {})
|
|
177
|
+
data, _status_code, _headers = image_edit_with_http_info(workspace_uuid, image_edit_input, opts)
|
|
178
|
+
data
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Edit an existing media image using AI
|
|
182
|
+
# Edits an existing workspace media item using the source image and a text prompt. Optionally accepts a mask (transparent areas are replaced). Saves results to the media library. Credits: `count × credit_weight`.
|
|
183
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
184
|
+
# @param image_edit_input [ImageEditInput]
|
|
185
|
+
# @param [Hash] opts the optional parameters
|
|
186
|
+
# @return [Array<(ImageGenerate200Response, Integer, Hash)>] ImageGenerate200Response data, response status code and response headers
|
|
187
|
+
def image_edit_with_http_info(workspace_uuid, image_edit_input, opts = {})
|
|
188
|
+
if @api_client.config.debugging
|
|
189
|
+
@api_client.config.logger.debug 'Calling API: AIApi.image_edit ...'
|
|
190
|
+
end
|
|
191
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
192
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
193
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AIApi.image_edit"
|
|
194
|
+
end
|
|
195
|
+
# verify the required parameter 'image_edit_input' is set
|
|
196
|
+
if @api_client.config.client_side_validation && image_edit_input.nil?
|
|
197
|
+
fail ArgumentError, "Missing the required parameter 'image_edit_input' when calling AIApi.image_edit"
|
|
198
|
+
end
|
|
199
|
+
# resource path
|
|
200
|
+
local_var_path = '/{workspaceUuid}/ai/image-edit'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
201
|
+
|
|
202
|
+
# query parameters
|
|
203
|
+
query_params = opts[:query_params] || {}
|
|
204
|
+
|
|
205
|
+
# header parameters
|
|
206
|
+
header_params = opts[:header_params] || {}
|
|
207
|
+
# HTTP header 'Accept' (if needed)
|
|
208
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
209
|
+
# HTTP header 'Content-Type'
|
|
210
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
211
|
+
if !content_type.nil?
|
|
212
|
+
header_params['Content-Type'] = content_type
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# form parameters
|
|
216
|
+
form_params = opts[:form_params] || {}
|
|
217
|
+
|
|
218
|
+
# http body (model)
|
|
219
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(image_edit_input)
|
|
220
|
+
|
|
221
|
+
# return_type
|
|
222
|
+
return_type = opts[:debug_return_type] || 'ImageGenerate200Response'
|
|
223
|
+
|
|
224
|
+
# auth_names
|
|
225
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
226
|
+
|
|
227
|
+
new_options = opts.merge(
|
|
228
|
+
:operation => :"AIApi.image_edit",
|
|
229
|
+
:header_params => header_params,
|
|
230
|
+
:query_params => query_params,
|
|
231
|
+
:form_params => form_params,
|
|
232
|
+
:body => post_body,
|
|
233
|
+
:auth_names => auth_names,
|
|
234
|
+
:return_type => return_type
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
238
|
+
if @api_client.config.debugging
|
|
239
|
+
@api_client.config.logger.debug "API called: AIApi#image_edit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
240
|
+
end
|
|
241
|
+
return data, status_code, headers
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Generate social media images from a caption
|
|
245
|
+
# Generates one or more images and saves them immediately to the workspace media library. **Standard mode** (recommended): provide `caption` + `platform`. PostBoost builds a professional image prompt internally using platform-specific templates. No prompt engineering required. **Developer mode**: provide `prompt` directly to bypass prompt building. If both `caption` and `prompt` are sent, standard mode runs. Credits: `count x credit_weight` (default: 5 per image).
|
|
246
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
247
|
+
# @param image_generate_input [ImageGenerateInput]
|
|
248
|
+
# @param [Hash] opts the optional parameters
|
|
249
|
+
# @return [ImageGenerate200Response]
|
|
250
|
+
def image_generate(workspace_uuid, image_generate_input, opts = {})
|
|
251
|
+
data, _status_code, _headers = image_generate_with_http_info(workspace_uuid, image_generate_input, opts)
|
|
252
|
+
data
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Generate social media images from a caption
|
|
256
|
+
# Generates one or more images and saves them immediately to the workspace media library. **Standard mode** (recommended): provide `caption` + `platform`. PostBoost builds a professional image prompt internally using platform-specific templates. No prompt engineering required. **Developer mode**: provide `prompt` directly to bypass prompt building. If both `caption` and `prompt` are sent, standard mode runs. Credits: `count x credit_weight` (default: 5 per image).
|
|
257
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
258
|
+
# @param image_generate_input [ImageGenerateInput]
|
|
259
|
+
# @param [Hash] opts the optional parameters
|
|
260
|
+
# @return [Array<(ImageGenerate200Response, Integer, Hash)>] ImageGenerate200Response data, response status code and response headers
|
|
261
|
+
def image_generate_with_http_info(workspace_uuid, image_generate_input, opts = {})
|
|
262
|
+
if @api_client.config.debugging
|
|
263
|
+
@api_client.config.logger.debug 'Calling API: AIApi.image_generate ...'
|
|
264
|
+
end
|
|
265
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
266
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
267
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AIApi.image_generate"
|
|
268
|
+
end
|
|
269
|
+
# verify the required parameter 'image_generate_input' is set
|
|
270
|
+
if @api_client.config.client_side_validation && image_generate_input.nil?
|
|
271
|
+
fail ArgumentError, "Missing the required parameter 'image_generate_input' when calling AIApi.image_generate"
|
|
272
|
+
end
|
|
273
|
+
# resource path
|
|
274
|
+
local_var_path = '/{workspaceUuid}/ai/image-generate'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
275
|
+
|
|
276
|
+
# query parameters
|
|
277
|
+
query_params = opts[:query_params] || {}
|
|
278
|
+
|
|
279
|
+
# header parameters
|
|
280
|
+
header_params = opts[:header_params] || {}
|
|
281
|
+
# HTTP header 'Accept' (if needed)
|
|
282
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
283
|
+
# HTTP header 'Content-Type'
|
|
284
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
285
|
+
if !content_type.nil?
|
|
286
|
+
header_params['Content-Type'] = content_type
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# form parameters
|
|
290
|
+
form_params = opts[:form_params] || {}
|
|
291
|
+
|
|
292
|
+
# http body (model)
|
|
293
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(image_generate_input)
|
|
294
|
+
|
|
295
|
+
# return_type
|
|
296
|
+
return_type = opts[:debug_return_type] || 'ImageGenerate200Response'
|
|
297
|
+
|
|
298
|
+
# auth_names
|
|
299
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
300
|
+
|
|
301
|
+
new_options = opts.merge(
|
|
302
|
+
:operation => :"AIApi.image_generate",
|
|
303
|
+
:header_params => header_params,
|
|
304
|
+
:query_params => query_params,
|
|
305
|
+
:form_params => form_params,
|
|
306
|
+
:body => post_body,
|
|
307
|
+
:auth_names => auth_names,
|
|
308
|
+
:return_type => return_type
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
312
|
+
if @api_client.config.debugging
|
|
313
|
+
@api_client.config.logger.debug "API called: AIApi#image_generate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
314
|
+
end
|
|
315
|
+
return data, status_code, headers
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Build an optimized image prompt from a social media caption
|
|
319
|
+
# Builds a professional image generation prompt from a caption and platform. No image is generated. Use this to preview the prompt before calling `image-generate`. Costs 1 AI credit per call. When `image-generate` builds the prompt internally (standard mode), no credit is charged for the prompt step.
|
|
320
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
321
|
+
# @param image_prompt_input [ImagePromptInput]
|
|
322
|
+
# @param [Hash] opts the optional parameters
|
|
323
|
+
# @return [ImagePrompt200Response]
|
|
324
|
+
def image_prompt(workspace_uuid, image_prompt_input, opts = {})
|
|
325
|
+
data, _status_code, _headers = image_prompt_with_http_info(workspace_uuid, image_prompt_input, opts)
|
|
326
|
+
data
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Build an optimized image prompt from a social media caption
|
|
330
|
+
# Builds a professional image generation prompt from a caption and platform. No image is generated. Use this to preview the prompt before calling `image-generate`. Costs 1 AI credit per call. When `image-generate` builds the prompt internally (standard mode), no credit is charged for the prompt step.
|
|
331
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
332
|
+
# @param image_prompt_input [ImagePromptInput]
|
|
333
|
+
# @param [Hash] opts the optional parameters
|
|
334
|
+
# @return [Array<(ImagePrompt200Response, Integer, Hash)>] ImagePrompt200Response data, response status code and response headers
|
|
335
|
+
def image_prompt_with_http_info(workspace_uuid, image_prompt_input, opts = {})
|
|
336
|
+
if @api_client.config.debugging
|
|
337
|
+
@api_client.config.logger.debug 'Calling API: AIApi.image_prompt ...'
|
|
338
|
+
end
|
|
339
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
340
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
341
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AIApi.image_prompt"
|
|
342
|
+
end
|
|
343
|
+
# verify the required parameter 'image_prompt_input' is set
|
|
344
|
+
if @api_client.config.client_side_validation && image_prompt_input.nil?
|
|
345
|
+
fail ArgumentError, "Missing the required parameter 'image_prompt_input' when calling AIApi.image_prompt"
|
|
346
|
+
end
|
|
347
|
+
# resource path
|
|
348
|
+
local_var_path = '/{workspaceUuid}/ai/image-prompt'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
349
|
+
|
|
350
|
+
# query parameters
|
|
351
|
+
query_params = opts[:query_params] || {}
|
|
352
|
+
|
|
353
|
+
# header parameters
|
|
354
|
+
header_params = opts[:header_params] || {}
|
|
355
|
+
# HTTP header 'Accept' (if needed)
|
|
356
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
357
|
+
# HTTP header 'Content-Type'
|
|
358
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
359
|
+
if !content_type.nil?
|
|
360
|
+
header_params['Content-Type'] = content_type
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# form parameters
|
|
364
|
+
form_params = opts[:form_params] || {}
|
|
365
|
+
|
|
366
|
+
# http body (model)
|
|
367
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(image_prompt_input)
|
|
368
|
+
|
|
369
|
+
# return_type
|
|
370
|
+
return_type = opts[:debug_return_type] || 'ImagePrompt200Response'
|
|
371
|
+
|
|
372
|
+
# auth_names
|
|
373
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
374
|
+
|
|
375
|
+
new_options = opts.merge(
|
|
376
|
+
:operation => :"AIApi.image_prompt",
|
|
377
|
+
:header_params => header_params,
|
|
378
|
+
:query_params => query_params,
|
|
379
|
+
:form_params => form_params,
|
|
380
|
+
:body => post_body,
|
|
381
|
+
:auth_names => auth_names,
|
|
382
|
+
:return_type => return_type
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
386
|
+
if @api_client.config.debugging
|
|
387
|
+
@api_client.config.logger.debug "API called: AIApi#image_prompt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
388
|
+
end
|
|
389
|
+
return data, status_code, headers
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
# Generate variations of an existing media image
|
|
393
|
+
# Creates one or more variations of an existing workspace media item. Saves results to the media library. Credits: `count × credit_weight`.
|
|
394
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
395
|
+
# @param image_variations_input [ImageVariationsInput]
|
|
396
|
+
# @param [Hash] opts the optional parameters
|
|
397
|
+
# @return [ImageVariations200Response]
|
|
398
|
+
def image_variations(workspace_uuid, image_variations_input, opts = {})
|
|
399
|
+
data, _status_code, _headers = image_variations_with_http_info(workspace_uuid, image_variations_input, opts)
|
|
400
|
+
data
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# Generate variations of an existing media image
|
|
404
|
+
# Creates one or more variations of an existing workspace media item. Saves results to the media library. Credits: `count × credit_weight`.
|
|
405
|
+
# @param workspace_uuid [String] UUID of the workspace.
|
|
406
|
+
# @param image_variations_input [ImageVariationsInput]
|
|
407
|
+
# @param [Hash] opts the optional parameters
|
|
408
|
+
# @return [Array<(ImageVariations200Response, Integer, Hash)>] ImageVariations200Response data, response status code and response headers
|
|
409
|
+
def image_variations_with_http_info(workspace_uuid, image_variations_input, opts = {})
|
|
410
|
+
if @api_client.config.debugging
|
|
411
|
+
@api_client.config.logger.debug 'Calling API: AIApi.image_variations ...'
|
|
412
|
+
end
|
|
413
|
+
# verify the required parameter 'workspace_uuid' is set
|
|
414
|
+
if @api_client.config.client_side_validation && workspace_uuid.nil?
|
|
415
|
+
fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling AIApi.image_variations"
|
|
416
|
+
end
|
|
417
|
+
# verify the required parameter 'image_variations_input' is set
|
|
418
|
+
if @api_client.config.client_side_validation && image_variations_input.nil?
|
|
419
|
+
fail ArgumentError, "Missing the required parameter 'image_variations_input' when calling AIApi.image_variations"
|
|
420
|
+
end
|
|
421
|
+
# resource path
|
|
422
|
+
local_var_path = '/{workspaceUuid}/ai/image-variations'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))
|
|
423
|
+
|
|
424
|
+
# query parameters
|
|
425
|
+
query_params = opts[:query_params] || {}
|
|
426
|
+
|
|
427
|
+
# header parameters
|
|
428
|
+
header_params = opts[:header_params] || {}
|
|
429
|
+
# HTTP header 'Accept' (if needed)
|
|
430
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
431
|
+
# HTTP header 'Content-Type'
|
|
432
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
433
|
+
if !content_type.nil?
|
|
434
|
+
header_params['Content-Type'] = content_type
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
# form parameters
|
|
438
|
+
form_params = opts[:form_params] || {}
|
|
439
|
+
|
|
440
|
+
# http body (model)
|
|
441
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(image_variations_input)
|
|
442
|
+
|
|
443
|
+
# return_type
|
|
444
|
+
return_type = opts[:debug_return_type] || 'ImageVariations200Response'
|
|
445
|
+
|
|
446
|
+
# auth_names
|
|
447
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
448
|
+
|
|
449
|
+
new_options = opts.merge(
|
|
450
|
+
:operation => :"AIApi.image_variations",
|
|
451
|
+
:header_params => header_params,
|
|
452
|
+
:query_params => query_params,
|
|
453
|
+
:form_params => form_params,
|
|
454
|
+
:body => post_body,
|
|
455
|
+
:auth_names => auth_names,
|
|
456
|
+
:return_type => return_type
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
460
|
+
if @api_client.config.debugging
|
|
461
|
+
@api_client.config.logger.debug "API called: AIApi#image_variations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
462
|
+
end
|
|
463
|
+
return data, status_code, headers
|
|
464
|
+
end
|
|
465
|
+
end
|
|
466
|
+
end
|