late-sdk 0.0.572 → 0.0.574

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/docs/AdAccountsApi.md +1 -1
  4. data/docs/CreateLeadFormRequest.md +13 -11
  5. data/docs/CreateLeadFormRequestPlatformSpecificData.md +49 -0
  6. data/docs/LeadGenApi.md +25 -21
  7. data/docs/LinkedInLeadFormPlatformData.md +30 -0
  8. data/docs/LinkedInLeadFormPlatformDataConsentsInner.md +20 -0
  9. data/docs/LinkedInLeadFormPlatformDataLocale.md +20 -0
  10. data/docs/LinkedInLeadFormPlatformDataQuestionsInner.md +49 -0
  11. data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf.md +28 -0
  12. data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf1.md +28 -0
  13. data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf1ChoicesInner.md +20 -0
  14. data/docs/MetaLeadFormPlatformData.md +46 -0
  15. data/docs/MetaLeadFormPlatformDataContextCard.md +26 -0
  16. data/lib/zernio-sdk/api/ad_accounts_api.rb +2 -2
  17. data/lib/zernio-sdk/api/lead_gen_api.rb +30 -24
  18. data/lib/zernio-sdk/models/create_lead_form_request.rb +25 -13
  19. data/lib/zernio-sdk/models/create_lead_form_request_platform_specific_data.rb +105 -0
  20. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data.rb +336 -0
  21. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_consents_inner.rb +176 -0
  22. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_locale.rb +156 -0
  23. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner.rb +104 -0
  24. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of.rb +268 -0
  25. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1.rb +295 -0
  26. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner.rb +190 -0
  27. data/lib/zernio-sdk/models/meta_lead_form_platform_data.rb +354 -0
  28. data/lib/zernio-sdk/models/meta_lead_form_platform_data_context_card.rb +219 -0
  29. data/lib/zernio-sdk/version.rb +1 -1
  30. data/lib/zernio-sdk.rb +10 -0
  31. data/openapi.yaml +146 -32
  32. data/spec/api/ad_accounts_api_spec.rb +1 -1
  33. data/spec/api/lead_gen_api_spec.rb +14 -12
  34. data/spec/models/create_lead_form_request_platform_specific_data_spec.rb +32 -0
  35. data/spec/models/create_lead_form_request_spec.rb +6 -0
  36. data/spec/models/linked_in_lead_form_platform_data_consents_inner_spec.rb +42 -0
  37. data/spec/models/linked_in_lead_form_platform_data_locale_spec.rb +42 -0
  38. data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner_spec.rb +42 -0
  39. data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of1_spec.rb +70 -0
  40. data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of_spec.rb +70 -0
  41. data/spec/models/linked_in_lead_form_platform_data_questions_inner_spec.rb +32 -0
  42. data/spec/models/linked_in_lead_form_platform_data_spec.rb +76 -0
  43. data/spec/models/meta_lead_form_platform_data_context_card_spec.rb +64 -0
  44. data/spec/models/meta_lead_form_platform_data_spec.rb +124 -0
  45. data/zernio-sdk-0.0.574.gem +0 -0
  46. metadata +42 -2
  47. data/zernio-sdk-0.0.572.gem +0 -0
@@ -0,0 +1,219 @@
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 MetaLeadFormPlatformDataContextCard < ApiModelBase
18
+ attr_accessor :title
19
+
20
+ attr_accessor :content
21
+
22
+ attr_accessor :style
23
+
24
+ attr_accessor :button_text
25
+
26
+ attr_accessor :cover_photo
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'title' => :'title',
54
+ :'content' => :'content',
55
+ :'style' => :'style',
56
+ :'button_text' => :'buttonText',
57
+ :'cover_photo' => :'coverPhoto'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'title' => :'String',
75
+ :'content' => :'Array<String>',
76
+ :'style' => :'String',
77
+ :'button_text' => :'String',
78
+ :'cover_photo' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MetaLeadFormPlatformDataContextCard` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::MetaLeadFormPlatformDataContextCard`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'title')
105
+ self.title = attributes[:'title']
106
+ end
107
+
108
+ if attributes.key?(:'content')
109
+ if (value = attributes[:'content']).is_a?(Array)
110
+ self.content = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'style')
115
+ self.style = attributes[:'style']
116
+ end
117
+
118
+ if attributes.key?(:'button_text')
119
+ self.button_text = attributes[:'button_text']
120
+ end
121
+
122
+ if attributes.key?(:'cover_photo')
123
+ self.cover_photo = attributes[:'cover_photo']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
131
+ invalid_properties = Array.new
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
+ style_validator = EnumAttributeValidator.new('String', ["LIST_STYLE", "PARAGRAPH_STYLE"])
140
+ return false unless style_validator.valid?(@style)
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] style Object to be assigned
146
+ def style=(style)
147
+ validator = EnumAttributeValidator.new('String', ["LIST_STYLE", "PARAGRAPH_STYLE"])
148
+ unless validator.valid?(style)
149
+ fail ArgumentError, "invalid value for \"style\", must be one of #{validator.allowable_values}."
150
+ end
151
+ @style = style
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ title == o.title &&
160
+ content == o.content &&
161
+ style == o.style &&
162
+ button_text == o.button_text &&
163
+ cover_photo == o.cover_photo
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [title, content, style, button_text, cover_photo].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.572'
14
+ VERSION = '0.0.574'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -218,6 +218,7 @@ require 'zernio-sdk/models/create_invite_token201_response'
218
218
  require 'zernio-sdk/models/create_invite_token_request'
219
219
  require 'zernio-sdk/models/create_lead_form200_response'
220
220
  require 'zernio-sdk/models/create_lead_form_request'
221
+ require 'zernio-sdk/models/create_lead_form_request_platform_specific_data'
221
222
  require 'zernio-sdk/models/create_lead_form_request_questions_inner'
222
223
  require 'zernio-sdk/models/create_messaging_ad_request'
223
224
  require 'zernio-sdk/models/create_phone_number_kyc_link200_response'
@@ -781,6 +782,13 @@ require 'zernio-sdk/models/linked_in_aggregate_analytics_daily_response_analytic
781
782
  require 'zernio-sdk/models/linked_in_aggregate_analytics_daily_response_analytics_impressions_inner'
782
783
  require 'zernio-sdk/models/linked_in_aggregate_analytics_total_response'
783
784
  require 'zernio-sdk/models/linked_in_aggregate_analytics_total_response_analytics'
785
+ require 'zernio-sdk/models/linked_in_lead_form_platform_data'
786
+ require 'zernio-sdk/models/linked_in_lead_form_platform_data_consents_inner'
787
+ require 'zernio-sdk/models/linked_in_lead_form_platform_data_locale'
788
+ require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner'
789
+ require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of'
790
+ require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1'
791
+ require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner'
784
792
  require 'zernio-sdk/models/linked_in_platform_data'
785
793
  require 'zernio-sdk/models/list_account_groups200_response'
786
794
  require 'zernio-sdk/models/list_account_groups200_response_groups_inner'
@@ -940,6 +948,8 @@ require 'zernio-sdk/models/lookup_sms_number200_response'
940
948
  require 'zernio-sdk/models/mark_conversation_read200_response'
941
949
  require 'zernio-sdk/models/media_item'
942
950
  require 'zernio-sdk/models/media_upload_response'
951
+ require 'zernio-sdk/models/meta_lead_form_platform_data'
952
+ require 'zernio-sdk/models/meta_lead_form_platform_data_context_card'
943
953
  require 'zernio-sdk/models/money'
944
954
  require 'zernio-sdk/models/money_amount'
945
955
  require 'zernio-sdk/models/move_account_to_profile200_response'
data/openapi.yaml CHANGED
@@ -35969,6 +35969,9 @@ paths:
35969
35969
  `/advertiser/info/` endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers
35970
35970
  without a BC fall back to the OAuth-time `advertiser_ids` list. Cached for 1h on the
35971
35971
  SocialAccount; lazy-refreshed on first call after expiry.
35972
+
35973
+ For Google Ads: responds `429` when Google's API quota is temporarily exhausted
35974
+ (instead of an empty list). Retry after a delay.
35972
35975
  security:
35973
35976
  - bearerAuth: []
35974
35977
  parameters:
@@ -36000,6 +36003,7 @@ paths:
36000
36003
  '401': { $ref: '#/components/responses/Unauthorized' }
36001
36004
  '422':
36002
36005
  description: Platform ads connection required (TikTok Ads, X Ads) or Instagram missing linked Facebook account
36006
+ '429': { $ref: '#/components/responses/RateLimited' }
36003
36007
  patch:
36004
36008
  operationId: updateAdAccount
36005
36009
  tags: ["Ad Accounts"]
@@ -37154,18 +37158,25 @@ paths:
37154
37158
  get:
37155
37159
  operationId: listLeads
37156
37160
  tags: ["Lead Gen"]
37157
- x-platforms: ["meta"]
37161
+ x-platforms: ["meta", "linkedin"]
37158
37162
  summary: List submitted leads
37159
37163
  description: >
37160
- Returns persisted Meta Lead Gen leads for your team, newest-first, with
37161
- keyset pagination on `cursor`. Leads are ingested in real time from the
37162
- `leadgen` webhook. Requires the Ads add-on.
37164
+ Returns submitted Lead Gen leads for your team, newest-first, with
37165
+ keyset pagination on `cursor`. For Meta (default) leads are served from
37166
+ the persisted cache, ingested in real time from the `leadgen` webhook.
37167
+ When `accountId` is a LinkedIn ads account, leads are fetched live from
37168
+ LinkedIn's `leadFormResponses` (LinkedIn has no webhook and enforces
37169
+ 90-day retention, so nothing is persisted) and `adAccountId` is required.
37170
+ Reading LinkedIn responses needs the `r_marketing_leadgen_automation`
37171
+ permission; accounts connected before it was added must reconnect.
37172
+ Requires the Ads add-on.
37163
37173
  parameters:
37164
37174
  - { name: formId, in: query, schema: { type: string }, description: Filter to a single lead form. }
37165
- - { name: accountId, in: query, schema: { type: string }, description: Filter to a single connected account. }
37175
+ - { name: accountId, in: query, schema: { type: string }, description: Filter to a single connected account. LinkedIn ads accounts switch to the live fetch. }
37176
+ - { name: adAccountId, in: query, schema: { type: string }, description: "LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder)." }
37166
37177
  - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 } }
37167
- - { name: since, in: query, schema: { type: integer }, description: Unix seconds; only leads created at/after this Meta timestamp. }
37168
- - { name: cursor, in: query, schema: { type: string }, description: Keyset cursor from a previous response's pagination.cursor. }
37178
+ - { name: since, in: query, schema: { type: integer }, description: Unix seconds; only leads created at/after this timestamp. }
37179
+ - { name: cursor, in: query, schema: { type: string }, description: "Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset)." }
37169
37180
  responses:
37170
37181
  '200':
37171
37182
  description: Lead list.
@@ -37204,11 +37215,16 @@ paths:
37204
37215
  get:
37205
37216
  operationId: listLeadForms
37206
37217
  tags: ["Lead Gen"]
37207
- x-platforms: ["meta"]
37218
+ x-platforms: ["meta", "linkedin"]
37208
37219
  summary: List lead forms
37209
- description: Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
37220
+ description: >
37221
+ Lists the Lead Gen forms owned by the account. Meta: forms on the
37222
+ connected Facebook Page. LinkedIn: forms owned by the ad account's
37223
+ Company Page — pass `adAccountId` (LinkedIn forms are org-owned).
37224
+ Requires the Ads add-on.
37210
37225
  parameters:
37211
- - { name: accountId, in: query, required: true, schema: { type: string }, description: Connected facebook account id. }
37226
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: Connected facebook or linkedin ads account id. }
37227
+ - { name: adAccountId, in: query, schema: { type: string }, description: "LinkedIn only: the LinkedIn ad account id (used to resolve the owning organization). Required for LinkedIn." }
37212
37228
  - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 } }
37213
37229
  - { name: cursor, in: query, schema: { type: string } }
37214
37230
  responses:
@@ -37227,26 +37243,36 @@ paths:
37227
37243
  post:
37228
37244
  operationId: createLeadForm
37229
37245
  tags: ["Lead Gen"]
37230
- x-platforms: ["meta"]
37246
+ x-platforms: ["meta", "linkedin"]
37231
37247
  summary: Create a lead form
37232
37248
  description: >
37233
- Creates a Lead Gen form on the connected Facebook Page (POST
37234
- /{page-id}/leadgen_forms). NOT idempotent a retry creates a second
37235
- form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit
37236
- label/key; CUSTOM questions require both. Requires the Ads add-on.
37249
+ Creates a Lead Gen form. The form content goes inside
37250
+ `platformSpecificData` for both platforms (the shape is selected by the
37251
+ accountId's platform). Meta: created on the connected Facebook Page
37252
+ (POST /{page-id}/leadgen_forms); the old top-level Meta fields
37253
+ (questions, thankYou*, contextCard, …) are DEPRECATED but still
37254
+ accepted while platformSpecificData is absent — mixing both shapes is
37255
+ a 400. LinkedIn: created on the ad account's Company Page. NOT
37256
+ idempotent — a retry creates a second form. Meta prefilled question
37257
+ types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM
37258
+ questions require both. LinkedIn exposes only free-text and
37259
+ multiple-choice questions via API (prefilled-from-profile fields are
37260
+ Campaign Manager UI-only). Requires the Ads add-on.
37237
37261
  requestBody:
37238
37262
  required: true
37239
37263
  content:
37240
37264
  application/json:
37241
37265
  schema:
37242
37266
  type: object
37243
- required: [accountId, name, questions, privacyPolicyUrl]
37267
+ required: [accountId, name, privacyPolicyUrl]
37244
37268
  properties:
37245
37269
  accountId: { type: string }
37246
37270
  name: { type: string, maxLength: 200 }
37247
37271
  questions:
37248
37272
  type: array
37249
37273
  minItems: 1
37274
+ deprecated: true
37275
+ description: "Deprecated (Meta legacy shape): use platformSpecificData.questions."
37250
37276
  items:
37251
37277
  type: object
37252
37278
  required: [type]
@@ -37257,15 +37283,103 @@ paths:
37257
37283
  options: { type: array, items: { type: object, properties: { key: { type: string }, value: { type: string } } } }
37258
37284
  inline_context: { type: string }
37259
37285
  privacyPolicyUrl: { type: string, format: uri }
37260
- privacyPolicyLinkText: { type: string, maxLength: 70 }
37261
- followUpActionUrl: { type: string, format: uri }
37262
- locale: { type: string, example: EN_US }
37263
- thankYouTitle: { type: string }
37264
- thankYouBody: { type: string }
37265
- thankYouButtonText: { type: string }
37266
- thankYouButtonType: { type: string, example: VIEW_WEBSITE }
37267
- thankYouWebsiteUrl: { type: string, format: uri }
37268
- isOptimizedForQuality: { type: boolean }
37286
+ privacyPolicyLinkText: { type: string, maxLength: 70, deprecated: true, description: "Deprecated: use platformSpecificData.privacyPolicyLinkText." }
37287
+ followUpActionUrl: { type: string, format: uri, deprecated: true, description: "Deprecated: use platformSpecificData.followUpActionUrl." }
37288
+ locale: { type: string, example: EN_US, deprecated: true, description: "Deprecated: use platformSpecificData.locale." }
37289
+ thankYouTitle: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouTitle." }
37290
+ thankYouBody: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouBody." }
37291
+ thankYouButtonText: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouButtonText." }
37292
+ thankYouButtonType: { type: string, example: VIEW_WEBSITE, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouButtonType." }
37293
+ thankYouWebsiteUrl: { type: string, format: uri, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouWebsiteUrl." }
37294
+ isOptimizedForQuality: { type: boolean, deprecated: true, description: "Deprecated: use platformSpecificData.isOptimizedForQuality." }
37295
+ platformSpecificData:
37296
+ description: "Form content; the shape is selected by the accountId's platform. Unknown fields are a 400 (strict-parsed)."
37297
+ oneOf:
37298
+ - type: object
37299
+ title: MetaLeadFormPlatformData
37300
+ required: [questions]
37301
+ properties:
37302
+ questions:
37303
+ type: array
37304
+ minItems: 1
37305
+ items:
37306
+ type: object
37307
+ required: [type]
37308
+ properties:
37309
+ type: { type: string, description: "EMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM, …" }
37310
+ key: { type: string, description: "CUSTOM questions only." }
37311
+ label: { type: string, description: "CUSTOM questions only." }
37312
+ options: { type: array, items: { type: object, properties: { key: { type: string }, value: { type: string } } } }
37313
+ inline_context: { type: string }
37314
+ privacyPolicyLinkText: { type: string, maxLength: 70 }
37315
+ followUpActionUrl: { type: string, format: uri }
37316
+ locale: { type: string, example: EN_US }
37317
+ thankYouTitle: { type: string }
37318
+ thankYouBody: { type: string }
37319
+ thankYouButtonText: { type: string }
37320
+ thankYouButtonType: { type: string, example: VIEW_WEBSITE }
37321
+ thankYouWebsiteUrl: { type: string, format: uri }
37322
+ isOptimizedForQuality: { type: boolean }
37323
+ formType: { type: string, enum: [MORE_VOLUME, HIGHER_INTENT, RICH_CREATIVE] }
37324
+ blockDisplayForNonTargetedViewer: { type: boolean }
37325
+ allowOrganicLeadGen: { type: boolean }
37326
+ questionPageCustomHeadline: { type: string }
37327
+ contextCard:
37328
+ type: object
37329
+ properties:
37330
+ title: { type: string }
37331
+ content: { type: array, items: { type: string } }
37332
+ style: { type: string, enum: [LIST_STYLE, PARAGRAPH_STYLE] }
37333
+ buttonText: { type: string }
37334
+ coverPhoto: { type: string }
37335
+ - type: object
37336
+ title: LinkedInLeadFormPlatformData
37337
+ required: [adAccountId, headline, description, questions]
37338
+ properties:
37339
+ adAccountId: { type: string, description: "LinkedIn ad account id (resolves the owning organization)." }
37340
+ headline: { type: string, maxLength: 255 }
37341
+ description: { type: string, maxLength: 1500 }
37342
+ state: { type: string, enum: [DRAFT, PUBLISHED], description: "Defaults to DRAFT." }
37343
+ locale: { type: object, properties: { country: { type: string }, language: { type: string } } }
37344
+ consents:
37345
+ type: array
37346
+ items:
37347
+ type: object
37348
+ required: [description]
37349
+ properties:
37350
+ description: { type: string }
37351
+ required: { type: boolean, description: "Whether the viewer must tick this consent to submit. Defaults to false.", default: false }
37352
+ questions:
37353
+ type: array
37354
+ minItems: 1
37355
+ items:
37356
+ oneOf:
37357
+ - type: object
37358
+ required: [kind, name, question]
37359
+ properties:
37360
+ kind: { type: string, enum: [text] }
37361
+ name: { type: string }
37362
+ question: { type: string }
37363
+ required: { type: boolean }
37364
+ responseEditable: { type: boolean }
37365
+ maxResponseLength: { type: integer, description: "Defaults to 300 on LinkedIn's side." }
37366
+ - type: object
37367
+ required: [kind, name, question, choices]
37368
+ properties:
37369
+ kind: { type: string, enum: [multipleChoice] }
37370
+ name: { type: string }
37371
+ question: { type: string }
37372
+ required: { type: boolean }
37373
+ responseEditable: { type: boolean }
37374
+ choices:
37375
+ type: array
37376
+ minItems: 1
37377
+ items:
37378
+ type: object
37379
+ required: [id, text]
37380
+ properties:
37381
+ id: { type: integer }
37382
+ text: { type: string }
37269
37383
  responses:
37270
37384
  '200':
37271
37385
  description: Created form.
@@ -37283,11 +37397,11 @@ paths:
37283
37397
  get:
37284
37398
  operationId: getLeadForm
37285
37399
  tags: ["Lead Gen"]
37286
- x-platforms: ["meta"]
37400
+ x-platforms: ["meta", "linkedin"]
37287
37401
  summary: Get a lead form
37288
37402
  parameters:
37289
- - { name: formId, in: path, required: true, schema: { type: string } }
37290
- - { name: accountId, in: query, required: true, schema: { type: string } }
37403
+ - { name: formId, in: path, required: true, schema: { type: string }, description: "Numeric form id (Meta leadgen_form id or LinkedIn leadForm id)." }
37404
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Connected facebook or linkedin ads account id (selects the platform)." }
37291
37405
  responses:
37292
37406
  '200':
37293
37407
  description: Form metadata.
@@ -37298,12 +37412,12 @@ paths:
37298
37412
  delete:
37299
37413
  operationId: archiveLeadForm
37300
37414
  tags: ["Lead Gen"]
37301
- x-platforms: ["meta"]
37415
+ x-platforms: ["meta", "linkedin"]
37302
37416
  summary: Archive a lead form
37303
- description: Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
37417
+ description: "Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE)."
37304
37418
  parameters:
37305
- - { name: formId, in: path, required: true, schema: { type: string } }
37306
- - { name: accountId, in: query, required: true, schema: { type: string } }
37419
+ - { name: formId, in: path, required: true, schema: { type: string }, description: "Numeric form id (Meta leadgen_form id or LinkedIn leadForm id)." }
37420
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Connected facebook or linkedin ads account id (selects the platform)." }
37307
37421
  responses:
37308
37422
  '200':
37309
37423
  description: Archived.
@@ -106,7 +106,7 @@ describe 'AdAccountsApi' do
106
106
 
107
107
  # unit tests for list_ad_accounts
108
108
  # List ad accounts
109
- # Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs). For TikTok agencies: enumerates every advertiser under every Business Center the token can read (paginated server-side), then chunks the lookup against TikTok&#39;s &#x60;/advertiser/info/&#x60; endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time &#x60;advertiser_ids&#x60; list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry.
109
+ # Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs). For TikTok agencies: enumerates every advertiser under every Business Center the token can read (paginated server-side), then chunks the lookup against TikTok&#39;s &#x60;/advertiser/info/&#x60; endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time &#x60;advertiser_ids&#x60; list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry. For Google Ads: responds &#x60;429&#x60; when Google&#39;s API quota is temporarily exhausted (instead of an empty list). Retry after a delay.
110
110
  # @param account_id Social account ID
111
111
  # @param [Hash] opts the optional parameters
112
112
  # @option opts [String] :ad_account_id Filter response to a single platform ad account ID (e.g. &#x60;act_123&#x60; for Meta, advertiser_id for TikTok). Returns at most one item.
@@ -34,9 +34,9 @@ describe 'LeadGenApi' do
34
34
 
35
35
  # unit tests for archive_lead_form
36
36
  # Archive a lead form
37
- # Meta has no hard delete for forms; this archives the form (status&#x3D;ARCHIVED).
38
- # @param form_id
39
- # @param account_id
37
+ # Neither platform hard-deletes a form; this archives it (Meta status&#x3D;ARCHIVED; LinkedIn state&#x3D;ARCHIVED via PARTIAL_UPDATE).
38
+ # @param form_id Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
39
+ # @param account_id Connected facebook or linkedin ads account id (selects the platform).
40
40
  # @param [Hash] opts the optional parameters
41
41
  # @return [ArchiveLeadForm200Response]
42
42
  describe 'archive_lead_form test' do
@@ -47,7 +47,7 @@ describe 'LeadGenApi' do
47
47
 
48
48
  # unit tests for create_lead_form
49
49
  # Create a lead form
50
- # Creates a Lead Gen form on the connected Facebook Page (POST /{page-id}/leadgen_forms). NOT idempotent — a retry creates a second form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. Requires the Ads add-on.
50
+ # Creates a Lead Gen form. The form content goes inside &#x60;platformSpecificData&#x60; for both platforms (the shape is selected by the accountId&#39;s platform). Meta: created on the connected Facebook Page (POST /{page-id}/leadgen_forms); the old top-level Meta fields (questions, thankYou*, contextCard, …) are DEPRECATED but still accepted while platformSpecificData is absent — mixing both shapes is a 400. LinkedIn: created on the ad account&#39;s Company Page. NOT idempotent — a retry creates a second form. Meta prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. LinkedIn exposes only free-text and multiple-choice questions via API (prefilled-from-profile fields are Campaign Manager UI-only). Requires the Ads add-on.
51
51
  # @param create_lead_form_request
52
52
  # @param [Hash] opts the optional parameters
53
53
  # @return [CreateLeadForm200Response]
@@ -72,8 +72,8 @@ describe 'LeadGenApi' do
72
72
 
73
73
  # unit tests for get_lead_form
74
74
  # Get a lead form
75
- # @param form_id
76
- # @param account_id
75
+ # @param form_id Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
76
+ # @param account_id Connected facebook or linkedin ads account id (selects the platform).
77
77
  # @param [Hash] opts the optional parameters
78
78
  # @return [GetLeadForm200Response]
79
79
  describe 'get_lead_form test' do
@@ -100,9 +100,10 @@ describe 'LeadGenApi' do
100
100
 
101
101
  # unit tests for list_lead_forms
102
102
  # List lead forms
103
- # Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
104
- # @param account_id Connected facebook account id.
103
+ # Lists the Lead Gen forms owned by the account. Meta: forms on the connected Facebook Page. LinkedIn: forms owned by the ad account&#39;s Company Page — pass &#x60;adAccountId&#x60; (LinkedIn forms are org-owned). Requires the Ads add-on.
104
+ # @param account_id Connected facebook or linkedin ads account id.
105
105
  # @param [Hash] opts the optional parameters
106
+ # @option opts [String] :ad_account_id LinkedIn only: the LinkedIn ad account id (used to resolve the owning organization). Required for LinkedIn.
106
107
  # @option opts [Integer] :limit
107
108
  # @option opts [String] :cursor
108
109
  # @return [ListLeadForms200Response]
@@ -114,13 +115,14 @@ describe 'LeadGenApi' do
114
115
 
115
116
  # unit tests for list_leads
116
117
  # List submitted leads
117
- # Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on &#x60;cursor&#x60;. Leads are ingested in real time from the &#x60;leadgen&#x60; webhook. Requires the Ads add-on.
118
+ # Returns submitted Lead Gen leads for your team, newest-first, with keyset pagination on &#x60;cursor&#x60;. For Meta (default) leads are served from the persisted cache, ingested in real time from the &#x60;leadgen&#x60; webhook. When &#x60;accountId&#x60; is a LinkedIn ads account, leads are fetched live from LinkedIn&#39;s &#x60;leadFormResponses&#x60; (LinkedIn has no webhook and enforces 90-day retention, so nothing is persisted) and &#x60;adAccountId&#x60; is required. Reading LinkedIn responses needs the &#x60;r_marketing_leadgen_automation&#x60; permission; accounts connected before it was added must reconnect. Requires the Ads add-on.
118
119
  # @param [Hash] opts the optional parameters
119
120
  # @option opts [String] :form_id Filter to a single lead form.
120
- # @option opts [String] :account_id Filter to a single connected account.
121
+ # @option opts [String] :account_id Filter to a single connected account. LinkedIn ads accounts switch to the live fetch.
122
+ # @option opts [String] :ad_account_id LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder).
121
123
  # @option opts [Integer] :limit
122
- # @option opts [Integer] :since Unix seconds; only leads created at/after this Meta timestamp.
123
- # @option opts [String] :cursor Keyset cursor from a previous response&#39;s pagination.cursor.
124
+ # @option opts [Integer] :since Unix seconds; only leads created at/after this timestamp.
125
+ # @option opts [String] :cursor Keyset cursor from a previous response&#39;s pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset).
124
126
  # @return [ListLeads200Response]
125
127
  describe 'list_leads test' do
126
128
  it 'should work' do
@@ -0,0 +1,32 @@
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::CreateLeadFormRequestPlatformSpecificData
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::CreateLeadFormRequestPlatformSpecificData do
21
+ describe '.openapi_one_of' do
22
+ it 'lists the items referenced in the oneOf array' do
23
+ expect(described_class.openapi_one_of).to_not be_empty
24
+ end
25
+ end
26
+
27
+ describe '.build' do
28
+ it 'returns the correct model' do
29
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
30
+ end
31
+ end
32
+ end
@@ -105,4 +105,10 @@ describe Zernio::CreateLeadFormRequest do
105
105
  end
106
106
  end
107
107
 
108
+ describe 'test attribute "platform_specific_data"' do
109
+ it 'should work' do
110
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
111
+ end
112
+ end
113
+
108
114
  end