Class: Pinterest::Resources::Audiences
- Inherits:
-
Base
- Object
- Base
- Pinterest::Resources::Audiences
show all
- Defined in:
- lib/pinterest/resources/audiences.rb
Instance Method Summary
collapse
-
#create(ad_account_id:, **params) ⇒ Hash
-
#find(ad_account_id:, audience_id:) ⇒ Hash
-
#list(ad_account_id:, bookmark: nil, page_size: nil, order: nil, ownership_type: nil, exclude_nca: nil) ⇒ Hash
{ “items” => […], “bookmark” => “…” }.
-
#update(ad_account_id:, audience_id:, **params) ⇒ Hash
Methods inherited from Base
#initialize
Instance Method Details
#create(ad_account_id:, **params) ⇒ Hash
7
8
9
|
# File 'lib/pinterest/resources/audiences.rb', line 7
def create(ad_account_id:, **params)
post("/ad_accounts/#{ad_account_id}/audiences", params)
end
|
#find(ad_account_id:, audience_id:) ⇒ Hash
28
29
30
|
# File 'lib/pinterest/resources/audiences.rb', line 28
def find(ad_account_id:, audience_id:)
get("/ad_accounts/#{ad_account_id}/audiences/#{audience_id}")
end
|
#list(ad_account_id:, bookmark: nil, page_size: nil, order: nil, ownership_type: nil, exclude_nca: nil) ⇒ Hash
Returns { “items” => […], “bookmark” => “…” }.
18
19
20
21
22
23
|
# File 'lib/pinterest/resources/audiences.rb', line 18
def list(ad_account_id:, bookmark: nil, page_size: nil, order: nil,
ownership_type: nil, exclude_nca: nil)
get("/ad_accounts/#{ad_account_id}/audiences",
{ bookmark: bookmark, page_size: page_size, order: order,
ownership_type: ownership_type, exclude_nca: exclude_nca }.compact)
end
|
#update(ad_account_id:, audience_id:, **params) ⇒ Hash
36
37
38
|
# File 'lib/pinterest/resources/audiences.rb', line 36
def update(ad_account_id:, audience_id:, **params)
patch("/ad_accounts/#{ad_account_id}/audiences/#{audience_id}", params)
end
|