Class: AmazonAds::Profiles

Inherits:
API
  • Object
show all
Defined in:
lib/amazon_ads/apis/profiles.rb

Overview

Amazon Ads API - Profiles

Constant Summary

Constants inherited from API

API::ENDPOINTS

Instance Attribute Summary

Attributes inherited from API

#access_token, #account_id, #profile_id, #region, #retries

Instance Method Summary collapse

Methods inherited from API

#endpoint, #http, #initialize

Constructor Details

This class inherits a constructor from AmazonAds::API

Instance Method Details

#get_profile_by_id(profile_id) ⇒ Object

Gets a profile specified by identifier.

Signature:

  • (Integer) -> HTTP::Response



8
9
10
# File 'lib/amazon_ads/apis/profiles.rb', line 8

def get_profile_by_id(profile_id)
  request(:get, "/v2/profiles/#{profile_id}")
end

#list_profiles(api_program: nil, access_level: nil, profile_type_filter: nil, valid_payment_method_filter: nil) ⇒ Object

Gets a list of profiles.

Signature:

  • (?api_program: String?, ?access_level: String?, ?profile_type_filter: String?, ?valid_payment_method_filter: String?) -> HTTP::Response

RBS:

  • api_program: String -- Filters response to include profiles that have permissions for the specified Advertising API program only. Setting apiProgram=billing filters the response to include only profiles to which the user and application associated with the access token have permission to view or edit billing information.

  • access_level: String -- Filters response to include profiles that have specified permissions for the specified Advertising API program only. Currently, the only supported access level is viewandedit. Setting accessLevel=view filters the response to include only profiles to which the user and application associated with the access token have view permission to the provided api program.

  • profile_type_filter: String -- Filters response to include profiles that are of the specified types in the comma-delimited list. Default is all types. Note that this filter performs an inclusive AND operation on the types.

  • valid_payment_method_filter: String -- Filter response to include profiles that have valid payment methods. Default is to include all profiles. Setting this filter to truereturns only profiles with either novalidPaymentMethodfield, or thevalidPaymentMethodfield set totrue. Setting this to falsereturns profiles with thevalidPaymentMethodfield set tofalse only.



18
19
20
# File 'lib/amazon_ads/apis/profiles.rb', line 18

def list_profiles(api_program: nil, access_level: nil, profile_type_filter: nil, valid_payment_method_filter: nil)
  request(:get, "/v2/profiles", params: { "apiProgram" => api_program, "accessLevel" => access_level, "profileTypeFilter" => profile_type_filter, "validPaymentMethodFilter" => valid_payment_method_filter }.compact)
end

#update_profiles(json: {}) ⇒ Object

Update the daily budget for one or more profiles.

Signature:

  • (?json: untyped) -> HTTP::Response



24
25
26
# File 'lib/amazon_ads/apis/profiles.rb', line 24

def update_profiles(json: {})
  request(:put, "/v2/profiles", json: json)
end