Class: PostForMe::Resources::SocialPosts
- Inherits:
-
Object
- Object
- PostForMe::Resources::SocialPosts
- Defined in:
- lib/post_for_me/resources/social_posts.rb,
sig/post_for_me/resources/social_posts.rbs
Overview
Posts represent content that can be published across multiple social media platforms. Each post can have platform-specific content variations, allowing customization for different platforms and accounts. Content can be defined at three levels:
- Default content for all platforms
- Platform-specific content overrides
- Account-specific content overrides
The system will use the most specific content override available when publishing to each platform and account.
Instance Method Summary collapse
-
#create(caption:, social_accounts:, account_configurations: nil, external_id: nil, is_draft: nil, media: nil, platform_configurations: nil, scheduled_at: nil, request_options: {}) ⇒ PostForMe::Models::SocialPost
Some parameter documentations has been truncated, see Models::SocialPostCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ PostForMe::Models::DeleteEntityResponse
Delete Post.
-
#initialize(client:) ⇒ SocialPosts
constructor
private
A new instance of SocialPosts.
-
#list(external_id: nil, limit: nil, offset: nil, platform: nil, social_account_id: nil, status: nil, request_options: {}) ⇒ PostForMe::Models::SocialPostListResponse
Get a paginated result for posts based on the applied filters.
-
#retrieve(id, request_options: {}) ⇒ PostForMe::Models::SocialPost
Get Post by ID.
-
#update(id, caption:, social_accounts:, account_configurations: nil, external_id: nil, is_draft: nil, media: nil, platform_configurations: nil, scheduled_at: nil, request_options: {}) ⇒ PostForMe::Models::SocialPost
Some parameter documentations has been truncated, see Models::SocialPostUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ SocialPosts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SocialPosts.
173 174 175 |
# File 'lib/post_for_me/resources/social_posts.rb', line 173 def initialize(client:) @client = client end |
Instance Method Details
#create(caption:, social_accounts:, account_configurations: nil, external_id: nil, is_draft: nil, media: nil, platform_configurations: nil, scheduled_at: nil, request_options: {}) ⇒ PostForMe::Models::SocialPost
Some parameter documentations has been truncated, see Models::SocialPostCreateParams for more details.
Create Post
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/post_for_me/resources/social_posts.rb', line 45 def create(params) parsed, = PostForMe::SocialPostCreateParams.dump_request(params) @client.request( method: :post, path: "v1/social-posts", body: parsed, model: PostForMe::SocialPost, options: ) end |
#delete(id, request_options: {}) ⇒ PostForMe::Models::DeleteEntityResponse
Delete Post
161 162 163 164 165 166 167 168 |
# File 'lib/post_for_me/resources/social_posts.rb', line 161 def delete(id, params = {}) @client.request( method: :delete, path: ["v1/social-posts/%1$s", id], model: PostForMe::DeleteEntityResponse, options: params[:request_options] ) end |
#list(external_id: nil, limit: nil, offset: nil, platform: nil, social_account_id: nil, status: nil, request_options: {}) ⇒ PostForMe::Models::SocialPostListResponse
Get a paginated result for posts based on the applied filters
138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/post_for_me/resources/social_posts.rb', line 138 def list(params = {}) parsed, = PostForMe::SocialPostListParams.dump_request(params) query = PostForMe::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/social-posts", query: query, model: PostForMe::Models::SocialPostListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ PostForMe::Models::SocialPost
Get Post by ID
67 68 69 70 71 72 73 74 |
# File 'lib/post_for_me/resources/social_posts.rb', line 67 def retrieve(id, params = {}) @client.request( method: :get, path: ["v1/social-posts/%1$s", id], model: PostForMe::SocialPost, options: params[:request_options] ) end |
#update(id, caption:, social_accounts:, account_configurations: nil, external_id: nil, is_draft: nil, media: nil, platform_configurations: nil, scheduled_at: nil, request_options: {}) ⇒ PostForMe::Models::SocialPost
Some parameter documentations has been truncated, see Models::SocialPostUpdateParams for more details.
Update Post
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/post_for_me/resources/social_posts.rb', line 106 def update(id, params) parsed, = PostForMe::SocialPostUpdateParams.dump_request(params) @client.request( method: :put, path: ["v1/social-posts/%1$s", id], body: parsed, model: PostForMe::SocialPost, options: ) end |