Class: PinterestSdkClient::TrendsApi
- Inherits:
-
Object
- Object
- PinterestSdkClient::TrendsApi
- Defined in:
- lib/pinterest_sdk/api/trends_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ TrendsApi
constructor
A new instance of TrendsApi.
-
#trends_editorial_articles_list(region, opts = {}) ⇒ Array<TrendsEditorial>
Returns editorial articles for a given region Get a list of published editorial articles.
-
#trends_editorial_articles_list_with_http_info(region, opts = {}) ⇒ Array<(Array<TrendsEditorial>, Integer, Hash)>
Returns editorial articles for a given region Get a list of published editorial articles.
-
#trends_featured_topics_list(region, opts = {}) ⇒ Array<FeaturedTrend>
Get featured topics Enables advertisers to pull top five trending topics by interest and market, at full parity with the Pinterest Trends UI.
-
#trends_featured_topics_list_with_http_info(region, opts = {}) ⇒ Array<(Array<FeaturedTrend>, Integer, Hash)>
Get featured topics Enables advertisers to pull top five trending topics by interest and market, at full parity with the Pinterest Trends UI.
-
#trends_product_categories_details_list(product_categories, region, opts = {}) ⇒ Array<ProductCategoryDetails>
Get product category details Enables advertisers to retrieve demographic information, related pins, and trend lines for specified product categories.
-
#trends_product_categories_details_list_with_http_info(product_categories, region, opts = {}) ⇒ Array<(Array<ProductCategoryDetails>, Integer, Hash)>
Get product category details Enables advertisers to retrieve demographic information, related pins, and trend lines for specified product categories.
-
#trends_product_categories_trending_list(region, opts = {}) ⇒ Array<TrendingProductCategory>
Get a list of growing Shopping Product Categories Get a list of growing Shopping Product Categories in ranked order allowing filtering by engagement type, vertical, age, and gender.
-
#trends_product_categories_trending_list_with_http_info(region, opts = {}) ⇒ Array<(Array<TrendingProductCategory>, Integer, Hash)>
Get a list of growing Shopping Product Categories Get a list of growing Shopping Product Categories in ranked order allowing filtering by engagement type, vertical, age, and gender.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TrendsApi
Returns a new instance of TrendsApi.
19 20 21 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#trends_editorial_articles_list(region, opts = {}) ⇒ Array<TrendsEditorial>
Returns editorial articles for a given region Get a list of published editorial articles. Translations of the editorials will be provided if available; otherwise, the default language will be English.
27 28 29 30 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 27 def trends_editorial_articles_list(region, opts = {}) data, _status_code, _headers = trends_editorial_articles_list_with_http_info(region, opts) data end |
#trends_editorial_articles_list_with_http_info(region, opts = {}) ⇒ Array<(Array<TrendsEditorial>, Integer, Hash)>
Returns editorial articles for a given region Get a list of published editorial articles. Translations of the editorials will be provided if available; otherwise, the default language will be English.
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 37 def trends_editorial_articles_list_with_http_info(region, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrendsApi.trends_editorial_articles_list ...' end # verify the required parameter 'region' is set if @api_client.config.client_side_validation && region.nil? fail ArgumentError, "Missing the required parameter 'region' when calling TrendsApi.trends_editorial_articles_list" end # resource path local_var_path = '/trends/editorial_articles' # query parameters query_params = opts[:query_params] || {} query_params[:'region'] = region # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<TrendsEditorial>' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"TrendsApi.trends_editorial_articles_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrendsApi#trends_editorial_articles_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#trends_featured_topics_list(region, opts = {}) ⇒ Array<FeaturedTrend>
Get featured topics Enables advertisers to pull top five trending topics by interest and market, at full parity with the Pinterest Trends UI.
92 93 94 95 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 92 def trends_featured_topics_list(region, opts = {}) data, _status_code, _headers = trends_featured_topics_list_with_http_info(region, opts) data end |
#trends_featured_topics_list_with_http_info(region, opts = {}) ⇒ Array<(Array<FeaturedTrend>, Integer, Hash)>
Get featured topics Enables advertisers to pull top five trending topics by interest and market, at full parity with the Pinterest Trends UI.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 103 def trends_featured_topics_list_with_http_info(region, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrendsApi.trends_featured_topics_list ...' end # verify the required parameter 'region' is set if @api_client.config.client_side_validation && region.nil? fail ArgumentError, "Missing the required parameter 'region' when calling TrendsApi.trends_featured_topics_list" end # resource path local_var_path = '/trends/topics/featured' # query parameters query_params = opts[:query_params] || {} query_params[:'region'] = region query_params[:'interest'] = opts[:'interest'] if !opts[:'interest'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<FeaturedTrend>' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2', 'client_credentials'] = opts.merge( :operation => :"TrendsApi.trends_featured_topics_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrendsApi#trends_featured_topics_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#trends_product_categories_details_list(product_categories, region, opts = {}) ⇒ Array<ProductCategoryDetails>
Get product category details Enables advertisers to retrieve demographic information, related pins, and trend lines for specified product categories
161 162 163 164 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 161 def trends_product_categories_details_list(product_categories, region, opts = {}) data, _status_code, _headers = trends_product_categories_details_list_with_http_info(product_categories, region, opts) data end |
#trends_product_categories_details_list_with_http_info(product_categories, region, opts = {}) ⇒ Array<(Array<ProductCategoryDetails>, Integer, Hash)>
Get product category details Enables advertisers to retrieve demographic information, related pins, and trend lines for specified product categories
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 174 def trends_product_categories_details_list_with_http_info(product_categories, region, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrendsApi.trends_product_categories_details_list ...' end # verify the required parameter 'product_categories' is set if @api_client.config.client_side_validation && product_categories.nil? fail ArgumentError, "Missing the required parameter 'product_categories' when calling TrendsApi.trends_product_categories_details_list" end if @api_client.config.client_side_validation && product_categories.length > 20 fail ArgumentError, 'invalid value for "product_categories" when calling TrendsApi.trends_product_categories_details_list, number of items must be less than or equal to 20.' end if @api_client.config.client_side_validation && product_categories.length < 1 fail ArgumentError, 'invalid value for "product_categories" when calling TrendsApi.trends_product_categories_details_list, number of items must be greater than or equal to 1.' end # verify the required parameter 'region' is set if @api_client.config.client_side_validation && region.nil? fail ArgumentError, "Missing the required parameter 'region' when calling TrendsApi.trends_product_categories_details_list" end # resource path local_var_path = '/trends/product_categories/details' # query parameters query_params = opts[:query_params] || {} query_params[:'product_categories'] = @api_client.build_collection_param(product_categories, :multi) query_params[:'region'] = region query_params[:'lookback_window'] = opts[:'lookback_window'] if !opts[:'lookback_window'].nil? query_params[:'engagement_type'] = opts[:'engagement_type'] if !opts[:'engagement_type'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<ProductCategoryDetails>' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2', 'client_credentials'] = opts.merge( :operation => :"TrendsApi.trends_product_categories_details_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrendsApi#trends_product_categories_details_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#trends_product_categories_trending_list(region, opts = {}) ⇒ Array<TrendingProductCategory>
Get a list of growing Shopping Product Categories Get a list of growing Shopping Product Categories in ranked order allowing filtering by engagement type, vertical, age, and gender.
247 248 249 250 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 247 def trends_product_categories_trending_list(region, opts = {}) data, _status_code, _headers = trends_product_categories_trending_list_with_http_info(region, opts) data end |
#trends_product_categories_trending_list_with_http_info(region, opts = {}) ⇒ Array<(Array<TrendingProductCategory>, Integer, Hash)>
Get a list of growing Shopping Product Categories Get a list of growing Shopping Product Categories in ranked order allowing filtering by engagement type, vertical, age, and gender.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/pinterest_sdk/api/trends_api.rb', line 261 def trends_product_categories_trending_list_with_http_info(region, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrendsApi.trends_product_categories_trending_list ...' end # verify the required parameter 'region' is set if @api_client.config.client_side_validation && region.nil? fail ArgumentError, "Missing the required parameter 'region' when calling TrendsApi.trends_product_categories_trending_list" end # resource path local_var_path = '/trends/product_categories/trending' # query parameters query_params = opts[:query_params] || {} query_params[:'region'] = region query_params[:'verticals'] = @api_client.build_collection_param(opts[:'verticals'], :multi) if !opts[:'verticals'].nil? query_params[:'ages'] = @api_client.build_collection_param(opts[:'ages'], :multi) if !opts[:'ages'].nil? query_params[:'genders'] = @api_client.build_collection_param(opts[:'genders'], :multi) if !opts[:'genders'].nil? query_params[:'engagement_type'] = opts[:'engagement_type'] if !opts[:'engagement_type'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<TrendingProductCategory>' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2', 'client_credentials'] = opts.merge( :operation => :"TrendsApi.trends_product_categories_trending_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrendsApi#trends_product_categories_trending_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |