klaviyo-api-sdk 13.0.1 → 14.0.0
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +434 -286
- data/klaviyo-api-sdk.gemspec +1 -1
- data/lib/klaviyo-api-sdk/api/accounts_api.rb +6 -6
- data/lib/klaviyo-api-sdk/api/campaigns_api.rb +82 -82
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +235 -235
- data/lib/klaviyo-api-sdk/api/coupons_api.rb +63 -63
- data/lib/klaviyo-api-sdk/api/custom_objects_api.rb +384 -0
- data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +1 -1
- data/lib/klaviyo-api-sdk/api/events_api.rb +34 -34
- data/lib/klaviyo-api-sdk/api/flows_api.rb +93 -93
- data/lib/klaviyo-api-sdk/api/forms_api.rb +40 -40
- data/lib/klaviyo-api-sdk/api/images_api.rb +15 -15
- data/lib/klaviyo-api-sdk/api/lists_api.rb +59 -59
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +643 -59
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +128 -128
- data/lib/klaviyo-api-sdk/api/reporting_api.rb +13 -13
- data/lib/klaviyo-api-sdk/api/reviews_api.rb +21 -21
- data/lib/klaviyo-api-sdk/api/segments_api.rb +53 -53
- data/lib/klaviyo-api-sdk/api/tags_api.rb +58 -58
- data/lib/klaviyo-api-sdk/api/templates_api.rb +36 -36
- data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +15 -15
- data/lib/klaviyo-api-sdk/api/web_feeds_api.rb +15 -15
- data/lib/klaviyo-api-sdk/api/webhooks_api.rb +15 -15
- data/lib/klaviyo-api-sdk/api_client.rb +1 -1
- data/lib/klaviyo-api-sdk/models/base_event_create_query_bulk_entry_resource_object_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/button_block.rb +247 -0
- data/lib/klaviyo-api-sdk/models/{custom_object_property_enum.rb → button_enum.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes_timeframe.rb +1 -1
- data/lib/klaviyo-api-sdk/models/condition_group_conditions_inner.rb +3 -0
- data/lib/klaviyo-api-sdk/models/conditional_branch_action_data_profile_filter_condition_groups_inner_conditions_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/data_source_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/data_source_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/data_source_create_query_resource_object_attributes.rb +284 -0
- data/lib/klaviyo-api-sdk/models/data_source_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object.rb +246 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object_attributes.rb +219 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object_relationships.rb +218 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object_relationships_data_source.rb +218 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/data_source_record_resource_object_attributes.rb +223 -0
- data/lib/klaviyo-api-sdk/models/drop_shadow_block.rb +247 -0
- data/lib/klaviyo-api-sdk/models/drop_shadow_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/{trigger_branch_action_data_trigger_filter.rb → dsr_bulk_create_attrs_data_source_records.rb} +15 -14
- data/lib/klaviyo-api-sdk/models/dsr_bulk_create_rels_data_source_data.rb +238 -0
- data/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/flow_definition_profile_filter_condition_groups_inner_conditions_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/flow_email_additional_filters_condition_groups_inner_conditions_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/flow_push_notification_additional_filters_condition_groups_inner_conditions_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/flow_sms_additional_filters_condition_groups_inner_conditions_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/horizontal_rule_block.rb +247 -0
- data/lib/klaviyo-api-sdk/models/horizontal_rule_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/image_block.rb +247 -0
- data/lib/klaviyo-api-sdk/models/mapped_metric_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object.rb +281 -0
- data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships.rb +227 -0
- data/lib/klaviyo-api-sdk/models/{trigger_branch_action_data_trigger_filter_condition_groups_inner.rb → mapped_metric_partial_update_query_resource_object_relationships_custom_metric.rb} +10 -17
- data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships_custom_metric_data.rb +238 -0
- data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships_metric.rb +218 -0
- data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships_metric_data.rb +238 -0
- data/lib/klaviyo-api-sdk/models/priority_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_priority_condition.rb +327 -0
- data/lib/klaviyo-api-sdk/models/{custom_object_property_condition.rb → profile_predictive_analytics_channel_affinity_priority_filter.rb} +23 -37
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_condition.rb +327 -0
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_filter.rb +286 -0
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_date_condition.rb +286 -0
- data/lib/klaviyo-api-sdk/models/rank_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes_timeframe.rb +1 -1
- data/lib/klaviyo-api-sdk/models/spacer_block.rb +247 -0
- data/lib/klaviyo-api-sdk/models/spacer_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/trigger_branch_action_data.rb +6 -2
- data/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes_definition.rb +5 -0
- data/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes_definition.rb +5 -0
- data/lib/klaviyo-api-sdk.rb +40 -5
- data/lib/klaviyo-api-sdk.rb.bak +974 -0
- metadata +43 -7
- data/lib/klaviyo-api-sdk/models/trigger_branch_action_data_trigger_filter_condition_groups_inner_conditions_inner.rb +0 -106
@@ -0,0 +1,35 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
|
5
|
+
|
6
|
+
Contact: developers@klaviyo.com
|
7
|
+
Generated by: https://openapi-generator.tech
|
8
|
+
OpenAPI Generator version: 6.2.1
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
require 'time'
|
14
|
+
|
15
|
+
module KlaviyoAPI
|
16
|
+
class PriorityEnum
|
17
|
+
PRIORITY = "priority".freeze
|
18
|
+
|
19
|
+
# Builds the enum from string
|
20
|
+
# @param [String] The enum value in the form of the string
|
21
|
+
# @return [String] The enum value
|
22
|
+
def self.build_from_hash(value)
|
23
|
+
new.build_from_hash(value)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Builds the enum from string
|
27
|
+
# @param [String] The enum value in the form of the string
|
28
|
+
# @return [String] The enum value
|
29
|
+
def build_from_hash(value)
|
30
|
+
constantValues = PriorityEnum.constants.select { |c| PriorityEnum::const_get(c) == value }
|
31
|
+
raise "Invalid ENUM value #{value} for class #PriorityEnum" if constantValues.empty?
|
32
|
+
value
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_priority_condition.rb
ADDED
@@ -0,0 +1,327 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
|
5
|
+
|
6
|
+
Contact: developers@klaviyo.com
|
7
|
+
Generated by: https://openapi-generator.tech
|
8
|
+
OpenAPI Generator version: 6.2.1
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
require 'time'
|
14
|
+
|
15
|
+
module KlaviyoAPI
|
16
|
+
class ProfilePredictiveAnalyticsChannelAffinityPriorityCondition
|
17
|
+
attr_accessor :type
|
18
|
+
|
19
|
+
# Possible dimension for channel affinity criterion.
|
20
|
+
attr_accessor :dimension
|
21
|
+
|
22
|
+
attr_accessor :measurement
|
23
|
+
|
24
|
+
# Possible channels in a channel affinity definition.
|
25
|
+
attr_accessor :predicted_channel
|
26
|
+
|
27
|
+
attr_accessor :filter
|
28
|
+
|
29
|
+
class EnumAttributeValidator
|
30
|
+
attr_reader :datatype
|
31
|
+
attr_reader :allowable_values
|
32
|
+
|
33
|
+
def initialize(datatype, allowable_values)
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
35
|
+
case datatype.to_s
|
36
|
+
when /Integer/i
|
37
|
+
value.to_i
|
38
|
+
when /Float/i
|
39
|
+
value.to_f
|
40
|
+
else
|
41
|
+
value
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def valid?(value)
|
47
|
+
!value || allowable_values.include?(value)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
52
|
+
def self.attribute_map
|
53
|
+
{
|
54
|
+
:'type' => :'type',
|
55
|
+
:'dimension' => :'dimension',
|
56
|
+
:'measurement' => :'measurement',
|
57
|
+
:'predicted_channel' => :'predicted_channel',
|
58
|
+
:'filter' => :'filter'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Returns all the JSON keys this model knows about
|
63
|
+
def self.acceptable_attributes
|
64
|
+
attribute_map.values
|
65
|
+
end
|
66
|
+
|
67
|
+
# Attribute type mapping.
|
68
|
+
def self.openapi_types
|
69
|
+
{
|
70
|
+
:'type' => :'ProfilePredictiveAnalyticsEnum',
|
71
|
+
:'dimension' => :'String',
|
72
|
+
:'measurement' => :'PriorityEnum',
|
73
|
+
:'predicted_channel' => :'String',
|
74
|
+
:'filter' => :'ProfilePredictiveAnalyticsChannelAffinityPriorityFilter'
|
75
|
+
}
|
76
|
+
end
|
77
|
+
|
78
|
+
# List of attributes with nullable: true
|
79
|
+
def self.openapi_nullable
|
80
|
+
Set.new([
|
81
|
+
])
|
82
|
+
end
|
83
|
+
|
84
|
+
# Initializes the object
|
85
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
86
|
+
def initialize(attributes = {})
|
87
|
+
if (!attributes.is_a?(Hash))
|
88
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ProfilePredictiveAnalyticsChannelAffinityPriorityCondition` initialize method"
|
89
|
+
end
|
90
|
+
|
91
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
93
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ProfilePredictiveAnalyticsChannelAffinityPriorityCondition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
95
|
+
end
|
96
|
+
h[k.to_sym] = v
|
97
|
+
}
|
98
|
+
|
99
|
+
if attributes.key?(:'type')
|
100
|
+
self.type = attributes[:'type']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'dimension')
|
104
|
+
self.dimension = attributes[:'dimension']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'measurement')
|
108
|
+
self.measurement = attributes[:'measurement']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'predicted_channel')
|
112
|
+
self.predicted_channel = attributes[:'predicted_channel']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'filter')
|
116
|
+
self.filter = attributes[:'filter']
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
121
|
+
# @return Array for valid properties with the reasons
|
122
|
+
def list_invalid_properties
|
123
|
+
invalid_properties = Array.new
|
124
|
+
if @type.nil?
|
125
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
126
|
+
end
|
127
|
+
|
128
|
+
if @dimension.nil?
|
129
|
+
invalid_properties.push('invalid value for "dimension", dimension cannot be nil.')
|
130
|
+
end
|
131
|
+
|
132
|
+
if @measurement.nil?
|
133
|
+
invalid_properties.push('invalid value for "measurement", measurement cannot be nil.')
|
134
|
+
end
|
135
|
+
|
136
|
+
if @predicted_channel.nil?
|
137
|
+
invalid_properties.push('invalid value for "predicted_channel", predicted_channel cannot be nil.')
|
138
|
+
end
|
139
|
+
|
140
|
+
if @filter.nil?
|
141
|
+
invalid_properties.push('invalid value for "filter", filter cannot be nil.')
|
142
|
+
end
|
143
|
+
|
144
|
+
invalid_properties
|
145
|
+
end
|
146
|
+
|
147
|
+
# Check to see if the all the properties in the model are valid
|
148
|
+
# @return true if the model is valid
|
149
|
+
def valid?
|
150
|
+
return false if @type.nil?
|
151
|
+
return false if @dimension.nil?
|
152
|
+
dimension_validator = EnumAttributeValidator.new('String', ["channel_affinity"])
|
153
|
+
return false unless dimension_validator.valid?(@dimension)
|
154
|
+
return false if @measurement.nil?
|
155
|
+
return false if @predicted_channel.nil?
|
156
|
+
predicted_channel_validator = EnumAttributeValidator.new('String', ["email", "push", "sms"])
|
157
|
+
return false unless predicted_channel_validator.valid?(@predicted_channel)
|
158
|
+
return false if @filter.nil?
|
159
|
+
true
|
160
|
+
end
|
161
|
+
|
162
|
+
# Custom attribute writer method checking allowed values (enum).
|
163
|
+
# @param [Object] dimension Object to be assigned
|
164
|
+
def dimension=(dimension)
|
165
|
+
validator = EnumAttributeValidator.new('String', ["channel_affinity"])
|
166
|
+
unless validator.valid?(dimension)
|
167
|
+
fail ArgumentError, "invalid value for \"dimension\", must be one of #{validator.allowable_values}."
|
168
|
+
end
|
169
|
+
@dimension = dimension
|
170
|
+
end
|
171
|
+
|
172
|
+
# Custom attribute writer method checking allowed values (enum).
|
173
|
+
# @param [Object] predicted_channel Object to be assigned
|
174
|
+
def predicted_channel=(predicted_channel)
|
175
|
+
validator = EnumAttributeValidator.new('String', ["email", "push", "sms"])
|
176
|
+
unless validator.valid?(predicted_channel)
|
177
|
+
fail ArgumentError, "invalid value for \"predicted_channel\", must be one of #{validator.allowable_values}."
|
178
|
+
end
|
179
|
+
@predicted_channel = predicted_channel
|
180
|
+
end
|
181
|
+
|
182
|
+
# Checks equality by comparing each attribute.
|
183
|
+
# @param [Object] Object to be compared
|
184
|
+
def ==(o)
|
185
|
+
return true if self.equal?(o)
|
186
|
+
self.class == o.class &&
|
187
|
+
type == o.type &&
|
188
|
+
dimension == o.dimension &&
|
189
|
+
measurement == o.measurement &&
|
190
|
+
predicted_channel == o.predicted_channel &&
|
191
|
+
filter == o.filter
|
192
|
+
end
|
193
|
+
|
194
|
+
# @see the `==` method
|
195
|
+
# @param [Object] Object to be compared
|
196
|
+
def eql?(o)
|
197
|
+
self == o
|
198
|
+
end
|
199
|
+
|
200
|
+
# Calculates hash code according to all attributes.
|
201
|
+
# @return [Integer] Hash code
|
202
|
+
def hash
|
203
|
+
[type, dimension, measurement, predicted_channel, filter].hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Builds the object from hash
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
208
|
+
# @return [Object] Returns the model itself
|
209
|
+
def self.build_from_hash(attributes)
|
210
|
+
new.build_from_hash(attributes)
|
211
|
+
end
|
212
|
+
|
213
|
+
# Builds the object from hash
|
214
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
215
|
+
# @return [Object] Returns the model itself
|
216
|
+
def build_from_hash(attributes)
|
217
|
+
return nil unless attributes.is_a?(Hash)
|
218
|
+
attributes = attributes.transform_keys(&:to_sym)
|
219
|
+
self.class.openapi_types.each_pair do |key, type|
|
220
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
221
|
+
self.send("#{key}=", nil)
|
222
|
+
elsif type =~ /\AArray<(.*)>/i
|
223
|
+
# check to ensure the input is an array given that the attribute
|
224
|
+
# is documented as an array but the input is not
|
225
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
226
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
227
|
+
end
|
228
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
229
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
self
|
234
|
+
end
|
235
|
+
|
236
|
+
# Deserializes the data based on type
|
237
|
+
# @param string type Data type
|
238
|
+
# @param string value Value to be deserialized
|
239
|
+
# @return [Object] Deserialized data
|
240
|
+
def _deserialize(type, value)
|
241
|
+
case type.to_sym
|
242
|
+
when :Time
|
243
|
+
Time.parse(value)
|
244
|
+
when :Date
|
245
|
+
Date.parse(value)
|
246
|
+
when :String
|
247
|
+
value.to_s
|
248
|
+
when :Integer
|
249
|
+
value.to_i
|
250
|
+
when :Float
|
251
|
+
value.to_f
|
252
|
+
when :Boolean
|
253
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
254
|
+
true
|
255
|
+
else
|
256
|
+
false
|
257
|
+
end
|
258
|
+
when :Object
|
259
|
+
# generic object (usually a Hash), return directly
|
260
|
+
value
|
261
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
262
|
+
inner_type = Regexp.last_match[:inner_type]
|
263
|
+
value.map { |v| _deserialize(inner_type, v) }
|
264
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
265
|
+
k_type = Regexp.last_match[:k_type]
|
266
|
+
v_type = Regexp.last_match[:v_type]
|
267
|
+
{}.tap do |hash|
|
268
|
+
value.each do |k, v|
|
269
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
else # model
|
273
|
+
# models (e.g. Pet) or oneOf
|
274
|
+
klass = KlaviyoAPI.const_get(type)
|
275
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
# Returns the string representation of the object
|
280
|
+
# @return [String] String presentation of the object
|
281
|
+
def to_s
|
282
|
+
to_hash.to_s
|
283
|
+
end
|
284
|
+
|
285
|
+
# to_body is an alias to to_hash (backward compatibility)
|
286
|
+
# @return [Hash] Returns the object in the form of hash
|
287
|
+
def to_body
|
288
|
+
to_hash
|
289
|
+
end
|
290
|
+
|
291
|
+
# Returns the object in the form of hash
|
292
|
+
# @return [Hash] Returns the object in the form of hash
|
293
|
+
def to_hash
|
294
|
+
hash = {}
|
295
|
+
self.class.attribute_map.each_pair do |attr, param|
|
296
|
+
value = self.send(attr)
|
297
|
+
if value.nil?
|
298
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
299
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
300
|
+
end
|
301
|
+
|
302
|
+
hash[param] = _to_hash(value)
|
303
|
+
end
|
304
|
+
hash
|
305
|
+
end
|
306
|
+
|
307
|
+
# Outputs non-array value in the form of hash
|
308
|
+
# For object, use to_hash. Otherwise, just return the value
|
309
|
+
# @param [Object] value Any valid value
|
310
|
+
# @return [Hash] Returns the value in the form of hash
|
311
|
+
def _to_hash(value)
|
312
|
+
if value.is_a?(Array)
|
313
|
+
value.compact.map { |v| _to_hash(v) }
|
314
|
+
elsif value.is_a?(Hash)
|
315
|
+
{}.tap do |hash|
|
316
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
317
|
+
end
|
318
|
+
elsif value.respond_to? :to_hash
|
319
|
+
value.to_hash
|
320
|
+
else
|
321
|
+
value
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
end
|
326
|
+
|
327
|
+
end
|
@@ -13,22 +13,19 @@ require 'date'
|
|
13
13
|
require 'time'
|
14
14
|
|
15
15
|
module KlaviyoAPI
|
16
|
-
class
|
16
|
+
class ProfilePredictiveAnalyticsChannelAffinityPriorityFilter
|
17
17
|
attr_accessor :type
|
18
18
|
|
19
|
-
attr_accessor :
|
19
|
+
attr_accessor :operator
|
20
20
|
|
21
|
-
attr_accessor :
|
22
|
-
|
23
|
-
attr_accessor :filter
|
21
|
+
attr_accessor :value
|
24
22
|
|
25
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
24
|
def self.attribute_map
|
27
25
|
{
|
28
26
|
:'type' => :'type',
|
29
|
-
:'
|
30
|
-
:'
|
31
|
-
:'filter' => :'filter'
|
27
|
+
:'operator' => :'operator',
|
28
|
+
:'value' => :'value'
|
32
29
|
}
|
33
30
|
end
|
34
31
|
|
@@ -40,10 +37,9 @@ module KlaviyoAPI
|
|
40
37
|
# Attribute type mapping.
|
41
38
|
def self.openapi_types
|
42
39
|
{
|
43
|
-
:'type' => :'
|
44
|
-
:'
|
45
|
-
:'
|
46
|
-
:'filter' => :'MetricPropertyConditionFilter'
|
40
|
+
:'type' => :'NumericEnum',
|
41
|
+
:'operator' => :'EqualsEnum',
|
42
|
+
:'value' => :'Integer'
|
47
43
|
}
|
48
44
|
end
|
49
45
|
|
@@ -57,13 +53,13 @@ module KlaviyoAPI
|
|
57
53
|
# @param [Hash] attributes Model attributes in the form of hash
|
58
54
|
def initialize(attributes = {})
|
59
55
|
if (!attributes.is_a?(Hash))
|
60
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ProfilePredictiveAnalyticsChannelAffinityPriorityFilter` initialize method"
|
61
57
|
end
|
62
58
|
|
63
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
64
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
65
61
|
if (!self.class.attribute_map.key?(k.to_sym))
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ProfilePredictiveAnalyticsChannelAffinityPriorityFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
67
63
|
end
|
68
64
|
h[k.to_sym] = v
|
69
65
|
}
|
@@ -72,16 +68,12 @@ module KlaviyoAPI
|
|
72
68
|
self.type = attributes[:'type']
|
73
69
|
end
|
74
70
|
|
75
|
-
if attributes.key?(:'
|
76
|
-
self.
|
77
|
-
end
|
78
|
-
|
79
|
-
if attributes.key?(:'field')
|
80
|
-
self.field = attributes[:'field']
|
71
|
+
if attributes.key?(:'operator')
|
72
|
+
self.operator = attributes[:'operator']
|
81
73
|
end
|
82
74
|
|
83
|
-
if attributes.key?(:'
|
84
|
-
self.
|
75
|
+
if attributes.key?(:'value')
|
76
|
+
self.value = attributes[:'value']
|
85
77
|
end
|
86
78
|
end
|
87
79
|
|
@@ -93,16 +85,12 @@ module KlaviyoAPI
|
|
93
85
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
94
86
|
end
|
95
87
|
|
96
|
-
if @
|
97
|
-
invalid_properties.push('invalid value for "
|
98
|
-
end
|
99
|
-
|
100
|
-
if @field.nil?
|
101
|
-
invalid_properties.push('invalid value for "field", field cannot be nil.')
|
88
|
+
if @operator.nil?
|
89
|
+
invalid_properties.push('invalid value for "operator", operator cannot be nil.')
|
102
90
|
end
|
103
91
|
|
104
|
-
if @
|
105
|
-
invalid_properties.push('invalid value for "
|
92
|
+
if @value.nil?
|
93
|
+
invalid_properties.push('invalid value for "value", value cannot be nil.')
|
106
94
|
end
|
107
95
|
|
108
96
|
invalid_properties
|
@@ -112,9 +100,8 @@ module KlaviyoAPI
|
|
112
100
|
# @return true if the model is valid
|
113
101
|
def valid?
|
114
102
|
return false if @type.nil?
|
115
|
-
return false if @
|
116
|
-
return false if @
|
117
|
-
return false if @filter.nil?
|
103
|
+
return false if @operator.nil?
|
104
|
+
return false if @value.nil?
|
118
105
|
true
|
119
106
|
end
|
120
107
|
|
@@ -124,9 +111,8 @@ module KlaviyoAPI
|
|
124
111
|
return true if self.equal?(o)
|
125
112
|
self.class == o.class &&
|
126
113
|
type == o.type &&
|
127
|
-
|
128
|
-
|
129
|
-
filter == o.filter
|
114
|
+
operator == o.operator &&
|
115
|
+
value == o.value
|
130
116
|
end
|
131
117
|
|
132
118
|
# @see the `==` method
|
@@ -138,7 +124,7 @@ module KlaviyoAPI
|
|
138
124
|
# Calculates hash code according to all attributes.
|
139
125
|
# @return [Integer] Hash code
|
140
126
|
def hash
|
141
|
-
[type,
|
127
|
+
[type, operator, value].hash
|
142
128
|
end
|
143
129
|
|
144
130
|
# Builds the object from hash
|