ultracart_api 3.10.28 → 3.10.31

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: 318716e3c951f48123d5680ccb6eeaaae0d1730abdce2e8331d3147870e4e257
4
- data.tar.gz: c36d17549fb0f6a52b7367e4f26278fc18052af5d08e529c2b2d00fb390a1b7c
3
+ metadata.gz: 8f4b73bbdb426927217bc2d54c77ec8fcfb8f2a33eee74c90ace3a09d47f34d0
4
+ data.tar.gz: 87440c867859a01b3969357a542b52374c030152420bebf3e1eb02c812caad97
5
5
  SHA512:
6
- metadata.gz: d1bc988c0d76418ab36b3cb64f395b1c7f79558c837e0511746b3b0365aa186cd01b04608aca5dd36243c16d437f8b9f589e068e4249458d3045127b3b5bdf2b
7
- data.tar.gz: 9590096f203eceed86560be5a2599a595e15c21917ec3f9c9b04eefd270f72489e235eb8de0b10d0cd32a95a83cf71442124113a7ed4fce657faf43bddfb5c5a
6
+ metadata.gz: 245edab535627643634cb6f8c584026b77f4113152e1fc13b7914776a695732560492b94245d3c1e3579454fc7956d11e02e757f9922784bb3b0d38ffdbfe6f0
7
+ data.tar.gz: 7475cafdcdbb264e351e54ff0d946487452a45434a6c7df61e33d4d34b6fcb8e38fd437611678ecfbe7006dc27aa6973bd293511d1c67c64313a6e668b659860
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.28
10
+ - Package version: 3.10.31
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.28.gem
27
+ gem install ./ultracart_api-3.10.31.gem
28
28
  ```
29
- (for development, run `gem install --dev ./ultracart_api-3.10.28.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./ultracart_api-3.10.31.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.28'
35
+ gem 'ultracart_api', '~> 3.10.31'
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,7 @@ 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)
565
567
  - [UltracartClient::ConversationMessage](docs/ConversationMessage.md)
566
568
  - [UltracartClient::ConversationMessageTransportStatus](docs/ConversationMessageTransportStatus.md)
567
569
  - [UltracartClient::ConversationMultimediaUploadUrl](docs/ConversationMultimediaUploadUrl.md)
@@ -571,6 +573,7 @@ Class | Method | HTTP request | Description
571
573
  - [UltracartClient::ConversationStartRequest](docs/ConversationStartRequest.md)
572
574
  - [UltracartClient::ConversationStartResponse](docs/ConversationStartResponse.md)
573
575
  - [UltracartClient::ConversationSummary](docs/ConversationSummary.md)
576
+ - [UltracartClient::ConversationTwilioAccount](docs/ConversationTwilioAccount.md)
574
577
  - [UltracartClient::ConversationWebchatQueueStatus](docs/ConversationWebchatQueueStatus.md)
575
578
  - [UltracartClient::ConversationWebchatQueueStatusAgent](docs/ConversationWebchatQueueStatusAgent.md)
576
579
  - [UltracartClient::ConversationWebchatQueueStatusQueueEntry](docs/ConversationWebchatQueueStatusQueueEntry.md)
@@ -700,6 +703,8 @@ Class | Method | HTTP request | Description
700
703
  - [UltracartClient::EmailCommseqPostcardsRequest](docs/EmailCommseqPostcardsRequest.md)
701
704
  - [UltracartClient::EmailCommseqPostcardsResponse](docs/EmailCommseqPostcardsResponse.md)
702
705
  - [UltracartClient::EmailCommseqResponse](docs/EmailCommseqResponse.md)
706
+ - [UltracartClient::EmailCommseqSequenceTestRequest](docs/EmailCommseqSequenceTestRequest.md)
707
+ - [UltracartClient::EmailCommseqSequenceTestResponse](docs/EmailCommseqSequenceTestResponse.md)
703
708
  - [UltracartClient::EmailCommseqStat](docs/EmailCommseqStat.md)
704
709
  - [UltracartClient::EmailCommseqStatResponse](docs/EmailCommseqStatResponse.md)
705
710
  - [UltracartClient::EmailCommseqStep](docs/EmailCommseqStep.md)
@@ -1166,6 +1171,9 @@ Not every change is committed to every SDK.
1166
1171
 
1167
1172
  | Version | Date | Comments |
1168
1173
  | --: | :-: | --- |
1174
+ | 3.10.31 | 08/02/2022 | storefront communication sequence test method |
1175
+ | 3.10.30 | 08/01/2022 | conversation event refinement |
1176
+ | 3.10.29 | 07/29/2022 | conversation development |
1169
1177
  | 3.10.28 | 07/28/2022 | conversation bug fixes |
1170
1178
  | 3.10.27 | 07/28/2022 | conversation message upload keys property |
1171
1179
  | 3.10.26 | 07/26/2022 | conversations - queue statistics |
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
7
7
  **conversation_participant_name** | **String** | | [optional]
8
8
  **jwt** | **String** | | [optional]
9
9
  **merchant_id** | **String** | | [optional]
10
- **twilio_phone_numbers** | **Array<String>** | | [optional]
10
+ **twilio_accounts** | [**Array<ConversationTwilioAccount>**](ConversationTwilioAccount.md) | | [optional]
11
11
  **websocket_url** | **String** | | [optional]
12
12
 
13
13
 
@@ -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
+
@@ -6,9 +6,11 @@ Name | Type | Description | Notes
6
6
  **author_conversation_participant_arn** | **String** | | [optional]
7
7
  **author_conversation_participant_name** | **String** | | [optional]
8
8
  **body** | **String** | | [optional]
9
+ **client_message_id** | **String** | | [optional]
9
10
  **media_urls** | **Array<String>** | | [optional]
10
11
  **message_dts** | **String** | Message date/time | [optional]
11
12
  **transport_statuses** | [**Array<ConversationMessageTransportStatus>**](ConversationMessageTransportStatus.md) | | [optional]
13
+ **type** | **String** | Message type | [optional]
12
14
  **upload_keys** | **Array<String>** | | [optional]
13
15
 
14
16
 
@@ -12,6 +12,8 @@ Name | Type | Description | Notes
12
12
  **last_message_dts** | **String** | Last message date/time | [optional]
13
13
  **merchant_id** | **String** | | [optional]
14
14
  **message_count** | **Integer** | | [optional]
15
+ **start_dts** | **String** | Start of the conversation date/time | [optional]
15
16
  **unread_messages** | **BOOLEAN** | | [optional]
17
+ **visible** | **BOOLEAN** | | [optional]
16
18
 
17
19
 
@@ -0,0 +1,9 @@
1
+ # UltracartClient::ConversationTwilioAccount
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **merchant_id** | **String** | | [optional]
7
+ **twilio_phone_numbers** | **Array<String>** | | [optional]
8
+
9
+
@@ -9,6 +9,7 @@ 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]
13
14
  **event_updated_message** | [**ConversationMessage**](ConversationMessage.md) | | [optional]
14
15
  **message** | [**ConversationMessage**](ConversationMessage.md) | | [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
@@ -22,7 +22,7 @@ module UltracartClient
22
22
 
23
23
  attr_accessor :merchant_id
24
24
 
25
- attr_accessor :twilio_phone_numbers
25
+ attr_accessor :twilio_accounts
26
26
 
27
27
  attr_accessor :websocket_url
28
28
 
@@ -33,7 +33,7 @@ module UltracartClient
33
33
  :'conversation_participant_name' => :'conversation_participant_name',
34
34
  :'jwt' => :'jwt',
35
35
  :'merchant_id' => :'merchant_id',
36
- :'twilio_phone_numbers' => :'twilio_phone_numbers',
36
+ :'twilio_accounts' => :'twilio_accounts',
37
37
  :'websocket_url' => :'websocket_url'
38
38
  }
39
39
  end
@@ -45,7 +45,7 @@ module UltracartClient
45
45
  :'conversation_participant_name' => :'String',
46
46
  :'jwt' => :'String',
47
47
  :'merchant_id' => :'String',
48
- :'twilio_phone_numbers' => :'Array<String>',
48
+ :'twilio_accounts' => :'Array<ConversationTwilioAccount>',
49
49
  :'websocket_url' => :'String'
50
50
  }
51
51
  end
@@ -74,9 +74,9 @@ module UltracartClient
74
74
  self.merchant_id = attributes[:'merchant_id']
75
75
  end
76
76
 
77
- if attributes.has_key?(:'twilio_phone_numbers')
78
- if (value = attributes[:'twilio_phone_numbers']).is_a?(Array)
79
- self.twilio_phone_numbers = value
77
+ if attributes.has_key?(:'twilio_accounts')
78
+ if (value = attributes[:'twilio_accounts']).is_a?(Array)
79
+ self.twilio_accounts = value
80
80
  end
81
81
  end
82
82
 
@@ -107,7 +107,7 @@ module UltracartClient
107
107
  conversation_participant_name == o.conversation_participant_name &&
108
108
  jwt == o.jwt &&
109
109
  merchant_id == o.merchant_id &&
110
- twilio_phone_numbers == o.twilio_phone_numbers &&
110
+ twilio_accounts == o.twilio_accounts &&
111
111
  websocket_url == o.websocket_url
112
112
  end
113
113
 
@@ -120,7 +120,7 @@ module UltracartClient
120
120
  # Calculates hash code according to all attributes.
121
121
  # @return [Fixnum] Hash code
122
122
  def hash
123
- [conversation_participant_arn, conversation_participant_name, jwt, merchant_id, twilio_phone_numbers, websocket_url].hash
123
+ [conversation_participant_arn, conversation_participant_name, jwt, merchant_id, twilio_accounts, websocket_url].hash
124
124
  end
125
125
 
126
126
  # Builds the object from hash
@@ -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