late-sdk 0.0.571 → 0.0.573

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/docs/CheckPhoneNumberAvailability200Response.md +1 -1
  4. data/docs/CheckPhoneNumberAvailability200ResponseAreaOptionsInner.md +2 -2
  5. data/docs/CreateLeadFormRequest.md +13 -11
  6. data/docs/CreateLeadFormRequestPlatformSpecificData.md +49 -0
  7. data/docs/LeadGenApi.md +25 -21
  8. data/docs/LinkedInLeadFormPlatformData.md +30 -0
  9. data/docs/LinkedInLeadFormPlatformDataConsentsInner.md +20 -0
  10. data/docs/LinkedInLeadFormPlatformDataLocale.md +20 -0
  11. data/docs/LinkedInLeadFormPlatformDataQuestionsInner.md +49 -0
  12. data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf.md +28 -0
  13. data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf1.md +28 -0
  14. data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf1ChoicesInner.md +20 -0
  15. data/docs/MetaLeadFormPlatformData.md +46 -0
  16. data/docs/MetaLeadFormPlatformDataContextCard.md +26 -0
  17. data/lib/zernio-sdk/api/lead_gen_api.rb +30 -24
  18. data/lib/zernio-sdk/models/check_phone_number_availability200_response.rb +1 -1
  19. data/lib/zernio-sdk/models/check_phone_number_availability200_response_area_options_inner.rb +2 -2
  20. data/lib/zernio-sdk/models/create_lead_form_request.rb +25 -13
  21. data/lib/zernio-sdk/models/create_lead_form_request_platform_specific_data.rb +105 -0
  22. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data.rb +336 -0
  23. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_consents_inner.rb +176 -0
  24. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_locale.rb +156 -0
  25. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner.rb +104 -0
  26. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of.rb +268 -0
  27. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1.rb +295 -0
  28. data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner.rb +190 -0
  29. data/lib/zernio-sdk/models/meta_lead_form_platform_data.rb +354 -0
  30. data/lib/zernio-sdk/models/meta_lead_form_platform_data_context_card.rb +219 -0
  31. data/lib/zernio-sdk/version.rb +1 -1
  32. data/lib/zernio-sdk.rb +10 -0
  33. data/openapi.yaml +158 -40
  34. data/spec/api/lead_gen_api_spec.rb +14 -12
  35. data/spec/models/create_lead_form_request_platform_specific_data_spec.rb +32 -0
  36. data/spec/models/create_lead_form_request_spec.rb +6 -0
  37. data/spec/models/linked_in_lead_form_platform_data_consents_inner_spec.rb +42 -0
  38. data/spec/models/linked_in_lead_form_platform_data_locale_spec.rb +42 -0
  39. data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner_spec.rb +42 -0
  40. data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of1_spec.rb +70 -0
  41. data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of_spec.rb +70 -0
  42. data/spec/models/linked_in_lead_form_platform_data_questions_inner_spec.rb +32 -0
  43. data/spec/models/linked_in_lead_form_platform_data_spec.rb +76 -0
  44. data/spec/models/meta_lead_form_platform_data_context_card_spec.rb +64 -0
  45. data/spec/models/meta_lead_form_platform_data_spec.rb +124 -0
  46. data/zernio-sdk-0.0.573.gem +0 -0
  47. metadata +42 -2
  48. data/zernio-sdk-0.0.571.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.571'
14
+ VERSION = '0.0.573'
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
@@ -28166,16 +28166,20 @@ paths:
28166
28166
  type: array
28167
28167
  description: >
28168
28168
  Live inventory grouped by area code, largest stock
28169
- first. Empty when out of stock (or the area lookup
28170
- failed). Pass a chosen `ndc` as `areaCode` on POST
28169
+ first. For US and CA this is the full country inventory
28170
+ (every area code with stock, named by state/province);
28171
+ other countries list the areas in the latest inventory
28172
+ page (up to 500 numbers, which for most countries is the
28173
+ entire pool). Empty when out of stock (or the area
28174
+ lookup failed). Pass a chosen `ndc` as `areaCode` on POST
28171
28175
  /v1/phone-numbers/purchase (or on the KYC submit for
28172
28176
  regulated countries) to require that area.
28173
28177
  items:
28174
28178
  type: object
28175
28179
  properties:
28176
28180
  ndc: { type: string, description: 'Area code (national destination code), e.g. "11".' }
28177
- name: { type: string, description: 'Human-readable area name, e.g. "Sao Paulo".' }
28178
- count: { type: integer, description: Deliverable numbers seen in this area on the latest inventory page. }
28181
+ name: { type: string, description: 'Area name: state/province for US/CA (e.g. "Minnesota"), city otherwise (e.g. "Sao Paulo").' }
28182
+ count: { type: integer, description: 'Numbers available in this area: country-wide count for US/CA, numbers seen on the latest inventory page otherwise.' }
28179
28183
  '400': { description: Country not offerable }
28180
28184
  '401': { $ref: '#/components/responses/Unauthorized' }
28181
28185
 
@@ -28532,16 +28536,20 @@ paths:
28532
28536
  type: array
28533
28537
  description: >
28534
28538
  Live inventory grouped by area code, largest stock
28535
- first. Empty when out of stock (or the area lookup
28536
- failed). Pass a chosen `ndc` as `areaCode` on POST
28539
+ first. For US and CA this is the full country inventory
28540
+ (every area code with stock, named by state/province);
28541
+ other countries list the areas in the latest inventory
28542
+ page (up to 500 numbers, which for most countries is the
28543
+ entire pool). Empty when out of stock (or the area
28544
+ lookup failed). Pass a chosen `ndc` as `areaCode` on POST
28537
28545
  /v1/phone-numbers/purchase (or on the KYC submit for
28538
28546
  regulated countries) to require that area.
28539
28547
  items:
28540
28548
  type: object
28541
28549
  properties:
28542
28550
  ndc: { type: string, description: 'Area code (national destination code), e.g. "11".' }
28543
- name: { type: string, description: 'Human-readable area name, e.g. "Sao Paulo".' }
28544
- count: { type: integer, description: Deliverable numbers seen in this area on the latest inventory page. }
28551
+ name: { type: string, description: 'Area name: state/province for US/CA (e.g. "Minnesota"), city otherwise (e.g. "Sao Paulo").' }
28552
+ count: { type: integer, description: 'Numbers available in this area: country-wide count for US/CA, numbers seen on the latest inventory page otherwise.' }
28545
28553
  '400': { description: Country not offerable }
28546
28554
  '401': { $ref: '#/components/responses/Unauthorized' }
28547
28555
 
@@ -37146,18 +37154,25 @@ paths:
37146
37154
  get:
37147
37155
  operationId: listLeads
37148
37156
  tags: ["Lead Gen"]
37149
- x-platforms: ["meta"]
37157
+ x-platforms: ["meta", "linkedin"]
37150
37158
  summary: List submitted leads
37151
37159
  description: >
37152
- Returns persisted Meta Lead Gen leads for your team, newest-first, with
37153
- keyset pagination on `cursor`. Leads are ingested in real time from the
37154
- `leadgen` webhook. Requires the Ads add-on.
37160
+ Returns submitted Lead Gen leads for your team, newest-first, with
37161
+ keyset pagination on `cursor`. For Meta (default) leads are served from
37162
+ the persisted cache, ingested in real time from the `leadgen` webhook.
37163
+ When `accountId` is a LinkedIn ads account, leads are fetched live from
37164
+ LinkedIn's `leadFormResponses` (LinkedIn has no webhook and enforces
37165
+ 90-day retention, so nothing is persisted) and `adAccountId` is required.
37166
+ Reading LinkedIn responses needs the `r_marketing_leadgen_automation`
37167
+ permission; accounts connected before it was added must reconnect.
37168
+ Requires the Ads add-on.
37155
37169
  parameters:
37156
37170
  - { name: formId, in: query, schema: { type: string }, description: Filter to a single lead form. }
37157
- - { name: accountId, in: query, schema: { type: string }, description: Filter to a single connected account. }
37171
+ - { name: accountId, in: query, schema: { type: string }, description: Filter to a single connected account. LinkedIn ads accounts switch to the live fetch. }
37172
+ - { name: adAccountId, in: query, schema: { type: string }, description: "LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder)." }
37158
37173
  - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 } }
37159
- - { name: since, in: query, schema: { type: integer }, description: Unix seconds; only leads created at/after this Meta timestamp. }
37160
- - { name: cursor, in: query, schema: { type: string }, description: Keyset cursor from a previous response's pagination.cursor. }
37174
+ - { name: since, in: query, schema: { type: integer }, description: Unix seconds; only leads created at/after this timestamp. }
37175
+ - { name: cursor, in: query, schema: { type: string }, description: "Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset)." }
37161
37176
  responses:
37162
37177
  '200':
37163
37178
  description: Lead list.
@@ -37196,11 +37211,16 @@ paths:
37196
37211
  get:
37197
37212
  operationId: listLeadForms
37198
37213
  tags: ["Lead Gen"]
37199
- x-platforms: ["meta"]
37214
+ x-platforms: ["meta", "linkedin"]
37200
37215
  summary: List lead forms
37201
- description: Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
37216
+ description: >
37217
+ Lists the Lead Gen forms owned by the account. Meta: forms on the
37218
+ connected Facebook Page. LinkedIn: forms owned by the ad account's
37219
+ Company Page — pass `adAccountId` (LinkedIn forms are org-owned).
37220
+ Requires the Ads add-on.
37202
37221
  parameters:
37203
- - { name: accountId, in: query, required: true, schema: { type: string }, description: Connected facebook account id. }
37222
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: Connected facebook or linkedin ads account id. }
37223
+ - { name: adAccountId, in: query, schema: { type: string }, description: "LinkedIn only: the LinkedIn ad account id (used to resolve the owning organization). Required for LinkedIn." }
37204
37224
  - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 } }
37205
37225
  - { name: cursor, in: query, schema: { type: string } }
37206
37226
  responses:
@@ -37219,26 +37239,36 @@ paths:
37219
37239
  post:
37220
37240
  operationId: createLeadForm
37221
37241
  tags: ["Lead Gen"]
37222
- x-platforms: ["meta"]
37242
+ x-platforms: ["meta", "linkedin"]
37223
37243
  summary: Create a lead form
37224
37244
  description: >
37225
- Creates a Lead Gen form on the connected Facebook Page (POST
37226
- /{page-id}/leadgen_forms). NOT idempotent a retry creates a second
37227
- form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit
37228
- label/key; CUSTOM questions require both. Requires the Ads add-on.
37245
+ Creates a Lead Gen form. The form content goes inside
37246
+ `platformSpecificData` for both platforms (the shape is selected by the
37247
+ accountId's platform). Meta: created on the connected Facebook Page
37248
+ (POST /{page-id}/leadgen_forms); the old top-level Meta fields
37249
+ (questions, thankYou*, contextCard, …) are DEPRECATED but still
37250
+ accepted while platformSpecificData is absent — mixing both shapes is
37251
+ a 400. LinkedIn: created on the ad account's Company Page. NOT
37252
+ idempotent — a retry creates a second form. Meta prefilled question
37253
+ types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM
37254
+ questions require both. LinkedIn exposes only free-text and
37255
+ multiple-choice questions via API (prefilled-from-profile fields are
37256
+ Campaign Manager UI-only). Requires the Ads add-on.
37229
37257
  requestBody:
37230
37258
  required: true
37231
37259
  content:
37232
37260
  application/json:
37233
37261
  schema:
37234
37262
  type: object
37235
- required: [accountId, name, questions, privacyPolicyUrl]
37263
+ required: [accountId, name, privacyPolicyUrl]
37236
37264
  properties:
37237
37265
  accountId: { type: string }
37238
37266
  name: { type: string, maxLength: 200 }
37239
37267
  questions:
37240
37268
  type: array
37241
37269
  minItems: 1
37270
+ deprecated: true
37271
+ description: "Deprecated (Meta legacy shape): use platformSpecificData.questions."
37242
37272
  items:
37243
37273
  type: object
37244
37274
  required: [type]
@@ -37249,15 +37279,103 @@ paths:
37249
37279
  options: { type: array, items: { type: object, properties: { key: { type: string }, value: { type: string } } } }
37250
37280
  inline_context: { type: string }
37251
37281
  privacyPolicyUrl: { type: string, format: uri }
37252
- privacyPolicyLinkText: { type: string, maxLength: 70 }
37253
- followUpActionUrl: { type: string, format: uri }
37254
- locale: { type: string, example: EN_US }
37255
- thankYouTitle: { type: string }
37256
- thankYouBody: { type: string }
37257
- thankYouButtonText: { type: string }
37258
- thankYouButtonType: { type: string, example: VIEW_WEBSITE }
37259
- thankYouWebsiteUrl: { type: string, format: uri }
37260
- isOptimizedForQuality: { type: boolean }
37282
+ privacyPolicyLinkText: { type: string, maxLength: 70, deprecated: true, description: "Deprecated: use platformSpecificData.privacyPolicyLinkText." }
37283
+ followUpActionUrl: { type: string, format: uri, deprecated: true, description: "Deprecated: use platformSpecificData.followUpActionUrl." }
37284
+ locale: { type: string, example: EN_US, deprecated: true, description: "Deprecated: use platformSpecificData.locale." }
37285
+ thankYouTitle: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouTitle." }
37286
+ thankYouBody: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouBody." }
37287
+ thankYouButtonText: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouButtonText." }
37288
+ thankYouButtonType: { type: string, example: VIEW_WEBSITE, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouButtonType." }
37289
+ thankYouWebsiteUrl: { type: string, format: uri, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouWebsiteUrl." }
37290
+ isOptimizedForQuality: { type: boolean, deprecated: true, description: "Deprecated: use platformSpecificData.isOptimizedForQuality." }
37291
+ platformSpecificData:
37292
+ description: "Form content; the shape is selected by the accountId's platform. Unknown fields are a 400 (strict-parsed)."
37293
+ oneOf:
37294
+ - type: object
37295
+ title: MetaLeadFormPlatformData
37296
+ required: [questions]
37297
+ properties:
37298
+ questions:
37299
+ type: array
37300
+ minItems: 1
37301
+ items:
37302
+ type: object
37303
+ required: [type]
37304
+ properties:
37305
+ type: { type: string, description: "EMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM, …" }
37306
+ key: { type: string, description: "CUSTOM questions only." }
37307
+ label: { type: string, description: "CUSTOM questions only." }
37308
+ options: { type: array, items: { type: object, properties: { key: { type: string }, value: { type: string } } } }
37309
+ inline_context: { type: string }
37310
+ privacyPolicyLinkText: { type: string, maxLength: 70 }
37311
+ followUpActionUrl: { type: string, format: uri }
37312
+ locale: { type: string, example: EN_US }
37313
+ thankYouTitle: { type: string }
37314
+ thankYouBody: { type: string }
37315
+ thankYouButtonText: { type: string }
37316
+ thankYouButtonType: { type: string, example: VIEW_WEBSITE }
37317
+ thankYouWebsiteUrl: { type: string, format: uri }
37318
+ isOptimizedForQuality: { type: boolean }
37319
+ formType: { type: string, enum: [MORE_VOLUME, HIGHER_INTENT, RICH_CREATIVE] }
37320
+ blockDisplayForNonTargetedViewer: { type: boolean }
37321
+ allowOrganicLeadGen: { type: boolean }
37322
+ questionPageCustomHeadline: { type: string }
37323
+ contextCard:
37324
+ type: object
37325
+ properties:
37326
+ title: { type: string }
37327
+ content: { type: array, items: { type: string } }
37328
+ style: { type: string, enum: [LIST_STYLE, PARAGRAPH_STYLE] }
37329
+ buttonText: { type: string }
37330
+ coverPhoto: { type: string }
37331
+ - type: object
37332
+ title: LinkedInLeadFormPlatformData
37333
+ required: [adAccountId, headline, description, questions]
37334
+ properties:
37335
+ adAccountId: { type: string, description: "LinkedIn ad account id (resolves the owning organization)." }
37336
+ headline: { type: string, maxLength: 255 }
37337
+ description: { type: string, maxLength: 1500 }
37338
+ state: { type: string, enum: [DRAFT, PUBLISHED], description: "Defaults to DRAFT." }
37339
+ locale: { type: object, properties: { country: { type: string }, language: { type: string } } }
37340
+ consents:
37341
+ type: array
37342
+ items:
37343
+ type: object
37344
+ required: [description]
37345
+ properties:
37346
+ description: { type: string }
37347
+ required: { type: boolean, description: "Whether the viewer must tick this consent to submit. Defaults to false.", default: false }
37348
+ questions:
37349
+ type: array
37350
+ minItems: 1
37351
+ items:
37352
+ oneOf:
37353
+ - type: object
37354
+ required: [kind, name, question]
37355
+ properties:
37356
+ kind: { type: string, enum: [text] }
37357
+ name: { type: string }
37358
+ question: { type: string }
37359
+ required: { type: boolean }
37360
+ responseEditable: { type: boolean }
37361
+ maxResponseLength: { type: integer, description: "Defaults to 300 on LinkedIn's side." }
37362
+ - type: object
37363
+ required: [kind, name, question, choices]
37364
+ properties:
37365
+ kind: { type: string, enum: [multipleChoice] }
37366
+ name: { type: string }
37367
+ question: { type: string }
37368
+ required: { type: boolean }
37369
+ responseEditable: { type: boolean }
37370
+ choices:
37371
+ type: array
37372
+ minItems: 1
37373
+ items:
37374
+ type: object
37375
+ required: [id, text]
37376
+ properties:
37377
+ id: { type: integer }
37378
+ text: { type: string }
37261
37379
  responses:
37262
37380
  '200':
37263
37381
  description: Created form.
@@ -37275,11 +37393,11 @@ paths:
37275
37393
  get:
37276
37394
  operationId: getLeadForm
37277
37395
  tags: ["Lead Gen"]
37278
- x-platforms: ["meta"]
37396
+ x-platforms: ["meta", "linkedin"]
37279
37397
  summary: Get a lead form
37280
37398
  parameters:
37281
- - { name: formId, in: path, required: true, schema: { type: string } }
37282
- - { name: accountId, in: query, required: true, schema: { type: string } }
37399
+ - { name: formId, in: path, required: true, schema: { type: string }, description: "Numeric form id (Meta leadgen_form id or LinkedIn leadForm id)." }
37400
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Connected facebook or linkedin ads account id (selects the platform)." }
37283
37401
  responses:
37284
37402
  '200':
37285
37403
  description: Form metadata.
@@ -37290,12 +37408,12 @@ paths:
37290
37408
  delete:
37291
37409
  operationId: archiveLeadForm
37292
37410
  tags: ["Lead Gen"]
37293
- x-platforms: ["meta"]
37411
+ x-platforms: ["meta", "linkedin"]
37294
37412
  summary: Archive a lead form
37295
- description: Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
37413
+ description: "Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE)."
37296
37414
  parameters:
37297
- - { name: formId, in: path, required: true, schema: { type: string } }
37298
- - { name: accountId, in: query, required: true, schema: { type: string } }
37415
+ - { name: formId, in: path, required: true, schema: { type: string }, description: "Numeric form id (Meta leadgen_form id or LinkedIn leadForm id)." }
37416
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Connected facebook or linkedin ads account id (selects the platform)." }
37299
37417
  responses:
37300
37418
  '200':
37301
37419
  description: Archived.
@@ -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