ultracart_api 4.1.110 → 4.1.111

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.
@@ -3601,6 +3601,91 @@ module UltracartClient
3601
3601
  return data, status_code, headers
3602
3602
  end
3603
3603
 
3604
+ # Get a customer's dispatch-log journey across all flows/campaigns
3605
+ # Paginated, date-boundable journey of every flow/campaign step a customer moved through (AP1/AP2), time-sorted. Rows are lean; fetch a row's detail via getEmailStepDispatchLogDetail. scanForward=false (default) returns recent-first; true returns chronological progression. Page forward until 'more' is false.
3606
+ # @param storefront_oid [Integer]
3607
+ # @param email_customer_uuid [String]
3608
+ # @param [Hash] opts the optional parameters
3609
+ # @option opts [String] :since
3610
+ # @option opts [String] :_until
3611
+ # @option opts [Integer] :page_number
3612
+ # @option opts [Integer] :page_size
3613
+ # @option opts [Boolean] :scan_forward
3614
+ # @return [EmailDispatchLogsResponse]
3615
+ def get_email_customer_dispatch_logs(storefront_oid, email_customer_uuid, opts = {})
3616
+ data, _status_code, _headers = get_email_customer_dispatch_logs_with_http_info(storefront_oid, email_customer_uuid, opts)
3617
+ data
3618
+ end
3619
+
3620
+ # Get a customer's dispatch-log journey across all flows/campaigns
3621
+ # Paginated, date-boundable journey of every flow/campaign step a customer moved through (AP1/AP2), time-sorted. Rows are lean; fetch a row's detail via getEmailStepDispatchLogDetail. scanForward=false (default) returns recent-first; true returns chronological progression. Page forward until 'more' is false.
3622
+ # @param storefront_oid [Integer]
3623
+ # @param email_customer_uuid [String]
3624
+ # @param [Hash] opts the optional parameters
3625
+ # @option opts [String] :since
3626
+ # @option opts [String] :_until
3627
+ # @option opts [Integer] :page_number
3628
+ # @option opts [Integer] :page_size
3629
+ # @option opts [Boolean] :scan_forward
3630
+ # @return [Array<(EmailDispatchLogsResponse, Integer, Hash)>] EmailDispatchLogsResponse data, response status code and response headers
3631
+ def get_email_customer_dispatch_logs_with_http_info(storefront_oid, email_customer_uuid, opts = {})
3632
+ if @api_client.config.debugging
3633
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_customer_dispatch_logs ...'
3634
+ end
3635
+ # verify the required parameter 'storefront_oid' is set
3636
+ if @api_client.config.client_side_validation && storefront_oid.nil?
3637
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_customer_dispatch_logs"
3638
+ end
3639
+ # verify the required parameter 'email_customer_uuid' is set
3640
+ if @api_client.config.client_side_validation && email_customer_uuid.nil?
3641
+ fail ArgumentError, "Missing the required parameter 'email_customer_uuid' when calling StorefrontApi.get_email_customer_dispatch_logs"
3642
+ end
3643
+ # resource path
3644
+ local_var_path = '/storefront/{storefront_oid}/email/customers/{email_customer_uuid}/dispatch_logs'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'email_customer_uuid' + '}', CGI.escape(email_customer_uuid.to_s))
3645
+
3646
+ # query parameters
3647
+ query_params = opts[:query_params] || {}
3648
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
3649
+ query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
3650
+ query_params[:'pageNumber'] = opts[:'page_number'] if !opts[:'page_number'].nil?
3651
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
3652
+ query_params[:'scanForward'] = opts[:'scan_forward'] if !opts[:'scan_forward'].nil?
3653
+
3654
+ # header parameters
3655
+ header_params = opts[:header_params] || {}
3656
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
3657
+ # HTTP header 'Accept' (if needed)
3658
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
3659
+
3660
+ # form parameters
3661
+ form_params = opts[:form_params] || {}
3662
+
3663
+ # http body (model)
3664
+ post_body = opts[:debug_body]
3665
+
3666
+ # return_type
3667
+ return_type = opts[:debug_return_type] || 'EmailDispatchLogsResponse'
3668
+
3669
+ # auth_names
3670
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
3671
+
3672
+ new_options = opts.merge(
3673
+ :operation => :"StorefrontApi.get_email_customer_dispatch_logs",
3674
+ :header_params => header_params,
3675
+ :query_params => query_params,
3676
+ :form_params => form_params,
3677
+ :body => post_body,
3678
+ :auth_names => auth_names,
3679
+ :return_type => return_type
3680
+ )
3681
+
3682
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3683
+ if @api_client.config.debugging
3684
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_customer_dispatch_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3685
+ end
3686
+ return data, status_code, headers
3687
+ end
3688
+
3604
3689
  # Get customers editor URL
3605
3690
  # @param storefront_oid [Integer]
3606
3691
  # @param email_customer_uuid [String]
@@ -3870,6 +3955,73 @@ module UltracartClient
3870
3955
  return data, status_code, headers
3871
3956
  end
3872
3957
 
3958
+ # Resolve a customer email to its ESP customer UUID
3959
+ # Entry-hop resolver for the customer-journey screen (AP0). Returns the esp_customer_uuid for a merchant's customer email, or a null uuid when the email is not on file.
3960
+ # @param storefront_oid [Integer]
3961
+ # @param [Hash] opts the optional parameters
3962
+ # @option opts [String] :email
3963
+ # @return [EmailCustomerLookupResponse]
3964
+ def get_email_dispatch_log_customer_lookup(storefront_oid, opts = {})
3965
+ data, _status_code, _headers = get_email_dispatch_log_customer_lookup_with_http_info(storefront_oid, opts)
3966
+ data
3967
+ end
3968
+
3969
+ # Resolve a customer email to its ESP customer UUID
3970
+ # Entry-hop resolver for the customer-journey screen (AP0). Returns the esp_customer_uuid for a merchant&#39;s customer email, or a null uuid when the email is not on file.
3971
+ # @param storefront_oid [Integer]
3972
+ # @param [Hash] opts the optional parameters
3973
+ # @option opts [String] :email
3974
+ # @return [Array<(EmailCustomerLookupResponse, Integer, Hash)>] EmailCustomerLookupResponse data, response status code and response headers
3975
+ def get_email_dispatch_log_customer_lookup_with_http_info(storefront_oid, opts = {})
3976
+ if @api_client.config.debugging
3977
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_dispatch_log_customer_lookup ...'
3978
+ end
3979
+ # verify the required parameter 'storefront_oid' is set
3980
+ if @api_client.config.client_side_validation && storefront_oid.nil?
3981
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_dispatch_log_customer_lookup"
3982
+ end
3983
+ # resource path
3984
+ local_var_path = '/storefront/{storefront_oid}/email/dispatch_logs/customer_lookup'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
3985
+
3986
+ # query parameters
3987
+ query_params = opts[:query_params] || {}
3988
+ query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
3989
+
3990
+ # header parameters
3991
+ header_params = opts[:header_params] || {}
3992
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
3993
+ # HTTP header 'Accept' (if needed)
3994
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
3995
+
3996
+ # form parameters
3997
+ form_params = opts[:form_params] || {}
3998
+
3999
+ # http body (model)
4000
+ post_body = opts[:debug_body]
4001
+
4002
+ # return_type
4003
+ return_type = opts[:debug_return_type] || 'EmailCustomerLookupResponse'
4004
+
4005
+ # auth_names
4006
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
4007
+
4008
+ new_options = opts.merge(
4009
+ :operation => :"StorefrontApi.get_email_dispatch_log_customer_lookup",
4010
+ :header_params => header_params,
4011
+ :query_params => query_params,
4012
+ :form_params => form_params,
4013
+ :body => post_body,
4014
+ :auth_names => auth_names,
4015
+ :return_type => return_type
4016
+ )
4017
+
4018
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
4019
+ if @api_client.config.debugging
4020
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_dispatch_log_customer_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4021
+ end
4022
+ return data, status_code, headers
4023
+ end
4024
+
3873
4025
  # Get email dispatch logs
3874
4026
  # @param storefront_oid [Integer]
3875
4027
  # @param commseq_uuid [String]
@@ -6103,6 +6255,176 @@ module UltracartClient
6103
6255
  return data, status_code, headers
6104
6256
  end
6105
6257
 
6258
+ # Get the full detail of a single dispatch-log record
6259
+ # Fetches and gunzips the full detail payload of one dispatch-log record (AP5 drill-down), identified by its step plus the log_dts and esp_customer_uuid shown on the list row.
6260
+ # @param storefront_oid [Integer]
6261
+ # @param commseq_uuid [String]
6262
+ # @param commseq_step_uuid [String]
6263
+ # @param [Hash] opts the optional parameters
6264
+ # @option opts [String] :log_dts
6265
+ # @option opts [String] :esp_customer_uuid
6266
+ # @return [EmailDispatchLogDetailResponse]
6267
+ def get_email_step_dispatch_log_detail(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
6268
+ data, _status_code, _headers = get_email_step_dispatch_log_detail_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts)
6269
+ data
6270
+ end
6271
+
6272
+ # Get the full detail of a single dispatch-log record
6273
+ # Fetches and gunzips the full detail payload of one dispatch-log record (AP5 drill-down), identified by its step plus the log_dts and esp_customer_uuid shown on the list row.
6274
+ # @param storefront_oid [Integer]
6275
+ # @param commseq_uuid [String]
6276
+ # @param commseq_step_uuid [String]
6277
+ # @param [Hash] opts the optional parameters
6278
+ # @option opts [String] :log_dts
6279
+ # @option opts [String] :esp_customer_uuid
6280
+ # @return [Array<(EmailDispatchLogDetailResponse, Integer, Hash)>] EmailDispatchLogDetailResponse data, response status code and response headers
6281
+ def get_email_step_dispatch_log_detail_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
6282
+ if @api_client.config.debugging
6283
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_step_dispatch_log_detail ...'
6284
+ end
6285
+ # verify the required parameter 'storefront_oid' is set
6286
+ if @api_client.config.client_side_validation && storefront_oid.nil?
6287
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_step_dispatch_log_detail"
6288
+ end
6289
+ # verify the required parameter 'commseq_uuid' is set
6290
+ if @api_client.config.client_side_validation && commseq_uuid.nil?
6291
+ fail ArgumentError, "Missing the required parameter 'commseq_uuid' when calling StorefrontApi.get_email_step_dispatch_log_detail"
6292
+ end
6293
+ # verify the required parameter 'commseq_step_uuid' is set
6294
+ if @api_client.config.client_side_validation && commseq_step_uuid.nil?
6295
+ fail ArgumentError, "Missing the required parameter 'commseq_step_uuid' when calling StorefrontApi.get_email_step_dispatch_log_detail"
6296
+ end
6297
+ # resource path
6298
+ local_var_path = '/storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/steps/{commseq_step_uuid}/dispatch_logs/detail'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'commseq_uuid' + '}', CGI.escape(commseq_uuid.to_s)).sub('{' + 'commseq_step_uuid' + '}', CGI.escape(commseq_step_uuid.to_s))
6299
+
6300
+ # query parameters
6301
+ query_params = opts[:query_params] || {}
6302
+ query_params[:'log_dts'] = opts[:'log_dts'] if !opts[:'log_dts'].nil?
6303
+ query_params[:'esp_customer_uuid'] = opts[:'esp_customer_uuid'] if !opts[:'esp_customer_uuid'].nil?
6304
+
6305
+ # header parameters
6306
+ header_params = opts[:header_params] || {}
6307
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
6308
+ # HTTP header 'Accept' (if needed)
6309
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
6310
+
6311
+ # form parameters
6312
+ form_params = opts[:form_params] || {}
6313
+
6314
+ # http body (model)
6315
+ post_body = opts[:debug_body]
6316
+
6317
+ # return_type
6318
+ return_type = opts[:debug_return_type] || 'EmailDispatchLogDetailResponse'
6319
+
6320
+ # auth_names
6321
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
6322
+
6323
+ new_options = opts.merge(
6324
+ :operation => :"StorefrontApi.get_email_step_dispatch_log_detail",
6325
+ :header_params => header_params,
6326
+ :query_params => query_params,
6327
+ :form_params => form_params,
6328
+ :body => post_body,
6329
+ :auth_names => auth_names,
6330
+ :return_type => return_type
6331
+ )
6332
+
6333
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
6334
+ if @api_client.config.debugging
6335
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_step_dispatch_log_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
6336
+ end
6337
+ return data, status_code, headers
6338
+ end
6339
+
6340
+ # Get a paginated, date-boundable dispatch-log feed for a step
6341
+ # Paginated per-step dispatch activity with 90-day depth (AP3/AP4). Rows are lean, rendered from the DynamoDB keys; fetch a row's full detail via getEmailStepDispatchLogDetail. Page forward by incrementing pageNumber until the response 'more' flag is false. since/until are inclusive ISO-8601 bounds on log_dts.
6342
+ # @param storefront_oid [Integer]
6343
+ # @param commseq_uuid [String]
6344
+ # @param commseq_step_uuid [String]
6345
+ # @param [Hash] opts the optional parameters
6346
+ # @option opts [String] :since
6347
+ # @option opts [String] :_until
6348
+ # @option opts [Integer] :page_number
6349
+ # @option opts [Integer] :page_size
6350
+ # @return [EmailDispatchLogsResponse]
6351
+ def get_email_step_dispatch_logs(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
6352
+ data, _status_code, _headers = get_email_step_dispatch_logs_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts)
6353
+ data
6354
+ end
6355
+
6356
+ # Get a paginated, date-boundable dispatch-log feed for a step
6357
+ # Paginated per-step dispatch activity with 90-day depth (AP3/AP4). Rows are lean, rendered from the DynamoDB keys; fetch a row&#39;s full detail via getEmailStepDispatchLogDetail. Page forward by incrementing pageNumber until the response &#39;more&#39; flag is false. since/until are inclusive ISO-8601 bounds on log_dts.
6358
+ # @param storefront_oid [Integer]
6359
+ # @param commseq_uuid [String]
6360
+ # @param commseq_step_uuid [String]
6361
+ # @param [Hash] opts the optional parameters
6362
+ # @option opts [String] :since
6363
+ # @option opts [String] :_until
6364
+ # @option opts [Integer] :page_number
6365
+ # @option opts [Integer] :page_size
6366
+ # @return [Array<(EmailDispatchLogsResponse, Integer, Hash)>] EmailDispatchLogsResponse data, response status code and response headers
6367
+ def get_email_step_dispatch_logs_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
6368
+ if @api_client.config.debugging
6369
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_step_dispatch_logs ...'
6370
+ end
6371
+ # verify the required parameter 'storefront_oid' is set
6372
+ if @api_client.config.client_side_validation && storefront_oid.nil?
6373
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_step_dispatch_logs"
6374
+ end
6375
+ # verify the required parameter 'commseq_uuid' is set
6376
+ if @api_client.config.client_side_validation && commseq_uuid.nil?
6377
+ fail ArgumentError, "Missing the required parameter 'commseq_uuid' when calling StorefrontApi.get_email_step_dispatch_logs"
6378
+ end
6379
+ # verify the required parameter 'commseq_step_uuid' is set
6380
+ if @api_client.config.client_side_validation && commseq_step_uuid.nil?
6381
+ fail ArgumentError, "Missing the required parameter 'commseq_step_uuid' when calling StorefrontApi.get_email_step_dispatch_logs"
6382
+ end
6383
+ # resource path
6384
+ local_var_path = '/storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/steps/{commseq_step_uuid}/dispatch_logs'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'commseq_uuid' + '}', CGI.escape(commseq_uuid.to_s)).sub('{' + 'commseq_step_uuid' + '}', CGI.escape(commseq_step_uuid.to_s))
6385
+
6386
+ # query parameters
6387
+ query_params = opts[:query_params] || {}
6388
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
6389
+ query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
6390
+ query_params[:'pageNumber'] = opts[:'page_number'] if !opts[:'page_number'].nil?
6391
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
6392
+
6393
+ # header parameters
6394
+ header_params = opts[:header_params] || {}
6395
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
6396
+ # HTTP header 'Accept' (if needed)
6397
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
6398
+
6399
+ # form parameters
6400
+ form_params = opts[:form_params] || {}
6401
+
6402
+ # http body (model)
6403
+ post_body = opts[:debug_body]
6404
+
6405
+ # return_type
6406
+ return_type = opts[:debug_return_type] || 'EmailDispatchLogsResponse'
6407
+
6408
+ # auth_names
6409
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
6410
+
6411
+ new_options = opts.merge(
6412
+ :operation => :"StorefrontApi.get_email_step_dispatch_logs",
6413
+ :header_params => header_params,
6414
+ :query_params => query_params,
6415
+ :form_params => form_params,
6416
+ :body => post_body,
6417
+ :auth_names => auth_names,
6418
+ :return_type => return_type
6419
+ )
6420
+
6421
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
6422
+ if @api_client.config.debugging
6423
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_step_dispatch_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
6424
+ end
6425
+ return data, status_code, headers
6426
+ end
6427
+
6106
6428
  # Get email template
6107
6429
  # @param storefront_oid [Integer]
6108
6430
  # @param email_template_oid [Integer]
@@ -0,0 +1,267 @@
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 EmailCustomerLookupResponse
18
+ # The email that was looked up
19
+ attr_accessor :email
20
+
21
+ attr_accessor :error
22
+
23
+ # ESP customer UUID, or null when the email is not on file
24
+ attr_accessor :esp_customer_uuid
25
+
26
+ attr_accessor :metadata
27
+
28
+ # Indicates if API call was successful
29
+ attr_accessor :success
30
+
31
+ attr_accessor :warning
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'email' => :'email',
37
+ :'error' => :'error',
38
+ :'esp_customer_uuid' => :'esp_customer_uuid',
39
+ :'metadata' => :'metadata',
40
+ :'success' => :'success',
41
+ :'warning' => :'warning'
42
+ }
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'email' => :'String',
54
+ :'error' => :'Error',
55
+ :'esp_customer_uuid' => :'String',
56
+ :'metadata' => :'ResponseMetadata',
57
+ :'success' => :'Boolean',
58
+ :'warning' => :'Warning'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::EmailCustomerLookupResponse` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::EmailCustomerLookupResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'email')
84
+ self.email = attributes[:'email']
85
+ end
86
+
87
+ if attributes.key?(:'error')
88
+ self.error = attributes[:'error']
89
+ end
90
+
91
+ if attributes.key?(:'esp_customer_uuid')
92
+ self.esp_customer_uuid = attributes[:'esp_customer_uuid']
93
+ end
94
+
95
+ if attributes.key?(:'metadata')
96
+ self.metadata = attributes[:'metadata']
97
+ end
98
+
99
+ if attributes.key?(:'success')
100
+ self.success = attributes[:'success']
101
+ end
102
+
103
+ if attributes.key?(:'warning')
104
+ self.warning = attributes[:'warning']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ email == o.email &&
127
+ error == o.error &&
128
+ esp_customer_uuid == o.esp_customer_uuid &&
129
+ metadata == o.metadata &&
130
+ success == o.success &&
131
+ warning == o.warning
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [email, error, esp_customer_uuid, metadata, success, warning].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ new.build_from_hash(attributes)
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ attributes = attributes.transform_keys(&:to_sym)
159
+ self.class.openapi_types.each_pair do |key, type|
160
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
161
+ self.send("#{key}=", nil)
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ end
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :Time
183
+ Time.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :Boolean
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ # models (e.g. Pet) or oneOf
214
+ klass = UltracartClient.const_get(type)
215
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+
265
+ end
266
+
267
+ end