late-sdk 0.0.936 → 0.0.937

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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/docs/GetLeadForm200Response.md +2 -2
  4. data/docs/GetLeadForm200ResponseForm.md +49 -0
  5. data/docs/LeadGenApi.md +11 -5
  6. data/docs/MetaLeadForm.md +58 -0
  7. data/docs/MetaLeadFormContextCard.md +28 -0
  8. data/docs/MetaLeadFormLegalContent.md +22 -0
  9. data/docs/MetaLeadFormLegalContentPrivacyPolicy.md +20 -0
  10. data/docs/MetaLeadFormQuestionsInner.md +34 -0
  11. data/docs/MetaLeadFormThankYouPage.md +38 -0
  12. data/lib/zernio-sdk/api/lead_gen_api.rb +11 -2
  13. data/lib/zernio-sdk/models/get_lead_form200_response.rb +1 -1
  14. data/lib/zernio-sdk/models/get_lead_form200_response_form.rb +104 -0
  15. data/lib/zernio-sdk/models/meta_lead_form.rb +337 -0
  16. data/lib/zernio-sdk/models/meta_lead_form_context_card.rb +228 -0
  17. data/lib/zernio-sdk/models/meta_lead_form_legal_content.rb +167 -0
  18. data/lib/zernio-sdk/models/meta_lead_form_legal_content_privacy_policy.rb +156 -0
  19. data/lib/zernio-sdk/models/meta_lead_form_questions_inner.rb +229 -0
  20. data/lib/zernio-sdk/models/meta_lead_form_thank_you_page.rb +238 -0
  21. data/lib/zernio-sdk/version.rb +1 -1
  22. data/lib/zernio-sdk.rb +7 -0
  23. data/openapi.yaml +115 -3
  24. data/spec/api/lead_gen_api_spec.rb +3 -1
  25. data/spec/models/get_lead_form200_response_form_spec.rb +32 -0
  26. data/spec/models/meta_lead_form_context_card_spec.rb +70 -0
  27. data/spec/models/meta_lead_form_legal_content_privacy_policy_spec.rb +42 -0
  28. data/spec/models/meta_lead_form_legal_content_spec.rb +48 -0
  29. data/spec/models/meta_lead_form_questions_inner_spec.rb +84 -0
  30. data/spec/models/meta_lead_form_spec.rb +156 -0
  31. data/spec/models/meta_lead_form_thank_you_page_spec.rb +96 -0
  32. data/zernio-sdk-0.0.937.gem +0 -0
  33. metadata +30 -2
  34. data/zernio-sdk-0.0.936.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e88e4c1a283525cb97c3aa96542117e6a6a5dc79f5f5169702ef9b9544f0301c
4
- data.tar.gz: b38003fa69e3a6bb442bb260d34be2012202efe7f86a046ad2b3397e1909694e
3
+ metadata.gz: ab87906cefb9d1114509587092f8add4580bec1060ea4454cf4f7066f94a88e4
4
+ data.tar.gz: ea4c2949818eaee9bf4e67d2e80252481fce3653fafe0f2b9ed50fbe38998a67
5
5
  SHA512:
6
- metadata.gz: '0809a018c6baa5f764c95748a855277bdeb87a803e97a6d7425a5b1e7d2a7ddec24a6d7fc88e3e43c9f6bb194d4c1b39c7b95e55db3f231b3b5538bc5f5805f6'
7
- data.tar.gz: 6224f3c6cc9109a2a95c4ed9c9177d60490706dd56a397eb076fe9ae9c0038d1566cacf97ac67480e1dfeb9e854d3c97d980fcdae9dc4474ba79622b2812ef0c
6
+ metadata.gz: 531f31208261f86a2ef4e6dbb78ee57eb32a0a5c05e28816fad4a42f36dc55e77906d71c3cc8369ce3d492da97371efedc527fa2511cf016e38adb21ca41dd37
7
+ data.tar.gz: 6bcd9d0704d2a5d619c5458e337feafbeba1eceed3bd73763e1a5c861d03e2f247e7620fcbd2d3c70415d5f9dec51dac90d37cfa8176c8ffd91b0797a4f60dfa
data/README.md CHANGED
@@ -1540,6 +1540,7 @@ Class | Method | HTTP request | Description
1540
1540
  - [Zernio::GetIosFourteenCampaignLimits200Response](docs/GetIosFourteenCampaignLimits200Response.md)
1541
1541
  - [Zernio::GetIosFourteenCampaignLimits200ResponseLimits](docs/GetIosFourteenCampaignLimits200ResponseLimits.md)
1542
1542
  - [Zernio::GetLeadForm200Response](docs/GetLeadForm200Response.md)
1543
+ - [Zernio::GetLeadForm200ResponseForm](docs/GetLeadForm200ResponseForm.md)
1543
1544
  - [Zernio::GetLinkedInAggregateAnalytics200Response](docs/GetLinkedInAggregateAnalytics200Response.md)
1544
1545
  - [Zernio::GetLinkedInAggregateAnalytics400Response](docs/GetLinkedInAggregateAnalytics400Response.md)
1545
1546
  - [Zernio::GetLinkedInAggregateAnalytics402Response](docs/GetLinkedInAggregateAnalytics402Response.md)
@@ -2038,8 +2039,14 @@ Class | Method | HTTP request | Description
2038
2039
  - [Zernio::MediaUploadResponse](docs/MediaUploadResponse.md)
2039
2040
  - [Zernio::MetaAdsPlatformData](docs/MetaAdsPlatformData.md)
2040
2041
  - [Zernio::MetaInstagramIdentityRef](docs/MetaInstagramIdentityRef.md)
2042
+ - [Zernio::MetaLeadForm](docs/MetaLeadForm.md)
2043
+ - [Zernio::MetaLeadFormContextCard](docs/MetaLeadFormContextCard.md)
2044
+ - [Zernio::MetaLeadFormLegalContent](docs/MetaLeadFormLegalContent.md)
2045
+ - [Zernio::MetaLeadFormLegalContentPrivacyPolicy](docs/MetaLeadFormLegalContentPrivacyPolicy.md)
2041
2046
  - [Zernio::MetaLeadFormPlatformData](docs/MetaLeadFormPlatformData.md)
2042
2047
  - [Zernio::MetaLeadFormPlatformDataContextCard](docs/MetaLeadFormPlatformDataContextCard.md)
2048
+ - [Zernio::MetaLeadFormQuestionsInner](docs/MetaLeadFormQuestionsInner.md)
2049
+ - [Zernio::MetaLeadFormThankYouPage](docs/MetaLeadFormThankYouPage.md)
2043
2050
  - [Zernio::Money](docs/Money.md)
2044
2051
  - [Zernio::MoneyAmount](docs/MoneyAmount.md)
2045
2052
  - [Zernio::MoveAccountToProfile200Response](docs/MoveAccountToProfile200Response.md)
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **status** | **String** | | [optional] |
8
- | **form** | **Object** | | [optional] |
8
+ | **form** | [**GetLeadForm200ResponseForm**](GetLeadForm200ResponseForm.md) | | [optional] |
9
9
 
10
10
  ## Example
11
11
 
@@ -13,7 +13,7 @@
13
13
  require 'zernio-sdk'
14
14
 
15
15
  instance = Zernio::GetLeadForm200Response.new(
16
- status: null,
16
+ status: success,
17
17
  form: null
18
18
  )
19
19
  ```
@@ -0,0 +1,49 @@
1
+ # Zernio::GetLeadForm200ResponseForm
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'zernio-sdk'
13
+
14
+ Zernio::GetLeadForm200ResponseForm.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'MetaLeadForm',
18
+ # :'Object'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'zernio-sdk'
30
+
31
+ Zernio::GetLeadForm200ResponseForm.build(data)
32
+ # => #<MetaLeadForm:0x00007fdd4aab02a0>
33
+
34
+ Zernio::GetLeadForm200ResponseForm.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `MetaLeadForm`
47
+ - `Object`
48
+ - `nil` (if no type matches)
49
+
data/docs/LeadGenApi.md CHANGED
@@ -19,7 +19,7 @@ All URIs are relative to *https://zernio.com/api*
19
19
 
20
20
  Archive a lead form
21
21
 
22
- Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE).
22
+ Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE). Meta forms must belong to the Page the accountId manages.
23
23
 
24
24
  ### Examples
25
25
 
@@ -226,10 +226,12 @@ end
226
226
 
227
227
  ## get_lead_form
228
228
 
229
- > <GetLeadForm200Response> get_lead_form(form_id, account_id)
229
+ > <GetLeadForm200Response> get_lead_form(form_id, account_id, opts)
230
230
 
231
231
  Get a lead form
232
232
 
233
+ Returns the full form, including the thank-you page, so a form can be diffed against what was created. Meta forms are scoped to the Page the accountId manages: a form on any other Page is a 404, never a read.
234
+
233
235
  ### Examples
234
236
 
235
237
  ```ruby
@@ -244,10 +246,13 @@ end
244
246
  api_instance = Zernio::LeadGenApi.new
245
247
  form_id = 'form_id_example' # String | Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
246
248
  account_id = 'account_id_example' # String | Connected facebook or linkedin ads account id (selects the platform).
249
+ opts = {
250
+ fields: 'name,thank_you_page{title,body,button_type,website_url}' # String | Meta only. A Graph field selection passed through verbatim to GET /{form-id}, replacing the default projection, so fields Meta adds later are reachable without an API change. Field names, commas and {} expansion only; anything else (Graph field modifiers such as .limit(), or characters that could open another query parameter) is a 400. Ownership of the form is verified before the selection runs, so this cannot reach any Page but the one accountId manages. Unknown field names are rejected by Meta as a 400.
251
+ }
247
252
 
248
253
  begin
249
254
  # Get a lead form
250
- result = api_instance.get_lead_form(form_id, account_id)
255
+ result = api_instance.get_lead_form(form_id, account_id, opts)
251
256
  p result
252
257
  rescue Zernio::ApiError => e
253
258
  puts "Error when calling LeadGenApi->get_lead_form: #{e}"
@@ -258,12 +263,12 @@ end
258
263
 
259
264
  This returns an Array which contains the response data, status code and headers.
260
265
 
261
- > <Array(<GetLeadForm200Response>, Integer, Hash)> get_lead_form_with_http_info(form_id, account_id)
266
+ > <Array(<GetLeadForm200Response>, Integer, Hash)> get_lead_form_with_http_info(form_id, account_id, opts)
262
267
 
263
268
  ```ruby
264
269
  begin
265
270
  # Get a lead form
266
- data, status_code, headers = api_instance.get_lead_form_with_http_info(form_id, account_id)
271
+ data, status_code, headers = api_instance.get_lead_form_with_http_info(form_id, account_id, opts)
267
272
  p status_code # => 2xx
268
273
  p headers # => { ... }
269
274
  p data # => <GetLeadForm200Response>
@@ -278,6 +283,7 @@ end
278
283
  | ---- | ---- | ----------- | ----- |
279
284
  | **form_id** | **String** | Numeric form id (Meta leadgen_form id or LinkedIn leadForm id). | |
280
285
  | **account_id** | **String** | Connected facebook or linkedin ads account id (selects the platform). | |
286
+ | **fields** | **String** | Meta only. A Graph field selection passed through verbatim to GET /{form-id}, replacing the default projection, so fields Meta adds later are reachable without an API change. Field names, commas and {} expansion only; anything else (Graph field modifiers such as .limit(), or characters that could open another query parameter) is a 400. Ownership of the form is verified before the selection runs, so this cannot reach any Page but the one accountId manages. Unknown field names are rejected by Meta as a 400. | [optional] |
281
287
 
282
288
  ### Return type
283
289
 
@@ -0,0 +1,58 @@
1
+ # Zernio::MetaLeadForm
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+ | **name** | **String** | | [optional] |
9
+ | **status** | **String** | One of ACTIVE, ARCHIVED, DELETED or DRAFT. | [optional] |
10
+ | **locale** | **String** | | [optional] |
11
+ | **created_time** | **Time** | | [optional] |
12
+ | **page_id** | **String** | Owning Facebook Page. A form on any other Page is a 404, whether read or archived. | [optional] |
13
+ | **leads_count** | **Integer** | | [optional] |
14
+ | **organic_leads_count** | **Integer** | | [optional] |
15
+ | **expired_leads_count** | **Integer** | Leads Meta has aged out of the retention window. | [optional] |
16
+ | **privacy_policy_url** | **String** | | [optional] |
17
+ | **follow_up_action_url** | **String** | | [optional] |
18
+ | **follow_up_action_text** | **String** | | [optional] |
19
+ | **question_page_custom_headline** | **String** | | [optional] |
20
+ | **is_optimized_for_quality** | **Boolean** | | [optional] |
21
+ | **block_display_for_non_targeted_viewer** | **Boolean** | | [optional] |
22
+ | **allow_organic_lead** | **Boolean** | Whether the form can also be submitted from an organic Page post. | [optional] |
23
+ | **tracking_parameters** | [**Array&lt;BoostPostRequestTrackingUrlTagsInner&gt;**](BoostPostRequestTrackingUrlTagsInner.md) | Custom key/value pairs attached to every lead of this form. | [optional] |
24
+ | **legal_content** | [**MetaLeadFormLegalContent**](MetaLeadFormLegalContent.md) | | [optional] |
25
+ | **context_card** | [**MetaLeadFormContextCard**](MetaLeadFormContextCard.md) | | [optional] |
26
+ | **thank_you_page** | [**MetaLeadFormThankYouPage**](MetaLeadFormThankYouPage.md) | | [optional] |
27
+ | **questions** | [**Array&lt;MetaLeadFormQuestionsInner&gt;**](MetaLeadFormQuestionsInner.md) | | [optional] |
28
+
29
+ ## Example
30
+
31
+ ```ruby
32
+ require 'zernio-sdk'
33
+
34
+ instance = Zernio::MetaLeadForm.new(
35
+ id: null,
36
+ name: null,
37
+ status: null,
38
+ locale: en_US,
39
+ created_time: null,
40
+ page_id: null,
41
+ leads_count: null,
42
+ organic_leads_count: null,
43
+ expired_leads_count: null,
44
+ privacy_policy_url: null,
45
+ follow_up_action_url: null,
46
+ follow_up_action_text: null,
47
+ question_page_custom_headline: null,
48
+ is_optimized_for_quality: null,
49
+ block_display_for_non_targeted_viewer: null,
50
+ allow_organic_lead: null,
51
+ tracking_parameters: null,
52
+ legal_content: null,
53
+ context_card: null,
54
+ thank_you_page: null,
55
+ questions: null
56
+ )
57
+ ```
58
+
@@ -0,0 +1,28 @@
1
+ # Zernio::MetaLeadFormContextCard
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+ | **title** | **String** | | [optional] |
9
+ | **style** | **String** | | [optional] |
10
+ | **content** | **Array&lt;String&gt;** | | [optional] |
11
+ | **button_text** | **String** | | [optional] |
12
+ | **cover_photo** | [**CreateTestLead200ResponseTestLead**](CreateTestLead200ResponseTestLead.md) | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'zernio-sdk'
18
+
19
+ instance = Zernio::MetaLeadFormContextCard.new(
20
+ id: null,
21
+ title: null,
22
+ style: null,
23
+ content: null,
24
+ button_text: null,
25
+ cover_photo: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,22 @@
1
+ # Zernio::MetaLeadFormLegalContent
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+ | **privacy_policy** | [**MetaLeadFormLegalContentPrivacyPolicy**](MetaLeadFormLegalContentPrivacyPolicy.md) | | [optional] |
9
+ | **custom_disclaimer** | **Object** | Set in Meta form builder only; there is no create parameter for it. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::MetaLeadFormLegalContent.new(
17
+ id: null,
18
+ privacy_policy: null,
19
+ custom_disclaimer: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,20 @@
1
+ # Zernio::MetaLeadFormLegalContentPrivacyPolicy
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **url** | **String** | | [optional] |
8
+ | **link_text** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zernio-sdk'
14
+
15
+ instance = Zernio::MetaLeadFormLegalContentPrivacyPolicy.new(
16
+ url: null,
17
+ link_text: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,34 @@
1
+ # Zernio::MetaLeadFormQuestionsInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+ | **key** | **String** | | [optional] |
9
+ | **label** | **String** | | [optional] |
10
+ | **type** | **String** | EMAIL, PHONE, FULL_NAME, CUSTOM, ... | [optional] |
11
+ | **inline_context** | **String** | | [optional] |
12
+ | **options** | [**Array&lt;BoostPostRequestTrackingUrlTagsInner&gt;**](BoostPostRequestTrackingUrlTagsInner.md) | | [optional] |
13
+ | **conditional_questions_group_id** | **String** | READ-ONLY. Conditional logic can only be authored in Meta form builder; Meta has no create parameter for it. | [optional] |
14
+ | **conditional_questions_choices** | **Array&lt;Object&gt;** | READ-ONLY. Which answers reveal the conditional group. | [optional] |
15
+ | **dependent_conditional_questions** | **Array&lt;Object&gt;** | READ-ONLY. Questions revealed by the conditional group. | [optional] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'zernio-sdk'
21
+
22
+ instance = Zernio::MetaLeadFormQuestionsInner.new(
23
+ id: null,
24
+ key: null,
25
+ label: null,
26
+ type: null,
27
+ inline_context: null,
28
+ options: null,
29
+ conditional_questions_group_id: null,
30
+ conditional_questions_choices: null,
31
+ dependent_conditional_questions: null
32
+ )
33
+ ```
34
+
@@ -0,0 +1,38 @@
1
+ # Zernio::MetaLeadFormThankYouPage
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+ | **title** | **String** | | [optional] |
9
+ | **body** | **String** | | [optional] |
10
+ | **button_text** | **String** | | [optional] |
11
+ | **button_type** | **String** | | [optional] |
12
+ | **website_url** | **String** | | [optional] |
13
+ | **enable_messenger** | **Boolean** | | [optional] |
14
+ | **status** | **String** | | [optional] |
15
+ | **lead_gen_use_case** | **String** | | [optional] |
16
+ | **business_phone_number** | **String** | | [optional] |
17
+ | **country_code** | **String** | | [optional] |
18
+
19
+ ## Example
20
+
21
+ ```ruby
22
+ require 'zernio-sdk'
23
+
24
+ instance = Zernio::MetaLeadFormThankYouPage.new(
25
+ id: null,
26
+ title: null,
27
+ body: null,
28
+ button_text: null,
29
+ button_type: VIEW_WEBSITE,
30
+ website_url: null,
31
+ enable_messenger: null,
32
+ status: null,
33
+ lead_gen_use_case: null,
34
+ business_phone_number: null,
35
+ country_code: null
36
+ )
37
+ ```
38
+
@@ -20,7 +20,7 @@ module Zernio
20
20
  @api_client = api_client
21
21
  end
22
22
  # Archive a lead form
23
- # Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE).
23
+ # Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE). Meta forms must belong to the Page the accountId manages.
24
24
  # @param form_id [String] Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
25
25
  # @param account_id [String] Connected facebook or linkedin ads account id (selects the platform).
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module Zernio
31
31
  end
32
32
 
33
33
  # Archive a lead form
34
- # Neither platform hard-deletes a form; this archives it (Meta status&#x3D;ARCHIVED; LinkedIn state&#x3D;ARCHIVED via PARTIAL_UPDATE).
34
+ # Neither platform hard-deletes a form; this archives it (Meta status&#x3D;ARCHIVED; LinkedIn state&#x3D;ARCHIVED via PARTIAL_UPDATE). Meta forms must belong to the Page the accountId manages.
35
35
  # @param form_id [String] Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
36
36
  # @param account_id [String] Connected facebook or linkedin ads account id (selects the platform).
37
37
  # @param [Hash] opts the optional parameters
@@ -232,9 +232,11 @@ module Zernio
232
232
  end
233
233
 
234
234
  # Get a lead form
235
+ # Returns the full form, including the thank-you page, so a form can be diffed against what was created. Meta forms are scoped to the Page the accountId manages: a form on any other Page is a 404, never a read.
235
236
  # @param form_id [String] Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
236
237
  # @param account_id [String] Connected facebook or linkedin ads account id (selects the platform).
237
238
  # @param [Hash] opts the optional parameters
239
+ # @option opts [String] :fields Meta only. A Graph field selection passed through verbatim to GET /{form-id}, replacing the default projection, so fields Meta adds later are reachable without an API change. Field names, commas and {} expansion only; anything else (Graph field modifiers such as .limit(), or characters that could open another query parameter) is a 400. Ownership of the form is verified before the selection runs, so this cannot reach any Page but the one accountId manages. Unknown field names are rejected by Meta as a 400.
238
240
  # @return [GetLeadForm200Response]
239
241
  def get_lead_form(form_id, account_id, opts = {})
240
242
  data, _status_code, _headers = get_lead_form_with_http_info(form_id, account_id, opts)
@@ -242,9 +244,11 @@ module Zernio
242
244
  end
243
245
 
244
246
  # Get a lead form
247
+ # Returns the full form, including the thank-you page, so a form can be diffed against what was created. Meta forms are scoped to the Page the accountId manages: a form on any other Page is a 404, never a read.
245
248
  # @param form_id [String] Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
246
249
  # @param account_id [String] Connected facebook or linkedin ads account id (selects the platform).
247
250
  # @param [Hash] opts the optional parameters
251
+ # @option opts [String] :fields Meta only. A Graph field selection passed through verbatim to GET /{form-id}, replacing the default projection, so fields Meta adds later are reachable without an API change. Field names, commas and {} expansion only; anything else (Graph field modifiers such as .limit(), or characters that could open another query parameter) is a 400. Ownership of the form is verified before the selection runs, so this cannot reach any Page but the one accountId manages. Unknown field names are rejected by Meta as a 400.
248
252
  # @return [Array<(GetLeadForm200Response, Integer, Hash)>] GetLeadForm200Response data, response status code and response headers
249
253
  def get_lead_form_with_http_info(form_id, account_id, opts = {})
250
254
  if @api_client.config.debugging
@@ -258,12 +262,17 @@ module Zernio
258
262
  if @api_client.config.client_side_validation && account_id.nil?
259
263
  fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.get_lead_form"
260
264
  end
265
+ if @api_client.config.client_side_validation && !opts[:'fields'].nil? && opts[:'fields'].to_s.length > 2000
266
+ fail ArgumentError, 'invalid value for "opts[:"fields"]" when calling LeadGenApi.get_lead_form, the character length must be smaller than or equal to 2000.'
267
+ end
268
+
261
269
  # resource path
262
270
  local_var_path = '/v1/ads/lead-forms/{formId}'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))
263
271
 
264
272
  # query parameters
265
273
  query_params = opts[:query_params] || {}
266
274
  query_params[:'accountId'] = account_id
275
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
267
276
 
268
277
  # header parameters
269
278
  header_params = opts[:header_params] || {}
@@ -41,7 +41,7 @@ module Zernio
41
41
  def self.openapi_types
42
42
  {
43
43
  :'status' => :'String',
44
- :'form' => :'Object'
44
+ :'form' => :'GetLeadForm200ResponseForm'
45
45
  }
46
46
  end
47
47
 
@@ -0,0 +1,104 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ module GetLeadForm200ResponseForm
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'MetaLeadForm',
23
+ :'Object'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_one_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = Zernio.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+
104
+ end