zernio-sdk 0.0.640 → 0.0.641

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2ff64886fade33da5f06b2722230cf5a5d4f9b97fa5aab2a3542af309da9e9a
4
- data.tar.gz: b140b0baddf19da2fe102072b60191588760831c527ff631fb43348bf496a005
3
+ metadata.gz: f8c73c4cb609a753750e3b8d13c8f072b9b2f6da9d3c76b6772eaedb5bc9ac9b
4
+ data.tar.gz: 310d98201701f94956e31dc16da969f57fa1a003ff14f613d1590a262b2a00f5
5
5
  SHA512:
6
- metadata.gz: 2c1445a899d6889cc4bf7ae6641ede8e3c83abbf20631426e42198b8593c8a28be2c55cd66f6e05fb92bea5fb18e3d1a8a1749f6229f96ec0babe77c60af4e2b
7
- data.tar.gz: 93683bfed0fcf62cfc073a2883e3c45e7b232963853b865c3c0daed0666162ddf3446263bef8f6ea86cbb52381278e213dc02ce5908e07a0021655cb04de54b4
6
+ metadata.gz: e6b8819fb67b0bf3d77ac4e6d70366cb3232ddcccc64e6f0d64bb4b1ee9a6da0381aee263ab90882af84b63917bce298ca2146ea1f84879bbfd8b011eebf2ca2
7
+ data.tar.gz: 064d0d397afebc5161e0d842f6f6864067d149791edf9933d69abc91ee1dcb1b8a45f7dab329793b365bed6a1fa6b86c918d36057e60640c04410732a43cd690
@@ -7,9 +7,10 @@
7
7
  | **account_id** | **String** | The social account ID to send from | |
8
8
  | **participant_id** | **String** | Recipient identifier. For X this is the numeric user ID; for WhatsApp, the recipient phone number in international format (digits, country code included). Provide either this or participantUsername. | [optional] |
9
9
  | **participant_username** | **String** | Recipient handle/username — an X or Bluesky handle (with or without @) or a Reddit username (with or without u/). Resolved via lookup. Provide either this or participantId. | [optional] |
10
- | **message** | **String** | Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required. | [optional] |
10
+ | **message** | **String** | Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required. Required when category is set (a Direct Send utility message is a text message). | [optional] |
11
11
  | **skip_dm_check** | **Boolean** | X/Twitter only. Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs. | [optional][default to false] |
12
- | **template_name** | **String** | WhatsApp only. Name of the approved template to start the conversation with (required for WhatsApp). | [optional] |
12
+ | **template_name** | **String** | WhatsApp only. Name of the approved template to start the conversation with. Required for WhatsApp unless category is used instead (Direct Send). Cannot be combined with category. | [optional] |
13
+ | **category** | **String** | WhatsApp only (Meta Direct Send). Combined with message and without templateName, starts the conversation with a business-initiated UTILITY message and no pre-approved template; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Cannot be combined with templateName (templates are already categorized at creation). Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests. | [optional] |
13
14
  | **template_language** | **String** | WhatsApp only. Template language code (e.g. en_US). | [optional] |
14
15
  | **template_params** | **Array<String>** | WhatsApp only. Template variable values as one flat array, in the order the variables appear across the whole template: text-header variables first, then body variables, then one value per dynamic URL button (in button order). Works with positional placeholders ({{1}}, {{2}}, ...) and with named placeholders ({{name}}, {{company}} - how Meta Business Manager creates templates), where values fill the named slots in order of appearance. Example - a body with {{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values: [body1, body2, buttonSuffix]. Media headers (image, video, document) are filled automatically from the approved template and take no value here (use headerMedia to override the header asset per send). | [optional] |
15
16
  | **header_media** | [**CreateInboxConversationRequestHeaderMedia**](CreateInboxConversationRequestHeaderMedia.md) | | [optional] |
@@ -26,6 +27,7 @@ instance = Zernio::CreateInboxConversationRequest.new(
26
27
  message: null,
27
28
  skip_dm_check: null,
28
29
  template_name: null,
30
+ category: null,
29
31
  template_language: null,
30
32
  template_params: null,
31
33
  header_media: null
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **cost_type** | **String** | Campaign cost model (billing event). Defaults to `CPM`. Required when `unitCost` is set so the manual bid applies to an explicit cost model. | [optional] |
8
8
  | **unit_cost** | **Float** | Manual bid in WHOLE account-currency units (e.g. 2.5 = $2.50). Requires `costType`. Omit for LinkedIn's automated (max delivery) bidding. LinkedIn enforces its own per-audience min/max bid bounds. | [optional] |
9
- | **optimization_target_type** | **String** | Campaign `optimizationTargetType` (e.g. `MAX_CLICK`, `TARGET_COST_PER_CLICK`, `MAX_IMPRESSION`). Forwarded verbatim LinkedIn validates compatibility with the objective and `costType`. Omit for the objective-derived default. | [optional] |
9
+ | **optimization_target_type** | **String** | Campaign `optimizationTargetType` (e.g. `MAX_CLICK`, `TARGET_COST_PER_CLICK`, `MAX_IMPRESSION`). Forwarded verbatim, LinkedIn validates compatibility with the objective and `costType`. Omit for the objective-derived default: `awareness` gets `MAX_IMPRESSION`, `video_views` gets `MAX_VIDEO_VIEW`, and every other goal gets `MAX_CLICK`. `lead_generation` and `conversions` also get `MAX_CLICK`, because `MAX_LEAD` and `MAX_CONVERSION` need a lead gen form or a conversion rule that neither creation flow attaches. The default applies only to `SPONSORED_UPDATES` campaigns (every boost, and the image, video and carousel standalone ads), never to the `TEXT_AD`, `DYNAMIC` and `SPONSORED_INMAILS` campaigns the other creative formats produce. It is also skipped when `unitCost` or a non-`CPM` `costType` is set, since those select manual bidding and the bid is then yours to choose. | [optional] |
10
10
  | **creative_selection** | **String** | How LinkedIn rotates creatives within the campaign. Defaults to `OPTIMIZED`. | [optional] |
11
11
  | **audience_expansion_enabled** | **Boolean** | Enable LinkedIn audience expansion. Defaults to false. | [optional] |
12
12
  | **offsite_delivery_enabled** | **Boolean** | Deliver on the LinkedIn Audience Network. Defaults to false. | [optional] |
data/docs/MessagesApi.md CHANGED
@@ -99,7 +99,7 @@ end
99
99
 
100
100
  Create conversation
101
101
 
102
- Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
102
+ Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
103
103
 
104
104
  ### Examples
105
105
 
@@ -7,6 +7,7 @@
7
7
  | **account_id** | **String** | Social account ID | |
8
8
  | **message** | **String** | Message text | [optional] |
9
9
  | **attachment_url** | **String** | URL of the attachment to send (image, video, audio, or file). The URL must be publicly accessible. For binary file uploads, use multipart/form-data instead. | [optional] |
10
+ | **category** | **String** | WhatsApp only (Meta Direct Send). Sends this message as a business-initiated UTILITY message without an approved template, for example outside the 24-hour customer service window; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Supported only for text messages (link preview ok) and interactive messages (reply buttons, CTA URL buttons, voice-call button, header of text/image/video/document). Cannot be combined with template, attachments, location, or contacts. Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests. | [optional] |
10
11
  | **attachment_type** | **String** | Type of attachment. Defaults to file if not specified. | [optional] |
11
12
  | **attachment_name** | **String** | WhatsApp only. Display name for a document sent via attachmentUrl with attachmentType: file (e.g. \"Report.pdf\"). Maps to the recipient's file name; without it WhatsApp derives the name from the URL and shows \"Untitled\". Ignored for image/video/audio and for binary uploads (which use the uploaded file's name). | [optional] |
12
13
  | **voice_note** | **Boolean** | WhatsApp only. When `true` on an audio attachment, the message is sent as a voice message (PTT) — the recipient sees the waveform + voice-note UI instead of a basic audio attachment. The audio file MUST be `.ogg` encoded with the OPUS codec (mono) per Meta's voice-message contract; other formats are rejected by WhatsApp. Ignored for non-audio attachments. | [optional] |
@@ -30,6 +31,7 @@ instance = Zernio::SendInboxMessageRequest.new(
30
31
  account_id: null,
31
32
  message: null,
32
33
  attachment_url: null,
34
+ category: null,
33
35
  attachment_type: null,
34
36
  attachment_name: null,
35
37
  voice_note: null,
@@ -100,7 +100,7 @@ module Zernio
100
100
  end
101
101
 
102
102
  # Create conversation
103
- # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
103
+ # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
104
104
  # @param create_inbox_conversation_request [CreateInboxConversationRequest]
105
105
  # @param [Hash] opts the optional parameters
106
106
  # @return [CreateInboxConversation201Response]
@@ -110,7 +110,7 @@ module Zernio
110
110
  end
111
111
 
112
112
  # Create conversation
113
- # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
113
+ # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
114
114
  # @param create_inbox_conversation_request [CreateInboxConversationRequest]
115
115
  # @param [Hash] opts the optional parameters
116
116
  # @return [Array<(CreateInboxConversation201Response, Integer, Hash)>] CreateInboxConversation201Response data, response status code and response headers
@@ -24,15 +24,18 @@ module Zernio
24
24
  # Recipient handle/username — an X or Bluesky handle (with or without @) or a Reddit username (with or without u/). Resolved via lookup. Provide either this or participantId.
25
25
  attr_accessor :participant_username
26
26
 
27
- # Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required.
27
+ # Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required. Required when category is set (a Direct Send utility message is a text message).
28
28
  attr_accessor :message
29
29
 
30
30
  # X/Twitter only. Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
31
31
  attr_accessor :skip_dm_check
32
32
 
33
- # WhatsApp only. Name of the approved template to start the conversation with (required for WhatsApp).
33
+ # WhatsApp only. Name of the approved template to start the conversation with. Required for WhatsApp unless category is used instead (Direct Send). Cannot be combined with category.
34
34
  attr_accessor :template_name
35
35
 
36
+ # WhatsApp only (Meta Direct Send). Combined with message and without templateName, starts the conversation with a business-initiated UTILITY message and no pre-approved template; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Cannot be combined with templateName (templates are already categorized at creation). Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests.
37
+ attr_accessor :category
38
+
36
39
  # WhatsApp only. Template language code (e.g. en_US).
37
40
  attr_accessor :template_language
38
41
 
@@ -41,6 +44,28 @@ module Zernio
41
44
 
42
45
  attr_accessor :header_media
43
46
 
47
+ class EnumAttributeValidator
48
+ attr_reader :datatype
49
+ attr_reader :allowable_values
50
+
51
+ def initialize(datatype, allowable_values)
52
+ @allowable_values = allowable_values.map do |value|
53
+ case datatype.to_s
54
+ when /Integer/i
55
+ value.to_i
56
+ when /Float/i
57
+ value.to_f
58
+ else
59
+ value
60
+ end
61
+ end
62
+ end
63
+
64
+ def valid?(value)
65
+ !value || allowable_values.include?(value)
66
+ end
67
+ end
68
+
44
69
  # Attribute mapping from ruby-style variable name to JSON key.
45
70
  def self.attribute_map
46
71
  {
@@ -50,6 +75,7 @@ module Zernio
50
75
  :'message' => :'message',
51
76
  :'skip_dm_check' => :'skipDmCheck',
52
77
  :'template_name' => :'templateName',
78
+ :'category' => :'category',
53
79
  :'template_language' => :'templateLanguage',
54
80
  :'template_params' => :'templateParams',
55
81
  :'header_media' => :'headerMedia'
@@ -75,6 +101,7 @@ module Zernio
75
101
  :'message' => :'String',
76
102
  :'skip_dm_check' => :'Boolean',
77
103
  :'template_name' => :'String',
104
+ :'category' => :'String',
78
105
  :'template_language' => :'String',
79
106
  :'template_params' => :'Array<String>',
80
107
  :'header_media' => :'CreateInboxConversationRequestHeaderMedia'
@@ -131,6 +158,10 @@ module Zernio
131
158
  self.template_name = attributes[:'template_name']
132
159
  end
133
160
 
161
+ if attributes.key?(:'category')
162
+ self.category = attributes[:'category']
163
+ end
164
+
134
165
  if attributes.key?(:'template_language')
135
166
  self.template_language = attributes[:'template_language']
136
167
  end
@@ -163,6 +194,8 @@ module Zernio
163
194
  def valid?
164
195
  warn '[DEPRECATED] the `valid?` method is obsolete'
165
196
  return false if @account_id.nil?
197
+ category_validator = EnumAttributeValidator.new('String', ["utility"])
198
+ return false unless category_validator.valid?(@category)
166
199
  true
167
200
  end
168
201
 
@@ -176,6 +209,16 @@ module Zernio
176
209
  @account_id = account_id
177
210
  end
178
211
 
212
+ # Custom attribute writer method checking allowed values (enum).
213
+ # @param [Object] category Object to be assigned
214
+ def category=(category)
215
+ validator = EnumAttributeValidator.new('String', ["utility"])
216
+ unless validator.valid?(category)
217
+ fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}."
218
+ end
219
+ @category = category
220
+ end
221
+
179
222
  # Checks equality by comparing each attribute.
180
223
  # @param [Object] Object to be compared
181
224
  def ==(o)
@@ -187,6 +230,7 @@ module Zernio
187
230
  message == o.message &&
188
231
  skip_dm_check == o.skip_dm_check &&
189
232
  template_name == o.template_name &&
233
+ category == o.category &&
190
234
  template_language == o.template_language &&
191
235
  template_params == o.template_params &&
192
236
  header_media == o.header_media
@@ -201,7 +245,7 @@ module Zernio
201
245
  # Calculates hash code according to all attributes.
202
246
  # @return [Integer] Hash code
203
247
  def hash
204
- [account_id, participant_id, participant_username, message, skip_dm_check, template_name, template_language, template_params, header_media].hash
248
+ [account_id, participant_id, participant_username, message, skip_dm_check, template_name, category, template_language, template_params, header_media].hash
205
249
  end
206
250
 
207
251
  # Builds the object from hash
@@ -22,7 +22,7 @@ module Zernio
22
22
  # Manual bid in WHOLE account-currency units (e.g. 2.5 = $2.50). Requires `costType`. Omit for LinkedIn's automated (max delivery) bidding. LinkedIn enforces its own per-audience min/max bid bounds.
23
23
  attr_accessor :unit_cost
24
24
 
25
- # Campaign `optimizationTargetType` (e.g. `MAX_CLICK`, `TARGET_COST_PER_CLICK`, `MAX_IMPRESSION`). Forwarded verbatim LinkedIn validates compatibility with the objective and `costType`. Omit for the objective-derived default.
25
+ # Campaign `optimizationTargetType` (e.g. `MAX_CLICK`, `TARGET_COST_PER_CLICK`, `MAX_IMPRESSION`). Forwarded verbatim, LinkedIn validates compatibility with the objective and `costType`. Omit for the objective-derived default: `awareness` gets `MAX_IMPRESSION`, `video_views` gets `MAX_VIDEO_VIEW`, and every other goal gets `MAX_CLICK`. `lead_generation` and `conversions` also get `MAX_CLICK`, because `MAX_LEAD` and `MAX_CONVERSION` need a lead gen form or a conversion rule that neither creation flow attaches. The default applies only to `SPONSORED_UPDATES` campaigns (every boost, and the image, video and carousel standalone ads), never to the `TEXT_AD`, `DYNAMIC` and `SPONSORED_INMAILS` campaigns the other creative formats produce. It is also skipped when `unitCost` or a non-`CPM` `costType` is set, since those select manual bidding and the bid is then yours to choose.
26
26
  attr_accessor :optimization_target_type
27
27
 
28
28
  # How LinkedIn rotates creatives within the campaign. Defaults to `OPTIMIZED`.
@@ -24,6 +24,9 @@ module Zernio
24
24
  # URL of the attachment to send (image, video, audio, or file). The URL must be publicly accessible. For binary file uploads, use multipart/form-data instead.
25
25
  attr_accessor :attachment_url
26
26
 
27
+ # WhatsApp only (Meta Direct Send). Sends this message as a business-initiated UTILITY message without an approved template, for example outside the 24-hour customer service window; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Supported only for text messages (link preview ok) and interactive messages (reply buttons, CTA URL buttons, voice-call button, header of text/image/video/document). Cannot be combined with template, attachments, location, or contacts. Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests.
28
+ attr_accessor :category
29
+
27
30
  # Type of attachment. Defaults to file if not specified.
28
31
  attr_accessor :attachment_type
29
32
 
@@ -87,6 +90,7 @@ module Zernio
87
90
  :'account_id' => :'accountId',
88
91
  :'message' => :'message',
89
92
  :'attachment_url' => :'attachmentUrl',
93
+ :'category' => :'category',
90
94
  :'attachment_type' => :'attachmentType',
91
95
  :'attachment_name' => :'attachmentName',
92
96
  :'voice_note' => :'voiceNote',
@@ -119,6 +123,7 @@ module Zernio
119
123
  :'account_id' => :'String',
120
124
  :'message' => :'String',
121
125
  :'attachment_url' => :'String',
126
+ :'category' => :'String',
122
127
  :'attachment_type' => :'String',
123
128
  :'attachment_name' => :'String',
124
129
  :'voice_note' => :'Boolean',
@@ -171,6 +176,10 @@ module Zernio
171
176
  self.attachment_url = attributes[:'attachment_url']
172
177
  end
173
178
 
179
+ if attributes.key?(:'category')
180
+ self.category = attributes[:'category']
181
+ end
182
+
174
183
  if attributes.key?(:'attachment_type')
175
184
  self.attachment_type = attributes[:'attachment_type']
176
185
  end
@@ -255,6 +264,8 @@ module Zernio
255
264
  def valid?
256
265
  warn '[DEPRECATED] the `valid?` method is obsolete'
257
266
  return false if @account_id.nil?
267
+ category_validator = EnumAttributeValidator.new('String', ["utility"])
268
+ return false unless category_validator.valid?(@category)
258
269
  attachment_type_validator = EnumAttributeValidator.new('String', ["image", "video", "audio", "file"])
259
270
  return false unless attachment_type_validator.valid?(@attachment_type)
260
271
  return false if !@quick_replies.nil? && @quick_replies.length > 13
@@ -276,6 +287,16 @@ module Zernio
276
287
  @account_id = account_id
277
288
  end
278
289
 
290
+ # Custom attribute writer method checking allowed values (enum).
291
+ # @param [Object] category Object to be assigned
292
+ def category=(category)
293
+ validator = EnumAttributeValidator.new('String', ["utility"])
294
+ unless validator.valid?(category)
295
+ fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}."
296
+ end
297
+ @category = category
298
+ end
299
+
279
300
  # Custom attribute writer method checking allowed values (enum).
280
301
  # @param [Object] attachment_type Object to be assigned
281
302
  def attachment_type=(attachment_type)
@@ -342,6 +363,7 @@ module Zernio
342
363
  account_id == o.account_id &&
343
364
  message == o.message &&
344
365
  attachment_url == o.attachment_url &&
366
+ category == o.category &&
345
367
  attachment_type == o.attachment_type &&
346
368
  attachment_name == o.attachment_name &&
347
369
  voice_note == o.voice_note &&
@@ -366,7 +388,7 @@ module Zernio
366
388
  # Calculates hash code according to all attributes.
367
389
  # @return [Integer] Hash code
368
390
  def hash
369
- [account_id, message, attachment_url, attachment_type, attachment_name, voice_note, quick_replies, buttons, template, interactive, reply_markup, messaging_type, message_tag, reply_to, location, contacts].hash
391
+ [account_id, message, attachment_url, category, attachment_type, attachment_name, voice_note, quick_replies, buttons, template, interactive, reply_markup, messaging_type, message_tag, reply_to, location, contacts].hash
370
392
  end
371
393
 
372
394
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.640'
14
+ VERSION = '0.0.641'
15
15
  end
data/openapi.yaml CHANGED
@@ -4714,8 +4714,17 @@ components:
4714
4714
  type: string
4715
4715
  description: |
4716
4716
  Campaign `optimizationTargetType` (e.g. `MAX_CLICK`, `TARGET_COST_PER_CLICK`,
4717
- `MAX_IMPRESSION`). Forwarded verbatim LinkedIn validates compatibility with
4718
- the objective and `costType`. Omit for the objective-derived default.
4717
+ `MAX_IMPRESSION`). Forwarded verbatim, LinkedIn validates compatibility with
4718
+ the objective and `costType`. Omit for the objective-derived default:
4719
+ `awareness` gets `MAX_IMPRESSION`, `video_views` gets `MAX_VIDEO_VIEW`, and
4720
+ every other goal gets `MAX_CLICK`. `lead_generation` and `conversions` also
4721
+ get `MAX_CLICK`, because `MAX_LEAD` and `MAX_CONVERSION` need a lead gen form
4722
+ or a conversion rule that neither creation flow attaches. The default applies
4723
+ only to `SPONSORED_UPDATES` campaigns (every boost, and the image, video and
4724
+ carousel standalone ads), never to the `TEXT_AD`, `DYNAMIC` and
4725
+ `SPONSORED_INMAILS` campaigns the other creative formats produce. It is also
4726
+ skipped when `unitCost` or a non-`CPM` `costType` is set, since those select
4727
+ manual bidding and the bid is then yours to choose.
4719
4728
  creativeSelection:
4720
4729
  type: string
4721
4730
  enum: [OPTIMIZED, ROUND_ROBIN]
@@ -22662,7 +22671,7 @@ paths:
22662
22671
 
22663
22672
  Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED.
22664
22673
 
22665
- WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests.
22674
+ WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below.
22666
22675
 
22667
22676
  DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility.
22668
22677
 
@@ -22690,14 +22699,28 @@ paths:
22690
22699
  description: Recipient handle/username — an X or Bluesky handle (with or without @) or a Reddit username (with or without u/). Resolved via lookup. Provide either this or participantId.
22691
22700
  message:
22692
22701
  type: string
22693
- description: Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required.
22702
+ description: 'Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required. Required when category is set (a Direct Send utility message is a text message).'
22694
22703
  skipDmCheck:
22695
22704
  type: boolean
22696
22705
  default: false
22697
22706
  description: X/Twitter only. Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
22698
22707
  templateName:
22699
22708
  type: string
22700
- description: WhatsApp only. Name of the approved template to start the conversation with (required for WhatsApp).
22709
+ description: 'WhatsApp only. Name of the approved template to start the conversation with. Required for WhatsApp unless category is used instead (Direct Send). Cannot be combined with category.'
22710
+ category:
22711
+ type: string
22712
+ enum: [utility]
22713
+ description: >-
22714
+ WhatsApp only (Meta Direct Send). Combined with message and without
22715
+ templateName, starts the conversation with a business-initiated
22716
+ UTILITY message and no pre-approved template; Meta matches or
22717
+ auto-creates a template asynchronously. The WhatsApp Business
22718
+ Account must be eligible for Direct Send, otherwise the send fails
22719
+ with an error telling you to use an approved message template
22720
+ instead. Cannot be combined with templateName (templates are
22721
+ already categorized at creation). Utility messages only; marketing
22722
+ content is not allowed under this category. Accepted on the JSON
22723
+ body only, not on multipart requests.
22701
22724
  templateLanguage:
22702
22725
  type: string
22703
22726
  description: WhatsApp only. Template language code (e.g. en_US).
@@ -22791,7 +22814,7 @@ paths:
22791
22814
  type: [string, "null"]
22792
22815
  description: Twitter username of the recipient
22793
22816
  '400':
22794
- description: Validation error or platform not supported
22817
+ description: 'Validation error, platform not supported, category combined with templateName or used on a non-WhatsApp account, or the WhatsApp Business Account is not eligible for Direct Send'
22795
22818
  content:
22796
22819
  application/json:
22797
22820
  schema:
@@ -23295,6 +23318,23 @@ paths:
23295
23318
  accountId: { type: string, description: Social account ID }
23296
23319
  message: { type: string, description: Message text }
23297
23320
  attachmentUrl: { type: string, description: "URL of the attachment to send (image, video, audio, or file). The URL must be publicly accessible. For binary file uploads, use multipart/form-data instead." }
23321
+ category:
23322
+ type: string
23323
+ enum: [utility]
23324
+ description: >-
23325
+ WhatsApp only (Meta Direct Send). Sends this message as a
23326
+ business-initiated UTILITY message without an approved template,
23327
+ for example outside the 24-hour customer service window; Meta
23328
+ matches or auto-creates a template asynchronously. The WhatsApp
23329
+ Business Account must be eligible for Direct Send, otherwise the
23330
+ send fails with an error telling you to use an approved message
23331
+ template instead. Supported only for text messages (link preview
23332
+ ok) and interactive messages (reply buttons, CTA URL buttons,
23333
+ voice-call button, header of text/image/video/document). Cannot
23334
+ be combined with template, attachments, location, or contacts.
23335
+ Utility messages only; marketing content is not allowed under
23336
+ this category. Accepted on the JSON body only, not on multipart
23337
+ requests.
23298
23338
  attachmentType:
23299
23339
  type: string
23300
23340
  enum: [image, video, audio, file]
@@ -23747,7 +23787,7 @@ paths:
23747
23787
  sentAt: { type: [string, "null"], format: date-time, description: Bluesky sent timestamp }
23748
23788
  message: { type: [string, "null"], description: Success message (Reddit only) }
23749
23789
  '400':
23750
- description: Bad request (e.g., attachment not supported for platform, validation error)
23790
+ description: 'Bad request (e.g., attachment not supported for platform, validation error, category combined with a template or attachment, category used on a non-WhatsApp account, or the WhatsApp Business Account is not eligible for Direct Send)'
23751
23791
  content:
23752
23792
  application/json:
23753
23793
  schema:
@@ -48,7 +48,7 @@ describe 'MessagesApi' do
48
48
 
49
49
  # unit tests for create_inbox_conversation
50
50
  # Create conversation
51
- # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template&#39;s approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X&#39;s DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta&#39;s per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
51
+ # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template&#39;s approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: &#39;utility&#39; together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X&#39;s DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta&#39;s per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
52
52
  # @param create_inbox_conversation_request
53
53
  # @param [Hash] opts the optional parameters
54
54
  # @return [CreateInboxConversation201Response]
@@ -63,6 +63,16 @@ describe Zernio::CreateInboxConversationRequest do
63
63
  end
64
64
  end
65
65
 
66
+ describe 'test attribute "category"' do
67
+ it 'should work' do
68
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
69
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["utility"])
70
+ # validator.allowable_values.each do |value|
71
+ # expect { instance.category = value }.not_to raise_error
72
+ # end
73
+ end
74
+ end
75
+
66
76
  describe 'test attribute "template_language"' do
67
77
  it 'should work' do
68
78
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -45,6 +45,16 @@ describe Zernio::SendInboxMessageRequest do
45
45
  end
46
46
  end
47
47
 
48
+ describe 'test attribute "category"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["utility"])
52
+ # validator.allowable_values.each do |value|
53
+ # expect { instance.category = value }.not_to raise_error
54
+ # end
55
+ end
56
+ end
57
+
48
58
  describe 'test attribute "attachment_type"' do
49
59
  it 'should work' do
50
60
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zernio-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.640
4
+ version: 0.0.641
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator