smooch-api 1.12.0 → 2.0.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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -25
  3. data/docs/AppUserApi.md +54 -83
  4. data/docs/ConversationApi.md +30 -15
  5. data/docs/MenuApi.md +26 -11
  6. data/lib/smooch-api.rb +1 -7
  7. data/lib/smooch-api/api/app_api.rb +1 -1
  8. data/lib/smooch-api/api/app_user_api.rb +91 -98
  9. data/lib/smooch-api/api/attachments_api.rb +1 -1
  10. data/lib/smooch-api/api/conversation_api.rb +51 -21
  11. data/lib/smooch-api/api/integration_api.rb +1 -1
  12. data/lib/smooch-api/api/menu_api.rb +31 -13
  13. data/lib/smooch-api/api/webhook_api.rb +1 -1
  14. data/lib/smooch-api/api_client.rb +1 -1
  15. data/lib/smooch-api/api_error.rb +1 -1
  16. data/lib/smooch-api/configuration.rb +1 -1
  17. data/lib/smooch-api/models/action.rb +1 -34
  18. data/lib/smooch-api/models/app.rb +1 -1
  19. data/lib/smooch-api/models/app_create.rb +1 -1
  20. data/lib/smooch-api/models/app_response.rb +1 -1
  21. data/lib/smooch-api/models/app_settings.rb +1 -1
  22. data/lib/smooch-api/models/app_update.rb +1 -1
  23. data/lib/smooch-api/models/app_user.rb +1 -1
  24. data/lib/smooch-api/models/app_user_link.rb +1 -34
  25. data/lib/smooch-api/models/app_user_pre_create.rb +1 -1
  26. data/lib/smooch-api/models/app_user_response.rb +1 -1
  27. data/lib/smooch-api/models/app_user_update.rb +1 -1
  28. data/lib/smooch-api/models/attachment_response.rb +1 -1
  29. data/lib/smooch-api/models/client.rb +1 -34
  30. data/lib/smooch-api/models/client_info.rb +1 -1
  31. data/lib/smooch-api/models/confirmation.rb +1 -1
  32. data/lib/smooch-api/models/conversation.rb +1 -1
  33. data/lib/smooch-api/models/destination.rb +1 -1
  34. data/lib/smooch-api/models/device_response.rb +1 -1
  35. data/lib/smooch-api/models/device_update.rb +1 -1
  36. data/lib/smooch-api/models/display_settings.rb +1 -1
  37. data/lib/smooch-api/models/get_messages_response.rb +1 -1
  38. data/lib/smooch-api/models/integration.rb +1 -1
  39. data/lib/smooch-api/models/integration_create.rb +1 -1
  40. data/lib/smooch-api/models/integration_response.rb +1 -1
  41. data/lib/smooch-api/models/jwt_response.rb +1 -1
  42. data/lib/smooch-api/models/list_apps_response.rb +1 -1
  43. data/lib/smooch-api/models/list_integrations_response.rb +1 -1
  44. data/lib/smooch-api/models/list_secret_keys_response.rb +1 -1
  45. data/lib/smooch-api/models/list_webhooks_response.rb +1 -1
  46. data/lib/smooch-api/models/menu.rb +1 -1
  47. data/lib/smooch-api/models/menu_item.rb +1 -1
  48. data/lib/smooch-api/models/menu_response.rb +1 -1
  49. data/lib/smooch-api/models/message.rb +1 -34
  50. data/lib/smooch-api/models/message_item.rb +1 -1
  51. data/lib/smooch-api/models/message_post.rb +1 -34
  52. data/lib/smooch-api/models/message_response.rb +1 -1
  53. data/lib/smooch-api/models/secret_key.rb +1 -1
  54. data/lib/smooch-api/models/secret_key_create.rb +1 -1
  55. data/lib/smooch-api/models/secret_key_response.rb +1 -1
  56. data/lib/smooch-api/models/source.rb +1 -1
  57. data/lib/smooch-api/models/typing_activity_trigger.rb +1 -1
  58. data/lib/smooch-api/models/webhook.rb +1 -22
  59. data/lib/smooch-api/models/webhook_create.rb +1 -22
  60. data/lib/smooch-api/models/webhook_response.rb +1 -1
  61. data/lib/smooch-api/models/webhook_update.rb +1 -22
  62. data/lib/smooch-api/version.rb +2 -2
  63. data/smooch-api.gemspec +1 -1
  64. data/spec/api_client_spec.rb +1 -1
  65. data/spec/configuration_spec.rb +1 -1
  66. data/spec/spec_helper.rb +1 -1
  67. metadata +3 -15
  68. data/docs/DeviceInit.md +0 -12
  69. data/docs/Event.md +0 -8
  70. data/docs/Init.md +0 -9
  71. data/docs/InitApi.md +0 -61
  72. data/docs/InitResponse.md +0 -9
  73. data/docs/TrackEventResponse.md +0 -8
  74. data/lib/smooch-api/api/init_api.rb +0 -78
  75. data/lib/smooch-api/models/device_init.rb +0 -271
  76. data/lib/smooch-api/models/event.rb +0 -194
  77. data/lib/smooch-api/models/init.rb +0 -203
  78. data/lib/smooch-api/models/init_response.rb +0 -209
  79. data/lib/smooch-api/models/track_event_response.rb +0 -189
data/docs/InitResponse.md DELETED
@@ -1,9 +0,0 @@
1
- # SmoochApi::InitResponse
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **app_user** | [**AppUser**](AppUser.md) | The app user. |
7
- **app** | [**App**](App.md) | The app. |
8
-
9
-
@@ -1,8 +0,0 @@
1
- # SmoochApi::TrackEventResponse
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **conversation_updated** | **BOOLEAN** | Flag indicating if the conversation was updated. | [optional]
7
-
8
-
@@ -1,78 +0,0 @@
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: 1.12
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 "uri"
14
-
15
- module SmoochApi
16
- class InitApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
-
23
- #
24
- # This API is called by an iOS, Android, or browser client when the app is first loaded. It serves a number of purposes. 1. Initializes a new *appUser* and *client* if they don’t yet exist. 2. Updates an existing app user’s profile and client information. 3. Authenticates the *appUser* if *jwt* credentials are provided.
25
- # @param init_body Body for an init request.
26
- # @param [Hash] opts the optional parameters
27
- # @return [InitResponse]
28
- def init(init_body, opts = {})
29
- data, _status_code, _headers = init_with_http_info(init_body, opts)
30
- return data
31
- end
32
-
33
- #
34
- # This API is called by an iOS, Android, or browser client when the app is first loaded. It serves a number of purposes. 1. Initializes a new *appUser* and *client* if they don’t yet exist. 2. Updates an existing app user’s profile and client information. 3. Authenticates the *appUser* if *jwt* credentials are provided.
35
- # @param init_body Body for an init request.
36
- # @param [Hash] opts the optional parameters
37
- # @return [Array<(InitResponse, Fixnum, Hash)>] InitResponse data, response status code and response headers
38
- def init_with_http_info(init_body, opts = {})
39
- if @api_client.config.debugging
40
- @api_client.config.logger.debug "Calling API: InitApi.init ..."
41
- end
42
- # verify the required parameter 'init_body' is set
43
- if @api_client.config.client_side_validation && init_body.nil?
44
- fail ArgumentError, "Missing the required parameter 'init_body' when calling InitApi.init"
45
- end
46
- # resource path
47
- local_var_path = "/init"
48
-
49
- # query parameters
50
- query_params = {}
51
-
52
- # header parameters
53
- header_params = {}
54
- # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
- # HTTP header 'Content-Type'
57
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
58
-
59
- # form parameters
60
- form_params = {}
61
-
62
- # http body (model)
63
- post_body = @api_client.object_to_http_body(init_body)
64
- auth_names = ['jwt']
65
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
66
- :header_params => header_params,
67
- :query_params => query_params,
68
- :form_params => form_params,
69
- :body => post_body,
70
- :auth_names => auth_names,
71
- :return_type => 'InitResponse')
72
- if @api_client.config.debugging
73
- @api_client.config.logger.debug "API called: InitApi#init\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
- end
75
- return data, status_code, headers
76
- end
77
- end
78
- end
@@ -1,271 +0,0 @@
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: 1.12
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 DeviceInit
18
- # An identifier for the client. Must be globally unique.
19
- attr_accessor :id
20
-
21
- # The client's platform.
22
- attr_accessor :platform
23
-
24
- # The GCM or APN token to be used for sending push notifications to the device. Applies to only *android* and *ios* clients.
25
- attr_accessor :push_notification_token
26
-
27
- # A reserved string field for reporting the app version running on the device.
28
- attr_accessor :app_version
29
-
30
- attr_accessor :info
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
- :'id' => :'id',
58
- :'platform' => :'platform',
59
- :'push_notification_token' => :'pushNotificationToken',
60
- :'app_version' => :'appVersion',
61
- :'info' => :'info'
62
- }
63
- end
64
-
65
- # Attribute type mapping.
66
- def self.swagger_types
67
- {
68
- :'id' => :'String',
69
- :'platform' => :'String',
70
- :'push_notification_token' => :'String',
71
- :'app_version' => :'String',
72
- :'info' => :'ClientInfo'
73
- }
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- return unless attributes.is_a?(Hash)
80
-
81
- # convert string to symbol for hash key
82
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
-
84
- if attributes.has_key?(:'id')
85
- self.id = attributes[:'id']
86
- end
87
-
88
- if attributes.has_key?(:'platform')
89
- self.platform = attributes[:'platform']
90
- end
91
-
92
- if attributes.has_key?(:'pushNotificationToken')
93
- self.push_notification_token = attributes[:'pushNotificationToken']
94
- end
95
-
96
- if attributes.has_key?(:'appVersion')
97
- self.app_version = attributes[:'appVersion']
98
- end
99
-
100
- if attributes.has_key?(:'info')
101
- self.info = attributes[:'info']
102
- end
103
-
104
- end
105
-
106
- # Show invalid properties with the reasons. Usually used together with valid?
107
- # @return Array for valid properies with the reasons
108
- def list_invalid_properties
109
- invalid_properties = Array.new
110
- if @id.nil?
111
- invalid_properties.push("invalid value for 'id', id cannot be nil.")
112
- end
113
-
114
- if @platform.nil?
115
- invalid_properties.push("invalid value for 'platform', platform cannot be nil.")
116
- end
117
-
118
- return invalid_properties
119
- end
120
-
121
- # Check to see if the all the properties in the model are valid
122
- # @return true if the model is valid
123
- def valid?
124
- return false if @id.nil?
125
- return false if @platform.nil?
126
- platform_validator = EnumAttributeValidator.new('String', ["ios", "android", "web", "twilio", "telegram", "messenger", "frontendEmail", "line", "wechat", "viber", "twitter", "mailgun", "other"])
127
- return false unless platform_validator.valid?(@platform)
128
- return true
129
- end
130
-
131
- # Custom attribute writer method checking allowed values (enum).
132
- # @param [Object] platform Object to be assigned
133
- def platform=(platform)
134
- validator = EnumAttributeValidator.new('String', ["ios", "android", "web", "twilio", "telegram", "messenger", "frontendEmail", "line", "wechat", "viber", "twitter", "mailgun", "other"])
135
- unless validator.valid?(platform)
136
- fail ArgumentError, "invalid value for 'platform', must be one of #{validator.allowable_values}."
137
- end
138
- @platform = platform
139
- end
140
-
141
- # Checks equality by comparing each attribute.
142
- # @param [Object] Object to be compared
143
- def ==(o)
144
- return true if self.equal?(o)
145
- self.class == o.class &&
146
- id == o.id &&
147
- platform == o.platform &&
148
- push_notification_token == o.push_notification_token &&
149
- app_version == o.app_version &&
150
- info == o.info
151
- end
152
-
153
- # @see the `==` method
154
- # @param [Object] Object to be compared
155
- def eql?(o)
156
- self == o
157
- end
158
-
159
- # Calculates hash code according to all attributes.
160
- # @return [Fixnum] Hash code
161
- def hash
162
- [id, platform, push_notification_token, app_version, info].hash
163
- end
164
-
165
- # Builds the object from hash
166
- # @param [Hash] attributes Model attributes in the form of hash
167
- # @return [Object] Returns the model itself
168
- def build_from_hash(attributes)
169
- return nil unless attributes.is_a?(Hash)
170
- self.class.swagger_types.each_pair do |key, type|
171
- if type =~ /\AArray<(.*)>/i
172
- # check to ensure the input is an array given that the the attribute
173
- # is documented as an array but the input is not
174
- if attributes[self.class.attribute_map[key]].is_a?(Array)
175
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
176
- end
177
- elsif !attributes[self.class.attribute_map[key]].nil?
178
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
- end # or else data not found in attributes(hash), not an issue as the data can be optional
180
- end
181
-
182
- self
183
- end
184
-
185
- # Deserializes the data based on type
186
- # @param string type Data type
187
- # @param string value Value to be deserialized
188
- # @return [Object] Deserialized data
189
- def _deserialize(type, value)
190
- case type.to_sym
191
- when :DateTime
192
- DateTime.parse(value)
193
- when :Date
194
- Date.parse(value)
195
- when :String
196
- value.to_s
197
- when :Integer
198
- value.to_i
199
- when :Float
200
- value.to_f
201
- when :BOOLEAN
202
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
- true
204
- else
205
- false
206
- end
207
- when :Object
208
- # generic object (usually a Hash), return directly
209
- value
210
- when /\AArray<(?<inner_type>.+)>\z/
211
- inner_type = Regexp.last_match[:inner_type]
212
- value.map { |v| _deserialize(inner_type, v) }
213
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
- k_type = Regexp.last_match[:k_type]
215
- v_type = Regexp.last_match[:v_type]
216
- {}.tap do |hash|
217
- value.each do |k, v|
218
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
- end
220
- end
221
- else # model
222
- temp_model = SmoochApi.const_get(type).new
223
- temp_model.build_from_hash(value)
224
- end
225
- end
226
-
227
- # Returns the string representation of the object
228
- # @return [String] String presentation of the object
229
- def to_s
230
- to_hash.to_s
231
- end
232
-
233
- # to_body is an alias to to_hash (backward compatibility)
234
- # @return [Hash] Returns the object in the form of hash
235
- def to_body
236
- to_hash
237
- end
238
-
239
- # Returns the object in the form of hash
240
- # @return [Hash] Returns the object in the form of hash
241
- def to_hash
242
- hash = {}
243
- self.class.attribute_map.each_pair do |attr, param|
244
- value = self.send(attr)
245
- next if value.nil?
246
- hash[param] = _to_hash(value)
247
- end
248
- hash
249
- end
250
-
251
- # Outputs non-array value in the form of hash
252
- # For object, use to_hash. Otherwise, just return the value
253
- # @param [Object] value Any valid value
254
- # @return [Hash] Returns the value in the form of hash
255
- def _to_hash(value)
256
- if value.is_a?(Array)
257
- value.compact.map{ |v| _to_hash(v) }
258
- elsif value.is_a?(Hash)
259
- {}.tap do |hash|
260
- value.each { |k, v| hash[k] = _to_hash(v) }
261
- end
262
- elsif value.respond_to? :to_hash
263
- value.to_hash
264
- else
265
- value
266
- end
267
- end
268
-
269
- end
270
-
271
- end
@@ -1,194 +0,0 @@
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: 1.12
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 Event
18
- # The name of the event.
19
- attr_accessor :name
20
-
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'name' => :'name'
26
- }
27
- end
28
-
29
- # Attribute type mapping.
30
- def self.swagger_types
31
- {
32
- :'name' => :'String'
33
- }
34
- end
35
-
36
- # Initializes the object
37
- # @param [Hash] attributes Model attributes in the form of hash
38
- def initialize(attributes = {})
39
- return unless attributes.is_a?(Hash)
40
-
41
- # convert string to symbol for hash key
42
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
43
-
44
- if attributes.has_key?(:'name')
45
- self.name = attributes[:'name']
46
- end
47
-
48
- end
49
-
50
- # Show invalid properties with the reasons. Usually used together with valid?
51
- # @return Array for valid properies with the reasons
52
- def list_invalid_properties
53
- invalid_properties = Array.new
54
- if @name.nil?
55
- invalid_properties.push("invalid value for 'name', name cannot be nil.")
56
- end
57
-
58
- return invalid_properties
59
- end
60
-
61
- # Check to see if the all the properties in the model are valid
62
- # @return true if the model is valid
63
- def valid?
64
- return false if @name.nil?
65
- return true
66
- end
67
-
68
- # Checks equality by comparing each attribute.
69
- # @param [Object] Object to be compared
70
- def ==(o)
71
- return true if self.equal?(o)
72
- self.class == o.class &&
73
- name == o.name
74
- end
75
-
76
- # @see the `==` method
77
- # @param [Object] Object to be compared
78
- def eql?(o)
79
- self == o
80
- end
81
-
82
- # Calculates hash code according to all attributes.
83
- # @return [Fixnum] Hash code
84
- def hash
85
- [name].hash
86
- end
87
-
88
- # Builds the object from hash
89
- # @param [Hash] attributes Model attributes in the form of hash
90
- # @return [Object] Returns the model itself
91
- def build_from_hash(attributes)
92
- return nil unless attributes.is_a?(Hash)
93
- self.class.swagger_types.each_pair do |key, type|
94
- if type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the the attribute
96
- # is documented as an array but the input is not
97
- if attributes[self.class.attribute_map[key]].is_a?(Array)
98
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
99
- end
100
- elsif !attributes[self.class.attribute_map[key]].nil?
101
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
- end # or else data not found in attributes(hash), not an issue as the data can be optional
103
- end
104
-
105
- self
106
- end
107
-
108
- # Deserializes the data based on type
109
- # @param string type Data type
110
- # @param string value Value to be deserialized
111
- # @return [Object] Deserialized data
112
- def _deserialize(type, value)
113
- case type.to_sym
114
- when :DateTime
115
- DateTime.parse(value)
116
- when :Date
117
- Date.parse(value)
118
- when :String
119
- value.to_s
120
- when :Integer
121
- value.to_i
122
- when :Float
123
- value.to_f
124
- when :BOOLEAN
125
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
- true
127
- else
128
- false
129
- end
130
- when :Object
131
- # generic object (usually a Hash), return directly
132
- value
133
- when /\AArray<(?<inner_type>.+)>\z/
134
- inner_type = Regexp.last_match[:inner_type]
135
- value.map { |v| _deserialize(inner_type, v) }
136
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
- k_type = Regexp.last_match[:k_type]
138
- v_type = Regexp.last_match[:v_type]
139
- {}.tap do |hash|
140
- value.each do |k, v|
141
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
- end
143
- end
144
- else # model
145
- temp_model = SmoochApi.const_get(type).new
146
- temp_model.build_from_hash(value)
147
- end
148
- end
149
-
150
- # Returns the string representation of the object
151
- # @return [String] String presentation of the object
152
- def to_s
153
- to_hash.to_s
154
- end
155
-
156
- # to_body is an alias to to_hash (backward compatibility)
157
- # @return [Hash] Returns the object in the form of hash
158
- def to_body
159
- to_hash
160
- end
161
-
162
- # Returns the object in the form of hash
163
- # @return [Hash] Returns the object in the form of hash
164
- def to_hash
165
- hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
167
- value = self.send(attr)
168
- next if value.nil?
169
- hash[param] = _to_hash(value)
170
- end
171
- hash
172
- end
173
-
174
- # Outputs non-array value in the form of hash
175
- # For object, use to_hash. Otherwise, just return the value
176
- # @param [Object] value Any valid value
177
- # @return [Hash] Returns the value in the form of hash
178
- def _to_hash(value)
179
- if value.is_a?(Array)
180
- value.compact.map{ |v| _to_hash(v) }
181
- elsif value.is_a?(Hash)
182
- {}.tap do |hash|
183
- value.each { |k, v| hash[k] = _to_hash(v) }
184
- end
185
- elsif value.respond_to? :to_hash
186
- value.to_hash
187
- else
188
- value
189
- end
190
- end
191
-
192
- end
193
-
194
- end