ultracart_api 4.1.164 → 4.1.167

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.
@@ -5661,6 +5661,149 @@ module UltracartClient
5661
5661
  return data, status_code, headers
5662
5662
  end
5663
5663
 
5664
+ # Get the review status of an email
5665
+ # @param storefront_oid [Integer]
5666
+ # @param commseq_email_uuid [String]
5667
+ # @param [Hash] opts the optional parameters
5668
+ # @return [EmailCommseqEmailReviewStatusResponse]
5669
+ def get_email_review_status(storefront_oid, commseq_email_uuid, opts = {})
5670
+ data, _status_code, _headers = get_email_review_status_with_http_info(storefront_oid, commseq_email_uuid, opts)
5671
+ data
5672
+ end
5673
+
5674
+ # Get the review status of an email
5675
+ # @param storefront_oid [Integer]
5676
+ # @param commseq_email_uuid [String]
5677
+ # @param [Hash] opts the optional parameters
5678
+ # @return [Array<(EmailCommseqEmailReviewStatusResponse, Integer, Hash)>] EmailCommseqEmailReviewStatusResponse data, response status code and response headers
5679
+ def get_email_review_status_with_http_info(storefront_oid, commseq_email_uuid, opts = {})
5680
+ if @api_client.config.debugging
5681
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_review_status ...'
5682
+ end
5683
+ # verify the required parameter 'storefront_oid' is set
5684
+ if @api_client.config.client_side_validation && storefront_oid.nil?
5685
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_review_status"
5686
+ end
5687
+ # verify the required parameter 'commseq_email_uuid' is set
5688
+ if @api_client.config.client_side_validation && commseq_email_uuid.nil?
5689
+ fail ArgumentError, "Missing the required parameter 'commseq_email_uuid' when calling StorefrontApi.get_email_review_status"
5690
+ end
5691
+ # resource path
5692
+ local_var_path = '/storefront/{storefront_oid}/email/emails/{commseq_email_uuid}/review_status'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'commseq_email_uuid' + '}', CGI.escape(commseq_email_uuid.to_s))
5693
+
5694
+ # query parameters
5695
+ query_params = opts[:query_params] || {}
5696
+
5697
+ # header parameters
5698
+ header_params = opts[:header_params] || {}
5699
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
5700
+ # HTTP header 'Accept' (if needed)
5701
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5702
+
5703
+ # form parameters
5704
+ form_params = opts[:form_params] || {}
5705
+
5706
+ # http body (model)
5707
+ post_body = opts[:debug_body]
5708
+
5709
+ # return_type
5710
+ return_type = opts[:debug_return_type] || 'EmailCommseqEmailReviewStatusResponse'
5711
+
5712
+ # auth_names
5713
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
5714
+
5715
+ new_options = opts.merge(
5716
+ :operation => :"StorefrontApi.get_email_review_status",
5717
+ :header_params => header_params,
5718
+ :query_params => query_params,
5719
+ :form_params => form_params,
5720
+ :body => post_body,
5721
+ :auth_names => auth_names,
5722
+ :return_type => return_type
5723
+ )
5724
+
5725
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
5726
+ if @api_client.config.debugging
5727
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_review_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5728
+ end
5729
+ return data, status_code, headers
5730
+ end
5731
+
5732
+ # Get the review status of multiple emails
5733
+ # Returns one entry per requested email, in the order requested, so a caller polling a campaign does not have to reconcile a short response.
5734
+ # @param storefront_oid [Integer]
5735
+ # @param email_commseq_email_review_statuses_request [EmailCommseqEmailReviewStatusesRequest] Request of email uuids
5736
+ # @param [Hash] opts the optional parameters
5737
+ # @return [EmailCommseqEmailReviewStatusesResponse]
5738
+ def get_email_review_statuses_multiple(storefront_oid, email_commseq_email_review_statuses_request, opts = {})
5739
+ data, _status_code, _headers = get_email_review_statuses_multiple_with_http_info(storefront_oid, email_commseq_email_review_statuses_request, opts)
5740
+ data
5741
+ end
5742
+
5743
+ # Get the review status of multiple emails
5744
+ # Returns one entry per requested email, in the order requested, so a caller polling a campaign does not have to reconcile a short response.
5745
+ # @param storefront_oid [Integer]
5746
+ # @param email_commseq_email_review_statuses_request [EmailCommseqEmailReviewStatusesRequest] Request of email uuids
5747
+ # @param [Hash] opts the optional parameters
5748
+ # @return [Array<(EmailCommseqEmailReviewStatusesResponse, Integer, Hash)>] EmailCommseqEmailReviewStatusesResponse data, response status code and response headers
5749
+ def get_email_review_statuses_multiple_with_http_info(storefront_oid, email_commseq_email_review_statuses_request, opts = {})
5750
+ if @api_client.config.debugging
5751
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_review_statuses_multiple ...'
5752
+ end
5753
+ # verify the required parameter 'storefront_oid' is set
5754
+ if @api_client.config.client_side_validation && storefront_oid.nil?
5755
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_review_statuses_multiple"
5756
+ end
5757
+ # verify the required parameter 'email_commseq_email_review_statuses_request' is set
5758
+ if @api_client.config.client_side_validation && email_commseq_email_review_statuses_request.nil?
5759
+ fail ArgumentError, "Missing the required parameter 'email_commseq_email_review_statuses_request' when calling StorefrontApi.get_email_review_statuses_multiple"
5760
+ end
5761
+ # resource path
5762
+ local_var_path = '/storefront/{storefront_oid}/email/emails/review_status/multiple'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
5763
+
5764
+ # query parameters
5765
+ query_params = opts[:query_params] || {}
5766
+
5767
+ # header parameters
5768
+ header_params = opts[:header_params] || {}
5769
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
5770
+ # HTTP header 'Accept' (if needed)
5771
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5772
+ # HTTP header 'Content-Type'
5773
+ content_type = @api_client.select_header_content_type(['application/json'])
5774
+ if !content_type.nil?
5775
+ header_params['Content-Type'] = content_type
5776
+ end
5777
+
5778
+ # form parameters
5779
+ form_params = opts[:form_params] || {}
5780
+
5781
+ # http body (model)
5782
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(email_commseq_email_review_statuses_request)
5783
+
5784
+ # return_type
5785
+ return_type = opts[:debug_return_type] || 'EmailCommseqEmailReviewStatusesResponse'
5786
+
5787
+ # auth_names
5788
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
5789
+
5790
+ new_options = opts.merge(
5791
+ :operation => :"StorefrontApi.get_email_review_statuses_multiple",
5792
+ :header_params => header_params,
5793
+ :query_params => query_params,
5794
+ :form_params => form_params,
5795
+ :body => post_body,
5796
+ :auth_names => auth_names,
5797
+ :return_type => return_type
5798
+ )
5799
+
5800
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
5801
+ if @api_client.config.debugging
5802
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_review_statuses_multiple\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5803
+ end
5804
+ return data, status_code, headers
5805
+ end
5806
+
5664
5807
  # Get email segment
5665
5808
  # @param storefront_oid [Integer]
5666
5809
  # @param email_segment_uuid [String]
@@ -0,0 +1,324 @@
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 EmailCommseqEmailReviewStatus
18
+ # Date the review was approved or rejected
19
+ attr_accessor :decided_dts
20
+
21
+ # Review UUID
22
+ attr_accessor :esp_commseq_email_review_uuid
23
+
24
+ # Email communication sequence email UUID
25
+ attr_accessor :esp_commseq_email_uuid
26
+
27
+ # Email communication sequence UUID
28
+ attr_accessor :esp_commseq_uuid
29
+
30
+ # Why the email was rejected, and what to change. Only present when the state is rejected.
31
+ attr_accessor :rejection_reason
32
+
33
+ # Date the review was requested
34
+ attr_accessor :requested_dts
35
+
36
+ # State of the review
37
+ attr_accessor :state
38
+
39
+ # Subject of the email as it was reviewed
40
+ attr_accessor :subject
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'decided_dts' => :'decided_dts',
68
+ :'esp_commseq_email_review_uuid' => :'esp_commseq_email_review_uuid',
69
+ :'esp_commseq_email_uuid' => :'esp_commseq_email_uuid',
70
+ :'esp_commseq_uuid' => :'esp_commseq_uuid',
71
+ :'rejection_reason' => :'rejection_reason',
72
+ :'requested_dts' => :'requested_dts',
73
+ :'state' => :'state',
74
+ :'subject' => :'subject'
75
+ }
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'decided_dts' => :'String',
87
+ :'esp_commseq_email_review_uuid' => :'String',
88
+ :'esp_commseq_email_uuid' => :'String',
89
+ :'esp_commseq_uuid' => :'String',
90
+ :'rejection_reason' => :'String',
91
+ :'requested_dts' => :'String',
92
+ :'state' => :'String',
93
+ :'subject' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::EmailCommseqEmailReviewStatus` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::EmailCommseqEmailReviewStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'decided_dts')
119
+ self.decided_dts = attributes[:'decided_dts']
120
+ end
121
+
122
+ if attributes.key?(:'esp_commseq_email_review_uuid')
123
+ self.esp_commseq_email_review_uuid = attributes[:'esp_commseq_email_review_uuid']
124
+ end
125
+
126
+ if attributes.key?(:'esp_commseq_email_uuid')
127
+ self.esp_commseq_email_uuid = attributes[:'esp_commseq_email_uuid']
128
+ end
129
+
130
+ if attributes.key?(:'esp_commseq_uuid')
131
+ self.esp_commseq_uuid = attributes[:'esp_commseq_uuid']
132
+ end
133
+
134
+ if attributes.key?(:'rejection_reason')
135
+ self.rejection_reason = attributes[:'rejection_reason']
136
+ end
137
+
138
+ if attributes.key?(:'requested_dts')
139
+ self.requested_dts = attributes[:'requested_dts']
140
+ end
141
+
142
+ if attributes.key?(:'state')
143
+ self.state = attributes[:'state']
144
+ end
145
+
146
+ if attributes.key?(:'subject')
147
+ self.subject = attributes[:'subject']
148
+ end
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properties with the reasons
153
+ def list_invalid_properties
154
+ invalid_properties = Array.new
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ state_validator = EnumAttributeValidator.new('String', ["not_submitted", "pending", "approved", "rejected"])
162
+ return false unless state_validator.valid?(@state)
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method checking allowed values (enum).
167
+ # @param [Object] state Object to be assigned
168
+ def state=(state)
169
+ validator = EnumAttributeValidator.new('String', ["not_submitted", "pending", "approved", "rejected"])
170
+ unless validator.valid?(state)
171
+ fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
172
+ end
173
+ @state = state
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ decided_dts == o.decided_dts &&
182
+ esp_commseq_email_review_uuid == o.esp_commseq_email_review_uuid &&
183
+ esp_commseq_email_uuid == o.esp_commseq_email_uuid &&
184
+ esp_commseq_uuid == o.esp_commseq_uuid &&
185
+ rejection_reason == o.rejection_reason &&
186
+ requested_dts == o.requested_dts &&
187
+ state == o.state &&
188
+ subject == o.subject
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [decided_dts, esp_commseq_email_review_uuid, esp_commseq_email_uuid, esp_commseq_uuid, rejection_reason, requested_dts, state, subject].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ new.build_from_hash(attributes)
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ self.class.openapi_types.each_pair do |key, type|
217
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
218
+ self.send("#{key}=", nil)
219
+ elsif type =~ /\AArray<(.*)>/i
220
+ # check to ensure the input is an array given that the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
223
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
+ end
225
+ elsif !attributes[self.class.attribute_map[key]].nil?
226
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
+ end
228
+ end
229
+
230
+ self
231
+ end
232
+
233
+ # Deserializes the data based on type
234
+ # @param string type Data type
235
+ # @param string value Value to be deserialized
236
+ # @return [Object] Deserialized data
237
+ def _deserialize(type, value)
238
+ case type.to_sym
239
+ when :Time
240
+ Time.parse(value)
241
+ when :Date
242
+ Date.parse(value)
243
+ when :String
244
+ value.to_s
245
+ when :Integer
246
+ value.to_i
247
+ when :Float
248
+ value.to_f
249
+ when :Boolean
250
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
+ true
252
+ else
253
+ false
254
+ end
255
+ when :Object
256
+ # generic object (usually a Hash), return directly
257
+ value
258
+ when /\AArray<(?<inner_type>.+)>\z/
259
+ inner_type = Regexp.last_match[:inner_type]
260
+ value.map { |v| _deserialize(inner_type, v) }
261
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
+ k_type = Regexp.last_match[:k_type]
263
+ v_type = Regexp.last_match[:v_type]
264
+ {}.tap do |hash|
265
+ value.each do |k, v|
266
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
+ end
268
+ end
269
+ else # model
270
+ # models (e.g. Pet) or oneOf
271
+ klass = UltracartClient.const_get(type)
272
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
+ end
274
+ end
275
+
276
+ # Returns the string representation of the object
277
+ # @return [String] String presentation of the object
278
+ def to_s
279
+ to_hash.to_s
280
+ end
281
+
282
+ # to_body is an alias to to_hash (backward compatibility)
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_body
285
+ to_hash
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ # Outputs non-array value in the form of hash
305
+ # For object, use to_hash. Otherwise, just return the value
306
+ # @param [Object] value Any valid value
307
+ # @return [Hash] Returns the value in the form of hash
308
+ def _to_hash(value)
309
+ if value.is_a?(Array)
310
+ value.compact.map { |v| _to_hash(v) }
311
+ elsif value.is_a?(Hash)
312
+ {}.tap do |hash|
313
+ value.each { |k, v| hash[k] = _to_hash(v) }
314
+ end
315
+ elsif value.respond_to? :to_hash
316
+ value.to_hash
317
+ else
318
+ value
319
+ end
320
+ end
321
+
322
+ end
323
+
324
+ end