ultracart_api 4.0.93.rc → 4.0.95.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -215,6 +215,64 @@ module UltracartClient
215
215
  return data, status_code, headers
216
216
  end
217
217
 
218
+ # Retrieve a list of canned messages ordered by short_code
219
+ # Retrieve a list of canned messages ordered by short_code
220
+ # @param [Hash] opts the optional parameters
221
+ # @return [ConversationCannedMessagesResponse]
222
+ def get_conversation_canned_messages(opts = {})
223
+ data, _status_code, _headers = get_conversation_canned_messages_with_http_info(opts)
224
+ data
225
+ end
226
+
227
+ # Retrieve a list of canned messages ordered by short_code
228
+ # Retrieve a list of canned messages ordered by short_code
229
+ # @param [Hash] opts the optional parameters
230
+ # @return [Array<(ConversationCannedMessagesResponse, Integer, Hash)>] ConversationCannedMessagesResponse data, response status code and response headers
231
+ def get_conversation_canned_messages_with_http_info(opts = {})
232
+ if @api_client.config.debugging
233
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_conversation_canned_messages ...'
234
+ end
235
+ # resource path
236
+ local_var_path = '/conversation/canned_messages'
237
+
238
+ # query parameters
239
+ query_params = opts[:query_params] || {}
240
+
241
+ # header parameters
242
+ header_params = opts[:header_params] || {}
243
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
244
+ # HTTP header 'Accept' (if needed)
245
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
246
+
247
+ # form parameters
248
+ form_params = opts[:form_params] || {}
249
+
250
+ # http body (model)
251
+ post_body = opts[:debug_body]
252
+
253
+ # return_type
254
+ return_type = opts[:debug_return_type] || 'ConversationCannedMessagesResponse'
255
+
256
+ # auth_names
257
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
258
+
259
+ new_options = opts.merge(
260
+ :operation => :"ConversationApi.get_conversation_canned_messages",
261
+ :header_params => header_params,
262
+ :query_params => query_params,
263
+ :form_params => form_params,
264
+ :body => post_body,
265
+ :auth_names => auth_names,
266
+ :return_type => return_type
267
+ )
268
+
269
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
270
+ if @api_client.config.debugging
271
+ @api_client.config.logger.debug "API called: ConversationApi#get_conversation_canned_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
+ end
273
+ return data, status_code, headers
274
+ end
275
+
218
276
  # Get a webchat conversation context
219
277
  # Get a webchat conversation context
220
278
  # @param conversation_uuid [String]
@@ -544,6 +602,75 @@ module UltracartClient
544
602
  return data, status_code, headers
545
603
  end
546
604
 
605
+ # Insert a canned message
606
+ # Insert a canned message
607
+ # @param canned_message [ConversationCannedMessage] Canned message
608
+ # @param [Hash] opts the optional parameters
609
+ # @return [ConversationCannedMessageResponse]
610
+ def insert_conversation_canned_message(canned_message, opts = {})
611
+ data, _status_code, _headers = insert_conversation_canned_message_with_http_info(canned_message, opts)
612
+ data
613
+ end
614
+
615
+ # Insert a canned message
616
+ # Insert a canned message
617
+ # @param canned_message [ConversationCannedMessage] Canned message
618
+ # @param [Hash] opts the optional parameters
619
+ # @return [Array<(ConversationCannedMessageResponse, Integer, Hash)>] ConversationCannedMessageResponse data, response status code and response headers
620
+ def insert_conversation_canned_message_with_http_info(canned_message, opts = {})
621
+ if @api_client.config.debugging
622
+ @api_client.config.logger.debug 'Calling API: ConversationApi.insert_conversation_canned_message ...'
623
+ end
624
+ # verify the required parameter 'canned_message' is set
625
+ if @api_client.config.client_side_validation && canned_message.nil?
626
+ fail ArgumentError, "Missing the required parameter 'canned_message' when calling ConversationApi.insert_conversation_canned_message"
627
+ end
628
+ # resource path
629
+ local_var_path = '/conversation/canned_messages'
630
+
631
+ # query parameters
632
+ query_params = opts[:query_params] || {}
633
+
634
+ # header parameters
635
+ header_params = opts[:header_params] || {}
636
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
637
+ # HTTP header 'Accept' (if needed)
638
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
639
+ # HTTP header 'Content-Type'
640
+ content_type = @api_client.select_header_content_type(['application/json'])
641
+ if !content_type.nil?
642
+ header_params['Content-Type'] = content_type
643
+ end
644
+
645
+ # form parameters
646
+ form_params = opts[:form_params] || {}
647
+
648
+ # http body (model)
649
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(canned_message)
650
+
651
+ # return_type
652
+ return_type = opts[:debug_return_type] || 'ConversationCannedMessageResponse'
653
+
654
+ # auth_names
655
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
656
+
657
+ new_options = opts.merge(
658
+ :operation => :"ConversationApi.insert_conversation_canned_message",
659
+ :header_params => header_params,
660
+ :query_params => query_params,
661
+ :form_params => form_params,
662
+ :body => post_body,
663
+ :auth_names => auth_names,
664
+ :return_type => return_type
665
+ )
666
+
667
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
668
+ if @api_client.config.debugging
669
+ @api_client.config.logger.debug "API called: ConversationApi#insert_conversation_canned_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
670
+ end
671
+ return data, status_code, headers
672
+ end
673
+
547
674
  # Join a conversation
548
675
  # Join a conversation
549
676
  # @param conversation_uuid [String]
@@ -736,6 +863,75 @@ module UltracartClient
736
863
  return data, status_code, headers
737
864
  end
738
865
 
866
+ # Search for canned messages by short_code
867
+ # Search for canned messages by short_code
868
+ # @param search_request [ConversationCannedMessagesSearch] Search request
869
+ # @param [Hash] opts the optional parameters
870
+ # @return [ConversationCannedMessagesResponse]
871
+ def search_conversation_canned_messages(search_request, opts = {})
872
+ data, _status_code, _headers = search_conversation_canned_messages_with_http_info(search_request, opts)
873
+ data
874
+ end
875
+
876
+ # Search for canned messages by short_code
877
+ # Search for canned messages by short_code
878
+ # @param search_request [ConversationCannedMessagesSearch] Search request
879
+ # @param [Hash] opts the optional parameters
880
+ # @return [Array<(ConversationCannedMessagesResponse, Integer, Hash)>] ConversationCannedMessagesResponse data, response status code and response headers
881
+ def search_conversation_canned_messages_with_http_info(search_request, opts = {})
882
+ if @api_client.config.debugging
883
+ @api_client.config.logger.debug 'Calling API: ConversationApi.search_conversation_canned_messages ...'
884
+ end
885
+ # verify the required parameter 'search_request' is set
886
+ if @api_client.config.client_side_validation && search_request.nil?
887
+ fail ArgumentError, "Missing the required parameter 'search_request' when calling ConversationApi.search_conversation_canned_messages"
888
+ end
889
+ # resource path
890
+ local_var_path = '/conversation/canned_messages/search'
891
+
892
+ # query parameters
893
+ query_params = opts[:query_params] || {}
894
+
895
+ # header parameters
896
+ header_params = opts[:header_params] || {}
897
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
898
+ # HTTP header 'Accept' (if needed)
899
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
900
+ # HTTP header 'Content-Type'
901
+ content_type = @api_client.select_header_content_type(['application/json'])
902
+ if !content_type.nil?
903
+ header_params['Content-Type'] = content_type
904
+ end
905
+
906
+ # form parameters
907
+ form_params = opts[:form_params] || {}
908
+
909
+ # http body (model)
910
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(search_request)
911
+
912
+ # return_type
913
+ return_type = opts[:debug_return_type] || 'ConversationCannedMessagesResponse'
914
+
915
+ # auth_names
916
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
917
+
918
+ new_options = opts.merge(
919
+ :operation => :"ConversationApi.search_conversation_canned_messages",
920
+ :header_params => header_params,
921
+ :query_params => query_params,
922
+ :form_params => form_params,
923
+ :body => post_body,
924
+ :auth_names => auth_names,
925
+ :return_type => return_type
926
+ )
927
+
928
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
929
+ if @api_client.config.debugging
930
+ @api_client.config.logger.debug "API called: ConversationApi#search_conversation_canned_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
931
+ end
932
+ return data, status_code, headers
933
+ end
934
+
739
935
  # Start a conversation
740
936
  # Start a new conversation
741
937
  # @param start_request [ConversationStartRequest] Start request
@@ -805,6 +1001,81 @@ module UltracartClient
805
1001
  return data, status_code, headers
806
1002
  end
807
1003
 
1004
+ # Update a canned message
1005
+ # Update a canned message
1006
+ # @param conversation_canned_message_oid [Integer]
1007
+ # @param canned_message [ConversationCannedMessage] Canned message
1008
+ # @param [Hash] opts the optional parameters
1009
+ # @return [ConversationCannedMessageResponse]
1010
+ def update_conversation_canned_message(conversation_canned_message_oid, canned_message, opts = {})
1011
+ data, _status_code, _headers = update_conversation_canned_message_with_http_info(conversation_canned_message_oid, canned_message, opts)
1012
+ data
1013
+ end
1014
+
1015
+ # Update a canned message
1016
+ # Update a canned message
1017
+ # @param conversation_canned_message_oid [Integer]
1018
+ # @param canned_message [ConversationCannedMessage] Canned message
1019
+ # @param [Hash] opts the optional parameters
1020
+ # @return [Array<(ConversationCannedMessageResponse, Integer, Hash)>] ConversationCannedMessageResponse data, response status code and response headers
1021
+ def update_conversation_canned_message_with_http_info(conversation_canned_message_oid, canned_message, opts = {})
1022
+ if @api_client.config.debugging
1023
+ @api_client.config.logger.debug 'Calling API: ConversationApi.update_conversation_canned_message ...'
1024
+ end
1025
+ # verify the required parameter 'conversation_canned_message_oid' is set
1026
+ if @api_client.config.client_side_validation && conversation_canned_message_oid.nil?
1027
+ fail ArgumentError, "Missing the required parameter 'conversation_canned_message_oid' when calling ConversationApi.update_conversation_canned_message"
1028
+ end
1029
+ # verify the required parameter 'canned_message' is set
1030
+ if @api_client.config.client_side_validation && canned_message.nil?
1031
+ fail ArgumentError, "Missing the required parameter 'canned_message' when calling ConversationApi.update_conversation_canned_message"
1032
+ end
1033
+ # resource path
1034
+ local_var_path = '/conversation/canned_messages/{conversation_canned_message_oid}'.sub('{' + 'conversation_canned_message_oid' + '}', CGI.escape(conversation_canned_message_oid.to_s))
1035
+
1036
+ # query parameters
1037
+ query_params = opts[:query_params] || {}
1038
+
1039
+ # header parameters
1040
+ header_params = opts[:header_params] || {}
1041
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1042
+ # HTTP header 'Accept' (if needed)
1043
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1044
+ # HTTP header 'Content-Type'
1045
+ content_type = @api_client.select_header_content_type(['application/json'])
1046
+ if !content_type.nil?
1047
+ header_params['Content-Type'] = content_type
1048
+ end
1049
+
1050
+ # form parameters
1051
+ form_params = opts[:form_params] || {}
1052
+
1053
+ # http body (model)
1054
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(canned_message)
1055
+
1056
+ # return_type
1057
+ return_type = opts[:debug_return_type] || 'ConversationCannedMessageResponse'
1058
+
1059
+ # auth_names
1060
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1061
+
1062
+ new_options = opts.merge(
1063
+ :operation => :"ConversationApi.update_conversation_canned_message",
1064
+ :header_params => header_params,
1065
+ :query_params => query_params,
1066
+ :form_params => form_params,
1067
+ :body => post_body,
1068
+ :auth_names => auth_names,
1069
+ :return_type => return_type
1070
+ )
1071
+
1072
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1073
+ if @api_client.config.debugging
1074
+ @api_client.config.logger.debug "API called: ConversationApi#update_conversation_canned_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1075
+ end
1076
+ return data, status_code, headers
1077
+ end
1078
+
808
1079
  # Update status within the queue
809
1080
  # Update status within the queue
810
1081
  # @param queue_name [String]
@@ -0,0 +1,248 @@
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 ConversationCannedMessage
18
+ attr_accessor :canned_message
19
+
20
+ attr_accessor :conversation_canned_message_oid
21
+
22
+ attr_accessor :conversation_webchat_queue_uuids
23
+
24
+ attr_accessor :short_code
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'canned_message' => :'canned_message',
30
+ :'conversation_canned_message_oid' => :'conversation_canned_message_oid',
31
+ :'conversation_webchat_queue_uuids' => :'conversation_webchat_queue_uuids',
32
+ :'short_code' => :'short_code'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'canned_message' => :'String',
45
+ :'conversation_canned_message_oid' => :'Integer',
46
+ :'conversation_webchat_queue_uuids' => :'Array<String>',
47
+ :'short_code' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationCannedMessage` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationCannedMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'canned_message')
73
+ self.canned_message = attributes[:'canned_message']
74
+ end
75
+
76
+ if attributes.key?(:'conversation_canned_message_oid')
77
+ self.conversation_canned_message_oid = attributes[:'conversation_canned_message_oid']
78
+ end
79
+
80
+ if attributes.key?(:'conversation_webchat_queue_uuids')
81
+ if (value = attributes[:'conversation_webchat_queue_uuids']).is_a?(Array)
82
+ self.conversation_webchat_queue_uuids = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'short_code')
87
+ self.short_code = attributes[:'short_code']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ canned_message == o.canned_message &&
110
+ conversation_canned_message_oid == o.conversation_canned_message_oid &&
111
+ conversation_webchat_queue_uuids == o.conversation_webchat_queue_uuids &&
112
+ short_code == o.short_code
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [canned_message, conversation_canned_message_oid, conversation_webchat_queue_uuids, short_code].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ new.build_from_hash(attributes)
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ self.class.openapi_types.each_pair do |key, type|
141
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
142
+ self.send("#{key}=", nil)
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
147
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
148
+ end
149
+ elsif !attributes[self.class.attribute_map[key]].nil?
150
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
151
+ end
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :Time
164
+ Time.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :Boolean
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ # models (e.g. Pet) or oneOf
195
+ klass = UltracartClient.const_get(type)
196
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ if value.nil?
219
+ is_nullable = self.class.openapi_nullable.include?(attr)
220
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
+ end
222
+
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+
246
+ end
247
+
248
+ end