late-sdk 0.0.723 → 0.0.724

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: 76635f6e654de1a48be7a52fe66219b03d65c15f25369d5c39cd98a43174d092
4
- data.tar.gz: b9c1c82b061c37af76d8fb1847ab371ae5148438dac8d2e7a7aba3e12c271158
3
+ metadata.gz: 8fe0affec7337a54f5a5626b8088c3a1055623f6fe609b396ef60e85d79ae7d5
4
+ data.tar.gz: 424bfdbebe8746e244c9db88f82109fd8169f9cbc4273a29e91c210b3de380cf
5
5
  SHA512:
6
- metadata.gz: f4fb12052c8861d314e204f281fa1ee5cf93df9a933c2cc4e205002736044d05c1ac9bb6c9d6c2f549f52528d873b2cae4f5392f5965f80535d361e32297a3bf
7
- data.tar.gz: 4b03150df77c33d99414345eaa462d61c076a7fe321311da2263034957ef595d7a1a0e97fc49e9b072c236a67fd1dd00dbe37099f52ba8d3290da16c5c66f3b0
6
+ metadata.gz: a7f44b04c676081d1b6f89235840b1569878b9917248ef15e6abc338144ee86b2d9d573aedff1ba107d005944181ca62d40a8a5c298c3cc213b5437f7a32dfaa
7
+ data.tar.gz: 965f7286746280990b7f59721a344db6600caf191ce78f95f456ac2fd33e24dca192f0f574ea7ce00eff3fb51f9e0472d9560142915717e5597cece7f80c69d4
data/README.md CHANGED
@@ -153,6 +153,7 @@ Class | Method | HTTP request | Description
153
153
  *Zernio::AdCreativesApi* | [**list_ad_catalogs**](docs/AdCreativesApi.md#list_ad_catalogs) | **GET** /v1/ads/catalogs | List Meta product catalogs
154
154
  *Zernio::AdCreativesApi* | [**list_ad_creatives**](docs/AdCreativesApi.md#list_ad_creatives) | **GET** /v1/ads/creatives | Creative library
155
155
  *Zernio::AdCreativesApi* | [**list_ad_images**](docs/AdCreativesApi.md#list_ad_images) | **GET** /v1/ads/images | Ad image library
156
+ *Zernio::AdCreativesApi* | [**list_ad_videos**](docs/AdCreativesApi.md#list_ad_videos) | **GET** /v1/ads/videos | Ad video library
156
157
  *Zernio::AdCreativesApi* | [**update_ad_creative**](docs/AdCreativesApi.md#update_ad_creative) | **PUT** /v1/ads/creatives/{creativeId} | Rename a creative
157
158
  *Zernio::AdCreativesApi* | [**upload_ad_image**](docs/AdCreativesApi.md#upload_ad_image) | **POST** /v1/ads/images | Upload an ad image from base64
158
159
  *Zernio::AdInsightsApi* | [**create_ad_insights_report**](docs/AdInsightsApi.md#create_ad_insights_report) | **POST** /v1/ads/insights/reports | Submit an async insights report run
@@ -1501,6 +1502,7 @@ Class | Method | HTTP request | Description
1501
1502
  - [Zernio::ListAdKeywords200ResponseKeywordsInner](docs/ListAdKeywords200ResponseKeywordsInner.md)
1502
1503
  - [Zernio::ListAdLabels200Response](docs/ListAdLabels200Response.md)
1503
1504
  - [Zernio::ListAdStudies200Response](docs/ListAdStudies200Response.md)
1505
+ - [Zernio::ListAdVideos200Response](docs/ListAdVideos200Response.md)
1504
1506
  - [Zernio::ListAds202Response](docs/ListAds202Response.md)
1505
1507
  - [Zernio::ListAdsBusinessCenters200Response](docs/ListAdsBusinessCenters200Response.md)
1506
1508
  - [Zernio::ListApiKeys200Response](docs/ListApiKeys200Response.md)
@@ -13,6 +13,7 @@ All URIs are relative to *https://zernio.com/api*
13
13
  | [**list_ad_catalogs**](AdCreativesApi.md#list_ad_catalogs) | **GET** /v1/ads/catalogs | List Meta product catalogs |
14
14
  | [**list_ad_creatives**](AdCreativesApi.md#list_ad_creatives) | **GET** /v1/ads/creatives | Creative library |
15
15
  | [**list_ad_images**](AdCreativesApi.md#list_ad_images) | **GET** /v1/ads/images | Ad image library |
16
+ | [**list_ad_videos**](AdCreativesApi.md#list_ad_videos) | **GET** /v1/ads/videos | Ad video library |
16
17
  | [**update_ad_creative**](AdCreativesApi.md#update_ad_creative) | **PUT** /v1/ads/creatives/{creativeId} | Rename a creative |
17
18
  | [**upload_ad_image**](AdCreativesApi.md#upload_ad_image) | **POST** /v1/ads/images | Upload an ad image from base64 |
18
19
 
@@ -674,6 +675,85 @@ end
674
675
  - **Accept**: application/json
675
676
 
676
677
 
678
+ ## list_ad_videos
679
+
680
+ > <ListAdVideos200Response> list_ad_videos(account_id, ad_account_id, opts)
681
+
682
+ Ad video library
683
+
684
+ Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`. There is no upload operation here: upload by URL inline via `video.url` on POST /v1/ads/create.
685
+
686
+ ### Examples
687
+
688
+ ```ruby
689
+ require 'time'
690
+ require 'zernio-sdk'
691
+ # setup authorization
692
+ Zernio.configure do |config|
693
+ # Configure Bearer authorization (JWT): bearerAuth
694
+ config.access_token = 'YOUR_BEARER_TOKEN'
695
+ end
696
+
697
+ api_instance = Zernio::AdCreativesApi.new
698
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
699
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>).
700
+ opts = {
701
+ fields: 'fields_example', # String | Comma-separated Graph field override (supports nested {} projections).
702
+ limit: 56, # Integer | Rows per page
703
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
704
+ }
705
+
706
+ begin
707
+ # Ad video library
708
+ result = api_instance.list_ad_videos(account_id, ad_account_id, opts)
709
+ p result
710
+ rescue Zernio::ApiError => e
711
+ puts "Error when calling AdCreativesApi->list_ad_videos: #{e}"
712
+ end
713
+ ```
714
+
715
+ #### Using the list_ad_videos_with_http_info variant
716
+
717
+ This returns an Array which contains the response data, status code and headers.
718
+
719
+ > <Array(<ListAdVideos200Response>, Integer, Hash)> list_ad_videos_with_http_info(account_id, ad_account_id, opts)
720
+
721
+ ```ruby
722
+ begin
723
+ # Ad video library
724
+ data, status_code, headers = api_instance.list_ad_videos_with_http_info(account_id, ad_account_id, opts)
725
+ p status_code # => 2xx
726
+ p headers # => { ... }
727
+ p data # => <ListAdVideos200Response>
728
+ rescue Zernio::ApiError => e
729
+ puts "Error when calling AdCreativesApi->list_ad_videos_with_http_info: #{e}"
730
+ end
731
+ ```
732
+
733
+ ### Parameters
734
+
735
+ | Name | Type | Description | Notes |
736
+ | ---- | ---- | ----------- | ----- |
737
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
738
+ | **ad_account_id** | **String** | Meta ad account id (act_&lt;n&gt;). | |
739
+ | **fields** | **String** | Comma-separated Graph field override (supports nested {} projections). | [optional] |
740
+ | **limit** | **Integer** | Rows per page | [optional][default to 25] |
741
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
742
+
743
+ ### Return type
744
+
745
+ [**ListAdVideos200Response**](ListAdVideos200Response.md)
746
+
747
+ ### Authorization
748
+
749
+ [bearerAuth](../README.md#bearerAuth)
750
+
751
+ ### HTTP request headers
752
+
753
+ - **Content-Type**: Not defined
754
+ - **Accept**: application/json
755
+
756
+
677
757
  ## update_ad_creative
678
758
 
679
759
  > <UpdateAdCreative200Response> update_ad_creative(creative_id, update_ad_creative_request)
@@ -0,0 +1,22 @@
1
+ # Zernio::ListAdVideos200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **ad_account_id** | **String** | | [optional] |
8
+ | **data** | **Array&lt;Object&gt;** | | [optional] |
9
+ | **paging** | [**GetAdsActivityLog200ResponsePaging**](GetAdsActivityLog200ResponsePaging.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::ListAdVideos200Response.new(
17
+ ad_account_id: null,
18
+ data: null,
19
+ paging: null
20
+ )
21
+ ```
22
+
@@ -23,7 +23,8 @@
23
23
  | **source_audience_id** | **String** | Required for lookalike audiences | [optional] |
24
24
  | **country** | **String** | 2-letter code, required for lookalike audiences | [optional] |
25
25
  | **ratio** | **Float** | Required for lookalike audiences | [optional] |
26
- | **rule** | **Object** | Optional raw Meta rule, forwarded verbatim: pixel event rule for website audiences, or the engagement rule for meta_engagement (overrides the built rule, e.g. for event/canvas/lead-form sources). | [optional] |
26
+ | **url_contains** | **String** | website only. Narrows the audience from all visitors to visitors of URLs containing this substring. Ignored when &#x60;rule&#x60; is supplied. | [optional] |
27
+ | **rule** | **Object** | Optional raw Meta rule, replacing the one we build. Omit it for all visitors of &#x60;pixelId&#x60;, or use &#x60;urlContains&#x60; for the common page-match case. For &#x60;website&#x60; this is Meta&#39;s Flexible Audience Rule and is VALIDATED before we call Meta: every entry in &#x60;inclusions.rules&#x60; (and &#x60;exclusions.rules&#x60;) must carry &#x60;event_sources&#x60;, &#x60;retention_seconds&#x60; AND &#x60;filter&#x60;. Meta rejects a rule missing any of the three with code 100 / subcode 1713098 (\&quot;Invalid rule JSON format\&quot;), so a bad shape is a 400 here instead. The pre-2018 flat shapes (&#x60;{url: ...}&#x60;, &#x60;{event: ...}&#x60;) are not accepted by Meta at all (subcode 1870029). Example, visitors of /checkout in the last 30 days: &#x60;{\&quot;inclusions\&quot;:{\&quot;operator\&quot;:\&quot;or\&quot;,\&quot;rules\&quot;:[{\&quot;event_sources\&quot;:[{\&quot;id\&quot;:\&quot;&lt;pixelId&gt;\&quot;,\&quot;type\&quot;:\&quot;pixel\&quot;}],\&quot;retention_seconds\&quot;:2592000,\&quot;filter\&quot;:{\&quot;operator\&quot;:\&quot;and\&quot;,\&quot;filters\&quot;:[{\&quot;field\&quot;:\&quot;url\&quot;,\&quot;operator\&quot;:\&quot;i_contains\&quot;,\&quot;value\&quot;:\&quot;/checkout\&quot;}]}}]}}&#x60; Note Meta DERIVES &#x60;retention_days&#x60; from &#x60;retention_seconds&#x60; and stores &#x60;event_sources[].id&#x60; as a number, so a rule read back will not be byte-identical to the one you sent. For &#x60;meta_engagement&#x60; the rule is forwarded verbatim and NOT validated: that type has two dialects (the &#x60;video&#x60; source uses a legacy flat array), so no single schema covers both. | [optional] |
27
28
  | **customer_file_source** | **String** | Data source declaration for GDPR compliance (customer_list only) | [optional] |
28
29
 
29
30
  ## Example
@@ -51,6 +52,7 @@ instance = Zernio::UploadedOrDerivedAudience.new(
51
52
  source_audience_id: null,
52
53
  country: null,
53
54
  ratio: null,
55
+ url_contains: null,
54
56
  rule: null,
55
57
  customer_file_source: null
56
58
  )
@@ -681,6 +681,94 @@ module Zernio
681
681
  return data, status_code, headers
682
682
  end
683
683
 
684
+ # Ad video library
685
+ # Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`. There is no upload operation here: upload by URL inline via `video.url` on POST /v1/ads/create.
686
+ # @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
687
+ # @param ad_account_id [String] Meta ad account id (act_&lt;n&gt;).
688
+ # @param [Hash] opts the optional parameters
689
+ # @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
690
+ # @option opts [Integer] :limit Rows per page (default to 25)
691
+ # @option opts [String] :after Cursor from paging.after of the previous page.
692
+ # @return [ListAdVideos200Response]
693
+ def list_ad_videos(account_id, ad_account_id, opts = {})
694
+ data, _status_code, _headers = list_ad_videos_with_http_info(account_id, ad_account_id, opts)
695
+ data
696
+ end
697
+
698
+ # Ad video library
699
+ # Lists the ad account&#39;s video library (Meta&#39;s &#x60;/act_X/advideos&#x60;), rows returned verbatim. The default projection covers id, title, status, poster frames and length; &#x60;fields&#x60; is a raw-passthrough override. Any &#x60;id&#x60; here is reusable as &#x60;video.id&#x60; on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as &#x60;creative.videoId&#x60; on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once &#x60;status.video_status&#x60; reads &#x60;ready&#x60;. There is no upload operation here: upload by URL inline via &#x60;video.url&#x60; on POST /v1/ads/create.
700
+ # @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
701
+ # @param ad_account_id [String] Meta ad account id (act_&lt;n&gt;).
702
+ # @param [Hash] opts the optional parameters
703
+ # @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
704
+ # @option opts [Integer] :limit Rows per page (default to 25)
705
+ # @option opts [String] :after Cursor from paging.after of the previous page.
706
+ # @return [Array<(ListAdVideos200Response, Integer, Hash)>] ListAdVideos200Response data, response status code and response headers
707
+ def list_ad_videos_with_http_info(account_id, ad_account_id, opts = {})
708
+ if @api_client.config.debugging
709
+ @api_client.config.logger.debug 'Calling API: AdCreativesApi.list_ad_videos ...'
710
+ end
711
+ # verify the required parameter 'account_id' is set
712
+ if @api_client.config.client_side_validation && account_id.nil?
713
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.list_ad_videos"
714
+ end
715
+ # verify the required parameter 'ad_account_id' is set
716
+ if @api_client.config.client_side_validation && ad_account_id.nil?
717
+ fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdCreativesApi.list_ad_videos"
718
+ end
719
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
720
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_videos, must be smaller than or equal to 100.'
721
+ end
722
+
723
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
724
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_videos, must be greater than or equal to 1.'
725
+ end
726
+
727
+ # resource path
728
+ local_var_path = '/v1/ads/videos'
729
+
730
+ # query parameters
731
+ query_params = opts[:query_params] || {}
732
+ query_params[:'accountId'] = account_id
733
+ query_params[:'adAccountId'] = ad_account_id
734
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
735
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
736
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
737
+
738
+ # header parameters
739
+ header_params = opts[:header_params] || {}
740
+ # HTTP header 'Accept' (if needed)
741
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
742
+
743
+ # form parameters
744
+ form_params = opts[:form_params] || {}
745
+
746
+ # http body (model)
747
+ post_body = opts[:debug_body]
748
+
749
+ # return_type
750
+ return_type = opts[:debug_return_type] || 'ListAdVideos200Response'
751
+
752
+ # auth_names
753
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
754
+
755
+ new_options = opts.merge(
756
+ :operation => :"AdCreativesApi.list_ad_videos",
757
+ :header_params => header_params,
758
+ :query_params => query_params,
759
+ :form_params => form_params,
760
+ :body => post_body,
761
+ :auth_names => auth_names,
762
+ :return_type => return_type
763
+ )
764
+
765
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
766
+ if @api_client.config.debugging
767
+ @api_client.config.logger.debug "API called: AdCreativesApi#list_ad_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
768
+ end
769
+ return data, status_code, headers
770
+ end
771
+
684
772
  # Rename a creative
685
773
  # Renames a creative. Creatives are immutable on Meta beyond `name` — for content changes create a new creative (POST /v1/ads/creatives) and swap it onto the ad (PUT /v1/ads/{adId} with `creative`).
686
774
  # @param creative_id [String] Platform creative id
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Meta (facebook, instagram) and LinkedIn. When set, creates a VIDEO ad on the legacy (or, for Meta, attach) shape. Mutually exclusive with `imageUrl`. For Meta multi-creative, set `video` per entry inside `creatives[]` instead. For LinkedIn the video is uploaded to LinkedIn under the authoring Company Page (see `organizationId`) and the campaign format is set to SINGLE_VIDEO; LinkedIn ignores `thumbnailUrl` (it auto-generates the poster frame) — supply MP4 H.264/AAC, 3s-30min, 75KB-500MB.
17
+ # Meta (facebook, instagram) and LinkedIn. Creates a single VIDEO ad. Mutually exclusive with `imageUrl`. Supply `url` to upload a file, or `id` to reuse a video already on the ad account (list them with GET /v1/ads/videos). Works on the single-ad and attach (`adSetId`) shapes; for Meta multi-creative, set `video` per entry inside `creatives[]` instead. For LinkedIn the video is uploaded to LinkedIn under the authoring Company Page (see `organizationId`) and the campaign format is set to SINGLE_VIDEO; LinkedIn ignores `thumbnailUrl` (it auto-generates the poster frame) — supply MP4 H.264/AAC, 3s-30min, 75KB-500MB.
18
18
  class CreateStandaloneAdRequestVideo < ApiModelBase
19
19
  # Public URL of the video. Meta: uploaded via chunked transfer on /act_X/advideos, then the request blocks on Meta's transcoding until status.video_status === 'ready'. LinkedIn: uploaded via the Videos API (multipart), then the request blocks until LinkedIn finishes transcoding (status AVAILABLE) — short clips take ~10-30s. Provide either `url` or `id`.
20
20
  attr_accessor :url
@@ -0,0 +1,167 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 ListAdVideos200Response < ApiModelBase
18
+ attr_accessor :ad_account_id
19
+
20
+ attr_accessor :data
21
+
22
+ attr_accessor :paging
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'ad_account_id' => :'adAccountId',
28
+ :'data' => :'data',
29
+ :'paging' => :'paging'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'ad_account_id' => :'String',
47
+ :'data' => :'Array<Object>',
48
+ :'paging' => :'GetAdsActivityLog200ResponsePaging'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListAdVideos200Response` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListAdVideos200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'ad_account_id')
75
+ self.ad_account_id = attributes[:'ad_account_id']
76
+ end
77
+
78
+ if attributes.key?(:'data')
79
+ if (value = attributes[:'data']).is_a?(Array)
80
+ self.data = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'paging')
85
+ self.paging = attributes[:'paging']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ ad_account_id == o.ad_account_id &&
110
+ data == o.data &&
111
+ paging == o.paging
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [ad_account_id, data, paging].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ if value.nil?
156
+ is_nullable = self.class.openapi_nullable.include?(attr)
157
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
+ end
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ end
166
+
167
+ end
@@ -69,7 +69,10 @@ module Zernio
69
69
  # Required for lookalike audiences
70
70
  attr_accessor :ratio
71
71
 
72
- # Optional raw Meta rule, forwarded verbatim: pixel event rule for website audiences, or the engagement rule for meta_engagement (overrides the built rule, e.g. for event/canvas/lead-form sources).
72
+ # website only. Narrows the audience from all visitors to visitors of URLs containing this substring. Ignored when `rule` is supplied.
73
+ attr_accessor :url_contains
74
+
75
+ # Optional raw Meta rule, replacing the one we build. Omit it for all visitors of `pixelId`, or use `urlContains` for the common page-match case. For `website` this is Meta's Flexible Audience Rule and is VALIDATED before we call Meta: every entry in `inclusions.rules` (and `exclusions.rules`) must carry `event_sources`, `retention_seconds` AND `filter`. Meta rejects a rule missing any of the three with code 100 / subcode 1713098 (\"Invalid rule JSON format\"), so a bad shape is a 400 here instead. The pre-2018 flat shapes (`{url: ...}`, `{event: ...}`) are not accepted by Meta at all (subcode 1870029). Example, visitors of /checkout in the last 30 days: `{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"<pixelId>\",\"type\":\"pixel\"}],\"retention_seconds\":2592000,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"url\",\"operator\":\"i_contains\",\"value\":\"/checkout\"}]}}]}}` Note Meta DERIVES `retention_days` from `retention_seconds` and stores `event_sources[].id` as a number, so a rule read back will not be byte-identical to the one you sent. For `meta_engagement` the rule is forwarded verbatim and NOT validated: that type has two dialects (the `video` source uses a legacy flat array), so no single schema covers both.
73
76
  attr_accessor :rule
74
77
 
75
78
  # Data source declaration for GDPR compliance (customer_list only)
@@ -119,6 +122,7 @@ module Zernio
119
122
  :'source_audience_id' => :'sourceAudienceId',
120
123
  :'country' => :'country',
121
124
  :'ratio' => :'ratio',
125
+ :'url_contains' => :'urlContains',
122
126
  :'rule' => :'rule',
123
127
  :'customer_file_source' => :'customerFileSource'
124
128
  }
@@ -156,6 +160,7 @@ module Zernio
156
160
  :'source_audience_id' => :'String',
157
161
  :'country' => :'String',
158
162
  :'ratio' => :'Float',
163
+ :'url_contains' => :'String',
159
164
  :'rule' => :'Object',
160
165
  :'customer_file_source' => :'String'
161
166
  }
@@ -273,6 +278,10 @@ module Zernio
273
278
  self.ratio = attributes[:'ratio']
274
279
  end
275
280
 
281
+ if attributes.key?(:'url_contains')
282
+ self.url_contains = attributes[:'url_contains']
283
+ end
284
+
276
285
  if attributes.key?(:'rule')
277
286
  self.rule = attributes[:'rule']
278
287
  end
@@ -568,6 +577,7 @@ module Zernio
568
577
  source_audience_id == o.source_audience_id &&
569
578
  country == o.country &&
570
579
  ratio == o.ratio &&
580
+ url_contains == o.url_contains &&
571
581
  rule == o.rule &&
572
582
  customer_file_source == o.customer_file_source
573
583
  end
@@ -581,7 +591,7 @@ module Zernio
581
591
  # Calculates hash code according to all attributes.
582
592
  # @return [Integer] Hash code
583
593
  def hash
584
- [account_id, ad_account_id, name, description, type, match_rules, source_type, trigger, lookback_days, engagement_sources, companies, pixel_id, retention_days, engagement_source, source_id, event, source_audience_id, country, ratio, rule, customer_file_source].hash
594
+ [account_id, ad_account_id, name, description, type, match_rules, source_type, trigger, lookback_days, engagement_sources, companies, pixel_id, retention_days, engagement_source, source_id, event, source_audience_id, country, ratio, url_contains, rule, customer_file_source].hash
585
595
  end
586
596
 
587
597
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.723'
14
+ VERSION = '0.0.724'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -878,6 +878,7 @@ require 'zernio-sdk/models/list_ad_keywords200_response'
878
878
  require 'zernio-sdk/models/list_ad_keywords200_response_keywords_inner'
879
879
  require 'zernio-sdk/models/list_ad_labels200_response'
880
880
  require 'zernio-sdk/models/list_ad_studies200_response'
881
+ require 'zernio-sdk/models/list_ad_videos200_response'
881
882
  require 'zernio-sdk/models/list_ads202_response'
882
883
  require 'zernio-sdk/models/list_ads_business_centers200_response'
883
884
  require 'zernio-sdk/models/list_api_keys200_response'
data/openapi.yaml CHANGED
@@ -42006,7 +42006,7 @@ paths:
42006
42006
  square: { type: string, format: uri, description: "Square 1:1 marketing image URL (e.g. 1080x1080). Required for Google Display." }
42007
42007
  video:
42008
42008
  type: object
42009
- description: "Meta (facebook, instagram) and LinkedIn. When set, creates a VIDEO ad on the legacy (or, for Meta, attach) shape. Mutually exclusive with `imageUrl`. For Meta multi-creative, set `video` per entry inside `creatives[]` instead. For LinkedIn the video is uploaded to LinkedIn under the authoring Company Page (see `organizationId`) and the campaign format is set to SINGLE_VIDEO; LinkedIn ignores `thumbnailUrl` (it auto-generates the poster frame) — supply MP4 H.264/AAC, 3s-30min, 75KB-500MB."
42009
+ description: "Meta (facebook, instagram) and LinkedIn. Creates a single VIDEO ad. Mutually exclusive with `imageUrl`. Supply `url` to upload a file, or `id` to reuse a video already on the ad account (list them with GET /v1/ads/videos). Works on the single-ad and attach (`adSetId`) shapes; for Meta multi-creative, set `video` per entry inside `creatives[]` instead. For LinkedIn the video is uploaded to LinkedIn under the authoring Company Page (see `organizationId`) and the campaign format is set to SINGLE_VIDEO; LinkedIn ignores `thumbnailUrl` (it auto-generates the poster frame) — supply MP4 H.264/AAC, 3s-30min, 75KB-500MB."
42010
42010
  properties:
42011
42011
  url: { type: string, format: uri, description: "Public URL of the video. Meta: uploaded via chunked transfer on /act_X/advideos, then the request blocks on Meta's transcoding until status.video_status === 'ready'. LinkedIn: uploaded via the Videos API (multipart), then the request blocks until LinkedIn finishes transcoding (status AVAILABLE) — short clips take ~10-30s. Provide either `url` or `id`."}
42012
42012
  id: { type: string, description: "Meta only. Reuse a video ALREADY uploaded to this ad account instead of re-uploading the file: pass the `videoId` returned by a previous create. Wins over `url`, so N ads that differ only in copy share one upload (`existingCreativeId` only covers the identical-copy case). Provide either `url` or `id`."}
@@ -43279,6 +43279,53 @@ paths:
43279
43279
  '401': { $ref: '#/components/responses/Unauthorized' }
43280
43280
  '501': { description: Only supported on Meta (facebook/instagram) }
43281
43281
 
43282
+ /v1/ads/videos:
43283
+ get:
43284
+ x-resource-group: "ads"
43285
+ operationId: listAdVideos
43286
+ tags: ["Ad Creatives"]
43287
+ x-platforms: ["meta"]
43288
+ summary: Ad video library
43289
+ description: |-
43290
+ Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim.
43291
+ The default projection covers id, title, status, poster frames and length; `fields` is a
43292
+ raw-passthrough override. Any `id` here is reusable as `video.id` on the create
43293
+ endpoints, so N ads that differ only in copy share one upload.
43294
+
43295
+ This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another
43296
+ tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads.
43297
+
43298
+ Meta transcodes asynchronously, so a row is only usable once `status.video_status`
43299
+ reads `ready`. There is no upload operation here: upload by URL inline via `video.url`
43300
+ on POST /v1/ads/create.
43301
+ security:
43302
+ - bearerAuth: []
43303
+ parameters:
43304
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token." }
43305
+ - { name: adAccountId, in: query, required: true, schema: { type: string }, description: "Meta ad account id (act_<n>)." }
43306
+ - { name: fields, in: query, schema: { type: string }, description: "Comma-separated Graph field override (supports nested {} projections)." }
43307
+ - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 }, description: Rows per page }
43308
+ - { name: after, in: query, schema: { type: string }, description: "Cursor from paging.after of the previous page." }
43309
+ responses:
43310
+ '200':
43311
+ description: Ad videos (raw Meta shape)
43312
+ content:
43313
+ application/json:
43314
+ schema:
43315
+ type: object
43316
+ properties:
43317
+ adAccountId: { type: string }
43318
+ data:
43319
+ type: array
43320
+ items: { type: object, description: "Raw Meta ad video row (id, title, status, picture, thumbnails, length)." }
43321
+ paging:
43322
+ type: object
43323
+ properties:
43324
+ after: { type: [string, "null"], description: "Cursor for the next page; null when exhausted." }
43325
+ '400': { $ref: '#/components/responses/BadRequest' }
43326
+ '401': { $ref: '#/components/responses/Unauthorized' }
43327
+ '501': { description: Only supported on Meta (facebook/instagram) }
43328
+
43282
43329
  /v1/ads/interests:
43283
43330
  get:
43284
43331
  x-resource-group: "ads"
@@ -43850,7 +43897,36 @@ paths:
43850
43897
  sourceAudienceId: { type: string, description: Required for lookalike audiences }
43851
43898
  country: { type: string, description: "2-letter code, required for lookalike audiences" }
43852
43899
  ratio: { type: number, minimum: 0.01, maximum: 0.20, description: Required for lookalike audiences }
43853
- rule: { type: object, description: "Optional raw Meta rule, forwarded verbatim: pixel event rule for website audiences, or the engagement rule for meta_engagement (overrides the built rule, e.g. for event/canvas/lead-form sources)." }
43900
+ urlContains:
43901
+ type: string
43902
+ description: |
43903
+ website only. Narrows the audience from all visitors to visitors of
43904
+ URLs containing this substring. Ignored when `rule` is supplied.
43905
+ rule:
43906
+ type: object
43907
+ description: |
43908
+ Optional raw Meta rule, replacing the one we build. Omit it for all
43909
+ visitors of `pixelId`, or use `urlContains` for the common page-match
43910
+ case.
43911
+
43912
+ For `website` this is Meta's Flexible Audience Rule and is VALIDATED
43913
+ before we call Meta: every entry in `inclusions.rules` (and
43914
+ `exclusions.rules`) must carry `event_sources`, `retention_seconds`
43915
+ AND `filter`. Meta rejects a rule missing any of the three with code
43916
+ 100 / subcode 1713098 ("Invalid rule JSON format"), so a bad shape is
43917
+ a 400 here instead. The pre-2018 flat shapes (`{url: ...}`,
43918
+ `{event: ...}`) are not accepted by Meta at all (subcode 1870029).
43919
+
43920
+ Example, visitors of /checkout in the last 30 days:
43921
+ `{"inclusions":{"operator":"or","rules":[{"event_sources":[{"id":"<pixelId>","type":"pixel"}],"retention_seconds":2592000,"filter":{"operator":"and","filters":[{"field":"url","operator":"i_contains","value":"/checkout"}]}}]}}`
43922
+
43923
+ Note Meta DERIVES `retention_days` from `retention_seconds` and
43924
+ stores `event_sources[].id` as a number, so a rule read back will
43925
+ not be byte-identical to the one you sent.
43926
+
43927
+ For `meta_engagement` the rule is forwarded verbatim and NOT
43928
+ validated: that type has two dialects (the `video` source uses a
43929
+ legacy flat array), so no single schema covers both.
43854
43930
  customerFileSource: { type: string, description: "Data source declaration for GDPR compliance (customer_list only)" }
43855
43931
  - type: object
43856
43932
  title: SavedTargetingAudience
@@ -154,6 +154,22 @@ describe 'AdCreativesApi' do
154
154
  end
155
155
  end
156
156
 
157
+ # unit tests for list_ad_videos
158
+ # Ad video library
159
+ # Lists the ad account&#39;s video library (Meta&#39;s &#x60;/act_X/advideos&#x60;), rows returned verbatim. The default projection covers id, title, status, poster frames and length; &#x60;fields&#x60; is a raw-passthrough override. Any &#x60;id&#x60; here is reusable as &#x60;video.id&#x60; on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as &#x60;creative.videoId&#x60; on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once &#x60;status.video_status&#x60; reads &#x60;ready&#x60;. There is no upload operation here: upload by URL inline via &#x60;video.url&#x60; on POST /v1/ads/create.
160
+ # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
161
+ # @param ad_account_id Meta ad account id (act_&lt;n&gt;).
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
164
+ # @option opts [Integer] :limit Rows per page
165
+ # @option opts [String] :after Cursor from paging.after of the previous page.
166
+ # @return [ListAdVideos200Response]
167
+ describe 'list_ad_videos test' do
168
+ it 'should work' do
169
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
170
+ end
171
+ end
172
+
157
173
  # unit tests for update_ad_creative
158
174
  # Rename a creative
159
175
  # Renames a creative. Creatives are immutable on Meta beyond &#x60;name&#x60; — for content changes create a new creative (POST /v1/ads/creatives) and swap it onto the ad (PUT /v1/ads/{adId} with &#x60;creative&#x60;).
@@ -0,0 +1,48 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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::ListAdVideos200Response
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::ListAdVideos200Response do
21
+ #let(:instance) { Zernio::ListAdVideos200Response.new }
22
+
23
+ describe 'test an instance of ListAdVideos200Response' do
24
+ it 'should create an instance of ListAdVideos200Response' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::ListAdVideos200Response)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "ad_account_id"' 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 "data"' 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
+ describe 'test attribute "paging"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ end
@@ -157,6 +157,12 @@ describe Zernio::UploadedOrDerivedAudience do
157
157
  end
158
158
  end
159
159
 
160
+ describe 'test attribute "url_contains"' do
161
+ it 'should work' do
162
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
163
+ end
164
+ end
165
+
160
166
  describe 'test attribute "rule"' do
161
167
  it 'should work' do
162
168
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
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.723
4
+ version: 0.0.724
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -958,6 +958,7 @@ files:
958
958
  - docs/ListAdKeywords200ResponseKeywordsInner.md
959
959
  - docs/ListAdLabels200Response.md
960
960
  - docs/ListAdStudies200Response.md
961
+ - docs/ListAdVideos200Response.md
961
962
  - docs/ListAds202Response.md
962
963
  - docs/ListAdsBusinessCenters200Response.md
963
964
  - docs/ListApiKeys200Response.md
@@ -2747,6 +2748,7 @@ files:
2747
2748
  - lib/zernio-sdk/models/list_ad_keywords200_response_keywords_inner.rb
2748
2749
  - lib/zernio-sdk/models/list_ad_labels200_response.rb
2749
2750
  - lib/zernio-sdk/models/list_ad_studies200_response.rb
2751
+ - lib/zernio-sdk/models/list_ad_videos200_response.rb
2750
2752
  - lib/zernio-sdk/models/list_ads202_response.rb
2751
2753
  - lib/zernio-sdk/models/list_ads_business_centers200_response.rb
2752
2754
  - lib/zernio-sdk/models/list_api_keys200_response.rb
@@ -4499,6 +4501,7 @@ files:
4499
4501
  - spec/models/list_ad_keywords200_response_spec.rb
4500
4502
  - spec/models/list_ad_labels200_response_spec.rb
4501
4503
  - spec/models/list_ad_studies200_response_spec.rb
4504
+ - spec/models/list_ad_videos200_response_spec.rb
4502
4505
  - spec/models/list_ads202_response_spec.rb
4503
4506
  - spec/models/list_ads_business_centers200_response_spec.rb
4504
4507
  - spec/models/list_api_keys200_response_spec.rb
@@ -5324,7 +5327,7 @@ files:
5324
5327
  - spec/models/you_tube_video_retention_response_retention_curve_inner_spec.rb
5325
5328
  - spec/models/you_tube_video_retention_response_spec.rb
5326
5329
  - spec/spec_helper.rb
5327
- - zernio-sdk-0.0.723.gem
5330
+ - zernio-sdk-0.0.724.gem
5328
5331
  - zernio-sdk.gemspec
5329
5332
  homepage: https://openapi-generator.tech
5330
5333
  licenses:
@@ -6696,6 +6699,7 @@ test_files:
6696
6699
  - spec/models/update_sequence200_response_spec.rb
6697
6700
  - spec/models/reddit_post_spec.rb
6698
6701
  - spec/models/mark_conversation_read200_response_spec.rb
6702
+ - spec/models/list_ad_videos200_response_spec.rb
6699
6703
  - spec/models/get_subreddit_rules200_response_spec.rb
6700
6704
  - spec/models/usage_stats_spend_spec.rb
6701
6705
  - spec/models/get_phone_number_port_in_order_requirements200_response_requirements_inner_spec.rb
Binary file