late-sdk 0.0.665 → 0.0.666

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/docs/SendInboxMessageRequestInteractiveAction.md +3 -1
  4. data/docs/SendInboxMessageRequestInteractiveActionOneOf5.md +2 -4
  5. data/docs/SendInboxMessageRequestInteractiveActionOneOf6.md +2 -2
  6. data/docs/SendInboxMessageRequestInteractiveActionOneOf7.md +4 -4
  7. data/docs/{SendInboxMessageRequestInteractiveActionOneOf6SectionsInner.md → SendInboxMessageRequestInteractiveActionOneOf7SectionsInner.md} +3 -3
  8. data/docs/{SendInboxMessageRequestInteractiveActionOneOf6SectionsInnerProductItemsInner.md → SendInboxMessageRequestInteractiveActionOneOf7SectionsInnerProductItemsInner.md} +2 -2
  9. data/docs/SendInboxMessageRequestInteractiveActionOneOf8.md +4 -2
  10. data/docs/{SendInboxMessageRequestInteractiveActionOneOf7Parameters.md → SendInboxMessageRequestInteractiveActionOneOf8Parameters.md} +2 -2
  11. data/docs/SendInboxMessageRequestInteractiveActionOneOf9.md +18 -0
  12. data/docs/{SendInboxMessageRequestInteractiveActionOneOf8CardsInner.md → SendInboxMessageRequestInteractiveActionOneOf9CardsInner.md} +2 -2
  13. data/docs/WebhookPayloadMessageMetadata.md +4 -0
  14. data/lib/zernio-sdk/models/send_inbox_message_request_interactive.rb +3 -3
  15. data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action.rb +2 -1
  16. data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of5.rb +42 -46
  17. data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of6.rb +18 -38
  18. data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of7.rb +64 -49
  19. data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner.rb} +4 -4
  20. data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner_product_items_inner.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner_product_items_inner.rb} +3 -3
  21. data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of8.rb +52 -39
  22. data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of7_parameters.rb → send_inbox_message_request_interactive_action_one_of8_parameters.rb} +3 -3
  23. data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of9.rb +185 -0
  24. data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of8_cards_inner.rb → send_inbox_message_request_interactive_action_one_of9_cards_inner.rb} +3 -3
  25. data/lib/zernio-sdk/models/webhook_payload_message_metadata.rb +35 -1
  26. data/lib/zernio-sdk/version.rb +1 -1
  27. data/lib/zernio-sdk.rb +5 -4
  28. data/openapi.yaml +35 -1
  29. data/spec/models/send_inbox_message_request_interactive_action_one_of5_spec.rb +5 -7
  30. data/spec/models/send_inbox_message_request_interactive_action_one_of6_spec.rb +1 -1
  31. data/spec/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner_product_items_inner_spec.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner_product_items_inner_spec.rb} +6 -6
  32. data/spec/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner_spec.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner_spec.rb} +6 -6
  33. data/spec/models/send_inbox_message_request_interactive_action_one_of7_spec.rb +2 -6
  34. data/spec/models/{send_inbox_message_request_interactive_action_one_of7_parameters_spec.rb → send_inbox_message_request_interactive_action_one_of8_parameters_spec.rb} +6 -6
  35. data/spec/models/send_inbox_message_request_interactive_action_one_of8_spec.rb +11 -1
  36. data/spec/models/{send_inbox_message_request_interactive_action_one_of8_cards_inner_spec.rb → send_inbox_message_request_interactive_action_one_of9_cards_inner_spec.rb} +6 -6
  37. data/spec/models/send_inbox_message_request_interactive_action_one_of9_spec.rb +36 -0
  38. data/spec/models/send_inbox_message_request_interactive_spec.rb +1 -1
  39. data/spec/models/webhook_payload_message_metadata_spec.rb +16 -0
  40. data/zernio-sdk-0.0.666.gem +0 -0
  41. metadata +22 -18
  42. data/zernio-sdk-0.0.665.gem +0 -0
@@ -14,39 +14,19 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Catalog-message action. `type` on the parent must be `catalog_message`. May be omitted entirely; it is defaulted to `{ \"name\": \"catalog_message\" }`. Requires a Meta catalog connected to the WhatsApp Business Account in Commerce Manager.
17
+ # Multi-product action. `type` on the parent must be `product_list`. Requires a Meta catalog connected to the WhatsApp Business Account in Commerce Manager.
18
18
  class SendInboxMessageRequestInteractiveActionOneOf7 < ApiModelBase
19
- attr_accessor :name
20
-
21
- attr_accessor :parameters
22
-
23
- class EnumAttributeValidator
24
- attr_reader :datatype
25
- attr_reader :allowable_values
26
-
27
- def initialize(datatype, allowable_values)
28
- @allowable_values = allowable_values.map do |value|
29
- case datatype.to_s
30
- when /Integer/i
31
- value.to_i
32
- when /Float/i
33
- value.to_f
34
- else
35
- value
36
- end
37
- end
38
- end
19
+ # Meta catalog ID connected to the WhatsApp Business Account.
20
+ attr_accessor :catalog_id
39
21
 
40
- def valid?(value)
41
- !value || allowable_values.include?(value)
42
- end
43
- end
22
+ # 1-10 sections. Total products across all sections cannot exceed 30.
23
+ attr_accessor :sections
44
24
 
45
25
  # Attribute mapping from ruby-style variable name to JSON key.
46
26
  def self.attribute_map
47
27
  {
48
- :'name' => :'name',
49
- :'parameters' => :'parameters'
28
+ :'catalog_id' => :'catalog_id',
29
+ :'sections' => :'sections'
50
30
  }
51
31
  end
52
32
 
@@ -63,8 +43,8 @@ module Zernio
63
43
  # Attribute type mapping.
64
44
  def self.openapi_types
65
45
  {
66
- :'name' => :'String',
67
- :'parameters' => :'SendInboxMessageRequestInteractiveActionOneOf7Parameters'
46
+ :'catalog_id' => :'String',
47
+ :'sections' => :'Array<SendInboxMessageRequestInteractiveActionOneOf7SectionsInner>'
68
48
  }
69
49
  end
70
50
 
@@ -90,14 +70,18 @@ module Zernio
90
70
  h[k.to_sym] = v
91
71
  }
92
72
 
93
- if attributes.key?(:'name')
94
- self.name = attributes[:'name']
73
+ if attributes.key?(:'catalog_id')
74
+ self.catalog_id = attributes[:'catalog_id']
95
75
  else
96
- self.name = nil
76
+ self.catalog_id = nil
97
77
  end
98
78
 
99
- if attributes.key?(:'parameters')
100
- self.parameters = attributes[:'parameters']
79
+ if attributes.key?(:'sections')
80
+ if (value = attributes[:'sections']).is_a?(Array)
81
+ self.sections = value
82
+ end
83
+ else
84
+ self.sections = nil
101
85
  end
102
86
  end
103
87
 
@@ -106,8 +90,20 @@ module Zernio
106
90
  def list_invalid_properties
107
91
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
92
  invalid_properties = Array.new
109
- if @name.nil?
110
- invalid_properties.push('invalid value for "name", name cannot be nil.')
93
+ if @catalog_id.nil?
94
+ invalid_properties.push('invalid value for "catalog_id", catalog_id cannot be nil.')
95
+ end
96
+
97
+ if @sections.nil?
98
+ invalid_properties.push('invalid value for "sections", sections cannot be nil.')
99
+ end
100
+
101
+ if @sections.length > 10
102
+ invalid_properties.push('invalid value for "sections", number of items must be less than or equal to 10.')
103
+ end
104
+
105
+ if @sections.length < 1
106
+ invalid_properties.push('invalid value for "sections", number of items must be greater than or equal to 1.')
111
107
  end
112
108
 
113
109
  invalid_properties
@@ -117,20 +113,39 @@ module Zernio
117
113
  # @return true if the model is valid
118
114
  def valid?
119
115
  warn '[DEPRECATED] the `valid?` method is obsolete'
120
- return false if @name.nil?
121
- name_validator = EnumAttributeValidator.new('String', ["catalog_message"])
122
- return false unless name_validator.valid?(@name)
116
+ return false if @catalog_id.nil?
117
+ return false if @sections.nil?
118
+ return false if @sections.length > 10
119
+ return false if @sections.length < 1
123
120
  true
124
121
  end
125
122
 
126
- # Custom attribute writer method checking allowed values (enum).
127
- # @param [Object] name Object to be assigned
128
- def name=(name)
129
- validator = EnumAttributeValidator.new('String', ["catalog_message"])
130
- unless validator.valid?(name)
131
- fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] catalog_id Value to be assigned
125
+ def catalog_id=(catalog_id)
126
+ if catalog_id.nil?
127
+ fail ArgumentError, 'catalog_id cannot be nil'
128
+ end
129
+
130
+ @catalog_id = catalog_id
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] sections Value to be assigned
135
+ def sections=(sections)
136
+ if sections.nil?
137
+ fail ArgumentError, 'sections cannot be nil'
132
138
  end
133
- @name = name
139
+
140
+ if sections.length > 10
141
+ fail ArgumentError, 'invalid value for "sections", number of items must be less than or equal to 10.'
142
+ end
143
+
144
+ if sections.length < 1
145
+ fail ArgumentError, 'invalid value for "sections", number of items must be greater than or equal to 1.'
146
+ end
147
+
148
+ @sections = sections
134
149
  end
135
150
 
136
151
  # Checks equality by comparing each attribute.
@@ -138,8 +153,8 @@ module Zernio
138
153
  def ==(o)
139
154
  return true if self.equal?(o)
140
155
  self.class == o.class &&
141
- name == o.name &&
142
- parameters == o.parameters
156
+ catalog_id == o.catalog_id &&
157
+ sections == o.sections
143
158
  end
144
159
 
145
160
  # @see the `==` method
@@ -151,7 +166,7 @@ module Zernio
151
166
  # Calculates hash code according to all attributes.
152
167
  # @return [Integer] Hash code
153
168
  def hash
154
- [name, parameters].hash
169
+ [catalog_id, sections].hash
155
170
  end
156
171
 
157
172
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- class SendInboxMessageRequestInteractiveActionOneOf6SectionsInner < ApiModelBase
17
+ class SendInboxMessageRequestInteractiveActionOneOf7SectionsInner < ApiModelBase
18
18
  # Optional section header.
19
19
  attr_accessor :title
20
20
 
@@ -42,7 +42,7 @@ module Zernio
42
42
  def self.openapi_types
43
43
  {
44
44
  :'title' => :'String',
45
- :'product_items' => :'Array<SendInboxMessageRequestInteractiveActionOneOf6SectionsInnerProductItemsInner>'
45
+ :'product_items' => :'Array<SendInboxMessageRequestInteractiveActionOneOf7SectionsInnerProductItemsInner>'
46
46
  }
47
47
  end
48
48
 
@@ -56,14 +56,14 @@ module Zernio
56
56
  # @param [Hash] attributes Model attributes in the form of hash
57
57
  def initialize(attributes = {})
58
58
  if (!attributes.is_a?(Hash))
59
- fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf6SectionsInner` initialize method"
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf7SectionsInner` initialize method"
60
60
  end
61
61
 
62
62
  # check to see if the attribute exists and convert string to symbol for hash key
63
63
  acceptable_attribute_map = self.class.acceptable_attribute_map
64
64
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
65
  if (!acceptable_attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf6SectionsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf7SectionsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
67
  end
68
68
  h[k.to_sym] = v
69
69
  }
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- class SendInboxMessageRequestInteractiveActionOneOf6SectionsInnerProductItemsInner < ApiModelBase
17
+ class SendInboxMessageRequestInteractiveActionOneOf7SectionsInnerProductItemsInner < ApiModelBase
18
18
  # Retailer ID (SKU) of the product inside the catalog.
19
19
  attr_accessor :product_retailer_id
20
20
 
@@ -52,14 +52,14 @@ module Zernio
52
52
  # @param [Hash] attributes Model attributes in the form of hash
53
53
  def initialize(attributes = {})
54
54
  if (!attributes.is_a?(Hash))
55
- fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf6SectionsInnerProductItemsInner` initialize method"
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf7SectionsInnerProductItemsInner` initialize method"
56
56
  end
57
57
 
58
58
  # check to see if the attribute exists and convert string to symbol for hash key
59
59
  acceptable_attribute_map = self.class.acceptable_attribute_map
60
60
  attributes = attributes.each_with_object({}) { |(k, v), h|
61
61
  if (!acceptable_attribute_map.key?(k.to_sym))
62
- fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf6SectionsInnerProductItemsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf7SectionsInnerProductItemsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
63
  end
64
64
  h[k.to_sym] = v
65
65
  }
@@ -14,14 +14,39 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Carousel action. `type` on the parent must be `carousel`. Carries 2-10 cards, either all product cards (`type: \"product\"`, all referencing the same `catalog_id`) or media cards (any other `type`, e.g. `cta_url`, with a required image/video `header` on each card). `card_index` (0-9, non-repeating) is auto-filled sequentially when omitted. Product carousels require a Meta catalog connected to the WhatsApp Business Account in Commerce Manager; media carousels do not.
17
+ # Catalog-message action. `type` on the parent must be `catalog_message`. May be omitted entirely; it is defaulted to `{ \"name\": \"catalog_message\" }`. Requires a Meta catalog connected to the WhatsApp Business Account in Commerce Manager.
18
18
  class SendInboxMessageRequestInteractiveActionOneOf8 < ApiModelBase
19
- attr_accessor :cards
19
+ attr_accessor :name
20
+
21
+ attr_accessor :parameters
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
20
44
 
21
45
  # Attribute mapping from ruby-style variable name to JSON key.
22
46
  def self.attribute_map
23
47
  {
24
- :'cards' => :'cards'
48
+ :'name' => :'name',
49
+ :'parameters' => :'parameters'
25
50
  }
26
51
  end
27
52
 
@@ -38,7 +63,8 @@ module Zernio
38
63
  # Attribute type mapping.
39
64
  def self.openapi_types
40
65
  {
41
- :'cards' => :'Array<SendInboxMessageRequestInteractiveActionOneOf8CardsInner>'
66
+ :'name' => :'String',
67
+ :'parameters' => :'SendInboxMessageRequestInteractiveActionOneOf8Parameters'
42
68
  }
43
69
  end
44
70
 
@@ -64,12 +90,14 @@ module Zernio
64
90
  h[k.to_sym] = v
65
91
  }
66
92
 
67
- if attributes.key?(:'cards')
68
- if (value = attributes[:'cards']).is_a?(Array)
69
- self.cards = value
70
- end
93
+ if attributes.key?(:'name')
94
+ self.name = attributes[:'name']
71
95
  else
72
- self.cards = nil
96
+ self.name = nil
97
+ end
98
+
99
+ if attributes.key?(:'parameters')
100
+ self.parameters = attributes[:'parameters']
73
101
  end
74
102
  end
75
103
 
@@ -78,16 +106,8 @@ module Zernio
78
106
  def list_invalid_properties
79
107
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
108
  invalid_properties = Array.new
81
- if @cards.nil?
82
- invalid_properties.push('invalid value for "cards", cards cannot be nil.')
83
- end
84
-
85
- if @cards.length > 10
86
- invalid_properties.push('invalid value for "cards", number of items must be less than or equal to 10.')
87
- end
88
-
89
- if @cards.length < 2
90
- invalid_properties.push('invalid value for "cards", number of items must be greater than or equal to 2.')
109
+ if @name.nil?
110
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
91
111
  end
92
112
 
93
113
  invalid_properties
@@ -97,28 +117,20 @@ module Zernio
97
117
  # @return true if the model is valid
98
118
  def valid?
99
119
  warn '[DEPRECATED] the `valid?` method is obsolete'
100
- return false if @cards.nil?
101
- return false if @cards.length > 10
102
- return false if @cards.length < 2
120
+ return false if @name.nil?
121
+ name_validator = EnumAttributeValidator.new('String', ["catalog_message"])
122
+ return false unless name_validator.valid?(@name)
103
123
  true
104
124
  end
105
125
 
106
- # Custom attribute writer method with validation
107
- # @param [Object] cards Value to be assigned
108
- def cards=(cards)
109
- if cards.nil?
110
- fail ArgumentError, 'cards cannot be nil'
126
+ # Custom attribute writer method checking allowed values (enum).
127
+ # @param [Object] name Object to be assigned
128
+ def name=(name)
129
+ validator = EnumAttributeValidator.new('String', ["catalog_message"])
130
+ unless validator.valid?(name)
131
+ fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
111
132
  end
112
-
113
- if cards.length > 10
114
- fail ArgumentError, 'invalid value for "cards", number of items must be less than or equal to 10.'
115
- end
116
-
117
- if cards.length < 2
118
- fail ArgumentError, 'invalid value for "cards", number of items must be greater than or equal to 2.'
119
- end
120
-
121
- @cards = cards
133
+ @name = name
122
134
  end
123
135
 
124
136
  # Checks equality by comparing each attribute.
@@ -126,7 +138,8 @@ module Zernio
126
138
  def ==(o)
127
139
  return true if self.equal?(o)
128
140
  self.class == o.class &&
129
- cards == o.cards
141
+ name == o.name &&
142
+ parameters == o.parameters
130
143
  end
131
144
 
132
145
  # @see the `==` method
@@ -138,7 +151,7 @@ module Zernio
138
151
  # Calculates hash code according to all attributes.
139
152
  # @return [Integer] Hash code
140
153
  def hash
141
- [cards].hash
154
+ [name, parameters].hash
142
155
  end
143
156
 
144
157
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- class SendInboxMessageRequestInteractiveActionOneOf7Parameters < ApiModelBase
17
+ class SendInboxMessageRequestInteractiveActionOneOf8Parameters < ApiModelBase
18
18
  # Optional product whose image is used as the message thumbnail. Falls back to the first catalog item when omitted.
19
19
  attr_accessor :thumbnail_product_retailer_id
20
20
 
@@ -52,14 +52,14 @@ module Zernio
52
52
  # @param [Hash] attributes Model attributes in the form of hash
53
53
  def initialize(attributes = {})
54
54
  if (!attributes.is_a?(Hash))
55
- fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf7Parameters` initialize method"
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf8Parameters` initialize method"
56
56
  end
57
57
 
58
58
  # check to see if the attribute exists and convert string to symbol for hash key
59
59
  acceptable_attribute_map = self.class.acceptable_attribute_map
60
60
  attributes = attributes.each_with_object({}) { |(k, v), h|
61
61
  if (!acceptable_attribute_map.key?(k.to_sym))
62
- fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf7Parameters`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf8Parameters`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
63
  end
64
64
  h[k.to_sym] = v
65
65
  }
@@ -0,0 +1,185 @@
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
+ # Carousel action. `type` on the parent must be `carousel`. Carries 2-10 cards, either all product cards (`type: \"product\"`, all referencing the same `catalog_id`) or media cards (any other `type`, e.g. `cta_url`, with a required image/video `header` on each card). `card_index` (0-9, non-repeating) is auto-filled sequentially when omitted. Product carousels require a Meta catalog connected to the WhatsApp Business Account in Commerce Manager; media carousels do not.
18
+ class SendInboxMessageRequestInteractiveActionOneOf9 < ApiModelBase
19
+ attr_accessor :cards
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'cards' => :'cards'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'cards' => :'Array<SendInboxMessageRequestInteractiveActionOneOf9CardsInner>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf9` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf9`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'cards')
68
+ if (value = attributes[:'cards']).is_a?(Array)
69
+ self.cards = value
70
+ end
71
+ else
72
+ self.cards = nil
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ if @cards.nil?
82
+ invalid_properties.push('invalid value for "cards", cards cannot be nil.')
83
+ end
84
+
85
+ if @cards.length > 10
86
+ invalid_properties.push('invalid value for "cards", number of items must be less than or equal to 10.')
87
+ end
88
+
89
+ if @cards.length < 2
90
+ invalid_properties.push('invalid value for "cards", number of items must be greater than or equal to 2.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ return false if @cards.nil?
101
+ return false if @cards.length > 10
102
+ return false if @cards.length < 2
103
+ true
104
+ end
105
+
106
+ # Custom attribute writer method with validation
107
+ # @param [Object] cards Value to be assigned
108
+ def cards=(cards)
109
+ if cards.nil?
110
+ fail ArgumentError, 'cards cannot be nil'
111
+ end
112
+
113
+ if cards.length > 10
114
+ fail ArgumentError, 'invalid value for "cards", number of items must be less than or equal to 10.'
115
+ end
116
+
117
+ if cards.length < 2
118
+ fail ArgumentError, 'invalid value for "cards", number of items must be greater than or equal to 2.'
119
+ end
120
+
121
+ @cards = cards
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ cards == o.cards
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [cards].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ attributes = attributes.transform_keys(&:to_sym)
150
+ transformed_hash = {}
151
+ openapi_types.each_pair do |key, type|
152
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = nil
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[attribute_map[key]].is_a?(Array)
158
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
159
+ end
160
+ elsif !attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
162
+ end
163
+ end
164
+ new(transformed_hash)
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ if value.nil?
174
+ is_nullable = self.class.openapi_nullable.include?(attr)
175
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
176
+ end
177
+
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ end
184
+
185
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- class SendInboxMessageRequestInteractiveActionOneOf8CardsInner < ApiModelBase
17
+ class SendInboxMessageRequestInteractiveActionOneOf9CardsInner < ApiModelBase
18
18
  # Card position. Auto-filled sequentially when omitted.
19
19
  attr_accessor :card_index
20
20
 
@@ -72,14 +72,14 @@ module Zernio
72
72
  # @param [Hash] attributes Model attributes in the form of hash
73
73
  def initialize(attributes = {})
74
74
  if (!attributes.is_a?(Hash))
75
- fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf8CardsInner` initialize method"
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf9CardsInner` initialize method"
76
76
  end
77
77
 
78
78
  # check to see if the attribute exists and convert string to symbol for hash key
79
79
  acceptable_attribute_map = self.class.acceptable_attribute_map
80
80
  attributes = attributes.each_with_object({}) { |(k, v), h|
81
81
  if (!acceptable_attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf8CardsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf9CardsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
83
  end
84
84
  h[k.to_sym] = v
85
85
  }