smooch-api 2.1.0 → 2.2.0

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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -1
  3. data/docs/AppUserApi.md +58 -2
  4. data/docs/AppUserBusinessSystemsResponse.md +8 -0
  5. data/docs/AppUserChannelsResponse.md +8 -0
  6. data/docs/BusinessSystemItem.md +12 -0
  7. data/docs/ChannelEntityItem.md +12 -0
  8. data/lib/smooch-api.rb +5 -1
  9. data/lib/smooch-api/api/app_api.rb +1 -1
  10. data/lib/smooch-api/api/app_user_api.rb +65 -4
  11. data/lib/smooch-api/api/attachments_api.rb +1 -1
  12. data/lib/smooch-api/api/conversation_api.rb +1 -1
  13. data/lib/smooch-api/api/integration_api.rb +1 -1
  14. data/lib/smooch-api/api/menu_api.rb +1 -1
  15. data/lib/smooch-api/api/webhook_api.rb +1 -1
  16. data/lib/smooch-api/api_client.rb +1 -1
  17. data/lib/smooch-api/api_error.rb +1 -1
  18. data/lib/smooch-api/configuration.rb +1 -1
  19. data/lib/smooch-api/models/action.rb +1 -1
  20. data/lib/smooch-api/models/app.rb +1 -1
  21. data/lib/smooch-api/models/app_create.rb +1 -1
  22. data/lib/smooch-api/models/app_response.rb +1 -1
  23. data/lib/smooch-api/models/app_settings.rb +1 -1
  24. data/lib/smooch-api/models/app_update.rb +1 -1
  25. data/lib/smooch-api/models/app_user.rb +1 -1
  26. data/lib/smooch-api/models/app_user_business_systems_response.rb +196 -0
  27. data/lib/smooch-api/models/app_user_channels_response.rb +196 -0
  28. data/lib/smooch-api/models/app_user_link.rb +1 -1
  29. data/lib/smooch-api/models/app_user_pre_create.rb +1 -1
  30. data/lib/smooch-api/models/app_user_response.rb +1 -1
  31. data/lib/smooch-api/models/app_user_update.rb +1 -1
  32. data/lib/smooch-api/models/attachment_response.rb +1 -1
  33. data/lib/smooch-api/models/business_system_item.rb +234 -0
  34. data/lib/smooch-api/models/channel_entity_item.rb +234 -0
  35. data/lib/smooch-api/models/client.rb +1 -1
  36. data/lib/smooch-api/models/client_info.rb +1 -1
  37. data/lib/smooch-api/models/confirmation.rb +1 -1
  38. data/lib/smooch-api/models/conversation.rb +1 -1
  39. data/lib/smooch-api/models/destination.rb +1 -1
  40. data/lib/smooch-api/models/display_settings.rb +1 -1
  41. data/lib/smooch-api/models/get_messages_response.rb +1 -1
  42. data/lib/smooch-api/models/integration.rb +1 -1
  43. data/lib/smooch-api/models/integration_create.rb +1 -1
  44. data/lib/smooch-api/models/integration_response.rb +1 -1
  45. data/lib/smooch-api/models/jwt_response.rb +1 -1
  46. data/lib/smooch-api/models/list_apps_response.rb +1 -1
  47. data/lib/smooch-api/models/list_integrations_response.rb +1 -1
  48. data/lib/smooch-api/models/list_secret_keys_response.rb +1 -1
  49. data/lib/smooch-api/models/list_webhooks_response.rb +1 -1
  50. data/lib/smooch-api/models/menu.rb +1 -1
  51. data/lib/smooch-api/models/menu_item.rb +1 -1
  52. data/lib/smooch-api/models/menu_response.rb +1 -1
  53. data/lib/smooch-api/models/message.rb +1 -1
  54. data/lib/smooch-api/models/message_item.rb +1 -1
  55. data/lib/smooch-api/models/message_post.rb +1 -1
  56. data/lib/smooch-api/models/message_response.rb +1 -1
  57. data/lib/smooch-api/models/secret_key.rb +1 -1
  58. data/lib/smooch-api/models/secret_key_create.rb +1 -1
  59. data/lib/smooch-api/models/secret_key_response.rb +1 -1
  60. data/lib/smooch-api/models/source.rb +1 -1
  61. data/lib/smooch-api/models/typing_activity_trigger.rb +1 -1
  62. data/lib/smooch-api/models/webhook.rb +1 -1
  63. data/lib/smooch-api/models/webhook_create.rb +1 -1
  64. data/lib/smooch-api/models/webhook_response.rb +1 -1
  65. data/lib/smooch-api/models/webhook_update.rb +1 -1
  66. data/lib/smooch-api/version.rb +2 -2
  67. data/smooch-api.gemspec +1 -1
  68. data/spec/api_client_spec.rb +1 -1
  69. data/spec/configuration_spec.rb +1 -1
  70. data/spec/spec_helper.rb +1 -1
  71. metadata +10 -2
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Smooch
3
+
4
+ #The Smooch API is a unified interface for powering messaging in your customer experiences across every channel. Our API speeds access to new markets, reduces time to ship, eliminates complexity, and helps you build the best experiences for your customers. For more information, visit our [official documentation](https://docs.smooch.io).
5
+
6
+ OpenAPI spec version: 2.2
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SmoochApi
16
+
17
+ class BusinessSystemItem
18
+ # The type of business system (ex. slack, hipchat, zendesk etc...)
19
+ attr_accessor :type
20
+
21
+ # The channel id for a *slack* integration
22
+ attr_accessor :channel_id
23
+
24
+ # The ticket id for a *zendesk* integration
25
+ attr_accessor :ticket_id
26
+
27
+ # The room id for a *hipchat* integration
28
+ attr_accessor :room_id
29
+
30
+ # The conversation id for a *helpscout* integration
31
+ attr_accessor :conversation_id
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'type' => :'type',
38
+ :'channel_id' => :'channelId',
39
+ :'ticket_id' => :'ticketId',
40
+ :'room_id' => :'roomId',
41
+ :'conversation_id' => :'conversationId'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'type' => :'String',
49
+ :'channel_id' => :'String',
50
+ :'ticket_id' => :'String',
51
+ :'room_id' => :'Integer',
52
+ :'conversation_id' => :'String'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+ if attributes.has_key?(:'type')
65
+ self.type = attributes[:'type']
66
+ end
67
+
68
+ if attributes.has_key?(:'channelId')
69
+ self.channel_id = attributes[:'channelId']
70
+ end
71
+
72
+ if attributes.has_key?(:'ticketId')
73
+ self.ticket_id = attributes[:'ticketId']
74
+ end
75
+
76
+ if attributes.has_key?(:'roomId')
77
+ self.room_id = attributes[:'roomId']
78
+ end
79
+
80
+ if attributes.has_key?(:'conversationId')
81
+ self.conversation_id = attributes[:'conversationId']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properies with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @type.nil?
91
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
92
+ end
93
+
94
+ return invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ return false if @type.nil?
101
+ return 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
+ type == o.type &&
110
+ channel_id == o.channel_id &&
111
+ ticket_id == o.ticket_id &&
112
+ room_id == o.room_id &&
113
+ conversation_id == o.conversation_id
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Fixnum] Hash code
124
+ def hash
125
+ [type, channel_id, ticket_id, room_id, conversation_id].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.swagger_types.each_pair do |key, type|
134
+ if type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :DateTime
155
+ DateTime.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :BOOLEAN
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ temp_model = SmoochApi.const_get(type).new
186
+ temp_model.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ next if value.nil?
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map{ |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Smooch
3
+
4
+ #The Smooch API is a unified interface for powering messaging in your customer experiences across every channel. Our API speeds access to new markets, reduces time to ship, eliminates complexity, and helps you build the best experiences for your customers. For more information, visit our [official documentation](https://docs.smooch.io).
5
+
6
+ OpenAPI spec version: 2.2
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SmoochApi
16
+
17
+ class ChannelEntityItem
18
+ # The type of channel (ex. messenger, viber, twilio etc...)
19
+ attr_accessor :type
20
+
21
+ # The phone number for a *twilio*, *messageBird* integration
22
+ attr_accessor :phone_number
23
+
24
+ # The userId for a *messenger*, *viber*, *line*, *wechat* integration
25
+ attr_accessor :user_id
26
+
27
+ # The email address for a *frontendEmail*, *mailgun* integration
28
+ attr_accessor :address
29
+
30
+ # The chat id for a *telegram* integration
31
+ attr_accessor :chat_id
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'type' => :'type',
38
+ :'phone_number' => :'phoneNumber',
39
+ :'user_id' => :'userId',
40
+ :'address' => :'address',
41
+ :'chat_id' => :'chatId'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'type' => :'String',
49
+ :'phone_number' => :'String',
50
+ :'user_id' => :'String',
51
+ :'address' => :'String',
52
+ :'chat_id' => :'String'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+ if attributes.has_key?(:'type')
65
+ self.type = attributes[:'type']
66
+ end
67
+
68
+ if attributes.has_key?(:'phoneNumber')
69
+ self.phone_number = attributes[:'phoneNumber']
70
+ end
71
+
72
+ if attributes.has_key?(:'userId')
73
+ self.user_id = attributes[:'userId']
74
+ end
75
+
76
+ if attributes.has_key?(:'address')
77
+ self.address = attributes[:'address']
78
+ end
79
+
80
+ if attributes.has_key?(:'chatId')
81
+ self.chat_id = attributes[:'chatId']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properies with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @type.nil?
91
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
92
+ end
93
+
94
+ return invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ return false if @type.nil?
101
+ return 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
+ type == o.type &&
110
+ phone_number == o.phone_number &&
111
+ user_id == o.user_id &&
112
+ address == o.address &&
113
+ chat_id == o.chat_id
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Fixnum] Hash code
124
+ def hash
125
+ [type, phone_number, user_id, address, chat_id].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.swagger_types.each_pair do |key, type|
134
+ if type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :DateTime
155
+ DateTime.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :BOOLEAN
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ temp_model = SmoochApi.const_get(type).new
186
+ temp_model.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ next if value.nil?
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map{ |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end