ultracart_api 3.10.29 → 3.10.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6abed8e1e4872a7847e7b24bf7a961f5b4327dc094b42c131548a1519bc36031
4
- data.tar.gz: '0881d8766ba29f7ed66f57390336fcbf3e50368dd4de0391171ae2bf699fe2a9'
3
+ metadata.gz: a2b344c52198212cfc7c83b6a1ac5f1520d6b6fcdaf5c549c30392549e728369
4
+ data.tar.gz: fed93ea72177fb94617dcc445c60ffd8a331c9fd97f58caa5164d7940e973be1
5
5
  SHA512:
6
- metadata.gz: ab263cb66fcfa98b1e5bd64425baffd8202eace4d65e34eef6e680657cbaf50beb17ebf32bee8ba51778a9270a0bc3be1bc1c80aa970d2daabf90faf330ddfbe
7
- data.tar.gz: 19a908d8e9aa5c372e741d8a9d380d6edf7443763696e70d8de3264e9109b041a7a04e90456b1f777a49d3b3a64d922fe07739f1d59313c49b6aae60684dbd1a
6
+ metadata.gz: 56ed6c0e1680ec1d66959a42217132045f54afa559b30416b8926816bac2c933249a33285d3e8c7533ac034674eb3fddbdec4fdb313fe9cc79a60a95c607b1fa
7
+ data.tar.gz: 3316892e49d0f28626fa1cbda664c5980b9a01c250994529045a50489fb739eb9a4c12dedf07cd92a76adbea89a8ee27e1b2c5486ec154d36b6a70758be0a28a
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 3.10.29
10
+ - Package version: 3.10.32
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,15 +24,15 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-3.10.29.gem
27
+ gem install ./ultracart_api-3.10.32.gem
28
28
  ```
29
- (for development, run `gem install --dev ./ultracart_api-3.10.29.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./ultracart_api-3.10.32.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'ultracart_api', '~> 3.10.29'
35
+ gem 'ultracart_api', '~> 3.10.32'
36
36
 
37
37
  ### Install from Git
38
38
 
@@ -364,6 +364,7 @@ Class | Method | HTTP request | Description
364
364
  *UltracartClient::StorefrontApi* | [**send_email_test**](docs/StorefrontApi.md#send_email_test) | **POST** /storefront/{storefront_oid}/email/emails/{commseq_email_uuid}/test | Send email test
365
365
  *UltracartClient::StorefrontApi* | [**send_postcard_test**](docs/StorefrontApi.md#send_postcard_test) | **POST** /storefront/{storefront_oid}/email/postcards/{commseq_postcard_uuid}/test | Send postcard test
366
366
  *UltracartClient::StorefrontApi* | [**send_webhook_test**](docs/StorefrontApi.md#send_webhook_test) | **POST** /storefront/{storefront_oid}/email/webhooks/test | Send webhook test
367
+ *UltracartClient::StorefrontApi* | [**sequence_test**](docs/StorefrontApi.md#sequence_test) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/test | Sequence test
367
368
  *UltracartClient::StorefrontApi* | [**start_email_campaign**](docs/StorefrontApi.md#start_email_campaign) | **PUT** /storefront/{storefront_oid}/email/campaigns/{email_campaign_uuid}/start | Start email campaign
368
369
  *UltracartClient::StorefrontApi* | [**subscribe_to_email_list**](docs/StorefrontApi.md#subscribe_to_email_list) | **POST** /storefront/{storefront_oid}/email/lists/{email_list_uuid}/subscribe | Subscribe customers to email list
369
370
  *UltracartClient::StorefrontApi* | [**unfavorite_screen_recording**](docs/StorefrontApi.md#unfavorite_screen_recording) | **DELETE** /storefront/{storefront_oid}/screen_recordings/{screen_recording_uuid}/favorite | Remove favorite flag on screen recording
@@ -562,6 +563,8 @@ Class | Method | HTTP request | Description
562
563
  - [UltracartClient::ConversationAgentAuth](docs/ConversationAgentAuth.md)
563
564
  - [UltracartClient::ConversationAgentAuthResponse](docs/ConversationAgentAuthResponse.md)
564
565
  - [UltracartClient::ConversationEventQueuePosition](docs/ConversationEventQueuePosition.md)
566
+ - [UltracartClient::ConversationEventRRWeb](docs/ConversationEventRRWeb.md)
567
+ - [UltracartClient::ConversationEventTyping](docs/ConversationEventTyping.md)
565
568
  - [UltracartClient::ConversationMessage](docs/ConversationMessage.md)
566
569
  - [UltracartClient::ConversationMessageTransportStatus](docs/ConversationMessageTransportStatus.md)
567
570
  - [UltracartClient::ConversationMultimediaUploadUrl](docs/ConversationMultimediaUploadUrl.md)
@@ -701,6 +704,8 @@ Class | Method | HTTP request | Description
701
704
  - [UltracartClient::EmailCommseqPostcardsRequest](docs/EmailCommseqPostcardsRequest.md)
702
705
  - [UltracartClient::EmailCommseqPostcardsResponse](docs/EmailCommseqPostcardsResponse.md)
703
706
  - [UltracartClient::EmailCommseqResponse](docs/EmailCommseqResponse.md)
707
+ - [UltracartClient::EmailCommseqSequenceTestRequest](docs/EmailCommseqSequenceTestRequest.md)
708
+ - [UltracartClient::EmailCommseqSequenceTestResponse](docs/EmailCommseqSequenceTestResponse.md)
704
709
  - [UltracartClient::EmailCommseqStat](docs/EmailCommseqStat.md)
705
710
  - [UltracartClient::EmailCommseqStatResponse](docs/EmailCommseqStatResponse.md)
706
711
  - [UltracartClient::EmailCommseqStep](docs/EmailCommseqStep.md)
@@ -1167,6 +1172,9 @@ Not every change is committed to every SDK.
1167
1172
 
1168
1173
  | Version | Date | Comments |
1169
1174
  | --: | :-: | --- |
1175
+ | 3.10.32 | 08/03/2022 | more conversation events |
1176
+ | 3.10.31 | 08/02/2022 | storefront communication sequence test method |
1177
+ | 3.10.30 | 08/01/2022 | conversation event refinement |
1170
1178
  | 3.10.29 | 07/29/2022 | conversation development |
1171
1179
  | 3.10.28 | 07/28/2022 | conversation bug fixes |
1172
1180
  | 3.10.27 | 07/28/2022 | conversation message upload keys property |
@@ -0,0 +1,14 @@
1
+ # UltracartClient::ConversationEventRRWeb
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **data** | **String** | | [optional]
7
+ **data_part** | **Integer** | | [optional]
8
+ **data_sha256** | **String** | | [optional]
9
+ **data_total_parts** | **Integer** | | [optional]
10
+ **data_total_sha256** | **String** | | [optional]
11
+ **event_index** | **Integer** | | [optional]
12
+ **type** | **String** | Type of event | [optional]
13
+
14
+
@@ -0,0 +1,10 @@
1
+ # UltracartClient::ConversationEventTyping
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **author_conversation_participant_arn** | **String** | | [optional]
7
+ **author_conversation_participant_name** | **String** | | [optional]
8
+ **value** | **String** | | [optional]
9
+
10
+
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
10
10
  **media_urls** | **Array<String>** | | [optional]
11
11
  **message_dts** | **String** | Message date/time | [optional]
12
12
  **transport_statuses** | [**Array<ConversationMessageTransportStatus>**](ConversationMessageTransportStatus.md) | | [optional]
13
+ **type** | **String** | Message type | [optional]
13
14
  **upload_keys** | **Array<String>** | | [optional]
14
15
 
15
16
 
@@ -9,7 +9,9 @@ Name | Type | Description | Notes
9
9
  **event_new_message** | [**ConversationSummary**](ConversationSummary.md) | | [optional]
10
10
  **event_queue_position** | [**ConversationEventQueuePosition**](ConversationEventQueuePosition.md) | | [optional]
11
11
  **event_queue_status_update** | [**ConversationWebchatQueueStatus**](ConversationWebchatQueueStatus.md) | | [optional]
12
+ **event_rrweb** | [**ConversationEventRRWeb**](ConversationEventRRWeb.md) | | [optional]
12
13
  **event_type** | **String** | Type of event | [optional]
14
+ **event_typing** | [**ConversationEventTyping**](ConversationEventTyping.md) | | [optional]
13
15
  **event_updated_message** | [**ConversationMessage**](ConversationMessage.md) | | [optional]
14
16
  **message** | [**ConversationMessage**](ConversationMessage.md) | | [optional]
15
17
  **type** | **String** | Type of message | [optional]
@@ -0,0 +1,15 @@
1
+ # UltracartClient::EmailCommseqSequenceTestRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **cart_id** | **String** | | [optional]
7
+ **cart_item_ids** | **Array<String>** | | [optional]
8
+ **esp_commseq_uuid** | **String** | | [optional]
9
+ **name** | **String** | | [optional]
10
+ **order_id** | **String** | | [optional]
11
+ **please_review** | **BOOLEAN** | | [optional]
12
+ **send_to_email** | **String** | | [optional]
13
+ **send_to_logged_in_user** | **BOOLEAN** | | [optional]
14
+
15
+
@@ -0,0 +1,11 @@
1
+ # UltracartClient::EmailCommseqSequenceTestResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **error** | [**Error**](Error.md) | | [optional]
7
+ **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional]
8
+ **success** | **BOOLEAN** | Indicates if API call was successful | [optional]
9
+ **warning** | [**Warning**](Warning.md) | | [optional]
10
+
11
+
@@ -140,6 +140,7 @@ Method | HTTP request | Description
140
140
  [**send_email_test**](StorefrontApi.md#send_email_test) | **POST** /storefront/{storefront_oid}/email/emails/{commseq_email_uuid}/test | Send email test
141
141
  [**send_postcard_test**](StorefrontApi.md#send_postcard_test) | **POST** /storefront/{storefront_oid}/email/postcards/{commseq_postcard_uuid}/test | Send postcard test
142
142
  [**send_webhook_test**](StorefrontApi.md#send_webhook_test) | **POST** /storefront/{storefront_oid}/email/webhooks/test | Send webhook test
143
+ [**sequence_test**](StorefrontApi.md#sequence_test) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/test | Sequence test
143
144
  [**start_email_campaign**](StorefrontApi.md#start_email_campaign) | **PUT** /storefront/{storefront_oid}/email/campaigns/{email_campaign_uuid}/start | Start email campaign
144
145
  [**subscribe_to_email_list**](StorefrontApi.md#subscribe_to_email_list) | **POST** /storefront/{storefront_oid}/email/lists/{email_list_uuid}/subscribe | Subscribe customers to email list
145
146
  [**unfavorite_screen_recording**](StorefrontApi.md#unfavorite_screen_recording) | **DELETE** /storefront/{storefront_oid}/screen_recordings/{screen_recording_uuid}/favorite | Remove favorite flag on screen recording
@@ -7145,6 +7146,60 @@ Name | Type | Description | Notes
7145
7146
 
7146
7147
 
7147
7148
 
7149
+ # **sequence_test**
7150
+ > EmailCommseqSequenceTestResponse sequence_test(storefront_oid, commseq_uuid, email_commseq_sequence_test_request)
7151
+
7152
+ Sequence test
7153
+
7154
+ ### Example
7155
+ ```ruby
7156
+ # load the gem
7157
+ require 'ultracart_api'
7158
+
7159
+ # Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
7160
+ simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
7161
+ api_instance = UltracartClient::StorefrontApi.new_using_api_key(simple_key, false, false)
7162
+
7163
+
7164
+ storefront_oid = 56 # Integer |
7165
+
7166
+ commseq_uuid = 'commseq_uuid_example' # String |
7167
+
7168
+ email_commseq_sequence_test_request = UltracartClient::EmailCommseqSequenceTestRequest.new # EmailCommseqSequenceTestRequest | Commseq test request
7169
+
7170
+
7171
+ begin
7172
+ #Sequence test
7173
+ result = api_instance.sequence_test(storefront_oid, commseq_uuid, email_commseq_sequence_test_request)
7174
+ p result
7175
+ rescue UltracartClient::ApiError => e
7176
+ puts "Exception when calling StorefrontApi->sequence_test: #{e}"
7177
+ end
7178
+ ```
7179
+
7180
+ ### Parameters
7181
+
7182
+ Name | Type | Description | Notes
7183
+ ------------- | ------------- | ------------- | -------------
7184
+ **storefront_oid** | **Integer**| |
7185
+ **commseq_uuid** | **String**| |
7186
+ **email_commseq_sequence_test_request** | [**EmailCommseqSequenceTestRequest**](EmailCommseqSequenceTestRequest.md)| Commseq test request |
7187
+
7188
+ ### Return type
7189
+
7190
+ [**EmailCommseqSequenceTestResponse**](EmailCommseqSequenceTestResponse.md)
7191
+
7192
+ ### Authorization
7193
+
7194
+ [ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
7195
+
7196
+ ### HTTP request headers
7197
+
7198
+ - **Content-Type**: application/json
7199
+ - **Accept**: application/json
7200
+
7201
+
7202
+
7148
7203
  # **start_email_campaign**
7149
7204
  > BaseResponse start_email_campaign(storefront_oid, email_campaign_uuid)
7150
7205
 
@@ -7979,6 +7979,71 @@ module UltracartClient
7979
7979
  end
7980
7980
  return data, status_code, headers
7981
7981
  end
7982
+ # Sequence test
7983
+ # @param storefront_oid
7984
+ # @param commseq_uuid
7985
+ # @param email_commseq_sequence_test_request Commseq test request
7986
+ # @param [Hash] opts the optional parameters
7987
+ # @return [EmailCommseqSequenceTestResponse]
7988
+ def sequence_test(storefront_oid, commseq_uuid, email_commseq_sequence_test_request, opts = {})
7989
+ data, _status_code, _headers = sequence_test_with_http_info(storefront_oid, commseq_uuid, email_commseq_sequence_test_request, opts)
7990
+ data
7991
+ end
7992
+
7993
+ # Sequence test
7994
+ # @param storefront_oid
7995
+ # @param commseq_uuid
7996
+ # @param email_commseq_sequence_test_request Commseq test request
7997
+ # @param [Hash] opts the optional parameters
7998
+ # @return [Array<(EmailCommseqSequenceTestResponse, Fixnum, Hash)>] EmailCommseqSequenceTestResponse data, response status code and response headers
7999
+ def sequence_test_with_http_info(storefront_oid, commseq_uuid, email_commseq_sequence_test_request, opts = {})
8000
+ if @api_client.config.debugging
8001
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.sequence_test ...'
8002
+ end
8003
+ # verify the required parameter 'storefront_oid' is set
8004
+ if @api_client.config.client_side_validation && storefront_oid.nil?
8005
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.sequence_test"
8006
+ end
8007
+ # verify the required parameter 'commseq_uuid' is set
8008
+ if @api_client.config.client_side_validation && commseq_uuid.nil?
8009
+ fail ArgumentError, "Missing the required parameter 'commseq_uuid' when calling StorefrontApi.sequence_test"
8010
+ end
8011
+ # verify the required parameter 'email_commseq_sequence_test_request' is set
8012
+ if @api_client.config.client_side_validation && email_commseq_sequence_test_request.nil?
8013
+ fail ArgumentError, "Missing the required parameter 'email_commseq_sequence_test_request' when calling StorefrontApi.sequence_test"
8014
+ end
8015
+ # resource path
8016
+ local_var_path = '/storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/test'.sub('{' + 'storefront_oid' + '}', storefront_oid.to_s).sub('{' + 'commseq_uuid' + '}', commseq_uuid.to_s)
8017
+
8018
+ # query parameters
8019
+ query_params = {}
8020
+
8021
+ # header parameters
8022
+ header_params = {}
8023
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
8024
+ # HTTP header 'Accept' (if needed)
8025
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
8026
+ # HTTP header 'Content-Type'
8027
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
8028
+
8029
+ # form parameters
8030
+ form_params = {}
8031
+
8032
+ # http body (model)
8033
+ post_body = @api_client.object_to_http_body(email_commseq_sequence_test_request)
8034
+ auth_names = ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
8035
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
8036
+ :header_params => header_params,
8037
+ :query_params => query_params,
8038
+ :form_params => form_params,
8039
+ :body => post_body,
8040
+ :auth_names => auth_names,
8041
+ :return_type => 'EmailCommseqSequenceTestResponse')
8042
+ if @api_client.config.debugging
8043
+ @api_client.config.logger.debug "API called: StorefrontApi#sequence_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
8044
+ end
8045
+ return data, status_code, headers
8046
+ end
7982
8047
  # Start email campaign
7983
8048
  # @param storefront_oid
7984
8049
  # @param email_campaign_uuid
@@ -0,0 +1,273 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationEventRRWeb
17
+ attr_accessor :data
18
+
19
+ attr_accessor :data_part
20
+
21
+ attr_accessor :data_sha256
22
+
23
+ attr_accessor :data_total_parts
24
+
25
+ attr_accessor :data_total_sha256
26
+
27
+ attr_accessor :event_index
28
+
29
+ # Type of event
30
+ attr_accessor :type
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'data' => :'data',
58
+ :'data_part' => :'data_part',
59
+ :'data_sha256' => :'data_sha256',
60
+ :'data_total_parts' => :'data_total_parts',
61
+ :'data_total_sha256' => :'data_total_sha256',
62
+ :'event_index' => :'event_index',
63
+ :'type' => :'type'
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.swagger_types
69
+ {
70
+ :'data' => :'String',
71
+ :'data_part' => :'Integer',
72
+ :'data_sha256' => :'String',
73
+ :'data_total_parts' => :'Integer',
74
+ :'data_total_sha256' => :'String',
75
+ :'event_index' => :'Integer',
76
+ :'type' => :'String'
77
+ }
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ return unless attributes.is_a?(Hash)
84
+
85
+ # convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
87
+
88
+ if attributes.has_key?(:'data')
89
+ self.data = attributes[:'data']
90
+ end
91
+
92
+ if attributes.has_key?(:'data_part')
93
+ self.data_part = attributes[:'data_part']
94
+ end
95
+
96
+ if attributes.has_key?(:'data_sha256')
97
+ self.data_sha256 = attributes[:'data_sha256']
98
+ end
99
+
100
+ if attributes.has_key?(:'data_total_parts')
101
+ self.data_total_parts = attributes[:'data_total_parts']
102
+ end
103
+
104
+ if attributes.has_key?(:'data_total_sha256')
105
+ self.data_total_sha256 = attributes[:'data_total_sha256']
106
+ end
107
+
108
+ if attributes.has_key?(:'event_index')
109
+ self.event_index = attributes[:'event_index']
110
+ end
111
+
112
+ if attributes.has_key?(:'type')
113
+ self.type = attributes[:'type']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ invalid_properties = Array.new
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ type_validator = EnumAttributeValidator.new('String', ['init', 'events'])
128
+ return false unless type_validator.valid?(@type)
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method checking allowed values (enum).
133
+ # @param [Object] type Object to be assigned
134
+ def type=(type)
135
+ validator = EnumAttributeValidator.new('String', ['init', 'events'])
136
+ unless validator.valid?(type)
137
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
138
+ end
139
+ @type = type
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ data == o.data &&
148
+ data_part == o.data_part &&
149
+ data_sha256 == o.data_sha256 &&
150
+ data_total_parts == o.data_total_parts &&
151
+ data_total_sha256 == o.data_total_sha256 &&
152
+ event_index == o.event_index &&
153
+ type == o.type
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Fixnum] Hash code
164
+ def hash
165
+ [data, data_part, data_sha256, data_total_parts, data_total_sha256, event_index, type].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ self.class.swagger_types.each_pair do |key, type|
174
+ if type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
178
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
179
+ end
180
+ elsif !attributes[self.class.attribute_map[key]].nil?
181
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
182
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
183
+ end
184
+
185
+ self
186
+ end
187
+
188
+ # Deserializes the data based on type
189
+ # @param string type Data type
190
+ # @param string value Value to be deserialized
191
+ # @return [Object] Deserialized data
192
+ def _deserialize(type, value)
193
+ case type.to_sym
194
+ when :DateTime
195
+ DateTime.parse(value)
196
+ when :Date
197
+ Date.parse(value)
198
+ when :String
199
+ value.to_s
200
+ when :Integer
201
+ value.to_i
202
+ when :Float
203
+ value.to_f
204
+ when :BOOLEAN
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ true
207
+ else
208
+ false
209
+ end
210
+ when :Object
211
+ # generic object (usually a Hash), return directly
212
+ value
213
+ when /\AArray<(?<inner_type>.+)>\z/
214
+ inner_type = Regexp.last_match[:inner_type]
215
+ value.map { |v| _deserialize(inner_type, v) }
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ k_type = Regexp.last_match[:k_type]
218
+ v_type = Regexp.last_match[:v_type]
219
+ {}.tap do |hash|
220
+ value.each do |k, v|
221
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
222
+ end
223
+ end
224
+ else # model
225
+ temp_model = UltracartClient.const_get(type).new
226
+ temp_model.build_from_hash(value)
227
+ end
228
+ end
229
+
230
+ # Returns the string representation of the object
231
+ # @return [String] String presentation of the object
232
+ def to_s
233
+ to_hash.to_s
234
+ end
235
+
236
+ # to_body is an alias to to_hash (backward compatibility)
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_body
239
+ to_hash
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ next if value.nil?
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+
272
+ end
273
+ end