Class: PostForMe::Resources::SocialPostResults

Inherits:
Object
  • Object
show all
Defined in:
lib/post_for_me/resources/social_post_results.rb,
sig/post_for_me/resources/social_post_results.rbs

Overview

Post results represent the outcome of publishing content to various social media platforms. They provide comprehensive information including:

  • Publication status (success/failure)
  • Any errors or issues encountered during posting
  • Platform url to view the published post

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SocialPostResults

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 SocialPostResults.

Parameters:



69
70
71
# File 'lib/post_for_me/resources/social_post_results.rb', line 69

def initialize(client:)
  @client = client
end

Instance Method Details

#list(limit: nil, offset: nil, platform: nil, post_id: nil, social_account_id: nil, request_options: {}) ⇒ PostForMe::Models::SocialPostResultListResponse

Some parameter documentations has been truncated, see Models::SocialPostResultListParams for more details.

Get a paginated result for post results based on the applied filters

Parameters:

  • limit (Float)

    Number of items to return

  • offset (Float)

    Number of items to skip

  • platform (Array<String>)

    Filter by platform(s). Multiple values imply OR logic (e.g., ?platform=x&platfor

  • post_id (Array<String>)

    Filter by post IDs. Multiple values imply OR logic (e.g., ?post_id=123&post_id=4

  • social_account_id (Array<String>)

    Filter by social account ID(s). Multiple values imply OR logic (e.g., ?social_ac

  • request_options (PostForMe::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/post_for_me/resources/social_post_results.rb', line 54

def list(params = {})
  parsed, options = PostForMe::SocialPostResultListParams.dump_request(params)
  query = PostForMe::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/social-post-results",
    query: query,
    model: PostForMe::Models::SocialPostResultListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ PostForMe::Models::SocialPostResult

Get post result by ID

Parameters:

Returns:

See Also:



23
24
25
26
27
28
29
30
# File 'lib/post_for_me/resources/social_post_results.rb', line 23

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["v1/social-post-results/%1$s", id],
    model: PostForMe::SocialPostResult,
    options: params[:request_options]
  )
end