smooch-api 1.12.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,203 +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 Init
18
- attr_accessor :device
19
-
20
- # The app user's userId. If specified, this ID can be used to invoke APIs. If left blank, an ID will automatically be generated.
21
- attr_accessor :user_id
22
-
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'device' => :'device',
28
- :'user_id' => :'userId'
29
- }
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.swagger_types
34
- {
35
- :'device' => :'DeviceInit',
36
- :'user_id' => :'String'
37
- }
38
- end
39
-
40
- # Initializes the object
41
- # @param [Hash] attributes Model attributes in the form of hash
42
- def initialize(attributes = {})
43
- return unless attributes.is_a?(Hash)
44
-
45
- # convert string to symbol for hash key
46
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
47
-
48
- if attributes.has_key?(:'device')
49
- self.device = attributes[:'device']
50
- end
51
-
52
- if attributes.has_key?(:'userId')
53
- self.user_id = attributes[:'userId']
54
- end
55
-
56
- end
57
-
58
- # Show invalid properties with the reasons. Usually used together with valid?
59
- # @return Array for valid properies with the reasons
60
- def list_invalid_properties
61
- invalid_properties = Array.new
62
- if @device.nil?
63
- invalid_properties.push("invalid value for 'device', device cannot be nil.")
64
- end
65
-
66
- return invalid_properties
67
- end
68
-
69
- # Check to see if the all the properties in the model are valid
70
- # @return true if the model is valid
71
- def valid?
72
- return false if @device.nil?
73
- return true
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(o)
79
- return true if self.equal?(o)
80
- self.class == o.class &&
81
- device == o.device &&
82
- user_id == o.user_id
83
- end
84
-
85
- # @see the `==` method
86
- # @param [Object] Object to be compared
87
- def eql?(o)
88
- self == o
89
- end
90
-
91
- # Calculates hash code according to all attributes.
92
- # @return [Fixnum] Hash code
93
- def hash
94
- [device, user_id].hash
95
- end
96
-
97
- # Builds the object from hash
98
- # @param [Hash] attributes Model attributes in the form of hash
99
- # @return [Object] Returns the model itself
100
- def build_from_hash(attributes)
101
- return nil unless attributes.is_a?(Hash)
102
- self.class.swagger_types.each_pair do |key, type|
103
- if type =~ /\AArray<(.*)>/i
104
- # check to ensure the input is an array given that the the attribute
105
- # is documented as an array but the input is not
106
- if attributes[self.class.attribute_map[key]].is_a?(Array)
107
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
108
- end
109
- elsif !attributes[self.class.attribute_map[key]].nil?
110
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
- end # or else data not found in attributes(hash), not an issue as the data can be optional
112
- end
113
-
114
- self
115
- end
116
-
117
- # Deserializes the data based on type
118
- # @param string type Data type
119
- # @param string value Value to be deserialized
120
- # @return [Object] Deserialized data
121
- def _deserialize(type, value)
122
- case type.to_sym
123
- when :DateTime
124
- DateTime.parse(value)
125
- when :Date
126
- Date.parse(value)
127
- when :String
128
- value.to_s
129
- when :Integer
130
- value.to_i
131
- when :Float
132
- value.to_f
133
- when :BOOLEAN
134
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
- true
136
- else
137
- false
138
- end
139
- when :Object
140
- # generic object (usually a Hash), return directly
141
- value
142
- when /\AArray<(?<inner_type>.+)>\z/
143
- inner_type = Regexp.last_match[:inner_type]
144
- value.map { |v| _deserialize(inner_type, v) }
145
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
- k_type = Regexp.last_match[:k_type]
147
- v_type = Regexp.last_match[:v_type]
148
- {}.tap do |hash|
149
- value.each do |k, v|
150
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
- end
152
- end
153
- else # model
154
- temp_model = SmoochApi.const_get(type).new
155
- temp_model.build_from_hash(value)
156
- end
157
- end
158
-
159
- # Returns the string representation of the object
160
- # @return [String] String presentation of the object
161
- def to_s
162
- to_hash.to_s
163
- end
164
-
165
- # to_body is an alias to to_hash (backward compatibility)
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_body
168
- to_hash
169
- end
170
-
171
- # Returns the object in the form of hash
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_hash
174
- hash = {}
175
- self.class.attribute_map.each_pair do |attr, param|
176
- value = self.send(attr)
177
- next if value.nil?
178
- hash[param] = _to_hash(value)
179
- end
180
- hash
181
- end
182
-
183
- # Outputs non-array value in the form of hash
184
- # For object, use to_hash. Otherwise, just return the value
185
- # @param [Object] value Any valid value
186
- # @return [Hash] Returns the value in the form of hash
187
- def _to_hash(value)
188
- if value.is_a?(Array)
189
- value.compact.map{ |v| _to_hash(v) }
190
- elsif value.is_a?(Hash)
191
- {}.tap do |hash|
192
- value.each { |k, v| hash[k] = _to_hash(v) }
193
- end
194
- elsif value.respond_to? :to_hash
195
- value.to_hash
196
- else
197
- value
198
- end
199
- end
200
-
201
- end
202
-
203
- end
@@ -1,209 +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 InitResponse
18
- # The app user.
19
- attr_accessor :app_user
20
-
21
- # The app.
22
- attr_accessor :app
23
-
24
-
25
- # Attribute mapping from ruby-style variable name to JSON key.
26
- def self.attribute_map
27
- {
28
- :'app_user' => :'appUser',
29
- :'app' => :'app'
30
- }
31
- end
32
-
33
- # Attribute type mapping.
34
- def self.swagger_types
35
- {
36
- :'app_user' => :'AppUser',
37
- :'app' => :'App'
38
- }
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- return unless attributes.is_a?(Hash)
45
-
46
- # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
-
49
- if attributes.has_key?(:'appUser')
50
- self.app_user = attributes[:'appUser']
51
- end
52
-
53
- if attributes.has_key?(:'app')
54
- self.app = attributes[:'app']
55
- end
56
-
57
- end
58
-
59
- # Show invalid properties with the reasons. Usually used together with valid?
60
- # @return Array for valid properies with the reasons
61
- def list_invalid_properties
62
- invalid_properties = Array.new
63
- if @app_user.nil?
64
- invalid_properties.push("invalid value for 'app_user', app_user cannot be nil.")
65
- end
66
-
67
- if @app.nil?
68
- invalid_properties.push("invalid value for 'app', app cannot be nil.")
69
- end
70
-
71
- return invalid_properties
72
- end
73
-
74
- # Check to see if the all the properties in the model are valid
75
- # @return true if the model is valid
76
- def valid?
77
- return false if @app_user.nil?
78
- return false if @app.nil?
79
- return true
80
- end
81
-
82
- # Checks equality by comparing each attribute.
83
- # @param [Object] Object to be compared
84
- def ==(o)
85
- return true if self.equal?(o)
86
- self.class == o.class &&
87
- app_user == o.app_user &&
88
- app == o.app
89
- end
90
-
91
- # @see the `==` method
92
- # @param [Object] Object to be compared
93
- def eql?(o)
94
- self == o
95
- end
96
-
97
- # Calculates hash code according to all attributes.
98
- # @return [Fixnum] Hash code
99
- def hash
100
- [app_user, app].hash
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- self.class.swagger_types.each_pair do |key, type|
109
- if type =~ /\AArray<(.*)>/i
110
- # check to ensure the input is an array given that the the attribute
111
- # is documented as an array but the input is not
112
- if attributes[self.class.attribute_map[key]].is_a?(Array)
113
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
- end
115
- elsif !attributes[self.class.attribute_map[key]].nil?
116
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
- end # or else data not found in attributes(hash), not an issue as the data can be optional
118
- end
119
-
120
- self
121
- end
122
-
123
- # Deserializes the data based on type
124
- # @param string type Data type
125
- # @param string value Value to be deserialized
126
- # @return [Object] Deserialized data
127
- def _deserialize(type, value)
128
- case type.to_sym
129
- when :DateTime
130
- DateTime.parse(value)
131
- when :Date
132
- Date.parse(value)
133
- when :String
134
- value.to_s
135
- when :Integer
136
- value.to_i
137
- when :Float
138
- value.to_f
139
- when :BOOLEAN
140
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
- true
142
- else
143
- false
144
- end
145
- when :Object
146
- # generic object (usually a Hash), return directly
147
- value
148
- when /\AArray<(?<inner_type>.+)>\z/
149
- inner_type = Regexp.last_match[:inner_type]
150
- value.map { |v| _deserialize(inner_type, v) }
151
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
- k_type = Regexp.last_match[:k_type]
153
- v_type = Regexp.last_match[:v_type]
154
- {}.tap do |hash|
155
- value.each do |k, v|
156
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
- end
158
- end
159
- else # model
160
- temp_model = SmoochApi.const_get(type).new
161
- temp_model.build_from_hash(value)
162
- end
163
- end
164
-
165
- # Returns the string representation of the object
166
- # @return [String] String presentation of the object
167
- def to_s
168
- to_hash.to_s
169
- end
170
-
171
- # to_body is an alias to to_hash (backward compatibility)
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_body
174
- to_hash
175
- end
176
-
177
- # Returns the object in the form of hash
178
- # @return [Hash] Returns the object in the form of hash
179
- def to_hash
180
- hash = {}
181
- self.class.attribute_map.each_pair do |attr, param|
182
- value = self.send(attr)
183
- next if value.nil?
184
- hash[param] = _to_hash(value)
185
- end
186
- hash
187
- end
188
-
189
- # Outputs non-array value in the form of hash
190
- # For object, use to_hash. Otherwise, just return the value
191
- # @param [Object] value Any valid value
192
- # @return [Hash] Returns the value in the form of hash
193
- def _to_hash(value)
194
- if value.is_a?(Array)
195
- value.compact.map{ |v| _to_hash(v) }
196
- elsif value.is_a?(Hash)
197
- {}.tap do |hash|
198
- value.each { |k, v| hash[k] = _to_hash(v) }
199
- end
200
- elsif value.respond_to? :to_hash
201
- value.to_hash
202
- else
203
- value
204
- end
205
- end
206
-
207
- end
208
-
209
- end
@@ -1,189 +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 TrackEventResponse
18
- # Flag indicating if the conversation was updated.
19
- attr_accessor :conversation_updated
20
-
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'conversation_updated' => :'conversationUpdated'
26
- }
27
- end
28
-
29
- # Attribute type mapping.
30
- def self.swagger_types
31
- {
32
- :'conversation_updated' => :'BOOLEAN'
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?(:'conversationUpdated')
45
- self.conversation_updated = attributes[:'conversationUpdated']
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
- return invalid_properties
55
- end
56
-
57
- # Check to see if the all the properties in the model are valid
58
- # @return true if the model is valid
59
- def valid?
60
- return true
61
- end
62
-
63
- # Checks equality by comparing each attribute.
64
- # @param [Object] Object to be compared
65
- def ==(o)
66
- return true if self.equal?(o)
67
- self.class == o.class &&
68
- conversation_updated == o.conversation_updated
69
- end
70
-
71
- # @see the `==` method
72
- # @param [Object] Object to be compared
73
- def eql?(o)
74
- self == o
75
- end
76
-
77
- # Calculates hash code according to all attributes.
78
- # @return [Fixnum] Hash code
79
- def hash
80
- [conversation_updated].hash
81
- end
82
-
83
- # Builds the object from hash
84
- # @param [Hash] attributes Model attributes in the form of hash
85
- # @return [Object] Returns the model itself
86
- def build_from_hash(attributes)
87
- return nil unless attributes.is_a?(Hash)
88
- self.class.swagger_types.each_pair do |key, type|
89
- if type =~ /\AArray<(.*)>/i
90
- # check to ensure the input is an array given that the the attribute
91
- # is documented as an array but the input is not
92
- if attributes[self.class.attribute_map[key]].is_a?(Array)
93
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
94
- end
95
- elsif !attributes[self.class.attribute_map[key]].nil?
96
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
- end # or else data not found in attributes(hash), not an issue as the data can be optional
98
- end
99
-
100
- self
101
- end
102
-
103
- # Deserializes the data based on type
104
- # @param string type Data type
105
- # @param string value Value to be deserialized
106
- # @return [Object] Deserialized data
107
- def _deserialize(type, value)
108
- case type.to_sym
109
- when :DateTime
110
- DateTime.parse(value)
111
- when :Date
112
- Date.parse(value)
113
- when :String
114
- value.to_s
115
- when :Integer
116
- value.to_i
117
- when :Float
118
- value.to_f
119
- when :BOOLEAN
120
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
- true
122
- else
123
- false
124
- end
125
- when :Object
126
- # generic object (usually a Hash), return directly
127
- value
128
- when /\AArray<(?<inner_type>.+)>\z/
129
- inner_type = Regexp.last_match[:inner_type]
130
- value.map { |v| _deserialize(inner_type, v) }
131
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
- k_type = Regexp.last_match[:k_type]
133
- v_type = Regexp.last_match[:v_type]
134
- {}.tap do |hash|
135
- value.each do |k, v|
136
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
- end
138
- end
139
- else # model
140
- temp_model = SmoochApi.const_get(type).new
141
- temp_model.build_from_hash(value)
142
- end
143
- end
144
-
145
- # Returns the string representation of the object
146
- # @return [String] String presentation of the object
147
- def to_s
148
- to_hash.to_s
149
- end
150
-
151
- # to_body is an alias to to_hash (backward compatibility)
152
- # @return [Hash] Returns the object in the form of hash
153
- def to_body
154
- to_hash
155
- end
156
-
157
- # Returns the object in the form of hash
158
- # @return [Hash] Returns the object in the form of hash
159
- def to_hash
160
- hash = {}
161
- self.class.attribute_map.each_pair do |attr, param|
162
- value = self.send(attr)
163
- next if value.nil?
164
- hash[param] = _to_hash(value)
165
- end
166
- hash
167
- end
168
-
169
- # Outputs non-array value in the form of hash
170
- # For object, use to_hash. Otherwise, just return the value
171
- # @param [Object] value Any valid value
172
- # @return [Hash] Returns the value in the form of hash
173
- def _to_hash(value)
174
- if value.is_a?(Array)
175
- value.compact.map{ |v| _to_hash(v) }
176
- elsif value.is_a?(Hash)
177
- {}.tap do |hash|
178
- value.each { |k, v| hash[k] = _to_hash(v) }
179
- end
180
- elsif value.respond_to? :to_hash
181
- value.to_hash
182
- else
183
- value
184
- end
185
- end
186
-
187
- end
188
-
189
- end