smooch-api 5.7.0 → 5.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -1
- data/docs/Action.md +2 -2
- data/docs/AppUserLink.md +1 -1
- data/docs/BusinessSystemItem.md +1 -1
- data/docs/ChannelEntityItem.md +1 -1
- data/docs/Client.md +1 -1
- data/docs/Confirmation.md +1 -1
- data/docs/ConversationActivity.md +2 -2
- data/docs/Deployment.md +17 -0
- data/docs/DeploymentActivatePhoneNumber.md +10 -0
- data/docs/DeploymentApi.md +325 -0
- data/docs/DeploymentConfirmCode.md +8 -0
- data/docs/DeploymentCreate.md +12 -0
- data/docs/DeploymentResponse.md +8 -0
- data/docs/Destination.md +1 -1
- data/docs/DisplaySettings.md +1 -1
- data/docs/Enums.md +3 -0
- data/docs/Integration.md +6 -5
- data/docs/IntegrationCreate.md +5 -4
- data/docs/LinkRequestResponseLinkRequests.md +1 -1
- data/docs/ListDeploymentsResponse.md +8 -0
- data/docs/MenuItem.md +1 -1
- data/docs/Message.md +2 -2
- data/docs/MessageItem.md +1 -1
- data/docs/MessagePost.md +2 -2
- data/docs/Source.md +1 -1
- data/docs/SubMenuItem.md +1 -1
- data/docs/Webhook.md +1 -1
- data/docs/WebhookCreate.md +1 -1
- data/docs/WebhookUpdate.md +1 -1
- data/lib/smooch-api.rb +8 -1
- data/lib/smooch-api/api/app_api.rb +1 -1
- data/lib/smooch-api/api/app_user_api.rb +1 -1
- data/lib/smooch-api/api/attachments_api.rb +1 -1
- data/lib/smooch-api/api/conversation_api.rb +1 -1
- data/lib/smooch-api/api/deployment_api.rb +358 -0
- data/lib/smooch-api/api/integration_api.rb +1 -1
- data/lib/smooch-api/api/menu_api.rb +1 -1
- data/lib/smooch-api/api/service_account_api.rb +1 -1
- data/lib/smooch-api/api/template_api.rb +1 -1
- data/lib/smooch-api/api/webhook_api.rb +1 -1
- data/lib/smooch-api/api_client.rb +1 -1
- data/lib/smooch-api/api_error.rb +1 -1
- data/lib/smooch-api/configuration.rb +1 -1
- data/lib/smooch-api/models/action.rb +3 -3
- data/lib/smooch-api/models/app.rb +1 -1
- data/lib/smooch-api/models/app_create.rb +1 -1
- data/lib/smooch-api/models/app_response.rb +1 -1
- data/lib/smooch-api/models/app_settings.rb +1 -1
- data/lib/smooch-api/models/app_update.rb +1 -1
- data/lib/smooch-api/models/app_user.rb +1 -1
- data/lib/smooch-api/models/app_user_business_systems_response.rb +1 -1
- data/lib/smooch-api/models/app_user_channels_response.rb +1 -1
- data/lib/smooch-api/models/app_user_link.rb +2 -2
- data/lib/smooch-api/models/app_user_pre_create.rb +1 -1
- data/lib/smooch-api/models/app_user_response.rb +1 -1
- data/lib/smooch-api/models/app_user_update.rb +1 -1
- data/lib/smooch-api/models/attachment_remove.rb +1 -1
- data/lib/smooch-api/models/attachment_response.rb +1 -1
- data/lib/smooch-api/models/auth_code_response.rb +1 -1
- data/lib/smooch-api/models/business_system_item.rb +2 -2
- data/lib/smooch-api/models/channel_entity_item.rb +2 -2
- data/lib/smooch-api/models/client.rb +2 -2
- data/lib/smooch-api/models/client_info.rb +1 -1
- data/lib/smooch-api/models/confirmation.rb +2 -2
- data/lib/smooch-api/models/conversation.rb +1 -1
- data/lib/smooch-api/models/conversation_activity.rb +3 -3
- data/lib/smooch-api/models/deployment.rb +294 -0
- data/lib/smooch-api/models/deployment_activate_phone_number.rb +224 -0
- data/lib/smooch-api/models/deployment_confirm_code.rb +194 -0
- data/lib/smooch-api/models/deployment_create.rb +234 -0
- data/lib/smooch-api/models/deployment_response.rb +194 -0
- data/lib/smooch-api/models/destination.rb +2 -2
- data/lib/smooch-api/models/display_settings.rb +2 -2
- data/lib/smooch-api/models/enums.rb +68 -5
- data/lib/smooch-api/models/get_integration_profile_response.rb +1 -1
- data/lib/smooch-api/models/get_messages_response.rb +1 -1
- data/lib/smooch-api/models/integration.rb +17 -7
- data/lib/smooch-api/models/integration_create.rb +16 -6
- data/lib/smooch-api/models/integration_profile_update.rb +1 -1
- data/lib/smooch-api/models/integration_response.rb +1 -1
- data/lib/smooch-api/models/integration_update.rb +1 -1
- data/lib/smooch-api/models/jwt_response.rb +1 -1
- data/lib/smooch-api/models/link_request_response.rb +1 -1
- data/lib/smooch-api/models/link_request_response_link_requests.rb +2 -2
- data/lib/smooch-api/models/list_apps_response.rb +1 -1
- data/lib/smooch-api/models/list_deployments_response.rb +196 -0
- data/lib/smooch-api/models/list_integrations_response.rb +1 -1
- data/lib/smooch-api/models/list_secret_keys_response.rb +1 -1
- data/lib/smooch-api/models/list_service_accounts_response.rb +1 -1
- data/lib/smooch-api/models/list_templates_response.rb +1 -1
- data/lib/smooch-api/models/list_webhooks_response.rb +1 -1
- data/lib/smooch-api/models/menu.rb +1 -1
- data/lib/smooch-api/models/menu_item.rb +2 -2
- data/lib/smooch-api/models/menu_response.rb +1 -1
- data/lib/smooch-api/models/message.rb +3 -3
- data/lib/smooch-api/models/message_item.rb +2 -2
- data/lib/smooch-api/models/message_override.rb +1 -1
- data/lib/smooch-api/models/message_override_whatsapp.rb +1 -1
- data/lib/smooch-api/models/message_post.rb +3 -3
- data/lib/smooch-api/models/message_response.rb +1 -1
- data/lib/smooch-api/models/secret_key.rb +1 -1
- data/lib/smooch-api/models/secret_key_create.rb +1 -1
- data/lib/smooch-api/models/secret_key_response.rb +1 -1
- data/lib/smooch-api/models/service_account.rb +1 -1
- data/lib/smooch-api/models/service_account_create.rb +1 -1
- data/lib/smooch-api/models/service_account_response.rb +1 -1
- data/lib/smooch-api/models/service_account_update.rb +1 -1
- data/lib/smooch-api/models/source.rb +2 -2
- data/lib/smooch-api/models/sub_menu_item.rb +2 -2
- data/lib/smooch-api/models/template.rb +1 -1
- data/lib/smooch-api/models/template_create.rb +1 -1
- data/lib/smooch-api/models/template_response.rb +1 -1
- data/lib/smooch-api/models/template_update.rb +1 -1
- data/lib/smooch-api/models/upload_integration_profile_photo_response.rb +1 -1
- data/lib/smooch-api/models/webhook.rb +2 -2
- data/lib/smooch-api/models/webhook_create.rb +2 -2
- data/lib/smooch-api/models/webhook_response.rb +1 -1
- data/lib/smooch-api/models/webhook_update.rb +2 -2
- data/lib/smooch-api/version.rb +2 -2
- data/smooch-api.gemspec +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +16 -2
@@ -0,0 +1,224 @@
|
|
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: 5.8
|
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 DeploymentActivatePhoneNumber
|
18
|
+
# The phone number to send the activation code to.
|
19
|
+
attr_accessor :phoneNumber
|
20
|
+
|
21
|
+
# The verified name certificate for the phone number.
|
22
|
+
attr_accessor :verifiedNameCertificate
|
23
|
+
|
24
|
+
# The method desired to receive the activation code. See [**DeploymentActivationMethodEnum**](Enums.md#DeploymentActivationMethodEnum) for available values.
|
25
|
+
attr_accessor :method
|
26
|
+
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'phoneNumber' => :'phoneNumber',
|
32
|
+
:'verifiedNameCertificate' => :'verifiedNameCertificate',
|
33
|
+
:'method' => :'method'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'phoneNumber' => :'String',
|
41
|
+
:'verifiedNameCertificate' => :'String',
|
42
|
+
:'method' => :'String'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
53
|
+
|
54
|
+
if attributes.has_key?(:'phoneNumber')
|
55
|
+
self.phoneNumber = attributes[:'phoneNumber']
|
56
|
+
end
|
57
|
+
|
58
|
+
if attributes.has_key?(:'verifiedNameCertificate')
|
59
|
+
self.verifiedNameCertificate = attributes[:'verifiedNameCertificate']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.has_key?(:'method')
|
63
|
+
self.method = attributes[:'method']
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properies with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
if @phoneNumber.nil?
|
73
|
+
invalid_properties.push("invalid value for 'phoneNumber', phoneNumber cannot be nil.")
|
74
|
+
end
|
75
|
+
|
76
|
+
if @verifiedNameCertificate.nil?
|
77
|
+
invalid_properties.push("invalid value for 'verifiedNameCertificate', verifiedNameCertificate cannot be nil.")
|
78
|
+
end
|
79
|
+
|
80
|
+
if @method.nil?
|
81
|
+
invalid_properties.push("invalid value for 'method', method cannot be nil.")
|
82
|
+
end
|
83
|
+
|
84
|
+
return invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
90
|
+
return false if @phoneNumber.nil?
|
91
|
+
return false if @verifiedNameCertificate.nil?
|
92
|
+
return false if @method.nil?
|
93
|
+
return true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
phoneNumber == o.phoneNumber &&
|
102
|
+
verifiedNameCertificate == o.verifiedNameCertificate &&
|
103
|
+
method == o.method
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(o)
|
109
|
+
self == o
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Fixnum] Hash code
|
114
|
+
def hash
|
115
|
+
[phoneNumber, verifiedNameCertificate, method].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def build_from_hash(attributes)
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
123
|
+
self.class.swagger_types.each_pair do |key, type|
|
124
|
+
if type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :DateTime
|
145
|
+
DateTime.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value.to_s
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :BOOLEAN
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
temp_model = SmoochApi.const_get(type).new
|
176
|
+
temp_model.build_from_hash(value)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns the string representation of the object
|
181
|
+
# @return [String] String presentation of the object
|
182
|
+
def to_s
|
183
|
+
to_hash.to_s
|
184
|
+
end
|
185
|
+
|
186
|
+
# to_body is an alias to to_hash (backward compatibility)
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_body
|
189
|
+
to_hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the object in the form of hash
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_hash
|
195
|
+
hash = {}
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
197
|
+
value = self.send(attr)
|
198
|
+
next if value.nil?
|
199
|
+
hash[param] = _to_hash(value)
|
200
|
+
end
|
201
|
+
hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Outputs non-array value in the form of hash
|
205
|
+
# For object, use to_hash. Otherwise, just return the value
|
206
|
+
# @param [Object] value Any valid value
|
207
|
+
# @return [Hash] Returns the value in the form of hash
|
208
|
+
def _to_hash(value)
|
209
|
+
if value.is_a?(Array)
|
210
|
+
value.compact.map{ |v| _to_hash(v) }
|
211
|
+
elsif value.is_a?(Hash)
|
212
|
+
{}.tap do |hash|
|
213
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
214
|
+
end
|
215
|
+
elsif value.respond_to? :to_hash
|
216
|
+
value.to_hash
|
217
|
+
else
|
218
|
+
value
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
@@ -0,0 +1,194 @@
|
|
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: 5.8
|
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 DeploymentConfirmCode
|
18
|
+
# The code that was sent to you via SMS or phone call.
|
19
|
+
attr_accessor :code
|
20
|
+
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'code' => :'code'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'code' => :'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?(:'code')
|
45
|
+
self.code = attributes[:'code']
|
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 @code.nil?
|
55
|
+
invalid_properties.push("invalid value for 'code', code 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 @code.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
|
+
code == o.code
|
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
|
+
[code].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
|
@@ -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: 5.8
|
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 DeploymentCreate
|
18
|
+
# The deployment hosting. See [**DeploymentHostingEnum**](Enums.md#DeploymentHostingEnum) for available values.
|
19
|
+
attr_accessor :hosting
|
20
|
+
|
21
|
+
# The base URL to access your WhatsApp EC. Only provide for `self` hosted deployments.
|
22
|
+
attr_accessor :baseUrl
|
23
|
+
|
24
|
+
# The username to access your WhatsApp EC. Only provide for `self` hosted deployments.
|
25
|
+
attr_accessor :username
|
26
|
+
|
27
|
+
# The password to access your WhatsApp EC. Only provide for `self` hosted deployments.
|
28
|
+
attr_accessor :password
|
29
|
+
|
30
|
+
# The URL to be called by Smooch when the status of the deployment changes.
|
31
|
+
attr_accessor :callbackUrl
|
32
|
+
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'hosting' => :'hosting',
|
38
|
+
:'baseUrl' => :'baseUrl',
|
39
|
+
:'username' => :'username',
|
40
|
+
:'password' => :'password',
|
41
|
+
:'callbackUrl' => :'callbackUrl'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.swagger_types
|
47
|
+
{
|
48
|
+
:'hosting' => :'String',
|
49
|
+
:'baseUrl' => :'String',
|
50
|
+
:'username' => :'String',
|
51
|
+
:'password' => :'String',
|
52
|
+
:'callbackUrl' => :'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?(:'hosting')
|
65
|
+
self.hosting = attributes[:'hosting']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.has_key?(:'baseUrl')
|
69
|
+
self.baseUrl = attributes[:'baseUrl']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.has_key?(:'username')
|
73
|
+
self.username = attributes[:'username']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.has_key?(:'password')
|
77
|
+
self.password = attributes[:'password']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'callbackUrl')
|
81
|
+
self.callbackUrl = attributes[:'callbackUrl']
|
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 @hosting.nil?
|
91
|
+
invalid_properties.push("invalid value for 'hosting', hosting 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 @hosting.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
|
+
hosting == o.hosting &&
|
110
|
+
baseUrl == o.baseUrl &&
|
111
|
+
username == o.username &&
|
112
|
+
password == o.password &&
|
113
|
+
callbackUrl == o.callbackUrl
|
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
|
+
[hosting, baseUrl, username, password, callbackUrl].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
|