ultracart_api 4.1.150 → 4.1.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -2
  3. data/docs/ConversationAgentTestSessionJoinRequest.md +18 -0
  4. data/docs/ConversationAgentTestSessionRequest.md +24 -0
  5. data/docs/ConversationAgentTestSessionResponse.md +32 -0
  6. data/docs/ConversationApi.md +111 -0
  7. data/docs/ConversationCustomerAuth.md +30 -0
  8. data/docs/SfvbApi.md +111 -0
  9. data/docs/SfvbThemeAttribute.md +34 -0
  10. data/docs/SfvbThemeAttributeUpdate.md +24 -0
  11. data/docs/SfvbThemeAttributeUpdateRequest.md +18 -0
  12. data/docs/SfvbThemeAttributesResponse.md +24 -0
  13. data/docs/SfvbThemeFont.md +22 -0
  14. data/docs/SfvbThemeFontFamily.md +22 -0
  15. data/lib/ultracart_api/api/conversation_api.rb +156 -0
  16. data/lib/ultracart_api/api/sfvb_api.rb +151 -0
  17. data/lib/ultracart_api/models/conversation_agent_test_session_join_request.rb +220 -0
  18. data/lib/ultracart_api/models/conversation_agent_test_session_request.rb +250 -0
  19. data/lib/ultracart_api/models/conversation_agent_test_session_response.rb +285 -0
  20. data/lib/ultracart_api/models/conversation_customer_auth.rb +273 -0
  21. data/lib/ultracart_api/models/sfvb_theme_attribute.rb +333 -0
  22. data/lib/ultracart_api/models/sfvb_theme_attribute_update.rb +283 -0
  23. data/lib/ultracart_api/models/sfvb_theme_attribute_update_request.rb +222 -0
  24. data/lib/ultracart_api/models/sfvb_theme_attributes_response.rb +252 -0
  25. data/lib/ultracart_api/models/sfvb_theme_font.rb +242 -0
  26. data/lib/ultracart_api/models/sfvb_theme_font_family.rb +274 -0
  27. data/lib/ultracart_api/version.rb +1 -1
  28. data/lib/ultracart_api.rb +10 -0
  29. metadata +22 -2
@@ -6646,6 +6646,87 @@ module UltracartClient
6646
6646
  return data, status_code, headers
6647
6647
  end
6648
6648
 
6649
+ # Join a test conversation as the simulated customer
6650
+ # Joins the simulated customer to the conversation the agent opened for a test session. This mirrors what the storefront webchat widget does after an agent picks up its queue entry, and it is what gives the conversation a customer participant. Requires a logged in user with conversations admin; an API key or OAuth application cannot call this.
6651
+ # @param user_id [Integer]
6652
+ # @param conversation_uuid [String]
6653
+ # @param join_request [ConversationAgentTestSessionJoinRequest] Test session join request
6654
+ # @param [Hash] opts the optional parameters
6655
+ # @return [nil]
6656
+ def join_agent_test_session(user_id, conversation_uuid, join_request, opts = {})
6657
+ join_agent_test_session_with_http_info(user_id, conversation_uuid, join_request, opts)
6658
+ nil
6659
+ end
6660
+
6661
+ # Join a test conversation as the simulated customer
6662
+ # Joins the simulated customer to the conversation the agent opened for a test session. This mirrors what the storefront webchat widget does after an agent picks up its queue entry, and it is what gives the conversation a customer participant. Requires a logged in user with conversations admin; an API key or OAuth application cannot call this.
6663
+ # @param user_id [Integer]
6664
+ # @param conversation_uuid [String]
6665
+ # @param join_request [ConversationAgentTestSessionJoinRequest] Test session join request
6666
+ # @param [Hash] opts the optional parameters
6667
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
6668
+ def join_agent_test_session_with_http_info(user_id, conversation_uuid, join_request, opts = {})
6669
+ if @api_client.config.debugging
6670
+ @api_client.config.logger.debug 'Calling API: ConversationApi.join_agent_test_session ...'
6671
+ end
6672
+ # verify the required parameter 'user_id' is set
6673
+ if @api_client.config.client_side_validation && user_id.nil?
6674
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.join_agent_test_session"
6675
+ end
6676
+ # verify the required parameter 'conversation_uuid' is set
6677
+ if @api_client.config.client_side_validation && conversation_uuid.nil?
6678
+ fail ArgumentError, "Missing the required parameter 'conversation_uuid' when calling ConversationApi.join_agent_test_session"
6679
+ end
6680
+ # verify the required parameter 'join_request' is set
6681
+ if @api_client.config.client_side_validation && join_request.nil?
6682
+ fail ArgumentError, "Missing the required parameter 'join_request' when calling ConversationApi.join_agent_test_session"
6683
+ end
6684
+ # resource path
6685
+ local_var_path = '/conversation/agent/profiles/{user_id}/test_session/{conversation_uuid}/join'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'conversation_uuid' + '}', CGI.escape(conversation_uuid.to_s))
6686
+
6687
+ # query parameters
6688
+ query_params = opts[:query_params] || {}
6689
+
6690
+ # header parameters
6691
+ header_params = opts[:header_params] || {}
6692
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
6693
+ # HTTP header 'Accept' (if needed)
6694
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
6695
+ # HTTP header 'Content-Type'
6696
+ content_type = @api_client.select_header_content_type(['application/json'])
6697
+ if !content_type.nil?
6698
+ header_params['Content-Type'] = content_type
6699
+ end
6700
+
6701
+ # form parameters
6702
+ form_params = opts[:form_params] || {}
6703
+
6704
+ # http body (model)
6705
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(join_request)
6706
+
6707
+ # return_type
6708
+ return_type = opts[:debug_return_type]
6709
+
6710
+ # auth_names
6711
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
6712
+
6713
+ new_options = opts.merge(
6714
+ :operation => :"ConversationApi.join_agent_test_session",
6715
+ :header_params => header_params,
6716
+ :query_params => query_params,
6717
+ :form_params => form_params,
6718
+ :body => post_body,
6719
+ :auth_names => auth_names,
6720
+ :return_type => return_type
6721
+ )
6722
+
6723
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
6724
+ if @api_client.config.debugging
6725
+ @api_client.config.logger.debug "API called: ConversationApi#join_agent_test_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
6726
+ end
6727
+ return data, status_code, headers
6728
+ end
6729
+
6649
6730
  # Join a conversation
6650
6731
  # Join a conversation
6651
6732
  # @param conversation_uuid [String]
@@ -7689,6 +7770,81 @@ module UltracartClient
7689
7770
  return data, status_code, headers
7690
7771
  end
7691
7772
 
7773
+ # Start a test conversation with this AI agent
7774
+ # Opens a webchat conversation against this specific AI agent as if the given customer had started it from the storefront, so the agent can be tried out before it is put in front of anyone. The session runs against live data: the cart is real, the customer is real, and anything the agent does during the conversation actually happens. Requires a logged in user with conversations admin; an API key or OAuth application cannot call this.
7775
+ # @param user_id [Integer]
7776
+ # @param test_session_request [ConversationAgentTestSessionRequest] Test session request
7777
+ # @param [Hash] opts the optional parameters
7778
+ # @return [ConversationAgentTestSessionResponse]
7779
+ def start_agent_test_session(user_id, test_session_request, opts = {})
7780
+ data, _status_code, _headers = start_agent_test_session_with_http_info(user_id, test_session_request, opts)
7781
+ data
7782
+ end
7783
+
7784
+ # Start a test conversation with this AI agent
7785
+ # Opens a webchat conversation against this specific AI agent as if the given customer had started it from the storefront, so the agent can be tried out before it is put in front of anyone. The session runs against live data: the cart is real, the customer is real, and anything the agent does during the conversation actually happens. Requires a logged in user with conversations admin; an API key or OAuth application cannot call this.
7786
+ # @param user_id [Integer]
7787
+ # @param test_session_request [ConversationAgentTestSessionRequest] Test session request
7788
+ # @param [Hash] opts the optional parameters
7789
+ # @return [Array<(ConversationAgentTestSessionResponse, Integer, Hash)>] ConversationAgentTestSessionResponse data, response status code and response headers
7790
+ def start_agent_test_session_with_http_info(user_id, test_session_request, opts = {})
7791
+ if @api_client.config.debugging
7792
+ @api_client.config.logger.debug 'Calling API: ConversationApi.start_agent_test_session ...'
7793
+ end
7794
+ # verify the required parameter 'user_id' is set
7795
+ if @api_client.config.client_side_validation && user_id.nil?
7796
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.start_agent_test_session"
7797
+ end
7798
+ # verify the required parameter 'test_session_request' is set
7799
+ if @api_client.config.client_side_validation && test_session_request.nil?
7800
+ fail ArgumentError, "Missing the required parameter 'test_session_request' when calling ConversationApi.start_agent_test_session"
7801
+ end
7802
+ # resource path
7803
+ local_var_path = '/conversation/agent/profiles/{user_id}/test_session'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
7804
+
7805
+ # query parameters
7806
+ query_params = opts[:query_params] || {}
7807
+
7808
+ # header parameters
7809
+ header_params = opts[:header_params] || {}
7810
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
7811
+ # HTTP header 'Accept' (if needed)
7812
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
7813
+ # HTTP header 'Content-Type'
7814
+ content_type = @api_client.select_header_content_type(['application/json'])
7815
+ if !content_type.nil?
7816
+ header_params['Content-Type'] = content_type
7817
+ end
7818
+
7819
+ # form parameters
7820
+ form_params = opts[:form_params] || {}
7821
+
7822
+ # http body (model)
7823
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(test_session_request)
7824
+
7825
+ # return_type
7826
+ return_type = opts[:debug_return_type] || 'ConversationAgentTestSessionResponse'
7827
+
7828
+ # auth_names
7829
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
7830
+
7831
+ new_options = opts.merge(
7832
+ :operation => :"ConversationApi.start_agent_test_session",
7833
+ :header_params => header_params,
7834
+ :query_params => query_params,
7835
+ :form_params => form_params,
7836
+ :body => post_body,
7837
+ :auth_names => auth_names,
7838
+ :return_type => return_type
7839
+ )
7840
+
7841
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
7842
+ if @api_client.config.debugging
7843
+ @api_client.config.logger.debug "API called: ConversationApi#start_agent_test_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
7844
+ end
7845
+ return data, status_code, headers
7846
+ end
7847
+
7692
7848
  # Start a conversation
7693
7849
  # Start a new conversation
7694
7850
  # @param start_request [ConversationStartRequest] Start request
@@ -1095,6 +1095,76 @@ module UltracartClient
1095
1095
  return data, status_code, headers
1096
1096
  end
1097
1097
 
1098
+ # Read a theme's colors, fonts and settings
1099
+ # The values theme.css and the compiled containers resolve at render time. These do NOT live in any file. settings.json contains a palette and looks like the answer, but it is the theme's factory template - it supplies defaults for slots that have never been set and is ignored for slots that have, so editing it will not change a color and reading it will not tell you the current one. Slots a template declares but nothing has ever set are included here, carrying the default they will render with, so the response describes the whole theme rather than the rows that happen to exist.
1100
+ # @param storefront_oid [Integer]
1101
+ # @param theme_oid [Integer]
1102
+ # @param [Hash] opts the optional parameters
1103
+ # @return [SfvbThemeAttributesResponse]
1104
+ def get_sfvb_theme_attributes(storefront_oid, theme_oid, opts = {})
1105
+ data, _status_code, _headers = get_sfvb_theme_attributes_with_http_info(storefront_oid, theme_oid, opts)
1106
+ data
1107
+ end
1108
+
1109
+ # Read a theme&#39;s colors, fonts and settings
1110
+ # The values theme.css and the compiled containers resolve at render time. These do NOT live in any file. settings.json contains a palette and looks like the answer, but it is the theme&#39;s factory template - it supplies defaults for slots that have never been set and is ignored for slots that have, so editing it will not change a color and reading it will not tell you the current one. Slots a template declares but nothing has ever set are included here, carrying the default they will render with, so the response describes the whole theme rather than the rows that happen to exist.
1111
+ # @param storefront_oid [Integer]
1112
+ # @param theme_oid [Integer]
1113
+ # @param [Hash] opts the optional parameters
1114
+ # @return [Array<(SfvbThemeAttributesResponse, Integer, Hash)>] SfvbThemeAttributesResponse data, response status code and response headers
1115
+ def get_sfvb_theme_attributes_with_http_info(storefront_oid, theme_oid, opts = {})
1116
+ if @api_client.config.debugging
1117
+ @api_client.config.logger.debug 'Calling API: SfvbApi.get_sfvb_theme_attributes ...'
1118
+ end
1119
+ # verify the required parameter 'storefront_oid' is set
1120
+ if @api_client.config.client_side_validation && storefront_oid.nil?
1121
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.get_sfvb_theme_attributes"
1122
+ end
1123
+ # verify the required parameter 'theme_oid' is set
1124
+ if @api_client.config.client_side_validation && theme_oid.nil?
1125
+ fail ArgumentError, "Missing the required parameter 'theme_oid' when calling SfvbApi.get_sfvb_theme_attributes"
1126
+ end
1127
+ # resource path
1128
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/themes/{theme_oid}/attributes'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'theme_oid' + '}', CGI.escape(theme_oid.to_s))
1129
+
1130
+ # query parameters
1131
+ query_params = opts[:query_params] || {}
1132
+
1133
+ # header parameters
1134
+ header_params = opts[:header_params] || {}
1135
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1136
+ # HTTP header 'Accept' (if needed)
1137
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1138
+
1139
+ # form parameters
1140
+ form_params = opts[:form_params] || {}
1141
+
1142
+ # http body (model)
1143
+ post_body = opts[:debug_body]
1144
+
1145
+ # return_type
1146
+ return_type = opts[:debug_return_type] || 'SfvbThemeAttributesResponse'
1147
+
1148
+ # auth_names
1149
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1150
+
1151
+ new_options = opts.merge(
1152
+ :operation => :"SfvbApi.get_sfvb_theme_attributes",
1153
+ :header_params => header_params,
1154
+ :query_params => query_params,
1155
+ :form_params => form_params,
1156
+ :body => post_body,
1157
+ :auth_names => auth_names,
1158
+ :return_type => return_type
1159
+ )
1160
+
1161
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1162
+ if @api_client.config.debugging
1163
+ @api_client.config.logger.debug "API called: SfvbApi#get_sfvb_theme_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1164
+ end
1165
+ return data, status_code, headers
1166
+ end
1167
+
1098
1168
  # Status of an asynchronous theme job
1099
1169
  # Poll until complete is true, then check success. Note that the new theme's oid is not returned. The job's product is a plain text report rather than a structured result, so once it completes, list themes and match on the target_path the start call gave you.
1100
1170
  # @param storefront_oid [Integer]
@@ -2073,6 +2143,87 @@ module UltracartClient
2073
2143
  return data, status_code, headers
2074
2144
  end
2075
2145
 
2146
+ # Change a theme's colors, fonts and settings
2147
+ # A partial update. Only the slots you name are changed and every other slot on the theme keeps its value, so there is no need to send the whole set back to change one color. Send a whole palette in one call rather than one call per color - they are applied together, so the storefront never renders half of a change. Needs sfvb_publish when the theme is the one serving live traffic, because a color is referenced by name from every template that uses it and one write repaints the whole storefront at once. On a dormant theme sfvb_write is enough, which is what makes duplicate-then-restyle work.
2148
+ # @param storefront_oid [Integer]
2149
+ # @param theme_oid [Integer]
2150
+ # @param attribute_update_request [SfvbThemeAttributeUpdateRequest] Slots to change
2151
+ # @param [Hash] opts the optional parameters
2152
+ # @return [SfvbThemeAttributesResponse]
2153
+ def put_sfvb_theme_attributes(storefront_oid, theme_oid, attribute_update_request, opts = {})
2154
+ data, _status_code, _headers = put_sfvb_theme_attributes_with_http_info(storefront_oid, theme_oid, attribute_update_request, opts)
2155
+ data
2156
+ end
2157
+
2158
+ # Change a theme&#39;s colors, fonts and settings
2159
+ # A partial update. Only the slots you name are changed and every other slot on the theme keeps its value, so there is no need to send the whole set back to change one color. Send a whole palette in one call rather than one call per color - they are applied together, so the storefront never renders half of a change. Needs sfvb_publish when the theme is the one serving live traffic, because a color is referenced by name from every template that uses it and one write repaints the whole storefront at once. On a dormant theme sfvb_write is enough, which is what makes duplicate-then-restyle work.
2160
+ # @param storefront_oid [Integer]
2161
+ # @param theme_oid [Integer]
2162
+ # @param attribute_update_request [SfvbThemeAttributeUpdateRequest] Slots to change
2163
+ # @param [Hash] opts the optional parameters
2164
+ # @return [Array<(SfvbThemeAttributesResponse, Integer, Hash)>] SfvbThemeAttributesResponse data, response status code and response headers
2165
+ def put_sfvb_theme_attributes_with_http_info(storefront_oid, theme_oid, attribute_update_request, opts = {})
2166
+ if @api_client.config.debugging
2167
+ @api_client.config.logger.debug 'Calling API: SfvbApi.put_sfvb_theme_attributes ...'
2168
+ end
2169
+ # verify the required parameter 'storefront_oid' is set
2170
+ if @api_client.config.client_side_validation && storefront_oid.nil?
2171
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.put_sfvb_theme_attributes"
2172
+ end
2173
+ # verify the required parameter 'theme_oid' is set
2174
+ if @api_client.config.client_side_validation && theme_oid.nil?
2175
+ fail ArgumentError, "Missing the required parameter 'theme_oid' when calling SfvbApi.put_sfvb_theme_attributes"
2176
+ end
2177
+ # verify the required parameter 'attribute_update_request' is set
2178
+ if @api_client.config.client_side_validation && attribute_update_request.nil?
2179
+ fail ArgumentError, "Missing the required parameter 'attribute_update_request' when calling SfvbApi.put_sfvb_theme_attributes"
2180
+ end
2181
+ # resource path
2182
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/themes/{theme_oid}/attributes'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'theme_oid' + '}', CGI.escape(theme_oid.to_s))
2183
+
2184
+ # query parameters
2185
+ query_params = opts[:query_params] || {}
2186
+
2187
+ # header parameters
2188
+ header_params = opts[:header_params] || {}
2189
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
2190
+ # HTTP header 'Accept' (if needed)
2191
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2192
+ # HTTP header 'Content-Type'
2193
+ content_type = @api_client.select_header_content_type(['application/json'])
2194
+ if !content_type.nil?
2195
+ header_params['Content-Type'] = content_type
2196
+ end
2197
+
2198
+ # form parameters
2199
+ form_params = opts[:form_params] || {}
2200
+
2201
+ # http body (model)
2202
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(attribute_update_request)
2203
+
2204
+ # return_type
2205
+ return_type = opts[:debug_return_type] || 'SfvbThemeAttributesResponse'
2206
+
2207
+ # auth_names
2208
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
2209
+
2210
+ new_options = opts.merge(
2211
+ :operation => :"SfvbApi.put_sfvb_theme_attributes",
2212
+ :header_params => header_params,
2213
+ :query_params => query_params,
2214
+ :form_params => form_params,
2215
+ :body => post_body,
2216
+ :auth_names => auth_names,
2217
+ :return_type => return_type
2218
+ )
2219
+
2220
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2221
+ if @api_client.config.debugging
2222
+ @api_client.config.logger.debug "API called: SfvbApi#put_sfvb_theme_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2223
+ end
2224
+ return data, status_code, headers
2225
+ end
2226
+
2076
2227
  # Render a CJSON node to HTML
2077
2228
  # Renders one node in the context of a theme and a page. Unlike compile this is stateful. Rendering resolves merchant data, so an element bound to an item renders wrongly, and silently, without a context item id. One node per call, so a node that fails to render fails on its own rather than taking a batch with it, and a failure says why.
2078
2229
  # @param storefront_oid [Integer]
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationAgentTestSessionJoinRequest
18
+ # Queue entry uuid returned when the test session was started
19
+ attr_accessor :conversation_webchat_queue_uuid
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'conversation_webchat_queue_uuid' => :'conversation_webchat_queue_uuid'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'conversation_webchat_queue_uuid' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentTestSessionJoinRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentTestSessionJoinRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'conversation_webchat_queue_uuid')
62
+ self.conversation_webchat_queue_uuid = attributes[:'conversation_webchat_queue_uuid']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ conversation_webchat_queue_uuid == o.conversation_webchat_queue_uuid
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [conversation_webchat_queue_uuid].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = UltracartClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end