Class: SocialstatsSDK::Resources::Creators

Inherits:
Base
  • Object
show all
Defined in:
lib/socialstats_sdk/resources/creators.rb

Constant Summary collapse

IDENTIFIER_KEYS =
%i[socialstats_creator_id].freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from SocialstatsSDK::Resources::Base

Instance Method Details

#activities(**params) ⇒ Object



32
33
34
# File 'lib/socialstats_sdk/resources/creators.rb', line 32

def activities(**params)
  get("creators/activities", params: with_identifier(params))
end

Raises:

  • (ArgumentError)


50
51
52
53
54
55
56
# File 'lib/socialstats_sdk/resources/creators.rb', line 50

def add_link_request(link:, **params)
  raise ArgumentError, "link is required" if link.to_s.empty?

  query = with_identifier(params)
  query[:link] = link
  post("creators/link_request", params: query)
end

#audience(**params) ⇒ Object



20
21
22
# File 'lib/socialstats_sdk/resources/creators.rb', line 20

def audience(**params)
  get("creators/audience", params: with_identifier(params))
end

#audience_details(country_code:, **params) ⇒ Object

Raises:

  • (ArgumentError)


24
25
26
27
28
29
30
# File 'lib/socialstats_sdk/resources/creators.rb', line 24

def audience_details(country_code:, **params)
  raise ArgumentError, "country_code is required" if country_code.to_s.empty?

  query = with_identifier(params)
  query[:country_code] = country_code
  get("creators/audience/details", params: query)
end

#content(**params) ⇒ Object



36
37
38
# File 'lib/socialstats_sdk/resources/creators.rb', line 36

def content(**params)
  get("creators/content", params: with_identifier(params))
end

#historic_stats(**params) ⇒ Object



16
17
18
# File 'lib/socialstats_sdk/resources/creators.rb', line 16

def historic_stats(**params)
  get("creators/historic_stats", params: with_identifier(params))
end

#info(**params) ⇒ Object



8
9
10
# File 'lib/socialstats_sdk/resources/creators.rb', line 8

def info(**params)
  get("creators/info", params: with_identifier(params))
end

Raises:

  • (ArgumentError)


58
59
60
61
62
63
64
# File 'lib/socialstats_sdk/resources/creators.rb', line 58

def remove_link_request(link:, **params)
  raise ArgumentError, "link is required" if link.to_s.empty?

  query = with_identifier(params)
  query[:link] = link
  delete("creators/link_request", params: query)
end

#search(q:, **params) ⇒ Object

Raises:

  • (ArgumentError)


44
45
46
47
48
# File 'lib/socialstats_sdk/resources/creators.rb', line 44

def search(q:, **params)
  raise ArgumentError, "q is required" if q.to_s.empty?

  get("creators/search", params: params.merge(q: q))
end

#stats(**params) ⇒ Object



12
13
14
# File 'lib/socialstats_sdk/resources/creators.rb', line 12

def stats(**params)
  get("creators/stats", params: with_identifier(params))
end

#top_posts(**params) ⇒ Object



40
41
42
# File 'lib/socialstats_sdk/resources/creators.rb', line 40

def top_posts(**params)
  get("creators/top_posts", params: with_identifier(params))
end