late-sdk 0.0.852 → 0.0.854

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9caae63ae2b4535119bb292d07151abe3de5ac4bf185e2cb29aff41817a429a9
4
- data.tar.gz: afd96f4ab77a4e182cc7a9cadf95a772667985a278ffa1264a7c1b4bf150aee3
3
+ metadata.gz: c541aaaa8448460a57e09acf9fe79b03e95d7b887d43446b44610c7318bbefca
4
+ data.tar.gz: b03c4ea167008348ed01fc8cbdb664045dfff9f901ed6642f50d7f7a25c52370
5
5
  SHA512:
6
- metadata.gz: dea130289656819a5215abbf0dcea66122627dfc652fc276679db737f714328fd69536fbe7dcd425a915c59e94d373f9d2995c2d9cf0fd53119de26ccadfcbcd
7
- data.tar.gz: d28329867f8de9f2c16206abfac4c853c36abb46dfa460acb8958dff3d2ff4c392d4dad53d9b43b2c9f0ef32c74eb8f3d0f6b98a5b1c53e9b247e9b500524f25
6
+ metadata.gz: 456cf510447ea7fada96c77e7c5fee370f3b716b33643d34fce10af7b72d2140f51b80c333e40d5a8206bff30430cc07a2edd25a8b545419718a11a0e6f43071
7
+ data.tar.gz: '0925de744e040767d2adb50be47404a637c64e87679499700eb9942cdc86a5a2653a07f0aecc90d3d3f59976359367b812889966a816e66327c32b655d6215cf'
data/README.md CHANGED
@@ -182,6 +182,7 @@ Class | Method | HTTP request | Description
182
182
  *Zernio::AdInsightsApi* | [**list_local_services_lead_conversations**](docs/AdInsightsApi.md#list_local_services_lead_conversations) | **GET** /v1/ads/local-services/leads/{leadId}/conversations | Conversations of a Local Services lead
183
183
  *Zernio::AdInsightsApi* | [**list_local_services_leads**](docs/AdInsightsApi.md#list_local_services_leads) | **GET** /v1/ads/local-services/leads | Google Local Services Ads leads
184
184
  *Zernio::AdInsightsApi* | [**query_ad_insights**](docs/AdInsightsApi.md#query_ad_insights) | **GET** /v1/ads/insights | Flexible live insights query
185
+ *Zernio::AdLibraryApi* | [**search_ad_library**](docs/AdLibraryApi.md#search_ad_library) | **GET** /v1/ads/library | Search the public Ad Library
185
186
  *Zernio::AdTargetingApi* | [**estimate_ad_reach**](docs/AdTargetingApi.md#estimate_ad_reach) | **POST** /v1/ads/targeting/reach-estimate | Estimate audience reach
186
187
  *Zernio::AdTargetingApi* | [**get_linked_in_bid_pricing**](docs/AdTargetingApi.md#get_linked_in_bid_pricing) | **POST** /v1/ads/targeting/bid-pricing | Suggested bid and budget bounds
187
188
  *Zernio::AdTargetingApi* | [**get_linked_in_supply_forecast**](docs/AdTargetingApi.md#get_linked_in_supply_forecast) | **POST** /v1/ads/targeting/supply-forecast | Impressions, clicks and spend forecast
@@ -1904,6 +1905,8 @@ Class | Method | HTTP request | Description
1904
1905
  - [Zernio::ScheduleBroadcastRequest](docs/ScheduleBroadcastRequest.md)
1905
1906
  - [Zernio::SearchAdInterests200Response](docs/SearchAdInterests200Response.md)
1906
1907
  - [Zernio::SearchAdInterests200ResponseInterestsInner](docs/SearchAdInterests200ResponseInterestsInner.md)
1908
+ - [Zernio::SearchAdLibrary200Response](docs/SearchAdLibrary200Response.md)
1909
+ - [Zernio::SearchAdLibrary200ResponsePaging](docs/SearchAdLibrary200ResponsePaging.md)
1907
1910
  - [Zernio::SearchAdTargeting200Response](docs/SearchAdTargeting200Response.md)
1908
1911
  - [Zernio::SearchAdTargeting200ResponseResultsInner](docs/SearchAdTargeting200ResponseResultsInner.md)
1909
1912
  - [Zernio::SearchAvailablePhoneNumbers200Response](docs/SearchAvailablePhoneNumbers200Response.md)
@@ -0,0 +1,109 @@
1
+ # Zernio::AdLibraryApi
2
+
3
+ All URIs are relative to *https://zernio.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**search_ad_library**](AdLibraryApi.md#search_ad_library) | **GET** /v1/ads/library | Search the public Ad Library |
8
+
9
+
10
+ ## search_ad_library
11
+
12
+ > <SearchAdLibrary200Response> search_ad_library(account_id, opts)
13
+
14
+ Search the public Ad Library
15
+
16
+ Competitor and market research over the platform's public ad archive, searched with the customer's own connected token (no extra scope): Meta's Ad Library (`GET /ads_archive`) for a `facebook` / `instagram` / `metaads` account, LinkedIn's Ad Library (`GET /rest/adLibrary`) for a `linkedin` / `linkedinads` account. Rows are returned in the platform's raw shape under `data`; `paging.after` is an opaque cursor on both (`null` when exhausted). **Meta coverage.** Political and social-issue ads are searchable worldwide. Every other ad is in the archive only if it was delivered to the EU or UK within the last year, so a US-only commercial advertiser is invisible. Spend, impressions and demographics are political-only fields and are left out of the default projection; request them via `fields`. Meta serves the archive only to people who confirmed their identity and location at facebook.com/ID: until the Facebook user behind the connection has done so, the call fails with `meta_identity_confirmation_required` (403). **LinkedIn coverage.** Ads served after June 1 2023, worldwide, kept for a year after their last impression. EU-delivered ads carry impression ranges and the disclosed targeting facets. Pages are capped at 25 ads (`limit` > 25 is a 400); `after` is the next offset. Which params apply: `q`, `countries`, `since`, `until`, `limit`, `after` on both; `pageIds`, `adType`, `status`, `platforms`, `mediaType`, `languages`, `searchType`, `fields` are Meta-only; `advertiser` is LinkedIn-only. Passing a param the account's platform does not support is a 400 naming the param.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'zernio-sdk'
23
+ # setup authorization
24
+ Zernio.configure do |config|
25
+ # Configure Bearer authorization (JWT): bearerAuth
26
+ config.access_token = 'YOUR_BEARER_TOKEN'
27
+ end
28
+
29
+ api_instance = Zernio::AdLibraryApi.new
30
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (facebook / instagram / metaads for Meta, linkedin / linkedinads for LinkedIn). Its token is the one that searches.
31
+ opts = {
32
+ q: 'q_example', # String | Keyword search. Meta does not translate it, so write it in the ads' language. Required unless pageIds (Meta) or advertiser (LinkedIn) is given.
33
+ page_ids: 'page_ids_example', # String | Meta only. Comma-separated Facebook Page ids (max 10) whose ads to list.
34
+ advertiser: 'advertiser_example', # String | LinkedIn only. Advertiser (Page) name to search.
35
+ countries: 'countries_example', # String | Comma-separated ISO 3166-1 alpha-2 codes the ads reached. Meta defaults to ALL (an explicit ALL is Meta-only); LinkedIn searches every market when omitted.
36
+ ad_type: 'ALL', # String | Meta only.
37
+ status: 'ACTIVE', # String | Meta only. ACTIVE = eligible for delivery right now.
38
+ platforms: 'platforms_example', # String | Meta only. Comma-separated publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING_SERVICES.
39
+ media_type: 'ALL', # String | Meta only.
40
+ languages: 'languages_example', # String | Meta only. Comma-separated ISO 639-1 codes of the ad text.
41
+ since: Date.parse('2013-10-20'), # Date | Earliest delivery date (YYYY-MM-DD).
42
+ _until: Date.parse('2013-10-20'), # Date | Latest delivery date (YYYY-MM-DD).
43
+ search_type: 'KEYWORD_UNORDERED', # String | Meta only. Whether q matches words in any order or as an exact phrase (comma-separate phrases to match all of them).
44
+ fields: 'fields_example', # String | Meta only. Raw Graph projection override, e.g. add spend,impressions,demographic_distribution for political ads.
45
+ limit: 56, # Integer | Rows per page. LinkedIn accepts at most 25.
46
+ after: 'after_example' # String | paging.after of the previous page.
47
+ }
48
+
49
+ begin
50
+ # Search the public Ad Library
51
+ result = api_instance.search_ad_library(account_id, opts)
52
+ p result
53
+ rescue Zernio::ApiError => e
54
+ puts "Error when calling AdLibraryApi->search_ad_library: #{e}"
55
+ end
56
+ ```
57
+
58
+ #### Using the search_ad_library_with_http_info variant
59
+
60
+ This returns an Array which contains the response data, status code and headers.
61
+
62
+ > <Array(<SearchAdLibrary200Response>, Integer, Hash)> search_ad_library_with_http_info(account_id, opts)
63
+
64
+ ```ruby
65
+ begin
66
+ # Search the public Ad Library
67
+ data, status_code, headers = api_instance.search_ad_library_with_http_info(account_id, opts)
68
+ p status_code # => 2xx
69
+ p headers # => { ... }
70
+ p data # => <SearchAdLibrary200Response>
71
+ rescue Zernio::ApiError => e
72
+ puts "Error when calling AdLibraryApi->search_ad_library_with_http_info: #{e}"
73
+ end
74
+ ```
75
+
76
+ ### Parameters
77
+
78
+ | Name | Type | Description | Notes |
79
+ | ---- | ---- | ----------- | ----- |
80
+ | **account_id** | **String** | Zernio SocialAccount id (facebook / instagram / metaads for Meta, linkedin / linkedinads for LinkedIn). Its token is the one that searches. | |
81
+ | **q** | **String** | Keyword search. Meta does not translate it, so write it in the ads&#39; language. Required unless pageIds (Meta) or advertiser (LinkedIn) is given. | [optional] |
82
+ | **page_ids** | **String** | Meta only. Comma-separated Facebook Page ids (max 10) whose ads to list. | [optional] |
83
+ | **advertiser** | **String** | LinkedIn only. Advertiser (Page) name to search. | [optional] |
84
+ | **countries** | **String** | Comma-separated ISO 3166-1 alpha-2 codes the ads reached. Meta defaults to ALL (an explicit ALL is Meta-only); LinkedIn searches every market when omitted. | [optional] |
85
+ | **ad_type** | **String** | Meta only. | [optional][default to &#39;ALL&#39;] |
86
+ | **status** | **String** | Meta only. ACTIVE &#x3D; eligible for delivery right now. | [optional][default to &#39;ACTIVE&#39;] |
87
+ | **platforms** | **String** | Meta only. Comma-separated publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING_SERVICES. | [optional] |
88
+ | **media_type** | **String** | Meta only. | [optional] |
89
+ | **languages** | **String** | Meta only. Comma-separated ISO 639-1 codes of the ad text. | [optional] |
90
+ | **since** | **Date** | Earliest delivery date (YYYY-MM-DD). | [optional] |
91
+ | **_until** | **Date** | Latest delivery date (YYYY-MM-DD). | [optional] |
92
+ | **search_type** | **String** | Meta only. Whether q matches words in any order or as an exact phrase (comma-separate phrases to match all of them). | [optional][default to &#39;KEYWORD_UNORDERED&#39;] |
93
+ | **fields** | **String** | Meta only. Raw Graph projection override, e.g. add spend,impressions,demographic_distribution for political ads. | [optional] |
94
+ | **limit** | **Integer** | Rows per page. LinkedIn accepts at most 25. | [optional][default to 25] |
95
+ | **after** | **String** | paging.after of the previous page. | [optional] |
96
+
97
+ ### Return type
98
+
99
+ [**SearchAdLibrary200Response**](SearchAdLibrary200Response.md)
100
+
101
+ ### Authorization
102
+
103
+ [bearerAuth](../README.md#bearerAuth)
104
+
105
+ ### HTTP request headers
106
+
107
+ - **Content-Type**: Not defined
108
+ - **Accept**: application/json
109
+
@@ -0,0 +1,22 @@
1
+ # Zernio::SearchAdLibrary200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **platform** | **String** | | |
8
+ | **data** | **Array&lt;Object&gt;** | | |
9
+ | **paging** | [**SearchAdLibrary200ResponsePaging**](SearchAdLibrary200ResponsePaging.md) | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::SearchAdLibrary200Response.new(
17
+ platform: null,
18
+ data: null,
19
+ paging: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,20 @@
1
+ # Zernio::SearchAdLibrary200ResponsePaging
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **after** | **String** | Cursor for the next page; null when exhausted. | [optional] |
8
+ | **total** | **Integer** | LinkedIn only. Total matching ads. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zernio-sdk'
14
+
15
+ instance = Zernio::SearchAdLibrary200ResponsePaging.new(
16
+ after: null,
17
+ total: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,163 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Zernio
16
+ class AdLibraryApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Search the public Ad Library
23
+ # Competitor and market research over the platform's public ad archive, searched with the customer's own connected token (no extra scope): Meta's Ad Library (`GET /ads_archive`) for a `facebook` / `instagram` / `metaads` account, LinkedIn's Ad Library (`GET /rest/adLibrary`) for a `linkedin` / `linkedinads` account. Rows are returned in the platform's raw shape under `data`; `paging.after` is an opaque cursor on both (`null` when exhausted). **Meta coverage.** Political and social-issue ads are searchable worldwide. Every other ad is in the archive only if it was delivered to the EU or UK within the last year, so a US-only commercial advertiser is invisible. Spend, impressions and demographics are political-only fields and are left out of the default projection; request them via `fields`. Meta serves the archive only to people who confirmed their identity and location at facebook.com/ID: until the Facebook user behind the connection has done so, the call fails with `meta_identity_confirmation_required` (403). **LinkedIn coverage.** Ads served after June 1 2023, worldwide, kept for a year after their last impression. EU-delivered ads carry impression ranges and the disclosed targeting facets. Pages are capped at 25 ads (`limit` > 25 is a 400); `after` is the next offset. Which params apply: `q`, `countries`, `since`, `until`, `limit`, `after` on both; `pageIds`, `adType`, `status`, `platforms`, `mediaType`, `languages`, `searchType`, `fields` are Meta-only; `advertiser` is LinkedIn-only. Passing a param the account's platform does not support is a 400 naming the param.
24
+ # @param account_id [String] Zernio SocialAccount id (facebook / instagram / metaads for Meta, linkedin / linkedinads for LinkedIn). Its token is the one that searches.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :q Keyword search. Meta does not translate it, so write it in the ads&#39; language. Required unless pageIds (Meta) or advertiser (LinkedIn) is given.
27
+ # @option opts [String] :page_ids Meta only. Comma-separated Facebook Page ids (max 10) whose ads to list.
28
+ # @option opts [String] :advertiser LinkedIn only. Advertiser (Page) name to search.
29
+ # @option opts [String] :countries Comma-separated ISO 3166-1 alpha-2 codes the ads reached. Meta defaults to ALL (an explicit ALL is Meta-only); LinkedIn searches every market when omitted.
30
+ # @option opts [String] :ad_type Meta only. (default to 'ALL')
31
+ # @option opts [String] :status Meta only. ACTIVE &#x3D; eligible for delivery right now. (default to 'ACTIVE')
32
+ # @option opts [String] :platforms Meta only. Comma-separated publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING_SERVICES.
33
+ # @option opts [String] :media_type Meta only.
34
+ # @option opts [String] :languages Meta only. Comma-separated ISO 639-1 codes of the ad text.
35
+ # @option opts [Date] :since Earliest delivery date (YYYY-MM-DD).
36
+ # @option opts [Date] :_until Latest delivery date (YYYY-MM-DD).
37
+ # @option opts [String] :search_type Meta only. Whether q matches words in any order or as an exact phrase (comma-separate phrases to match all of them). (default to 'KEYWORD_UNORDERED')
38
+ # @option opts [String] :fields Meta only. Raw Graph projection override, e.g. add spend,impressions,demographic_distribution for political ads.
39
+ # @option opts [Integer] :limit Rows per page. LinkedIn accepts at most 25. (default to 25)
40
+ # @option opts [String] :after paging.after of the previous page.
41
+ # @return [SearchAdLibrary200Response]
42
+ def search_ad_library(account_id, opts = {})
43
+ data, _status_code, _headers = search_ad_library_with_http_info(account_id, opts)
44
+ data
45
+ end
46
+
47
+ # Search the public Ad Library
48
+ # Competitor and market research over the platform&#39;s public ad archive, searched with the customer&#39;s own connected token (no extra scope): Meta&#39;s Ad Library (&#x60;GET /ads_archive&#x60;) for a &#x60;facebook&#x60; / &#x60;instagram&#x60; / &#x60;metaads&#x60; account, LinkedIn&#39;s Ad Library (&#x60;GET /rest/adLibrary&#x60;) for a &#x60;linkedin&#x60; / &#x60;linkedinads&#x60; account. Rows are returned in the platform&#39;s raw shape under &#x60;data&#x60;; &#x60;paging.after&#x60; is an opaque cursor on both (&#x60;null&#x60; when exhausted). **Meta coverage.** Political and social-issue ads are searchable worldwide. Every other ad is in the archive only if it was delivered to the EU or UK within the last year, so a US-only commercial advertiser is invisible. Spend, impressions and demographics are political-only fields and are left out of the default projection; request them via &#x60;fields&#x60;. Meta serves the archive only to people who confirmed their identity and location at facebook.com/ID: until the Facebook user behind the connection has done so, the call fails with &#x60;meta_identity_confirmation_required&#x60; (403). **LinkedIn coverage.** Ads served after June 1 2023, worldwide, kept for a year after their last impression. EU-delivered ads carry impression ranges and the disclosed targeting facets. Pages are capped at 25 ads (&#x60;limit&#x60; &gt; 25 is a 400); &#x60;after&#x60; is the next offset. Which params apply: &#x60;q&#x60;, &#x60;countries&#x60;, &#x60;since&#x60;, &#x60;until&#x60;, &#x60;limit&#x60;, &#x60;after&#x60; on both; &#x60;pageIds&#x60;, &#x60;adType&#x60;, &#x60;status&#x60;, &#x60;platforms&#x60;, &#x60;mediaType&#x60;, &#x60;languages&#x60;, &#x60;searchType&#x60;, &#x60;fields&#x60; are Meta-only; &#x60;advertiser&#x60; is LinkedIn-only. Passing a param the account&#39;s platform does not support is a 400 naming the param.
49
+ # @param account_id [String] Zernio SocialAccount id (facebook / instagram / metaads for Meta, linkedin / linkedinads for LinkedIn). Its token is the one that searches.
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [String] :q Keyword search. Meta does not translate it, so write it in the ads&#39; language. Required unless pageIds (Meta) or advertiser (LinkedIn) is given.
52
+ # @option opts [String] :page_ids Meta only. Comma-separated Facebook Page ids (max 10) whose ads to list.
53
+ # @option opts [String] :advertiser LinkedIn only. Advertiser (Page) name to search.
54
+ # @option opts [String] :countries Comma-separated ISO 3166-1 alpha-2 codes the ads reached. Meta defaults to ALL (an explicit ALL is Meta-only); LinkedIn searches every market when omitted.
55
+ # @option opts [String] :ad_type Meta only. (default to 'ALL')
56
+ # @option opts [String] :status Meta only. ACTIVE &#x3D; eligible for delivery right now. (default to 'ACTIVE')
57
+ # @option opts [String] :platforms Meta only. Comma-separated publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING_SERVICES.
58
+ # @option opts [String] :media_type Meta only.
59
+ # @option opts [String] :languages Meta only. Comma-separated ISO 639-1 codes of the ad text.
60
+ # @option opts [Date] :since Earliest delivery date (YYYY-MM-DD).
61
+ # @option opts [Date] :_until Latest delivery date (YYYY-MM-DD).
62
+ # @option opts [String] :search_type Meta only. Whether q matches words in any order or as an exact phrase (comma-separate phrases to match all of them). (default to 'KEYWORD_UNORDERED')
63
+ # @option opts [String] :fields Meta only. Raw Graph projection override, e.g. add spend,impressions,demographic_distribution for political ads.
64
+ # @option opts [Integer] :limit Rows per page. LinkedIn accepts at most 25. (default to 25)
65
+ # @option opts [String] :after paging.after of the previous page.
66
+ # @return [Array<(SearchAdLibrary200Response, Integer, Hash)>] SearchAdLibrary200Response data, response status code and response headers
67
+ def search_ad_library_with_http_info(account_id, opts = {})
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug 'Calling API: AdLibraryApi.search_ad_library ...'
70
+ end
71
+ # verify the required parameter 'account_id' is set
72
+ if @api_client.config.client_side_validation && account_id.nil?
73
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AdLibraryApi.search_ad_library"
74
+ end
75
+ if @api_client.config.client_side_validation && !opts[:'q'].nil? && opts[:'q'].to_s.length > 100
76
+ fail ArgumentError, 'invalid value for "opts[:"q"]" when calling AdLibraryApi.search_ad_library, the character length must be smaller than or equal to 100.'
77
+ end
78
+
79
+ if @api_client.config.client_side_validation && !opts[:'advertiser'].nil? && opts[:'advertiser'].to_s.length > 100
80
+ fail ArgumentError, 'invalid value for "opts[:"advertiser"]" when calling AdLibraryApi.search_ad_library, the character length must be smaller than or equal to 100.'
81
+ end
82
+
83
+ allowable_values = ["ALL", "POLITICAL_AND_ISSUE_ADS", "HOUSING_ADS", "EMPLOYMENT_ADS", "FINANCIAL_PRODUCTS_AND_SERVICES_ADS"]
84
+ if @api_client.config.client_side_validation && opts[:'ad_type'] && !allowable_values.include?(opts[:'ad_type'])
85
+ fail ArgumentError, "invalid value for \"ad_type\", must be one of #{allowable_values}"
86
+ end
87
+ allowable_values = ["ACTIVE", "INACTIVE", "ALL"]
88
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
89
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
90
+ end
91
+ allowable_values = ["ALL", "IMAGE", "MEME", "VIDEO", "NONE"]
92
+ if @api_client.config.client_side_validation && opts[:'media_type'] && !allowable_values.include?(opts[:'media_type'])
93
+ fail ArgumentError, "invalid value for \"media_type\", must be one of #{allowable_values}"
94
+ end
95
+ allowable_values = ["KEYWORD_UNORDERED", "KEYWORD_EXACT_PHRASE"]
96
+ if @api_client.config.client_side_validation && opts[:'search_type'] && !allowable_values.include?(opts[:'search_type'])
97
+ fail ArgumentError, "invalid value for \"search_type\", must be one of #{allowable_values}"
98
+ end
99
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
100
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdLibraryApi.search_ad_library, must be smaller than or equal to 100.'
101
+ end
102
+
103
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
104
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdLibraryApi.search_ad_library, must be greater than or equal to 1.'
105
+ end
106
+
107
+ # resource path
108
+ local_var_path = '/v1/ads/library'
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+ query_params[:'accountId'] = account_id
113
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
114
+ query_params[:'pageIds'] = opts[:'page_ids'] if !opts[:'page_ids'].nil?
115
+ query_params[:'advertiser'] = opts[:'advertiser'] if !opts[:'advertiser'].nil?
116
+ query_params[:'countries'] = opts[:'countries'] if !opts[:'countries'].nil?
117
+ query_params[:'adType'] = opts[:'ad_type'] if !opts[:'ad_type'].nil?
118
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
119
+ query_params[:'platforms'] = opts[:'platforms'] if !opts[:'platforms'].nil?
120
+ query_params[:'mediaType'] = opts[:'media_type'] if !opts[:'media_type'].nil?
121
+ query_params[:'languages'] = opts[:'languages'] if !opts[:'languages'].nil?
122
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
123
+ query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
124
+ query_params[:'searchType'] = opts[:'search_type'] if !opts[:'search_type'].nil?
125
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
126
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
127
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
128
+
129
+ # header parameters
130
+ header_params = opts[:header_params] || {}
131
+ # HTTP header 'Accept' (if needed)
132
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
133
+
134
+ # form parameters
135
+ form_params = opts[:form_params] || {}
136
+
137
+ # http body (model)
138
+ post_body = opts[:debug_body]
139
+
140
+ # return_type
141
+ return_type = opts[:debug_return_type] || 'SearchAdLibrary200Response'
142
+
143
+ # auth_names
144
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
145
+
146
+ new_options = opts.merge(
147
+ :operation => :"AdLibraryApi.search_ad_library",
148
+ :header_params => header_params,
149
+ :query_params => query_params,
150
+ :form_params => form_params,
151
+ :body => post_body,
152
+ :auth_names => auth_names,
153
+ :return_type => return_type
154
+ )
155
+
156
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
157
+ if @api_client.config.debugging
158
+ @api_client.config.logger.debug "API called: AdLibraryApi#search_ad_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
159
+ end
160
+ return data, status_code, headers
161
+ end
162
+ end
163
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class SearchAdLibrary200Response < ApiModelBase
18
+ attr_accessor :platform
19
+
20
+ attr_accessor :data
21
+
22
+ attr_accessor :paging
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'platform' => :'platform',
50
+ :'data' => :'data',
51
+ :'paging' => :'paging'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'platform' => :'String',
69
+ :'data' => :'Array<Object>',
70
+ :'paging' => :'SearchAdLibrary200ResponsePaging'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SearchAdLibrary200Response` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SearchAdLibrary200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'platform')
97
+ self.platform = attributes[:'platform']
98
+ else
99
+ self.platform = nil
100
+ end
101
+
102
+ if attributes.key?(:'data')
103
+ if (value = attributes[:'data']).is_a?(Array)
104
+ self.data = value
105
+ end
106
+ else
107
+ self.data = nil
108
+ end
109
+
110
+ if attributes.key?(:'paging')
111
+ self.paging = attributes[:'paging']
112
+ else
113
+ self.paging = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @platform.nil?
123
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
124
+ end
125
+
126
+ if @data.nil?
127
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
128
+ end
129
+
130
+ if @paging.nil?
131
+ invalid_properties.push('invalid value for "paging", paging cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @platform.nil?
142
+ platform_validator = EnumAttributeValidator.new('String', ["meta", "linkedin"])
143
+ return false unless platform_validator.valid?(@platform)
144
+ return false if @data.nil?
145
+ return false if @paging.nil?
146
+ true
147
+ end
148
+
149
+ # Custom attribute writer method checking allowed values (enum).
150
+ # @param [Object] platform Object to be assigned
151
+ def platform=(platform)
152
+ validator = EnumAttributeValidator.new('String', ["meta", "linkedin"])
153
+ unless validator.valid?(platform)
154
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
155
+ end
156
+ @platform = platform
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] data Value to be assigned
161
+ def data=(data)
162
+ if data.nil?
163
+ fail ArgumentError, 'data cannot be nil'
164
+ end
165
+
166
+ @data = data
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] paging Value to be assigned
171
+ def paging=(paging)
172
+ if paging.nil?
173
+ fail ArgumentError, 'paging cannot be nil'
174
+ end
175
+
176
+ @paging = paging
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ platform == o.platform &&
185
+ data == o.data &&
186
+ paging == o.paging
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [platform, data, paging].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -0,0 +1,159 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class SearchAdLibrary200ResponsePaging < ApiModelBase
18
+ # Cursor for the next page; null when exhausted.
19
+ attr_accessor :after
20
+
21
+ # LinkedIn only. Total matching ads.
22
+ attr_accessor :total
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'after' => :'after',
28
+ :'total' => :'total'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'after' => :'String',
46
+ :'total' => :'Integer'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'after',
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SearchAdLibrary200ResponsePaging` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SearchAdLibrary200ResponsePaging`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'after')
74
+ self.after = attributes[:'after']
75
+ end
76
+
77
+ if attributes.key?(:'total')
78
+ self.total = attributes[:'total']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ after == o.after &&
103
+ total == o.total
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [after, total].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Returns the object in the form of hash
142
+ # @return [Hash] Returns the object in the form of hash
143
+ def to_hash
144
+ hash = {}
145
+ self.class.attribute_map.each_pair do |attr, param|
146
+ value = self.send(attr)
147
+ if value.nil?
148
+ is_nullable = self.class.openapi_nullable.include?(attr)
149
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
150
+ end
151
+
152
+ hash[param] = _to_hash(value)
153
+ end
154
+ hash
155
+ end
156
+
157
+ end
158
+
159
+ end
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.852'
14
+ VERSION = '0.0.854'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -1242,6 +1242,8 @@ require 'zernio-sdk/models/schedule_broadcast200_response_broadcast'
1242
1242
  require 'zernio-sdk/models/schedule_broadcast_request'
1243
1243
  require 'zernio-sdk/models/search_ad_interests200_response'
1244
1244
  require 'zernio-sdk/models/search_ad_interests200_response_interests_inner'
1245
+ require 'zernio-sdk/models/search_ad_library200_response'
1246
+ require 'zernio-sdk/models/search_ad_library200_response_paging'
1245
1247
  require 'zernio-sdk/models/search_ad_targeting200_response'
1246
1248
  require 'zernio-sdk/models/search_ad_targeting200_response_results_inner'
1247
1249
  require 'zernio-sdk/models/search_available_phone_numbers200_response'
@@ -1805,6 +1807,7 @@ require 'zernio-sdk/api/ad_audiences_api'
1805
1807
  require 'zernio-sdk/api/ad_campaigns_api'
1806
1808
  require 'zernio-sdk/api/ad_creatives_api'
1807
1809
  require 'zernio-sdk/api/ad_insights_api'
1810
+ require 'zernio-sdk/api/ad_library_api'
1808
1811
  require 'zernio-sdk/api/ad_targeting_api'
1809
1812
  require 'zernio-sdk/api/analytics_api'
1810
1813
  require 'zernio-sdk/api/blogs_api'
data/openapi.yaml CHANGED
@@ -389,6 +389,10 @@ tags:
389
389
  Targeting discovery: search interests/behaviors/geo/demographics, estimate reach, and (LinkedIn)
390
390
  bid pricing and supply forecasts. Feeds the targeting fields on create.
391
391
  Requires the Ads add-on.
392
+ - name: Ad Library
393
+ description: |
394
+ Competitor and market research over the public ad archives (Meta Ad Library, LinkedIn Ad Library),
395
+ searched with the customer's own connected token. Requires the Ads add-on.
392
396
  - name: Ad Insights
393
397
  description: |
394
398
  Measurement: cached aggregate analytics per ad/campaign, plus live Meta Graph insight queries
@@ -46652,6 +46656,117 @@ paths:
46652
46656
  '404':
46653
46657
  description: Account not found, or the platform does not support the requested dimension
46654
46658
 
46659
+ /v1/ads/library:
46660
+ get:
46661
+ x-resource-group: "ads"
46662
+ operationId: searchAdLibrary
46663
+ tags: ["Ad Library"]
46664
+ x-platforms: ["meta", "linkedin"]
46665
+ summary: Search the public Ad Library
46666
+ description: |-
46667
+ Competitor and market research over the platform's public ad archive, searched with the
46668
+ customer's own connected token (no extra scope): Meta's Ad Library (`GET /ads_archive`) for
46669
+ a `facebook` / `instagram` / `metaads` account, LinkedIn's Ad Library (`GET /rest/adLibrary`)
46670
+ for a `linkedin` / `linkedinads` account. Rows are returned in the platform's raw shape under
46671
+ `data`; `paging.after` is an opaque cursor on both (`null` when exhausted).
46672
+
46673
+ **Meta coverage.** Political and social-issue ads are searchable worldwide. Every other ad is
46674
+ in the archive only if it was delivered to the EU or UK within the last year, so a US-only
46675
+ commercial advertiser is invisible. Spend, impressions and demographics are political-only
46676
+ fields and are left out of the default projection; request them via `fields`. Meta serves the
46677
+ archive only to people who confirmed their identity and location at facebook.com/ID: until the
46678
+ Facebook user behind the connection has done so, the call fails with
46679
+ `meta_identity_confirmation_required` (403).
46680
+
46681
+ **LinkedIn coverage.** Ads served after June 1 2023, worldwide, kept for a year after their
46682
+ last impression. EU-delivered ads carry impression ranges and the disclosed targeting facets.
46683
+ Pages are capped at 25 ads (`limit` > 25 is a 400); `after` is the next offset.
46684
+
46685
+ Which params apply: `q`, `countries`, `since`, `until`, `limit`, `after` on both; `pageIds`,
46686
+ `adType`, `status`, `platforms`, `mediaType`, `languages`, `searchType`, `fields` are Meta-only;
46687
+ `advertiser` is LinkedIn-only. Passing a param the account's platform does not support is a 400
46688
+ naming the param.
46689
+ security:
46690
+ - bearerAuth: []
46691
+ parameters:
46692
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Zernio SocialAccount id (facebook / instagram / metaads for Meta, linkedin / linkedinads for LinkedIn). Its token is the one that searches." }
46693
+ - { name: q, in: query, schema: { type: string, maxLength: 100 }, description: "Keyword search. Meta does not translate it, so write it in the ads' language. Required unless pageIds (Meta) or advertiser (LinkedIn) is given." }
46694
+ - { name: pageIds, in: query, schema: { type: string }, description: "Meta only. Comma-separated Facebook Page ids (max 10) whose ads to list." }
46695
+ - { name: advertiser, in: query, schema: { type: string, maxLength: 100 }, description: "LinkedIn only. Advertiser (Page) name to search." }
46696
+ - { name: countries, in: query, schema: { type: string }, description: "Comma-separated ISO 3166-1 alpha-2 codes the ads reached. Meta defaults to ALL (an explicit ALL is Meta-only); LinkedIn searches every market when omitted." }
46697
+ - { name: adType, in: query, schema: { type: string, enum: [ALL, POLITICAL_AND_ISSUE_ADS, HOUSING_ADS, EMPLOYMENT_ADS, FINANCIAL_PRODUCTS_AND_SERVICES_ADS], default: ALL }, description: "Meta only." }
46698
+ - { name: status, in: query, schema: { type: string, enum: [ACTIVE, INACTIVE, ALL], default: ACTIVE }, description: "Meta only. ACTIVE = eligible for delivery right now." }
46699
+ - { name: platforms, in: query, schema: { type: string }, description: "Meta only. Comma-separated publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING_SERVICES." }
46700
+ - { name: mediaType, in: query, schema: { type: string, enum: [ALL, IMAGE, MEME, VIDEO, NONE] }, description: "Meta only." }
46701
+ - { name: languages, in: query, schema: { type: string }, description: "Meta only. Comma-separated ISO 639-1 codes of the ad text." }
46702
+ - { name: since, in: query, schema: { type: string, format: date }, description: "Earliest delivery date (YYYY-MM-DD)." }
46703
+ - { name: until, in: query, schema: { type: string, format: date }, description: "Latest delivery date (YYYY-MM-DD)." }
46704
+ - { name: searchType, in: query, schema: { type: string, enum: [KEYWORD_UNORDERED, KEYWORD_EXACT_PHRASE], default: KEYWORD_UNORDERED }, description: "Meta only. Whether q matches words in any order or as an exact phrase (comma-separate phrases to match all of them)." }
46705
+ - { name: fields, in: query, schema: { type: string }, description: "Meta only. Raw Graph projection override, e.g. add spend,impressions,demographic_distribution for political ads." }
46706
+ - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 }, description: "Rows per page. LinkedIn accepts at most 25." }
46707
+ - { name: after, in: query, schema: { type: string }, description: "paging.after of the previous page." }
46708
+ responses:
46709
+ '200':
46710
+ description: Archived ads (raw platform shape)
46711
+ content:
46712
+ application/json:
46713
+ schema:
46714
+ type: object
46715
+ required: [platform, data, paging]
46716
+ properties:
46717
+ platform: { type: string, enum: [meta, linkedin] }
46718
+ data:
46719
+ type: array
46720
+ items:
46721
+ type: object
46722
+ description: "Meta: an ArchivedAd (id, page_id, page_name, ad_creation_time, ad_delivery_start_time, ad_delivery_stop_time, ad_creative_bodies[], ad_creative_link_titles[], ad_creative_link_descriptions[], ad_creative_link_captions[], ad_snapshot_url, publisher_platforms[], languages[], plus eu_total_reach, beneficiary_payers, target_ages, target_gender, target_locations, age_country_gender_reach_breakdown, total_reach_by_location on EU/UK ads). LinkedIn: { adUrl, isRestricted, details: { type, advertiser: { advertiserName, advertiserUrl, adPayer }, adStatistics: { firstImpressionAt, latestImpressionAt, totalImpressions: { from, to }, impressionsDistributionByCountry[] }, adTargeting: [{ facetName, includedSegments[], excludedSegments[] }] } } (adStatistics and adTargeting only on EU-delivered ads)."
46723
+ paging:
46724
+ type: object
46725
+ properties:
46726
+ after: { type: [string, "null"], description: "Cursor for the next page; null when exhausted." }
46727
+ total: { type: integer, description: "LinkedIn only. Total matching ads." }
46728
+ examples:
46729
+ meta:
46730
+ summary: Meta, an EU-delivered ad
46731
+ value:
46732
+ platform: meta
46733
+ data:
46734
+ - id: "1234567890"
46735
+ page_id: "811889972008357"
46736
+ page_name: "Zernio"
46737
+ ad_creation_time: "2026-08-02"
46738
+ ad_delivery_start_time: "2026-08-03"
46739
+ ad_creative_bodies: ["Schedule posts and run ads from one API."]
46740
+ ad_creative_link_titles: ["Zernio for developers"]
46741
+ ad_snapshot_url: "https://www.facebook.com/ads/archive/render_ad/?id=1234567890&access_token=..."
46742
+ publisher_platforms: ["facebook", "instagram"]
46743
+ languages: ["en"]
46744
+ eu_total_reach: 18400
46745
+ target_ages: ["25", "54"]
46746
+ target_gender: "All"
46747
+ paging: { after: "QVFIUm..." }
46748
+ linkedin:
46749
+ summary: LinkedIn, an EU-delivered ad
46750
+ value:
46751
+ platform: linkedin
46752
+ data:
46753
+ - isRestricted: false
46754
+ adUrl: "https://www.linkedin.com/ad-library/detail/1521996423"
46755
+ details:
46756
+ type: SPONSORED_STATUS_UPDATE
46757
+ advertiser: { advertiserName: "CEE Microsoft Dynamics Partners", advertiserUrl: "https://www.linkedin.com/company/71491884", adPayer: "UAB Companial" }
46758
+ adStatistics: { firstImpressionAt: 1788623666998, latestImpressionAt: 1788780782520, totalImpressions: { from: 5000, to: 10000 }, impressionsDistributionByCountry: [] }
46759
+ adTargeting:
46760
+ - { facetName: Language, includedSegments: [polski], excludedSegments: [] }
46761
+ - { facetName: Location, includedSegments: [Polska], excludedSegments: [] }
46762
+ paging: { after: "25", total: 27147 }
46763
+ '400': { $ref: '#/components/responses/BadRequest' }
46764
+ '401': { $ref: '#/components/responses/Unauthorized' }
46765
+ '403':
46766
+ description: "Ads access required (legacy plans need the Ads add-on), or, on Meta, `meta_identity_confirmation_required`: the Facebook user behind the connection has not confirmed identity and location at facebook.com/ID."
46767
+ '404': { description: Account not found }
46768
+ '501': { description: Only supported on Meta and LinkedIn accounts }
46769
+
46655
46770
  /v1/ads/targeting/reach-estimate:
46656
46771
  post:
46657
46772
  x-resource-group: "ads"
@@ -0,0 +1,62 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for Zernio::AdLibraryApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'AdLibraryApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = Zernio::AdLibraryApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of AdLibraryApi' do
30
+ it 'should create an instance of AdLibraryApi' do
31
+ expect(@api_instance).to be_instance_of(Zernio::AdLibraryApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for search_ad_library
36
+ # Search the public Ad Library
37
+ # Competitor and market research over the platform&#39;s public ad archive, searched with the customer&#39;s own connected token (no extra scope): Meta&#39;s Ad Library (&#x60;GET /ads_archive&#x60;) for a &#x60;facebook&#x60; / &#x60;instagram&#x60; / &#x60;metaads&#x60; account, LinkedIn&#39;s Ad Library (&#x60;GET /rest/adLibrary&#x60;) for a &#x60;linkedin&#x60; / &#x60;linkedinads&#x60; account. Rows are returned in the platform&#39;s raw shape under &#x60;data&#x60;; &#x60;paging.after&#x60; is an opaque cursor on both (&#x60;null&#x60; when exhausted). **Meta coverage.** Political and social-issue ads are searchable worldwide. Every other ad is in the archive only if it was delivered to the EU or UK within the last year, so a US-only commercial advertiser is invisible. Spend, impressions and demographics are political-only fields and are left out of the default projection; request them via &#x60;fields&#x60;. Meta serves the archive only to people who confirmed their identity and location at facebook.com/ID: until the Facebook user behind the connection has done so, the call fails with &#x60;meta_identity_confirmation_required&#x60; (403). **LinkedIn coverage.** Ads served after June 1 2023, worldwide, kept for a year after their last impression. EU-delivered ads carry impression ranges and the disclosed targeting facets. Pages are capped at 25 ads (&#x60;limit&#x60; &gt; 25 is a 400); &#x60;after&#x60; is the next offset. Which params apply: &#x60;q&#x60;, &#x60;countries&#x60;, &#x60;since&#x60;, &#x60;until&#x60;, &#x60;limit&#x60;, &#x60;after&#x60; on both; &#x60;pageIds&#x60;, &#x60;adType&#x60;, &#x60;status&#x60;, &#x60;platforms&#x60;, &#x60;mediaType&#x60;, &#x60;languages&#x60;, &#x60;searchType&#x60;, &#x60;fields&#x60; are Meta-only; &#x60;advertiser&#x60; is LinkedIn-only. Passing a param the account&#39;s platform does not support is a 400 naming the param.
38
+ # @param account_id Zernio SocialAccount id (facebook / instagram / metaads for Meta, linkedin / linkedinads for LinkedIn). Its token is the one that searches.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :q Keyword search. Meta does not translate it, so write it in the ads&#39; language. Required unless pageIds (Meta) or advertiser (LinkedIn) is given.
41
+ # @option opts [String] :page_ids Meta only. Comma-separated Facebook Page ids (max 10) whose ads to list.
42
+ # @option opts [String] :advertiser LinkedIn only. Advertiser (Page) name to search.
43
+ # @option opts [String] :countries Comma-separated ISO 3166-1 alpha-2 codes the ads reached. Meta defaults to ALL (an explicit ALL is Meta-only); LinkedIn searches every market when omitted.
44
+ # @option opts [String] :ad_type Meta only.
45
+ # @option opts [String] :status Meta only. ACTIVE &#x3D; eligible for delivery right now.
46
+ # @option opts [String] :platforms Meta only. Comma-separated publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING_SERVICES.
47
+ # @option opts [String] :media_type Meta only.
48
+ # @option opts [String] :languages Meta only. Comma-separated ISO 639-1 codes of the ad text.
49
+ # @option opts [Date] :since Earliest delivery date (YYYY-MM-DD).
50
+ # @option opts [Date] :_until Latest delivery date (YYYY-MM-DD).
51
+ # @option opts [String] :search_type Meta only. Whether q matches words in any order or as an exact phrase (comma-separate phrases to match all of them).
52
+ # @option opts [String] :fields Meta only. Raw Graph projection override, e.g. add spend,impressions,demographic_distribution for political ads.
53
+ # @option opts [Integer] :limit Rows per page. LinkedIn accepts at most 25.
54
+ # @option opts [String] :after paging.after of the previous page.
55
+ # @return [SearchAdLibrary200Response]
56
+ describe 'search_ad_library test' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
59
+ end
60
+ end
61
+
62
+ end
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::SearchAdLibrary200ResponsePaging
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::SearchAdLibrary200ResponsePaging do
21
+ #let(:instance) { Zernio::SearchAdLibrary200ResponsePaging.new }
22
+
23
+ describe 'test an instance of SearchAdLibrary200ResponsePaging' do
24
+ it 'should create an instance of SearchAdLibrary200ResponsePaging' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::SearchAdLibrary200ResponsePaging)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "after"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "total"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ end
@@ -0,0 +1,52 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::SearchAdLibrary200Response
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::SearchAdLibrary200Response do
21
+ #let(:instance) { Zernio::SearchAdLibrary200Response.new }
22
+
23
+ describe 'test an instance of SearchAdLibrary200Response' do
24
+ it 'should create an instance of SearchAdLibrary200Response' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::SearchAdLibrary200Response)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "platform"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["meta", "linkedin"])
34
+ # validator.allowable_values.each do |value|
35
+ # expect { instance.platform = value }.not_to raise_error
36
+ # end
37
+ end
38
+ end
39
+
40
+ describe 'test attribute "data"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "paging"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ end
50
+ end
51
+
52
+ end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: late-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.852
4
+ version: 0.0.854
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -94,6 +94,7 @@ files:
94
94
  - docs/AdEngagementCounts.md
95
95
  - docs/AdFunnelCounts.md
96
96
  - docs/AdInsightsApi.md
97
+ - docs/AdLibraryApi.md
97
98
  - docs/AdMetrics.md
98
99
  - docs/AdPromotedObject.md
99
100
  - docs/AdReviewStatus.md
@@ -1340,6 +1341,8 @@ files:
1340
1341
  - docs/ScheduleBroadcastRequest.md
1341
1342
  - docs/SearchAdInterests200Response.md
1342
1343
  - docs/SearchAdInterests200ResponseInterestsInner.md
1344
+ - docs/SearchAdLibrary200Response.md
1345
+ - docs/SearchAdLibrary200ResponsePaging.md
1343
1346
  - docs/SearchAdTargeting200Response.md
1344
1347
  - docs/SearchAdTargeting200ResponseResultsInner.md
1345
1348
  - docs/SearchAvailablePhoneNumbers200Response.md
@@ -1922,6 +1925,7 @@ files:
1922
1925
  - lib/zernio-sdk/api/ad_campaigns_api.rb
1923
1926
  - lib/zernio-sdk/api/ad_creatives_api.rb
1924
1927
  - lib/zernio-sdk/api/ad_insights_api.rb
1928
+ - lib/zernio-sdk/api/ad_library_api.rb
1925
1929
  - lib/zernio-sdk/api/ad_targeting_api.rb
1926
1930
  - lib/zernio-sdk/api/analytics_api.rb
1927
1931
  - lib/zernio-sdk/api/api_keys_api.rb
@@ -3208,6 +3212,8 @@ files:
3208
3212
  - lib/zernio-sdk/models/schedule_broadcast_request.rb
3209
3213
  - lib/zernio-sdk/models/search_ad_interests200_response.rb
3210
3214
  - lib/zernio-sdk/models/search_ad_interests200_response_interests_inner.rb
3215
+ - lib/zernio-sdk/models/search_ad_library200_response.rb
3216
+ - lib/zernio-sdk/models/search_ad_library200_response_paging.rb
3211
3217
  - lib/zernio-sdk/models/search_ad_targeting200_response.rb
3212
3218
  - lib/zernio-sdk/models/search_ad_targeting200_response_results_inner.rb
3213
3219
  - lib/zernio-sdk/models/search_available_phone_numbers200_response.rb
@@ -3771,6 +3777,7 @@ files:
3771
3777
  - spec/api/ad_campaigns_api_spec.rb
3772
3778
  - spec/api/ad_creatives_api_spec.rb
3773
3779
  - spec/api/ad_insights_api_spec.rb
3780
+ - spec/api/ad_library_api_spec.rb
3774
3781
  - spec/api/ad_targeting_api_spec.rb
3775
3782
  - spec/api/analytics_api_spec.rb
3776
3783
  - spec/api/api_keys_api_spec.rb
@@ -5052,6 +5059,8 @@ files:
5052
5059
  - spec/models/schedule_broadcast_request_spec.rb
5053
5060
  - spec/models/search_ad_interests200_response_interests_inner_spec.rb
5054
5061
  - spec/models/search_ad_interests200_response_spec.rb
5062
+ - spec/models/search_ad_library200_response_paging_spec.rb
5063
+ - spec/models/search_ad_library200_response_spec.rb
5055
5064
  - spec/models/search_ad_targeting200_response_results_inner_spec.rb
5056
5065
  - spec/models/search_ad_targeting200_response_spec.rb
5057
5066
  - spec/models/search_available_phone_numbers200_response_numbers_inner_spec.rb
@@ -5605,7 +5614,7 @@ files:
5605
5614
  - spec/models/you_tube_video_retention_response_retention_curve_inner_spec.rb
5606
5615
  - spec/models/you_tube_video_retention_response_spec.rb
5607
5616
  - spec/spec_helper.rb
5608
- - zernio-sdk-0.0.852.gem
5617
+ - zernio-sdk-0.0.854.gem
5609
5618
  - zernio-sdk.gemspec
5610
5619
  homepage: https://openapi-generator.tech
5611
5620
  licenses:
@@ -5637,6 +5646,7 @@ test_files:
5637
5646
  - spec/api/phone_numbers_api_spec.rb
5638
5647
  - spec/api/ad_accounts_api_spec.rb
5639
5648
  - spec/api/media_api_spec.rb
5649
+ - spec/api/ad_library_api_spec.rb
5640
5650
  - spec/api/lead_gen_api_spec.rb
5641
5651
  - spec/api/twitter_engagement_api_spec.rb
5642
5652
  - spec/api/account_settings_api_spec.rb
@@ -5937,6 +5947,7 @@ test_files:
5937
5947
  - spec/models/delete_google_business_media200_response_spec.rb
5938
5948
  - spec/models/get_inbox_post_comments200_response_meta_ad_comments_spec.rb
5939
5949
  - spec/models/webhook_payload_post_platform_spec.rb
5950
+ - spec/models/search_ad_library200_response_spec.rb
5940
5951
  - spec/models/on_whats_app_number_verification_required_request_spec.rb
5941
5952
  - spec/models/webhook_payload_message_message_sender_spec.rb
5942
5953
  - spec/models/purchase_phone_number200_response_one_of1_phone_number_spec.rb
@@ -6694,6 +6705,7 @@ test_files:
6694
6705
  - spec/models/create_rf_prediction_request_spec.rb
6695
6706
  - spec/models/get_tik_tok_creator_info200_response_posting_limits_interaction_settings_allow_duet_spec.rb
6696
6707
  - spec/models/create_sip_trunk201_response_termination_spec.rb
6708
+ - spec/models/search_ad_library200_response_paging_spec.rb
6697
6709
  - spec/models/create_discord_scheduled_event200_response_spec.rb
6698
6710
  - spec/models/instagram_account_insights_response_metrics_value_spec.rb
6699
6711
  - spec/models/adjust_conversions200_response_failures_inner_spec.rb
Binary file