ultracart_api 4.1.231 → 4.1.233

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 (105) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -2
  3. data/docs/ItemContentMultimedia.md +2 -0
  4. data/docs/SfvbApi.md +1660 -162
  5. data/docs/SfvbApprovalCreateRequest.md +8 -0
  6. data/docs/SfvbCampaign.md +4 -0
  7. data/docs/SfvbCampaignWriteRequest.md +2 -0
  8. data/docs/SfvbCommsBranchStat.md +20 -0
  9. data/docs/SfvbCommsChange.md +22 -0
  10. data/docs/SfvbCommsClick.md +20 -0
  11. data/docs/SfvbCommsClicksResponse.md +26 -0
  12. data/docs/SfvbCommsDailyStat.md +30 -0
  13. data/docs/SfvbCommsDashboardResponse.md +24 -0
  14. data/docs/SfvbCommsDashboardRow.md +28 -0
  15. data/docs/SfvbCommsLookupOwner.md +26 -0
  16. data/docs/SfvbCommsLookupResponse.md +34 -0
  17. data/docs/SfvbCommsPlan.md +66 -0
  18. data/docs/SfvbCommsPlanResponse.md +20 -0
  19. data/docs/SfvbCommsProvider.md +28 -0
  20. data/docs/SfvbCommsProviderImportRequest.md +22 -0
  21. data/docs/SfvbCommsProviderImportResponse.md +26 -0
  22. data/docs/SfvbCommsProviderList.md +20 -0
  23. data/docs/SfvbCommsProvidersResponse.md +22 -0
  24. data/docs/SfvbCommsRulerValidateRequest.md +18 -0
  25. data/docs/SfvbCommsRulerValidateResponse.md +22 -0
  26. data/docs/SfvbCommsSender.md +24 -0
  27. data/docs/SfvbCommsSenderUpdate.md +22 -0
  28. data/docs/SfvbCommsSequenceFolder.md +28 -0
  29. data/docs/SfvbCommsSequenceFolderResponse.md +22 -0
  30. data/docs/SfvbCommsSequenceFoldersResponse.md +18 -0
  31. data/docs/SfvbCommsSequenceStatsResponse.md +26 -0
  32. data/docs/SfvbCommsSettings.md +34 -0
  33. data/docs/SfvbCommsSettingsResponse.md +24 -0
  34. data/docs/SfvbCommsSettingsUpdateRequest.md +26 -0
  35. data/docs/SfvbCommsStat.md +54 -0
  36. data/docs/SfvbCommsStepStat.md +34 -0
  37. data/docs/SfvbCommsTemplate.md +30 -0
  38. data/docs/SfvbCommsTemplateResponse.md +30 -0
  39. data/docs/SfvbCommsTemplatesResponse.md +20 -0
  40. data/docs/SfvbCommsTestEmailRequest.md +24 -0
  41. data/docs/SfvbCommsTestPostcardRequest.md +36 -0
  42. data/docs/SfvbCommsTestSendResponse.md +32 -0
  43. data/docs/SfvbCommsTestSmsRequest.md +18 -0
  44. data/docs/SfvbCommsUnreferencedEmail.md +30 -0
  45. data/docs/SfvbCommsUnreferencedPostcard.md +24 -0
  46. data/docs/SfvbCommsUnreferencedResponse.md +32 -0
  47. data/docs/SfvbEmail.md +8 -0
  48. data/docs/SfvbFlow.md +4 -0
  49. data/docs/SfvbFlowBackfillRequest.md +24 -0
  50. data/docs/SfvbFlowBackfillResponse.md +38 -0
  51. data/docs/SfvbFlowWriteRequest.md +2 -0
  52. data/docs/SfvbStepCounts.md +1 -1
  53. data/lib/ultracart_api/api/sfvb_api.rb +2356 -348
  54. data/lib/ultracart_api/models/item_content_multimedia.rb +11 -1
  55. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +39 -3
  56. data/lib/ultracart_api/models/sfvb_campaign.rb +21 -1
  57. data/lib/ultracart_api/models/sfvb_campaign_write_request.rb +11 -1
  58. data/lib/ultracart_api/models/sfvb_comms_branch_stat.rb +229 -0
  59. data/lib/ultracart_api/models/sfvb_comms_change.rb +240 -0
  60. data/lib/ultracart_api/models/sfvb_comms_click.rb +230 -0
  61. data/lib/ultracart_api/models/sfvb_comms_clicks_response.rb +264 -0
  62. data/lib/ultracart_api/models/sfvb_comms_daily_stat.rb +280 -0
  63. data/lib/ultracart_api/models/sfvb_comms_dashboard_response.rb +256 -0
  64. data/lib/ultracart_api/models/sfvb_comms_dashboard_row.rb +269 -0
  65. data/lib/ultracart_api/models/sfvb_comms_lookup_owner.rb +260 -0
  66. data/lib/ultracart_api/models/sfvb_comms_lookup_response.rb +301 -0
  67. data/lib/ultracart_api/models/sfvb_comms_plan.rb +460 -0
  68. data/lib/ultracart_api/models/sfvb_comms_plan_response.rb +231 -0
  69. data/lib/ultracart_api/models/sfvb_comms_provider.rb +272 -0
  70. data/lib/ultracart_api/models/sfvb_comms_provider_import_request.rb +242 -0
  71. data/lib/ultracart_api/models/sfvb_comms_provider_import_response.rb +264 -0
  72. data/lib/ultracart_api/models/sfvb_comms_provider_list.rb +230 -0
  73. data/lib/ultracart_api/models/sfvb_comms_providers_response.rb +244 -0
  74. data/lib/ultracart_api/models/sfvb_comms_ruler_validate_request.rb +220 -0
  75. data/lib/ultracart_api/models/sfvb_comms_ruler_validate_response.rb +242 -0
  76. data/lib/ultracart_api/models/sfvb_comms_sender.rb +250 -0
  77. data/lib/ultracart_api/models/sfvb_comms_sender_update.rb +240 -0
  78. data/lib/ultracart_api/models/sfvb_comms_sequence_folder.rb +270 -0
  79. data/lib/ultracart_api/models/sfvb_comms_sequence_folder_response.rb +243 -0
  80. data/lib/ultracart_api/models/sfvb_comms_sequence_folders_response.rb +222 -0
  81. data/lib/ultracart_api/models/sfvb_comms_sequence_stats_response.rb +263 -0
  82. data/lib/ultracart_api/models/sfvb_comms_settings.rb +297 -0
  83. data/lib/ultracart_api/models/sfvb_comms_settings_response.rb +253 -0
  84. data/lib/ultracart_api/models/sfvb_comms_settings_update_request.rb +257 -0
  85. data/lib/ultracart_api/models/sfvb_comms_stat.rb +402 -0
  86. data/lib/ultracart_api/models/sfvb_comms_step_stat.rb +301 -0
  87. data/lib/ultracart_api/models/sfvb_comms_template.rb +280 -0
  88. data/lib/ultracart_api/models/sfvb_comms_template_response.rb +281 -0
  89. data/lib/ultracart_api/models/sfvb_comms_templates_response.rb +234 -0
  90. data/lib/ultracart_api/models/sfvb_comms_test_email_request.rb +252 -0
  91. data/lib/ultracart_api/models/sfvb_comms_test_postcard_request.rb +312 -0
  92. data/lib/ultracart_api/models/sfvb_comms_test_send_response.rb +292 -0
  93. data/lib/ultracart_api/models/sfvb_comms_test_sms_request.rb +220 -0
  94. data/lib/ultracart_api/models/sfvb_comms_unreferenced_email.rb +280 -0
  95. data/lib/ultracart_api/models/sfvb_comms_unreferenced_postcard.rb +250 -0
  96. data/lib/ultracart_api/models/sfvb_comms_unreferenced_response.rb +296 -0
  97. data/lib/ultracart_api/models/sfvb_email.rb +41 -1
  98. data/lib/ultracart_api/models/sfvb_flow.rb +21 -1
  99. data/lib/ultracart_api/models/sfvb_flow_backfill_request.rb +250 -0
  100. data/lib/ultracart_api/models/sfvb_flow_backfill_response.rb +322 -0
  101. data/lib/ultracart_api/models/sfvb_flow_write_request.rb +11 -1
  102. data/lib/ultracart_api/models/sfvb_step_counts.rb +1 -1
  103. data/lib/ultracart_api/version.rb +1 -1
  104. data/lib/ultracart_api.rb +41 -0
  105. metadata +84 -2
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbCommsProvidersResponse
18
+ # True when the account may import lists.
19
+ attr_accessor :import_allowed
20
+
21
+ # Why import isn't allowed, and what an import does.
22
+ attr_accessor :notes
23
+
24
+ # Each connected provider that can share list members.
25
+ attr_accessor :providers
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'import_allowed' => :'import_allowed',
31
+ :'notes' => :'notes',
32
+ :'providers' => :'providers'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'import_allowed' => :'Boolean',
45
+ :'notes' => :'Array<String>',
46
+ :'providers' => :'Array<SfvbCommsProvider>'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsProvidersResponse` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsProvidersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'import_allowed')
72
+ self.import_allowed = attributes[:'import_allowed']
73
+ end
74
+
75
+ if attributes.key?(:'notes')
76
+ if (value = attributes[:'notes']).is_a?(Array)
77
+ self.notes = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'providers')
82
+ if (value = attributes[:'providers']).is_a?(Array)
83
+ self.providers = value
84
+ end
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ import_allowed == o.import_allowed &&
107
+ notes == o.notes &&
108
+ providers == o.providers
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [import_allowed, notes, providers].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ attributes = attributes.transform_keys(&:to_sym)
136
+ self.class.openapi_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = UltracartClient.const_get(type)
192
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbCommsRulerValidateRequest
18
+ # The Event Ruler pattern, as JSON text, the same text the rule's bigquery_ruler holds. At most 16384 characters.
19
+ attr_accessor :ruler
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'ruler' => :'ruler'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'ruler' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsRulerValidateRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsRulerValidateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'ruler')
62
+ self.ruler = attributes[:'ruler']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ ruler == o.ruler
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [ruler].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = UltracartClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbCommsRulerValidateResponse
18
+ # Why it doesn't compile. Only when valid is false.
19
+ attr_accessor :error_message
20
+
21
+ # How the pattern is used.
22
+ attr_accessor :notes
23
+
24
+ # True when the pattern compiles, so an Is in BigQuery segment rule will accept it.
25
+ attr_accessor :valid
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'error_message' => :'error_message',
31
+ :'notes' => :'notes',
32
+ :'valid' => :'valid'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'error_message' => :'String',
45
+ :'notes' => :'Array<String>',
46
+ :'valid' => :'Boolean'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsRulerValidateResponse` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsRulerValidateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'error_message')
72
+ self.error_message = attributes[:'error_message']
73
+ end
74
+
75
+ if attributes.key?(:'notes')
76
+ if (value = attributes[:'notes']).is_a?(Array)
77
+ self.notes = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'valid')
82
+ self.valid = attributes[:'valid']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ error_message == o.error_message &&
105
+ notes == o.notes &&
106
+ valid == o.valid
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ def hash
118
+ [error_message, notes, valid].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def self.build_from_hash(attributes)
125
+ new.build_from_hash(attributes)
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ self.class.openapi_types.each_pair do |key, type|
135
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
136
+ self.send("#{key}=", nil)
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
142
+ end
143
+ elsif !attributes[self.class.attribute_map[key]].nil?
144
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
+ end
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :Time
158
+ Time.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :Boolean
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ # models (e.g. Pet) or oneOf
189
+ klass = UltracartClient.const_get(type)
190
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+ end
241
+
242
+ end