purecloudplatformclientv2 30.0.0 → 30.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,346 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@genesys.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ # Represents an organization langauge assigned to a user. When assigning to a user specify the organization language id as the id.
21
+ class UserRoutingLanguage
22
+ # The globally unique identifier for the object.
23
+ attr_accessor :id
24
+
25
+ attr_accessor :name
26
+
27
+ # Proficiency is a rating from 0.0 to 5.0 on how competent an agent is for a particular language. It is used when a queue is set to \"Best available language\" mode to allow acd interactions to target agents with higher proficiency ratings.
28
+ attr_accessor :proficiency
29
+
30
+ # Activate or deactivate this routing langauge.
31
+ attr_accessor :state
32
+
33
+ # URI to the organization language used by this user langauge.
34
+ attr_accessor :language_uri
35
+
36
+ # The URI for this object
37
+ attr_accessor :self_uri
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+
43
+ :'id' => :'id',
44
+
45
+ :'name' => :'name',
46
+
47
+ :'proficiency' => :'proficiency',
48
+
49
+ :'state' => :'state',
50
+
51
+ :'language_uri' => :'languageUri',
52
+
53
+ :'self_uri' => :'selfUri'
54
+
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.swagger_types
60
+ {
61
+
62
+ :'id' => :'String',
63
+
64
+ :'name' => :'String',
65
+
66
+ :'proficiency' => :'Float',
67
+
68
+ :'state' => :'String',
69
+
70
+ :'language_uri' => :'String',
71
+
72
+ :'self_uri' => :'String'
73
+
74
+ }
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
84
+
85
+
86
+ if attributes.has_key?(:'id')
87
+
88
+
89
+ self.id = attributes[:'id']
90
+
91
+
92
+ end
93
+
94
+
95
+ if attributes.has_key?(:'name')
96
+
97
+
98
+ self.name = attributes[:'name']
99
+
100
+
101
+ end
102
+
103
+
104
+ if attributes.has_key?(:'proficiency')
105
+
106
+
107
+ self.proficiency = attributes[:'proficiency']
108
+
109
+
110
+ end
111
+
112
+
113
+ if attributes.has_key?(:'state')
114
+
115
+
116
+ self.state = attributes[:'state']
117
+
118
+
119
+ end
120
+
121
+
122
+ if attributes.has_key?(:'languageUri')
123
+
124
+
125
+ self.language_uri = attributes[:'languageUri']
126
+
127
+
128
+ end
129
+
130
+
131
+ if attributes.has_key?(:'selfUri')
132
+
133
+
134
+ self.self_uri = attributes[:'selfUri']
135
+
136
+
137
+ end
138
+
139
+
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properies with the reasons
144
+ def list_invalid_properties
145
+ invalid_properties = Array.new
146
+
147
+
148
+ return invalid_properties
149
+ end
150
+
151
+ # Check to see if the all the properties in the model are valid
152
+ # @return true if the model is valid
153
+ def valid?
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ allowed_values = ["active", "inactive", "deleted"]
170
+ if @state && !allowed_values.include?(@state)
171
+ return false
172
+ end
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ end
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ # Custom attribute writer method checking allowed values (enum).
204
+ # @param [Object] state Object to be assigned
205
+ def state=(state)
206
+ allowed_values = ["active", "inactive", "deleted"]
207
+ if state && !allowed_values.include?(state)
208
+ fail ArgumentError, "invalid value for 'state', must be one of #{allowed_values}."
209
+ end
210
+ @state = state
211
+ end
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ # Checks equality by comparing each attribute.
227
+ # @param [Object] Object to be compared
228
+ def ==(o)
229
+ return true if self.equal?(o)
230
+ self.class == o.class &&
231
+ id == o.id &&
232
+ name == o.name &&
233
+ proficiency == o.proficiency &&
234
+ state == o.state &&
235
+ language_uri == o.language_uri &&
236
+ self_uri == o.self_uri
237
+ end
238
+
239
+ # @see the `==` method
240
+ # @param [Object] Object to be compared
241
+ def eql?(o)
242
+ self == o
243
+ end
244
+
245
+ # Calculates hash code according to all attributes.
246
+ # @return [Fixnum] Hash code
247
+ def hash
248
+ [id, name, proficiency, state, language_uri, self_uri].hash
249
+ end
250
+
251
+ # build the object from hash
252
+ def build_from_hash(attributes)
253
+ return nil unless attributes.is_a?(Hash)
254
+ self.class.swagger_types.each_pair do |key, type|
255
+ if type =~ /^Array<(.*)>/i
256
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
257
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
258
+ else
259
+ #TODO show warning in debug mode
260
+ end
261
+ elsif !attributes[self.class.attribute_map[key]].nil?
262
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
263
+ else
264
+ # data not found in attributes(hash), not an issue as the data can be optional
265
+ end
266
+ end
267
+
268
+ self
269
+ end
270
+
271
+ def _deserialize(type, value)
272
+ case type.to_sym
273
+ when :DateTime
274
+ DateTime.parse(value)
275
+ when :Date
276
+ Date.parse(value)
277
+ when :String
278
+ value.to_s
279
+ when :Integer
280
+ value.to_i
281
+ when :Float
282
+ value.to_f
283
+ when :BOOLEAN
284
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
285
+ true
286
+ else
287
+ false
288
+ end
289
+ when :Object
290
+ # generic object (usually a Hash), return directly
291
+ value
292
+ when /\AArray<(?<inner_type>.+)>\z/
293
+ inner_type = Regexp.last_match[:inner_type]
294
+ value.map { |v| _deserialize(inner_type, v) }
295
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
296
+ k_type = Regexp.last_match[:k_type]
297
+ v_type = Regexp.last_match[:v_type]
298
+ {}.tap do |hash|
299
+ value.each do |k, v|
300
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
301
+ end
302
+ end
303
+ else # model
304
+ _model = Object.const_get("PureCloud").const_get(type).new
305
+ _model.build_from_hash(value)
306
+ end
307
+ end
308
+
309
+ def to_s
310
+ to_hash.to_s
311
+ end
312
+
313
+ # to_body is an alias to to_body (backward compatibility))
314
+ def to_body
315
+ to_hash
316
+ end
317
+
318
+ # return the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ next if value.nil?
324
+ hash[param] = _to_hash(value)
325
+ end
326
+ hash
327
+ end
328
+
329
+ # Method to output non-array value in the form of hash
330
+ # For object, use to_hash. Otherwise, just return the value
331
+ def _to_hash(value)
332
+ if value.is_a?(Array)
333
+ value.compact.map{ |v| _to_hash(v) }
334
+ elsif value.is_a?(Hash)
335
+ {}.tap do |hash|
336
+ value.each { |k, v| hash[k] = _to_hash(v) }
337
+ end
338
+ elsif value.respond_to? :to_hash
339
+ value.to_hash
340
+ else
341
+ value
342
+ end
343
+ end
344
+
345
+ end
346
+ end
@@ -0,0 +1,291 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@genesys.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ # Represents an organization language assigned to a user. When assigning to a user specify the organization langauge id as the id.
21
+ class UserRoutingLanguagePost
22
+ # The id of the existing routing language to add to the user
23
+ attr_accessor :id
24
+
25
+ # Proficiency is a rating from 0.0 to 5.0 on how competent an agent is for a particular language. It is used when a queue is set to \"Best available language\" mode to allow acd interactions to target agents with higher proficiency ratings.
26
+ attr_accessor :proficiency
27
+
28
+ # URI to the organization language used by this user langauge.
29
+ attr_accessor :language_uri
30
+
31
+ # The URI for this object
32
+ attr_accessor :self_uri
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+
38
+ :'id' => :'id',
39
+
40
+ :'proficiency' => :'proficiency',
41
+
42
+ :'language_uri' => :'languageUri',
43
+
44
+ :'self_uri' => :'selfUri'
45
+
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+
53
+ :'id' => :'String',
54
+
55
+ :'proficiency' => :'Float',
56
+
57
+ :'language_uri' => :'String',
58
+
59
+ :'self_uri' => :'String'
60
+
61
+ }
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ return unless attributes.is_a?(Hash)
68
+
69
+ # convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
71
+
72
+
73
+ if attributes.has_key?(:'id')
74
+
75
+
76
+ self.id = attributes[:'id']
77
+
78
+
79
+ end
80
+
81
+
82
+ if attributes.has_key?(:'proficiency')
83
+
84
+
85
+ self.proficiency = attributes[:'proficiency']
86
+
87
+
88
+ end
89
+
90
+
91
+ if attributes.has_key?(:'languageUri')
92
+
93
+
94
+ self.language_uri = attributes[:'languageUri']
95
+
96
+
97
+ end
98
+
99
+
100
+ if attributes.has_key?(:'selfUri')
101
+
102
+
103
+ self.self_uri = attributes[:'selfUri']
104
+
105
+
106
+ end
107
+
108
+
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properies with the reasons
113
+ def list_invalid_properties
114
+ invalid_properties = Array.new
115
+
116
+
117
+ return invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+
124
+
125
+ if @id.nil?
126
+ return false
127
+ end
128
+
129
+
130
+
131
+
132
+
133
+
134
+ if @proficiency.nil?
135
+ return false
136
+ end
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ end
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ id == o.id &&
179
+ proficiency == o.proficiency &&
180
+ language_uri == o.language_uri &&
181
+ self_uri == o.self_uri
182
+ end
183
+
184
+ # @see the `==` method
185
+ # @param [Object] Object to be compared
186
+ def eql?(o)
187
+ self == o
188
+ end
189
+
190
+ # Calculates hash code according to all attributes.
191
+ # @return [Fixnum] Hash code
192
+ def hash
193
+ [id, proficiency, language_uri, self_uri].hash
194
+ end
195
+
196
+ # build the object from hash
197
+ def build_from_hash(attributes)
198
+ return nil unless attributes.is_a?(Hash)
199
+ self.class.swagger_types.each_pair do |key, type|
200
+ if type =~ /^Array<(.*)>/i
201
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
202
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
203
+ else
204
+ #TODO show warning in debug mode
205
+ end
206
+ elsif !attributes[self.class.attribute_map[key]].nil?
207
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
208
+ else
209
+ # data not found in attributes(hash), not an issue as the data can be optional
210
+ end
211
+ end
212
+
213
+ self
214
+ end
215
+
216
+ def _deserialize(type, value)
217
+ case type.to_sym
218
+ when :DateTime
219
+ DateTime.parse(value)
220
+ when :Date
221
+ Date.parse(value)
222
+ when :String
223
+ value.to_s
224
+ when :Integer
225
+ value.to_i
226
+ when :Float
227
+ value.to_f
228
+ when :BOOLEAN
229
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
230
+ true
231
+ else
232
+ false
233
+ end
234
+ when :Object
235
+ # generic object (usually a Hash), return directly
236
+ value
237
+ when /\AArray<(?<inner_type>.+)>\z/
238
+ inner_type = Regexp.last_match[:inner_type]
239
+ value.map { |v| _deserialize(inner_type, v) }
240
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
241
+ k_type = Regexp.last_match[:k_type]
242
+ v_type = Regexp.last_match[:v_type]
243
+ {}.tap do |hash|
244
+ value.each do |k, v|
245
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
+ end
247
+ end
248
+ else # model
249
+ _model = Object.const_get("PureCloud").const_get(type).new
250
+ _model.build_from_hash(value)
251
+ end
252
+ end
253
+
254
+ def to_s
255
+ to_hash.to_s
256
+ end
257
+
258
+ # to_body is an alias to to_body (backward compatibility))
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # return the object in the form of hash
264
+ def to_hash
265
+ hash = {}
266
+ self.class.attribute_map.each_pair do |attr, param|
267
+ value = self.send(attr)
268
+ next if value.nil?
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Method to output non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map{ |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+
290
+ end
291
+ end