Class: BrightData::LinkedIn::Types::Post

Inherits:
Data
  • Object
show all
Defined in:
lib/brightdata/linkedin/types/post.rb

Overview

Note:

Use #raw to access fields not yet typed by this gem.

Typed representation of a LinkedIn post response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#comments_countInteger, ... (readonly)

Returns comment count.

Returns:

  • (Integer, String, nil)

    comment count



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#date_postedString? (readonly)

Returns date posted.

Returns:

  • (String, nil)

    date posted



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

Returns embedded links.

Returns:

  • (Array<String>, nil)

    embedded links



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#hashtagsArray<String>? (readonly)

Returns hashtags.

Returns:

  • (Array<String>, nil)

    hashtags



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#headlineString? (readonly)

Returns author headline.

Returns:

  • (String, nil)

    author headline



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#idString? (readonly)

Returns post ID.

Returns:

  • (String, nil)

    post ID



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#imagesArray<String>? (readonly)

Returns image URLs.

Returns:

  • (Array<String>, nil)

    image URLs



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#likesInteger, ... (readonly)

Returns like count.

Returns:

  • (Integer, String, nil)

    like count



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#original_postHash? (readonly)

Returns original post details.

Returns:

  • (Hash, nil)

    original post details



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#post_textString? (readonly)

Returns post text.

Returns:

  • (String, nil)

    post text



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#rawHash (readonly)

Returns full parsed API response.

Returns:

  • (Hash)

    full parsed API response



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#repostHash? (readonly)

Returns repost details.

Returns:

  • (Hash, nil)

    repost details



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#user_idString? (readonly)

Returns author user ID.

Returns:

  • (String, nil)

    author user ID



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

#videosArray<String>? (readonly)

Returns video URLs.

Returns:

  • (Array<String>, nil)

    video URLs



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/brightdata/linkedin/types/post.rb', line 37

Post = Data.define(
  :id, :user_id, :headline, :post_text, :date_posted, :hashtags,
  :embedded_links, :images, :videos, :likes, :comments_count,
  :repost, :original_post, :raw
) do
  # Build a post from a symbol-keyed API response.
  #
  # @param hash [Hash] symbolized-key API response object
  # @return [BrightData::LinkedIn::Types::Post]
  def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
    new(
      id: hash[:id],
      user_id: hash[:user_id],
      headline: hash[:headline],
      post_text: hash[:post_text],
      date_posted: hash[:date_posted],
      hashtags: hash[:hashtags],
      embedded_links: hash[:embedded_links],
      images: hash[:images],
      videos: hash[:videos],
      likes: hash[:likes],
      comments_count: hash[:comments_count],
      repost: hash[:repost],
      original_post: hash[:original_post],
      raw: hash
    )
  end
end

Class Method Details

.from_api(hash) ⇒ BrightData::LinkedIn::Types::Post

Build a post from a symbol-keyed API response.

Parameters:

  • hash (Hash)

    symbolized-key API response object

Returns:



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/brightdata/linkedin/types/post.rb', line 46

def self.from_api(hash) # rubocop:disable Metrics/MethodLength -- flat field-by-field mapping from the API response
  new(
    id: hash[:id],
    user_id: hash[:user_id],
    headline: hash[:headline],
    post_text: hash[:post_text],
    date_posted: hash[:date_posted],
    hashtags: hash[:hashtags],
    embedded_links: hash[:embedded_links],
    images: hash[:images],
    videos: hash[:videos],
    likes: hash[:likes],
    comments_count: hash[:comments_count],
    repost: hash[:repost],
    original_post: hash[:original_post],
    raw: hash
  )
end