late-sdk 0.0.724 → 0.0.726

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/docs/AdAudiencesApi.md +74 -2
  4. data/docs/MessagesApi.md +1 -1
  5. data/docs/ReplaceAdAudienceCompanies200Response.md +20 -0
  6. data/docs/ReplaceAdAudienceCompaniesRequest.md +18 -0
  7. data/docs/ReplaceAdAudienceCompaniesRequestCompaniesInner.md +24 -0
  8. data/docs/SendInboxMessage200ResponseData.md +4 -6
  9. data/docs/SendInboxMessage200ResponseDataAttachmentsInner.md +20 -0
  10. data/docs/UploadedOrDerivedAudience.md +1 -1
  11. data/lib/zernio-sdk/api/ad_audiences_api.rb +78 -4
  12. data/lib/zernio-sdk/api/messages_api.rb +2 -2
  13. data/lib/zernio-sdk/models/replace_ad_audience_companies200_response.rb +157 -0
  14. data/lib/zernio-sdk/models/replace_ad_audience_companies_request.rb +185 -0
  15. data/lib/zernio-sdk/models/replace_ad_audience_companies_request_companies_inner.rb +231 -0
  16. data/lib/zernio-sdk/models/send_inbox_message200_response_data.rb +12 -23
  17. data/lib/zernio-sdk/models/send_inbox_message200_response_data_attachments_inner.rb +156 -0
  18. data/lib/zernio-sdk/models/uploaded_or_derived_audience.rb +1 -1
  19. data/lib/zernio-sdk/version.rb +1 -1
  20. data/lib/zernio-sdk.rb +4 -0
  21. data/openapi.yaml +114 -11
  22. data/spec/api/ad_audiences_api_spec.rb +15 -2
  23. data/spec/api/messages_api_spec.rb +1 -1
  24. data/spec/models/replace_ad_audience_companies200_response_spec.rb +42 -0
  25. data/spec/models/replace_ad_audience_companies_request_companies_inner_spec.rb +54 -0
  26. data/spec/models/replace_ad_audience_companies_request_spec.rb +36 -0
  27. data/spec/models/send_inbox_message200_response_data_attachments_inner_spec.rb +42 -0
  28. data/spec/models/send_inbox_message200_response_data_spec.rb +1 -7
  29. data/zernio-sdk-0.0.726.gem +0 -0
  30. metadata +18 -2
  31. data/zernio-sdk-0.0.724.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fe0affec7337a54f5a5626b8088c3a1055623f6fe609b396ef60e85d79ae7d5
4
- data.tar.gz: 424bfdbebe8746e244c9db88f82109fd8169f9cbc4273a29e91c210b3de380cf
3
+ metadata.gz: 389c2a6db9bcb1e1bfe4682df90c5ef3f73f8b23ee2bbb4a418ff43737c991c6
4
+ data.tar.gz: 6a98465ee15e882eda3f4a8ce86d943f0792388649bed0683535bd2610940128
5
5
  SHA512:
6
- metadata.gz: a7f44b04c676081d1b6f89235840b1569878b9917248ef15e6abc338144ee86b2d9d573aedff1ba107d005944181ca62d40a8a5c298c3cc213b5437f7a32dfaa
7
- data.tar.gz: 965f7286746280990b7f59721a344db6600caf191ce78f95f456ac2fd33e24dca192f0f574ea7ce00eff3fb51f9e0472d9560142915717e5597cece7f80c69d4
6
+ metadata.gz: 94468de2ca9483929a9a94a401ea2dadb816e47fbc6517901a1f9d566be02d4d3b2313ec219bb7cb763f6262e13749b11a668f7f8d027a4cb72122e0903c640c
7
+ data.tar.gz: 80f6f893e201edb178ced529fb411564b0740fd0256024e777bcb481f065cdd7fe653f86b95c827e7eeb674614fa1b2b24ff42a854f614944cbb212f2c24220f
data/README.md CHANGED
@@ -121,6 +121,7 @@ Class | Method | HTTP request | Description
121
121
  *Zernio::AdAudiencesApi* | [**delete_ad_audience**](docs/AdAudiencesApi.md#delete_ad_audience) | **DELETE** /v1/ads/audiences/{audienceId} | Delete custom audience
122
122
  *Zernio::AdAudiencesApi* | [**get_ad_audience**](docs/AdAudiencesApi.md#get_ad_audience) | **GET** /v1/ads/audiences/{audienceId} | Get audience details
123
123
  *Zernio::AdAudiencesApi* | [**list_ad_audiences**](docs/AdAudiencesApi.md#list_ad_audiences) | **GET** /v1/ads/audiences | List custom audiences
124
+ *Zernio::AdAudiencesApi* | [**replace_ad_audience_companies**](docs/AdAudiencesApi.md#replace_ad_audience_companies) | **POST** /v1/ads/audiences/{audienceId}/companies | Replace audience companies
124
125
  *Zernio::AdAudiencesApi* | [**update_ad_audience**](docs/AdAudiencesApi.md#update_ad_audience) | **PUT** /v1/ads/audiences/{audienceId} | Update an audience
125
126
  *Zernio::AdCampaignsApi* | [**boost_post**](docs/AdCampaignsApi.md#boost_post) | **POST** /v1/ads/boost | Boost post as ad
126
127
  *Zernio::AdCampaignsApi* | [**bulk_update_ad_campaign_status**](docs/AdCampaignsApi.md#bulk_update_ad_campaign_status) | **POST** /v1/ads/campaigns/bulk-status | Pause or resume many campaigns
@@ -1760,6 +1761,9 @@ Class | Method | HTTP request | Description
1760
1761
  - [Zernio::RemoveConversionAssociations200Response](docs/RemoveConversionAssociations200Response.md)
1761
1762
  - [Zernio::RemoveDiscordMemberRole200Response](docs/RemoveDiscordMemberRole200Response.md)
1762
1763
  - [Zernio::RemoveWhatsAppGroupParticipantsRequest](docs/RemoveWhatsAppGroupParticipantsRequest.md)
1764
+ - [Zernio::ReplaceAdAudienceCompanies200Response](docs/ReplaceAdAudienceCompanies200Response.md)
1765
+ - [Zernio::ReplaceAdAudienceCompaniesRequest](docs/ReplaceAdAudienceCompaniesRequest.md)
1766
+ - [Zernio::ReplaceAdAudienceCompaniesRequestCompaniesInner](docs/ReplaceAdAudienceCompaniesRequestCompaniesInner.md)
1763
1767
  - [Zernio::ReplyToGoogleBusinessReview200Response](docs/ReplyToGoogleBusinessReview200Response.md)
1764
1768
  - [Zernio::ReplyToGoogleBusinessReviewRequest](docs/ReplyToGoogleBusinessReviewRequest.md)
1765
1769
  - [Zernio::ReplyToInboxPost200Response](docs/ReplyToInboxPost200Response.md)
@@ -1858,6 +1862,7 @@ Class | Method | HTTP request | Description
1858
1862
  - [Zernio::SendDiscordDirectMessageRequestAttachmentsInner](docs/SendDiscordDirectMessageRequestAttachmentsInner.md)
1859
1863
  - [Zernio::SendInboxMessage200Response](docs/SendInboxMessage200Response.md)
1860
1864
  - [Zernio::SendInboxMessage200ResponseData](docs/SendInboxMessage200ResponseData.md)
1865
+ - [Zernio::SendInboxMessage200ResponseDataAttachmentsInner](docs/SendInboxMessage200ResponseDataAttachmentsInner.md)
1861
1866
  - [Zernio::SendInboxMessage400Response](docs/SendInboxMessage400Response.md)
1862
1867
  - [Zernio::SendInboxMessage400ResponsePlatformError](docs/SendInboxMessage400ResponsePlatformError.md)
1863
1868
  - [Zernio::SendInboxMessageRequest](docs/SendInboxMessageRequest.md)
@@ -9,6 +9,7 @@ All URIs are relative to *https://zernio.com/api*
9
9
  | [**delete_ad_audience**](AdAudiencesApi.md#delete_ad_audience) | **DELETE** /v1/ads/audiences/{audienceId} | Delete custom audience |
10
10
  | [**get_ad_audience**](AdAudiencesApi.md#get_ad_audience) | **GET** /v1/ads/audiences/{audienceId} | Get audience details |
11
11
  | [**list_ad_audiences**](AdAudiencesApi.md#list_ad_audiences) | **GET** /v1/ads/audiences | List custom audiences |
12
+ | [**replace_ad_audience_companies**](AdAudiencesApi.md#replace_ad_audience_companies) | **POST** /v1/ads/audiences/{audienceId}/companies | Replace audience companies |
12
13
  | [**update_ad_audience**](AdAudiencesApi.md#update_ad_audience) | **PUT** /v1/ads/audiences/{audienceId} | Update an audience |
13
14
 
14
15
 
@@ -18,7 +19,7 @@ All URIs are relative to *https://zernio.com/api*
18
19
 
19
20
  Add users to audience
20
21
 
21
- Upload user data to a customer_list audience. Data is SHA256-hashed server-side before sending to the platform. Email is used on every platform; phone is used on Meta only (other platforms ignore it). On TikTok and Pinterest, the first upload also provisions the audience (deferred create). LinkedIn uploads are full-replace. Max 10,000 users per request.
22
+ Upload user data to a customer_list audience. Data is SHA256-hashed server-side before sending to the platform. Email is used on every platform; phone is used on Meta only (other platforms ignore it). On TikTok and Pinterest, the first upload also provisions the audience (deferred create). LinkedIn uploads are full-replace. Max 10,000 users per request. customer_list only. A LinkedIn `company_list` audience takes company rows, not people: send those to `POST /v1/ads/audiences/{audienceId}/companies`. This endpoint 422s for every other audience type.
22
23
 
23
24
  ### Examples
24
25
 
@@ -89,7 +90,7 @@ end
89
90
 
90
91
  Create custom audience
91
92
 
92
- Create a custom audience. `customer_list` is supported on Meta, Google, X, LinkedIn, TikTok, and Pinterest; `website` and `lookalike` are Meta-only. `saved_targeting` stores a reusable TargetingSpec (no member upload, no adAccountId) that you reference later via `savedTargetingId` on `POST /v1/ads/create`. Upload-backed audiences are created empty, add members via `POST /v1/ads/audiences/{audienceId}/users`. On TikTok and Pinterest the audience is provisioned lazily on the first member upload (until then its status is `pending`). Create is not idempotent, never auto-retry.
93
+ Create a custom audience. `customer_list` is supported on Meta, Google, X, LinkedIn, TikTok, and Pinterest; `website` and `lookalike` are Meta-only; `company_list`, `engagement` and `website_retargeting` are LinkedIn-only. `saved_targeting` stores a reusable TargetingSpec (no member upload, no adAccountId) that you reference later via `savedTargetingId` on `POST /v1/ads/create`. How the audience gets filled depends on the type: - `customer_list` is created empty. Add members with `POST /v1/ads/audiences/{audienceId}/users`. On TikTok and Pinterest the audience is provisioned lazily on that first upload (until then its status is `pending`). - `company_list` is filled AT CREATION from the `companies` array below, which is required. To change the list afterwards send the new full list to `POST /v1/ads/audiences/{audienceId}/companies` (a replace, not a merge). The `/users` endpoint rejects these audiences with a 422. - `website`, `website_retargeting`, `engagement`, `meta_engagement` and `lookalike` fill themselves from the pixel, engagement source or seed audience you point them at. They take no member upload at all. Create is not idempotent, never auto-retry.
93
94
 
94
95
  ### Examples
95
96
 
@@ -367,6 +368,77 @@ end
367
368
  - **Accept**: application/json
368
369
 
369
370
 
371
+ ## replace_ad_audience_companies
372
+
373
+ > <ReplaceAdAudienceCompanies200Response> replace_ad_audience_companies(audience_id, replace_ad_audience_companies_request)
374
+
375
+ Replace audience companies
376
+
377
+ Upload the company rows of a LinkedIn `company_list` audience (account-based marketing). LinkedIn-only, every other platform returns 422. A LinkedIn audience segment holds exactly one uploaded list, so the list you send here REPLACES the segment's list instead of being appended to it: always send the full set of companies. LinkedIn returns only the identifier of the uploaded file, never its rows, so the merge cannot be done for you, keep the source list on your side. LinkedIn does not document how quickly companies dropped from the list stop being targeted, so treat removals as eventual rather than immediate. Rows are plain text (not hashed), matched against LinkedIn's own company graph. Matching is asynchronous: LinkedIn takes up to 48h for a new audience and up to 24h for a later update, and the audience stays `processing` meanwhile. LinkedIn recommends at least 1,000 companies for a usable match rate, and caps a list at 300,000. The initial list is sent with `companies` on `POST /v1/ads/audiences`; this endpoint is for every change after that.
378
+
379
+ ### Examples
380
+
381
+ ```ruby
382
+ require 'time'
383
+ require 'zernio-sdk'
384
+ # setup authorization
385
+ Zernio.configure do |config|
386
+ # Configure Bearer authorization (JWT): bearerAuth
387
+ config.access_token = 'YOUR_BEARER_TOKEN'
388
+ end
389
+
390
+ api_instance = Zernio::AdAudiencesApi.new
391
+ audience_id = 'audience_id_example' # String |
392
+ replace_ad_audience_companies_request = Zernio::ReplaceAdAudienceCompaniesRequest.new({companies: [Zernio::ReplaceAdAudienceCompaniesRequestCompaniesInner.new]}) # ReplaceAdAudienceCompaniesRequest |
393
+
394
+ begin
395
+ # Replace audience companies
396
+ result = api_instance.replace_ad_audience_companies(audience_id, replace_ad_audience_companies_request)
397
+ p result
398
+ rescue Zernio::ApiError => e
399
+ puts "Error when calling AdAudiencesApi->replace_ad_audience_companies: #{e}"
400
+ end
401
+ ```
402
+
403
+ #### Using the replace_ad_audience_companies_with_http_info variant
404
+
405
+ This returns an Array which contains the response data, status code and headers.
406
+
407
+ > <Array(<ReplaceAdAudienceCompanies200Response>, Integer, Hash)> replace_ad_audience_companies_with_http_info(audience_id, replace_ad_audience_companies_request)
408
+
409
+ ```ruby
410
+ begin
411
+ # Replace audience companies
412
+ data, status_code, headers = api_instance.replace_ad_audience_companies_with_http_info(audience_id, replace_ad_audience_companies_request)
413
+ p status_code # => 2xx
414
+ p headers # => { ... }
415
+ p data # => <ReplaceAdAudienceCompanies200Response>
416
+ rescue Zernio::ApiError => e
417
+ puts "Error when calling AdAudiencesApi->replace_ad_audience_companies_with_http_info: #{e}"
418
+ end
419
+ ```
420
+
421
+ ### Parameters
422
+
423
+ | Name | Type | Description | Notes |
424
+ | ---- | ---- | ----------- | ----- |
425
+ | **audience_id** | **String** | | |
426
+ | **replace_ad_audience_companies_request** | [**ReplaceAdAudienceCompaniesRequest**](ReplaceAdAudienceCompaniesRequest.md) | | |
427
+
428
+ ### Return type
429
+
430
+ [**ReplaceAdAudienceCompanies200Response**](ReplaceAdAudienceCompanies200Response.md)
431
+
432
+ ### Authorization
433
+
434
+ [bearerAuth](../README.md#bearerAuth)
435
+
436
+ ### HTTP request headers
437
+
438
+ - **Content-Type**: application/json
439
+ - **Accept**: application/json
440
+
441
+
370
442
  ## update_ad_audience
371
443
 
372
444
  > <CreateAdAudience201Response> update_ad_audience(audience_id, update_ad_audience_request)
data/docs/MessagesApi.md CHANGED
@@ -854,7 +854,7 @@ end
854
854
 
855
855
  Send message
856
856
 
857
- Send a message in a conversation. Supports text, attachments, quick replies, buttons, templates, and message tags. Attachment and interactive message support varies by platform. WhatsApp template messages: to send an approved template into this conversation (required when the 24-hour customer-service window is closed), use the `template` field with a single element carrying the template reference: `{ \"elements\": [{ \"name\": ..., \"language\": ..., \"components\": [...] }] }`. See the `template` field below for the exact shape. To send a template to a phone number you have no conversation with yet, use the create-conversation endpoint (POST /v1/inbox/conversations) instead. WhatsApp rich interactive messages (list, CTA URL, Flow, location request) are available via the `interactive` field. Tap events are delivered through the `message.received` webhook with WhatsApp-specific `metadata` fields (`interactiveType`, `interactiveId`, `flowResponseJson`, `flowResponseData`). **Idempotency:** send an `Idempotency-Key` header to make retries safe (e.g. after a client-side timeout where delivery is unknown): same key + same body replays the original response (with `Idempotent-Replayed: true`) instead of sending the message a second time; same key + different body returns 422; a key still in flight returns 409. Works for JSON and multipart (file upload) requests alike. Keys are retained for 24 hours.
857
+ Send a message in a conversation. Supports text, attachments, quick replies, buttons, templates, and message tags. Attachment and interactive message support varies by platform. WhatsApp template messages: to send an approved template into this conversation (required when the 24-hour customer-service window is closed), use the `template` field with a single element carrying the template reference: `{ \"elements\": [{ \"name\": ..., \"language\": ..., \"components\": [...] }] }`. See the `template` field below for the exact shape. To send a template to a phone number you have no conversation with yet, use the create-conversation endpoint (POST /v1/inbox/conversations) instead. WhatsApp rich interactive messages (list, CTA URL, Flow, location request) are available via the `interactive` field. Tap events are delivered through the `message.received` webhook with WhatsApp-specific `metadata` fields (`interactiveType`, `interactiveId`, `flowResponseJson`, `flowResponseData`). **Idempotency:** send an `Idempotency-Key` header to make retries safe (e.g. after a client-side timeout where delivery is unknown): same key + same body replays the original response (with `Idempotent-Replayed: true`) instead of sending the message a second time; same key + different body returns 422; a key still in flight returns 409. Works for JSON and multipart (file upload) requests alike. Keys are retained for 24 hours. Only successful (2xx) responses are stored for replay: if the request throws or returns a non-2xx status, the key is released so the same key can be retried once the problem is fixed. The header therefore protects the \"request succeeded but the response was lost\" case. For an ambiguous failure (a 5xx or a network timeout), reconcile before retrying: a failure after the platform already accepted the message also releases the key, and a blind retry could send it twice. List the conversation's messages first, and treat an empty result as inconclusive rather than as proof nothing was sent, since a send that failed while being recorded leaves no trace on our side.
858
858
 
859
859
  ### Examples
860
860
 
@@ -0,0 +1,20 @@
1
+ # Zernio::ReplaceAdAudienceCompanies200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **message** | **String** | | [optional] |
8
+ | **num_received** | **Integer** | Rows sent to LinkedIn. Matching happens asynchronously, so this is not the matched company count. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zernio-sdk'
14
+
15
+ instance = Zernio::ReplaceAdAudienceCompanies200Response.new(
16
+ message: null,
17
+ num_received: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,18 @@
1
+ # Zernio::ReplaceAdAudienceCompaniesRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **companies** | [**Array&lt;ReplaceAdAudienceCompaniesRequestCompaniesInner&gt;**](ReplaceAdAudienceCompaniesRequestCompaniesInner.md) | The complete company list. Each row needs at least one of name, domain, website or linkedinPageUrl. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'zernio-sdk'
13
+
14
+ instance = Zernio::ReplaceAdAudienceCompaniesRequest.new(
15
+ companies: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,24 @@
1
+ # Zernio::ReplaceAdAudienceCompaniesRequestCompaniesInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | | [optional] |
8
+ | **domain** | **String** | | [optional] |
9
+ | **website** | **String** | | [optional] |
10
+ | **linkedin_page_url** | **String** | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zernio-sdk'
16
+
17
+ instance = Zernio::ReplaceAdAudienceCompaniesRequestCompaniesInner.new(
18
+ name: null,
19
+ domain: null,
20
+ website: null,
21
+ linkedin_page_url: null
22
+ )
23
+ ```
24
+
@@ -4,10 +4,9 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **message_id** | **String** | ID of the sent message (not returned for Reddit) | [optional] |
8
- | **conversation_id** | **String** | Twitter conversation ID | [optional] |
9
- | **sent_at** | **Time** | Bluesky sent timestamp | [optional] |
10
- | **message** | **String** | Success message (Reddit only) | [optional] |
7
+ | **message_id** | **String** | Platform id of the sent message (not returned for Reddit). For WhatsApp this is the raw Meta wamid, the same id delivered as message.platformMessageId on webhooks and delivery-status updates, and the value to pass as replyTo to quote-reply. | [optional] |
8
+ | **conversation_id** | **String** | Zernio conversation id, echoed so the thread can be read back or replied to. It equals the id the list-conversations endpoint returns for Telegram, WhatsApp, SMS and Slack; for Facebook, Instagram, Bluesky and Reddit that endpoint returns the platform thread id instead, so do not correlate the two by equality. For X (Twitter), when the request addressed the conversation by its Twitter dm_conversation_id, that platform id is echoed back instead. Omitted when the send succeeded but the conversation could not be resolved to a stored record. | [optional] |
9
+ | **attachments** | [**Array&lt;SendInboxMessage200ResponseDataAttachmentsInner&gt;**](SendInboxMessage200ResponseDataAttachmentsInner.md) | Echo of the sent attachment with its resolved public URL, when one is available (Facebook, Instagram, Telegram, WhatsApp). | [optional] |
11
10
 
12
11
  ## Example
13
12
 
@@ -17,8 +16,7 @@ require 'zernio-sdk'
17
16
  instance = Zernio::SendInboxMessage200ResponseData.new(
18
17
  message_id: null,
19
18
  conversation_id: null,
20
- sent_at: null,
21
- message: null
19
+ attachments: null
22
20
  )
23
21
  ```
24
22
 
@@ -0,0 +1,20 @@
1
+ # Zernio::SendInboxMessage200ResponseDataAttachmentsInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **type** | **String** | | [optional] |
8
+ | **url** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zernio-sdk'
14
+
15
+ instance = Zernio::SendInboxMessage200ResponseDataAttachmentsInner.new(
16
+ type: null,
17
+ url: null
18
+ )
19
+ ```
20
+
@@ -14,7 +14,7 @@
14
14
  | **trigger** | **String** | Required for engagement audiences. The action, validated by LinkedIn against &#x60;sourceType&#x60;. Common values: VIDEO_ADS FIRST_QUARTILE / MIDPOINT / THIRD_QUARTILE / FULL_COMPLETE; LEAD_GEN_FORMS VIEW_FORM / LEAD_FORM_SUBMIT; ORGANIZATION_PAGES VIEW / CTA_CLICK; EVENT_PAGES RSVPED / VIDEO_VIEWED / ENGAGEMENT / CLICK. | [optional] |
15
15
  | **lookback_days** | **Integer** | Required for engagement audiences. Rolling window. | [optional] |
16
16
  | **engagement_sources** | **Array&lt;String&gt;** | Required for engagement audiences. Campaign URNs for the ad source types, organization URNs for pages and events. LinkedIn creates one rule per source, all sharing the same trigger and lookbackDays. | [optional] |
17
- | **companies** | [**Array&lt;UploadedOrDerivedAudienceCompaniesInner&gt;**](UploadedOrDerivedAudienceCompaniesInner.md) | Required for company_list audiences (LinkedIn only): plain-text company rows for account targeting. Each row needs at least one identifier. LinkedIn recommends 1,000+ companies for a usable match rate and takes up to 48h to process the list. | [optional] |
17
+ | **companies** | [**Array&lt;UploadedOrDerivedAudienceCompaniesInner&gt;**](UploadedOrDerivedAudienceCompaniesInner.md) | Required for company_list audiences (LinkedIn only): plain-text company rows for account targeting. Each row needs at least one identifier. Not hashed, LinkedIn matches these against its own company graph. LinkedIn recommends 1,000+ companies for a usable match rate and takes up to 48h to process the list. Replace the list later with POST /v1/ads/audiences/{audienceId}/companies. | [optional] |
18
18
  | **pixel_id** | **String** | Required for website audiences | [optional] |
19
19
  | **retention_days** | **Integer** | Required for website (max 180) and meta_engagement (max 365) audiences. | [optional] |
20
20
  | **engagement_source** | **String** | Required for meta_engagement audiences (Meta only): what people engaged with. &#x60;page&#x60; &#x3D; a Facebook Page, &#x60;instagram&#x60; &#x3D; an IG professional account, &#x60;video&#x60; &#x3D; a video. The source object must be eligible for engagement audiences or Meta rejects with subcode 1713151 (\&quot;Invalid Event Name\&quot;), surfaced verbatim. | [optional] |
@@ -20,7 +20,7 @@ module Zernio
20
20
  @api_client = api_client
21
21
  end
22
22
  # Add users to audience
23
- # Upload user data to a customer_list audience. Data is SHA256-hashed server-side before sending to the platform. Email is used on every platform; phone is used on Meta only (other platforms ignore it). On TikTok and Pinterest, the first upload also provisions the audience (deferred create). LinkedIn uploads are full-replace. Max 10,000 users per request.
23
+ # Upload user data to a customer_list audience. Data is SHA256-hashed server-side before sending to the platform. Email is used on every platform; phone is used on Meta only (other platforms ignore it). On TikTok and Pinterest, the first upload also provisions the audience (deferred create). LinkedIn uploads are full-replace. Max 10,000 users per request. customer_list only. A LinkedIn `company_list` audience takes company rows, not people: send those to `POST /v1/ads/audiences/{audienceId}/companies`. This endpoint 422s for every other audience type.
24
24
  # @param audience_id [String]
25
25
  # @param add_users_to_ad_audience_request [AddUsersToAdAudienceRequest]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module Zernio
31
31
  end
32
32
 
33
33
  # Add users to audience
34
- # Upload user data to a customer_list audience. Data is SHA256-hashed server-side before sending to the platform. Email is used on every platform; phone is used on Meta only (other platforms ignore it). On TikTok and Pinterest, the first upload also provisions the audience (deferred create). LinkedIn uploads are full-replace. Max 10,000 users per request.
34
+ # Upload user data to a customer_list audience. Data is SHA256-hashed server-side before sending to the platform. Email is used on every platform; phone is used on Meta only (other platforms ignore it). On TikTok and Pinterest, the first upload also provisions the audience (deferred create). LinkedIn uploads are full-replace. Max 10,000 users per request. customer_list only. A LinkedIn &#x60;company_list&#x60; audience takes company rows, not people: send those to &#x60;POST /v1/ads/audiences/{audienceId}/companies&#x60;. This endpoint 422s for every other audience type.
35
35
  # @param audience_id [String]
36
36
  # @param add_users_to_ad_audience_request [AddUsersToAdAudienceRequest]
37
37
  # @param [Hash] opts the optional parameters
@@ -94,7 +94,7 @@ module Zernio
94
94
  end
95
95
 
96
96
  # Create custom audience
97
- # Create a custom audience. `customer_list` is supported on Meta, Google, X, LinkedIn, TikTok, and Pinterest; `website` and `lookalike` are Meta-only. `saved_targeting` stores a reusable TargetingSpec (no member upload, no adAccountId) that you reference later via `savedTargetingId` on `POST /v1/ads/create`. Upload-backed audiences are created empty, add members via `POST /v1/ads/audiences/{audienceId}/users`. On TikTok and Pinterest the audience is provisioned lazily on the first member upload (until then its status is `pending`). Create is not idempotent, never auto-retry.
97
+ # Create a custom audience. `customer_list` is supported on Meta, Google, X, LinkedIn, TikTok, and Pinterest; `website` and `lookalike` are Meta-only; `company_list`, `engagement` and `website_retargeting` are LinkedIn-only. `saved_targeting` stores a reusable TargetingSpec (no member upload, no adAccountId) that you reference later via `savedTargetingId` on `POST /v1/ads/create`. How the audience gets filled depends on the type: - `customer_list` is created empty. Add members with `POST /v1/ads/audiences/{audienceId}/users`. On TikTok and Pinterest the audience is provisioned lazily on that first upload (until then its status is `pending`). - `company_list` is filled AT CREATION from the `companies` array below, which is required. To change the list afterwards send the new full list to `POST /v1/ads/audiences/{audienceId}/companies` (a replace, not a merge). The `/users` endpoint rejects these audiences with a 422. - `website`, `website_retargeting`, `engagement`, `meta_engagement` and `lookalike` fill themselves from the pixel, engagement source or seed audience you point them at. They take no member upload at all. Create is not idempotent, never auto-retry.
98
98
  # @param create_ad_audience_request [CreateAdAudienceRequest]
99
99
  # @param [Hash] opts the optional parameters
100
100
  # @return [CreateAdAudience201Response]
@@ -104,7 +104,7 @@ module Zernio
104
104
  end
105
105
 
106
106
  # Create custom audience
107
- # Create a custom audience. &#x60;customer_list&#x60; is supported on Meta, Google, X, LinkedIn, TikTok, and Pinterest; &#x60;website&#x60; and &#x60;lookalike&#x60; are Meta-only. &#x60;saved_targeting&#x60; stores a reusable TargetingSpec (no member upload, no adAccountId) that you reference later via &#x60;savedTargetingId&#x60; on &#x60;POST /v1/ads/create&#x60;. Upload-backed audiences are created empty, add members via &#x60;POST /v1/ads/audiences/{audienceId}/users&#x60;. On TikTok and Pinterest the audience is provisioned lazily on the first member upload (until then its status is &#x60;pending&#x60;). Create is not idempotent, never auto-retry.
107
+ # Create a custom audience. &#x60;customer_list&#x60; is supported on Meta, Google, X, LinkedIn, TikTok, and Pinterest; &#x60;website&#x60; and &#x60;lookalike&#x60; are Meta-only; &#x60;company_list&#x60;, &#x60;engagement&#x60; and &#x60;website_retargeting&#x60; are LinkedIn-only. &#x60;saved_targeting&#x60; stores a reusable TargetingSpec (no member upload, no adAccountId) that you reference later via &#x60;savedTargetingId&#x60; on &#x60;POST /v1/ads/create&#x60;. How the audience gets filled depends on the type: - &#x60;customer_list&#x60; is created empty. Add members with &#x60;POST /v1/ads/audiences/{audienceId}/users&#x60;. On TikTok and Pinterest the audience is provisioned lazily on that first upload (until then its status is &#x60;pending&#x60;). - &#x60;company_list&#x60; is filled AT CREATION from the &#x60;companies&#x60; array below, which is required. To change the list afterwards send the new full list to &#x60;POST /v1/ads/audiences/{audienceId}/companies&#x60; (a replace, not a merge). The &#x60;/users&#x60; endpoint rejects these audiences with a 422. - &#x60;website&#x60;, &#x60;website_retargeting&#x60;, &#x60;engagement&#x60;, &#x60;meta_engagement&#x60; and &#x60;lookalike&#x60; fill themselves from the pixel, engagement source or seed audience you point them at. They take no member upload at all. Create is not idempotent, never auto-retry.
108
108
  # @param create_ad_audience_request [CreateAdAudienceRequest]
109
109
  # @param [Hash] opts the optional parameters
110
110
  # @return [Array<(CreateAdAudience201Response, Integer, Hash)>] CreateAdAudience201Response data, response status code and response headers
@@ -372,6 +372,80 @@ module Zernio
372
372
  return data, status_code, headers
373
373
  end
374
374
 
375
+ # Replace audience companies
376
+ # Upload the company rows of a LinkedIn `company_list` audience (account-based marketing). LinkedIn-only, every other platform returns 422. A LinkedIn audience segment holds exactly one uploaded list, so the list you send here REPLACES the segment's list instead of being appended to it: always send the full set of companies. LinkedIn returns only the identifier of the uploaded file, never its rows, so the merge cannot be done for you, keep the source list on your side. LinkedIn does not document how quickly companies dropped from the list stop being targeted, so treat removals as eventual rather than immediate. Rows are plain text (not hashed), matched against LinkedIn's own company graph. Matching is asynchronous: LinkedIn takes up to 48h for a new audience and up to 24h for a later update, and the audience stays `processing` meanwhile. LinkedIn recommends at least 1,000 companies for a usable match rate, and caps a list at 300,000. The initial list is sent with `companies` on `POST /v1/ads/audiences`; this endpoint is for every change after that.
377
+ # @param audience_id [String]
378
+ # @param replace_ad_audience_companies_request [ReplaceAdAudienceCompaniesRequest]
379
+ # @param [Hash] opts the optional parameters
380
+ # @return [ReplaceAdAudienceCompanies200Response]
381
+ def replace_ad_audience_companies(audience_id, replace_ad_audience_companies_request, opts = {})
382
+ data, _status_code, _headers = replace_ad_audience_companies_with_http_info(audience_id, replace_ad_audience_companies_request, opts)
383
+ data
384
+ end
385
+
386
+ # Replace audience companies
387
+ # Upload the company rows of a LinkedIn &#x60;company_list&#x60; audience (account-based marketing). LinkedIn-only, every other platform returns 422. A LinkedIn audience segment holds exactly one uploaded list, so the list you send here REPLACES the segment&#39;s list instead of being appended to it: always send the full set of companies. LinkedIn returns only the identifier of the uploaded file, never its rows, so the merge cannot be done for you, keep the source list on your side. LinkedIn does not document how quickly companies dropped from the list stop being targeted, so treat removals as eventual rather than immediate. Rows are plain text (not hashed), matched against LinkedIn&#39;s own company graph. Matching is asynchronous: LinkedIn takes up to 48h for a new audience and up to 24h for a later update, and the audience stays &#x60;processing&#x60; meanwhile. LinkedIn recommends at least 1,000 companies for a usable match rate, and caps a list at 300,000. The initial list is sent with &#x60;companies&#x60; on &#x60;POST /v1/ads/audiences&#x60;; this endpoint is for every change after that.
388
+ # @param audience_id [String]
389
+ # @param replace_ad_audience_companies_request [ReplaceAdAudienceCompaniesRequest]
390
+ # @param [Hash] opts the optional parameters
391
+ # @return [Array<(ReplaceAdAudienceCompanies200Response, Integer, Hash)>] ReplaceAdAudienceCompanies200Response data, response status code and response headers
392
+ def replace_ad_audience_companies_with_http_info(audience_id, replace_ad_audience_companies_request, opts = {})
393
+ if @api_client.config.debugging
394
+ @api_client.config.logger.debug 'Calling API: AdAudiencesApi.replace_ad_audience_companies ...'
395
+ end
396
+ # verify the required parameter 'audience_id' is set
397
+ if @api_client.config.client_side_validation && audience_id.nil?
398
+ fail ArgumentError, "Missing the required parameter 'audience_id' when calling AdAudiencesApi.replace_ad_audience_companies"
399
+ end
400
+ # verify the required parameter 'replace_ad_audience_companies_request' is set
401
+ if @api_client.config.client_side_validation && replace_ad_audience_companies_request.nil?
402
+ fail ArgumentError, "Missing the required parameter 'replace_ad_audience_companies_request' when calling AdAudiencesApi.replace_ad_audience_companies"
403
+ end
404
+ # resource path
405
+ local_var_path = '/v1/ads/audiences/{audienceId}/companies'.sub('{' + 'audienceId' + '}', CGI.escape(audience_id.to_s))
406
+
407
+ # query parameters
408
+ query_params = opts[:query_params] || {}
409
+
410
+ # header parameters
411
+ header_params = opts[:header_params] || {}
412
+ # HTTP header 'Accept' (if needed)
413
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
414
+ # HTTP header 'Content-Type'
415
+ content_type = @api_client.select_header_content_type(['application/json'])
416
+ if !content_type.nil?
417
+ header_params['Content-Type'] = content_type
418
+ end
419
+
420
+ # form parameters
421
+ form_params = opts[:form_params] || {}
422
+
423
+ # http body (model)
424
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(replace_ad_audience_companies_request)
425
+
426
+ # return_type
427
+ return_type = opts[:debug_return_type] || 'ReplaceAdAudienceCompanies200Response'
428
+
429
+ # auth_names
430
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
431
+
432
+ new_options = opts.merge(
433
+ :operation => :"AdAudiencesApi.replace_ad_audience_companies",
434
+ :header_params => header_params,
435
+ :query_params => query_params,
436
+ :form_params => form_params,
437
+ :body => post_body,
438
+ :auth_names => auth_names,
439
+ :return_type => return_type
440
+ )
441
+
442
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
443
+ if @api_client.config.debugging
444
+ @api_client.config.logger.debug "API called: AdAudiencesApi#replace_ad_audience_companies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
445
+ end
446
+ return data, status_code, headers
447
+ end
448
+
375
449
  # Update an audience
376
450
  # Update an audience. `saved_targeting` audiences accept `name`, `description`, and `spec` (full replacement, no merge, Zernio-only, no platform call). Platform audiences (uploaded/website/lookalike) accept `name` and `description` only, updated on the platform first and then mirrored locally; their rules are immutable, so `spec` returns 400 for them. Platform audience updates are Meta-only for now (other platforms return 501). Ads already created from a saved_targeting audience are unaffected, they snapshot the targeting at creation.
377
451
  # @param audience_id [String]
@@ -932,7 +932,7 @@ module Zernio
932
932
  end
933
933
 
934
934
  # Send message
935
- # Send a message in a conversation. Supports text, attachments, quick replies, buttons, templates, and message tags. Attachment and interactive message support varies by platform. WhatsApp template messages: to send an approved template into this conversation (required when the 24-hour customer-service window is closed), use the `template` field with a single element carrying the template reference: `{ \"elements\": [{ \"name\": ..., \"language\": ..., \"components\": [...] }] }`. See the `template` field below for the exact shape. To send a template to a phone number you have no conversation with yet, use the create-conversation endpoint (POST /v1/inbox/conversations) instead. WhatsApp rich interactive messages (list, CTA URL, Flow, location request) are available via the `interactive` field. Tap events are delivered through the `message.received` webhook with WhatsApp-specific `metadata` fields (`interactiveType`, `interactiveId`, `flowResponseJson`, `flowResponseData`). **Idempotency:** send an `Idempotency-Key` header to make retries safe (e.g. after a client-side timeout where delivery is unknown): same key + same body replays the original response (with `Idempotent-Replayed: true`) instead of sending the message a second time; same key + different body returns 422; a key still in flight returns 409. Works for JSON and multipart (file upload) requests alike. Keys are retained for 24 hours.
935
+ # Send a message in a conversation. Supports text, attachments, quick replies, buttons, templates, and message tags. Attachment and interactive message support varies by platform. WhatsApp template messages: to send an approved template into this conversation (required when the 24-hour customer-service window is closed), use the `template` field with a single element carrying the template reference: `{ \"elements\": [{ \"name\": ..., \"language\": ..., \"components\": [...] }] }`. See the `template` field below for the exact shape. To send a template to a phone number you have no conversation with yet, use the create-conversation endpoint (POST /v1/inbox/conversations) instead. WhatsApp rich interactive messages (list, CTA URL, Flow, location request) are available via the `interactive` field. Tap events are delivered through the `message.received` webhook with WhatsApp-specific `metadata` fields (`interactiveType`, `interactiveId`, `flowResponseJson`, `flowResponseData`). **Idempotency:** send an `Idempotency-Key` header to make retries safe (e.g. after a client-side timeout where delivery is unknown): same key + same body replays the original response (with `Idempotent-Replayed: true`) instead of sending the message a second time; same key + different body returns 422; a key still in flight returns 409. Works for JSON and multipart (file upload) requests alike. Keys are retained for 24 hours. Only successful (2xx) responses are stored for replay: if the request throws or returns a non-2xx status, the key is released so the same key can be retried once the problem is fixed. The header therefore protects the \"request succeeded but the response was lost\" case. For an ambiguous failure (a 5xx or a network timeout), reconcile before retrying: a failure after the platform already accepted the message also releases the key, and a blind retry could send it twice. List the conversation's messages first, and treat an empty result as inconclusive rather than as proof nothing was sent, since a send that failed while being recorded leaves no trace on our side.
936
936
  # @param conversation_id [String] Opaque conversation identifier, accepted verbatim from the list endpoint or from the conversationId on inbox webhooks. Format not to be assumed.
937
937
  # @param send_inbox_message_request [SendInboxMessageRequest]
938
938
  # @param [Hash] opts the optional parameters
@@ -944,7 +944,7 @@ module Zernio
944
944
  end
945
945
 
946
946
  # Send message
947
- # Send a message in a conversation. Supports text, attachments, quick replies, buttons, templates, and message tags. Attachment and interactive message support varies by platform. WhatsApp template messages: to send an approved template into this conversation (required when the 24-hour customer-service window is closed), use the &#x60;template&#x60; field with a single element carrying the template reference: &#x60;{ \&quot;elements\&quot;: [{ \&quot;name\&quot;: ..., \&quot;language\&quot;: ..., \&quot;components\&quot;: [...] }] }&#x60;. See the &#x60;template&#x60; field below for the exact shape. To send a template to a phone number you have no conversation with yet, use the create-conversation endpoint (POST /v1/inbox/conversations) instead. WhatsApp rich interactive messages (list, CTA URL, Flow, location request) are available via the &#x60;interactive&#x60; field. Tap events are delivered through the &#x60;message.received&#x60; webhook with WhatsApp-specific &#x60;metadata&#x60; fields (&#x60;interactiveType&#x60;, &#x60;interactiveId&#x60;, &#x60;flowResponseJson&#x60;, &#x60;flowResponseData&#x60;). **Idempotency:** send an &#x60;Idempotency-Key&#x60; header to make retries safe (e.g. after a client-side timeout where delivery is unknown): same key + same body replays the original response (with &#x60;Idempotent-Replayed: true&#x60;) instead of sending the message a second time; same key + different body returns 422; a key still in flight returns 409. Works for JSON and multipart (file upload) requests alike. Keys are retained for 24 hours.
947
+ # Send a message in a conversation. Supports text, attachments, quick replies, buttons, templates, and message tags. Attachment and interactive message support varies by platform. WhatsApp template messages: to send an approved template into this conversation (required when the 24-hour customer-service window is closed), use the &#x60;template&#x60; field with a single element carrying the template reference: &#x60;{ \&quot;elements\&quot;: [{ \&quot;name\&quot;: ..., \&quot;language\&quot;: ..., \&quot;components\&quot;: [...] }] }&#x60;. See the &#x60;template&#x60; field below for the exact shape. To send a template to a phone number you have no conversation with yet, use the create-conversation endpoint (POST /v1/inbox/conversations) instead. WhatsApp rich interactive messages (list, CTA URL, Flow, location request) are available via the &#x60;interactive&#x60; field. Tap events are delivered through the &#x60;message.received&#x60; webhook with WhatsApp-specific &#x60;metadata&#x60; fields (&#x60;interactiveType&#x60;, &#x60;interactiveId&#x60;, &#x60;flowResponseJson&#x60;, &#x60;flowResponseData&#x60;). **Idempotency:** send an &#x60;Idempotency-Key&#x60; header to make retries safe (e.g. after a client-side timeout where delivery is unknown): same key + same body replays the original response (with &#x60;Idempotent-Replayed: true&#x60;) instead of sending the message a second time; same key + different body returns 422; a key still in flight returns 409. Works for JSON and multipart (file upload) requests alike. Keys are retained for 24 hours. Only successful (2xx) responses are stored for replay: if the request throws or returns a non-2xx status, the key is released so the same key can be retried once the problem is fixed. The header therefore protects the \&quot;request succeeded but the response was lost\&quot; case. For an ambiguous failure (a 5xx or a network timeout), reconcile before retrying: a failure after the platform already accepted the message also releases the key, and a blind retry could send it twice. List the conversation&#39;s messages first, and treat an empty result as inconclusive rather than as proof nothing was sent, since a send that failed while being recorded leaves no trace on our side.
948
948
  # @param conversation_id [String] Opaque conversation identifier, accepted verbatim from the list endpoint or from the conversationId on inbox webhooks. Format not to be assumed.
949
949
  # @param send_inbox_message_request [SendInboxMessageRequest]
950
950
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,157 @@
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 ReplaceAdAudienceCompanies200Response < ApiModelBase
18
+ attr_accessor :message
19
+
20
+ # Rows sent to LinkedIn. Matching happens asynchronously, so this is not the matched company count.
21
+ attr_accessor :num_received
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'message' => :'message',
27
+ :'num_received' => :'numReceived'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'message' => :'String',
45
+ :'num_received' => :'Integer'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ReplaceAdAudienceCompanies200Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ReplaceAdAudienceCompanies200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'message')
72
+ self.message = attributes[:'message']
73
+ end
74
+
75
+ if attributes.key?(:'num_received')
76
+ self.num_received = attributes[:'num_received']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ message == o.message &&
101
+ num_received == o.num_received
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [message, num_received].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end