purecloud 0.40.1 → 0.41.1

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 (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/config-ruby.json +1 -1
  4. data/doc_out/AdditionalInfo.html.md +12 -0
  5. data/doc_out/{Entity.html.md → AuthzPerm.html.md} +3 -5
  6. data/doc_out/AuthzPermissionContext.html.md +1 -1
  7. data/doc_out/CallableTimeSet.html.md +1 -1
  8. data/doc_out/Callback.html.md +1 -0
  9. data/doc_out/CallbackIdentifier.html.md +14 -0
  10. data/doc_out/CallbackMediaParticipant.html.md +1 -0
  11. data/doc_out/ContentManagementApi.html.md +51 -0
  12. data/doc_out/ConversationsApi.html.md +120 -0
  13. data/doc_out/CreateCallbackCommand.html.md +2 -0
  14. data/doc_out/CreateCallbackResponse.html.md +14 -0
  15. data/doc_out/Dependency.html.md +1 -0
  16. data/doc_out/DependencyObject.html.md +1 -0
  17. data/doc_out/DomainEdgeSoftwareVersionDto.html.md +1 -1
  18. data/doc_out/GroupSearchCriteria.html.md +20 -0
  19. data/doc_out/GroupSearchRequest.html.md +19 -0
  20. data/doc_out/GroupsApi.html.md +2 -2
  21. data/doc_out/GroupsSearchResponse.html.md +1 -0
  22. data/doc_out/Integration.html.md +20 -0
  23. data/doc_out/IntegrationConfiguration.html.md +20 -0
  24. data/doc_out/{DeletedResourceConsumerEntityListing.html.md → IntegrationEntityListing.html.md} +3 -3
  25. data/doc_out/IntegrationStatusInfo.html.md +16 -0
  26. data/doc_out/IntegrationType.html.md +5 -3
  27. data/doc_out/JsonNode.html.md +1 -1
  28. data/doc_out/JsonNodeSearchResponse.html.md +1 -0
  29. data/doc_out/LocationSearchCriteria.html.md +20 -0
  30. data/doc_out/LocationSearchRequest.html.md +19 -0
  31. data/doc_out/LocationsApi.html.md +6 -6
  32. data/doc_out/LocationsSearchResponse.html.md +22 -0
  33. data/doc_out/NumberOrder.html.md +27 -0
  34. data/doc_out/PortBillingAddress.html.md +17 -0
  35. data/doc_out/PortContact.html.md +14 -0
  36. data/doc_out/PresenceApi.html.md +1 -1
  37. data/doc_out/QualityAudit.html.md +1 -1
  38. data/doc_out/RecordingApi.html.md +4 -2
  39. data/doc_out/ResponseSet.html.md +1 -1
  40. data/doc_out/RoutingData.html.md +17 -0
  41. data/doc_out/RuleSet.html.md +1 -1
  42. data/doc_out/SearchAggregation.html.md +3 -0
  43. data/doc_out/SearchApi.html.md +12 -12
  44. data/doc_out/SearchCriteria.html.md +1 -1
  45. data/doc_out/SearchRequest.html.md +3 -3
  46. data/doc_out/SuggestApi.html.md +2 -2
  47. data/doc_out/SuggestSearchCriteria.html.md +19 -0
  48. data/doc_out/SuggestSearchRequest.html.md +14 -0
  49. data/doc_out/Usage.html.md +13 -0
  50. data/doc_out/UsageItem.html.md +15 -0
  51. data/doc_out/UserSearchCriteria.html.md +20 -0
  52. data/doc_out/UserSearchRequest.html.md +19 -0
  53. data/doc_out/UsersApi.html.md +2 -120
  54. data/doc_out/UsersSearchResponse.html.md +1 -0
  55. data/doc_out/VoicemailMessageEntityListing.html.md +0 -7
  56. data/doc_out/Workspace.html.md +1 -0
  57. data/doc_out/WorkspaceCreate.html.md +1 -0
  58. data/doc_out/WorkspaceSummary.html.md +1 -0
  59. data/doc_out/index.html.md +3 -3
  60. data/lib/purecloud/api/content_management_api.rb +55 -0
  61. data/lib/purecloud/api/conversations_api.rb +121 -0
  62. data/lib/purecloud/api/groups_api.rb +6 -6
  63. data/lib/purecloud/api/languages_api.rb +2 -2
  64. data/lib/purecloud/api/locations_api.rb +8 -8
  65. data/lib/purecloud/api/presence_api.rb +2 -2
  66. data/lib/purecloud/api/recording_api.rb +5 -2
  67. data/lib/purecloud/api/routing_api.rb +2 -2
  68. data/lib/purecloud/api/search_api.rb +14 -14
  69. data/lib/purecloud/api/suggest_api.rb +2 -2
  70. data/lib/purecloud/api/users_api.rb +6 -128
  71. data/lib/purecloud/api_client.rb +1 -1
  72. data/lib/purecloud/models/additional_info.rb +155 -0
  73. data/lib/purecloud/models/authz_perm.rb +177 -0
  74. data/lib/purecloud/models/authz_permission_context.rb +7 -7
  75. data/lib/purecloud/models/callback.rb +15 -4
  76. data/lib/purecloud/models/{entity.rb → callback_identifier.rb} +15 -24
  77. data/lib/purecloud/models/callback_media_participant.rb +15 -4
  78. data/lib/purecloud/models/contact.rb +1 -1
  79. data/lib/purecloud/models/create_callback_command.rb +24 -4
  80. data/lib/purecloud/models/create_callback_response.rb +179 -0
  81. data/lib/purecloud/models/dependency.rb +13 -1
  82. data/lib/purecloud/models/dependency_object.rb +13 -1
  83. data/lib/purecloud/models/domain_edge_software_version_dto.rb +13 -13
  84. data/lib/purecloud/models/group_search_criteria.rb +260 -0
  85. data/lib/purecloud/models/group_search_request.rb +240 -0
  86. data/lib/purecloud/models/groups_search_response.rb +16 -4
  87. data/lib/purecloud/models/integration.rb +252 -0
  88. data/lib/purecloud/models/integration_configuration.rb +243 -0
  89. data/lib/purecloud/models/{deleted_resource_consumer_entity_listing.rb → integration_entity_listing.rb} +2 -2
  90. data/lib/purecloud/models/integration_status_info.rb +209 -0
  91. data/lib/purecloud/models/integration_type.rb +27 -1
  92. data/lib/purecloud/models/json_node.rb +13 -13
  93. data/lib/purecloud/models/json_node_search_response.rb +14 -4
  94. data/lib/purecloud/models/location_search_criteria.rb +260 -0
  95. data/lib/purecloud/models/location_search_request.rb +240 -0
  96. data/lib/purecloud/models/locations_search_response.rb +261 -0
  97. data/lib/purecloud/models/number_order.rb +339 -0
  98. data/lib/purecloud/models/number_order_request.rb +1 -1
  99. data/lib/purecloud/models/port_billing_address.rb +205 -0
  100. data/lib/purecloud/models/port_contact.rb +175 -0
  101. data/lib/purecloud/models/quality_audit.rb +1 -1
  102. data/lib/purecloud/models/reservation.rb +1 -1
  103. data/lib/purecloud/models/routing_data.rb +209 -0
  104. data/lib/purecloud/models/search_aggregation.rb +37 -5
  105. data/lib/purecloud/models/search_criteria.rb +22 -22
  106. data/lib/purecloud/models/search_request.rb +40 -39
  107. data/lib/purecloud/models/suggest_search_criteria.rb +240 -0
  108. data/lib/purecloud/models/suggest_search_request.rb +180 -0
  109. data/lib/purecloud/models/usage.rb +167 -0
  110. data/lib/purecloud/models/usage_item.rb +194 -0
  111. data/lib/purecloud/models/user_search_criteria.rb +260 -0
  112. data/lib/purecloud/models/user_search_request.rb +240 -0
  113. data/lib/purecloud/models/users_search_response.rb +16 -4
  114. data/lib/purecloud/models/voicemail_message_entity_listing.rb +4 -74
  115. data/lib/purecloud/models/workspace.rb +11 -1
  116. data/lib/purecloud/models/workspace_create.rb +14 -4
  117. data/lib/purecloud/models/workspace_summary.rb +14 -4
  118. data/lib/purecloud/version.rb +1 -1
  119. data/lib/purecloud.rb +23 -2
  120. data/newVersion.md +1 -1
  121. data/swagger.json +1 -1
  122. data/version.json +1 -1
  123. metadata +48 -6
@@ -0,0 +1,209 @@
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@inin.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
+ # Status information for an Integration.
21
+ class IntegrationStatusInfo
22
+ # Machine-readable status as reported by the integration.
23
+ attr_accessor :internal
24
+
25
+ # Localized, human-readable, effective status of the integration.
26
+ attr_accessor :effective
27
+
28
+ # Localized status details for the integration.
29
+ attr_accessor :detail
30
+
31
+ # Date and time (in UTC) when the integration status (i.e. the internal field) was last updated. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
32
+ attr_accessor :last_updated
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+
38
+ :'internal' => :'internal',
39
+
40
+ :'effective' => :'effective',
41
+
42
+ :'detail' => :'detail',
43
+
44
+ :'last_updated' => :'lastUpdated'
45
+
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+ :'internal' => :'String',
53
+ :'effective' => :'String',
54
+ :'detail' => :'String',
55
+ :'last_updated' => :'DateTime'
56
+
57
+ }
58
+ end
59
+
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
65
+
66
+
67
+ if attributes[:'internal']
68
+ self.internal = attributes[:'internal']
69
+ end
70
+
71
+ if attributes[:'effective']
72
+ self.effective = attributes[:'effective']
73
+ end
74
+
75
+ if attributes[:'detail']
76
+ self.detail = attributes[:'detail']
77
+ end
78
+
79
+ if attributes[:'lastUpdated']
80
+ self.last_updated = attributes[:'lastUpdated']
81
+ end
82
+
83
+ end
84
+
85
+ # Custom attribute writer method checking allowed values (enum).
86
+ def internal=(internal)
87
+ allowed_values = ["ACTIVE", "ACTIVATING", "INACTIVE", "DEACTIVATING", "ERROR"]
88
+ if internal && !allowed_values.include?(internal)
89
+ fail "invalid value for 'internal', must be one of #{allowed_values}"
90
+ end
91
+ @internal = internal
92
+ end
93
+
94
+ # Check equality by comparing each attribute.
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ internal == o.internal &&
99
+ effective == o.effective &&
100
+ detail == o.detail &&
101
+ last_updated == o.last_updated
102
+ end
103
+
104
+ # @see the `==` method
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculate hash code according to all attributes.
110
+ def hash
111
+ [internal, effective, detail, last_updated].hash
112
+ end
113
+
114
+ # build the object from hash
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /^Array<(.*)>/i
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
121
+ else
122
+ #TODO show warning in debug mode
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ else
127
+ # data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ _model = Object.const_get("PureCloud").const_get(type).new
168
+ _model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_body (backward compatibility))
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # return the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Method to output non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map{ |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+
208
+ end
209
+ end
@@ -17,18 +17,28 @@ Terms of Service: https://developer.mypurecloud.com/tos
17
17
  require 'date'
18
18
 
19
19
  module PureCloud
20
+ # Descriptor for a type of Integration.
20
21
  class IntegrationType
21
22
  # The globally unique identifier for the object.
22
23
  attr_accessor :id
23
24
 
24
25
  attr_accessor :name
25
26
 
27
+ # Localized description of the integration type.
26
28
  attr_accessor :description
27
29
 
30
+ # PureCloud provider of the integration type.
28
31
  attr_accessor :provider
29
32
 
33
+ # Collection of logos.
30
34
  attr_accessor :images
31
35
 
36
+ # URI of the schema describing the key-value properties needed to configure an integration of this type.
37
+ attr_accessor :config_properties_schema_uri
38
+
39
+ # URI of the schema describing the advanced JSON document needed to configure an integration of this type.
40
+ attr_accessor :config_advanced_schema_uri
41
+
32
42
  # The URI for this object
33
43
  attr_accessor :self_uri
34
44
 
@@ -46,6 +56,10 @@ module PureCloud
46
56
 
47
57
  :'images' => :'images',
48
58
 
59
+ :'config_properties_schema_uri' => :'configPropertiesSchemaUri',
60
+
61
+ :'config_advanced_schema_uri' => :'configAdvancedSchemaUri',
62
+
49
63
  :'self_uri' => :'selfUri'
50
64
 
51
65
  }
@@ -59,6 +73,8 @@ module PureCloud
59
73
  :'description' => :'String',
60
74
  :'provider' => :'String',
61
75
  :'images' => :'Array<UserImage>',
76
+ :'config_properties_schema_uri' => :'String',
77
+ :'config_advanced_schema_uri' => :'String',
62
78
  :'self_uri' => :'String'
63
79
 
64
80
  }
@@ -93,6 +109,14 @@ module PureCloud
93
109
  end
94
110
  end
95
111
 
112
+ if attributes[:'configPropertiesSchemaUri']
113
+ self.config_properties_schema_uri = attributes[:'configPropertiesSchemaUri']
114
+ end
115
+
116
+ if attributes[:'configAdvancedSchemaUri']
117
+ self.config_advanced_schema_uri = attributes[:'configAdvancedSchemaUri']
118
+ end
119
+
96
120
  if attributes[:'selfUri']
97
121
  self.self_uri = attributes[:'selfUri']
98
122
  end
@@ -117,6 +141,8 @@ module PureCloud
117
141
  description == o.description &&
118
142
  provider == o.provider &&
119
143
  images == o.images &&
144
+ config_properties_schema_uri == o.config_properties_schema_uri &&
145
+ config_advanced_schema_uri == o.config_advanced_schema_uri &&
120
146
  self_uri == o.self_uri
121
147
  end
122
148
 
@@ -127,7 +153,7 @@ module PureCloud
127
153
 
128
154
  # Calculate hash code according to all attributes.
129
155
  def hash
130
- [id, name, description, provider, images, self_uri].hash
156
+ [id, name, description, provider, images, config_properties_schema_uri, config_advanced_schema_uri, self_uri].hash
131
157
  end
132
158
 
133
159
  # build the object from hash
@@ -36,6 +36,8 @@ module PureCloud
36
36
 
37
37
  attr_accessor :integral_number
38
38
 
39
+ attr_accessor :floating_point_number
40
+
39
41
  attr_accessor :short
40
42
 
41
43
  attr_accessor :int
@@ -54,8 +56,6 @@ module PureCloud
54
56
 
55
57
  attr_accessor :value_node
56
58
 
57
- attr_accessor :floating_point_number
58
-
59
59
  attr_accessor :array
60
60
 
61
61
  attr_accessor :null
@@ -82,6 +82,8 @@ module PureCloud
82
82
 
83
83
  :'integral_number' => :'integralNumber',
84
84
 
85
+ :'floating_point_number' => :'floatingPointNumber',
86
+
85
87
  :'short' => :'short',
86
88
 
87
89
  :'int' => :'int',
@@ -100,8 +102,6 @@ module PureCloud
100
102
 
101
103
  :'value_node' => :'valueNode',
102
104
 
103
- :'floating_point_number' => :'floatingPointNumber',
104
-
105
105
  :'array' => :'array',
106
106
 
107
107
  :'null' => :'null'
@@ -121,6 +121,7 @@ module PureCloud
121
121
  :'missing_node' => :'BOOLEAN',
122
122
  :'pojo' => :'BOOLEAN',
123
123
  :'integral_number' => :'BOOLEAN',
124
+ :'floating_point_number' => :'BOOLEAN',
124
125
  :'short' => :'BOOLEAN',
125
126
  :'int' => :'BOOLEAN',
126
127
  :'long' => :'BOOLEAN',
@@ -130,7 +131,6 @@ module PureCloud
130
131
  :'textual' => :'BOOLEAN',
131
132
  :'binary' => :'BOOLEAN',
132
133
  :'value_node' => :'BOOLEAN',
133
- :'floating_point_number' => :'BOOLEAN',
134
134
  :'array' => :'BOOLEAN',
135
135
  :'null' => :'BOOLEAN'
136
136
 
@@ -196,6 +196,12 @@ module PureCloud
196
196
  self.integral_number = false
197
197
  end
198
198
 
199
+ if attributes[:'floatingPointNumber']
200
+ self.floating_point_number = attributes[:'floatingPointNumber']
201
+ else
202
+ self.floating_point_number = false
203
+ end
204
+
199
205
  if attributes[:'short']
200
206
  self.short = attributes[:'short']
201
207
  else
@@ -250,12 +256,6 @@ module PureCloud
250
256
  self.value_node = false
251
257
  end
252
258
 
253
- if attributes[:'floatingPointNumber']
254
- self.floating_point_number = attributes[:'floatingPointNumber']
255
- else
256
- self.floating_point_number = false
257
- end
258
-
259
259
  if attributes[:'array']
260
260
  self.array = attributes[:'array']
261
261
  else
@@ -292,6 +292,7 @@ module PureCloud
292
292
  missing_node == o.missing_node &&
293
293
  pojo == o.pojo &&
294
294
  integral_number == o.integral_number &&
295
+ floating_point_number == o.floating_point_number &&
295
296
  short == o.short &&
296
297
  int == o.int &&
297
298
  long == o.long &&
@@ -301,7 +302,6 @@ module PureCloud
301
302
  textual == o.textual &&
302
303
  binary == o.binary &&
303
304
  value_node == o.value_node &&
304
- floating_point_number == o.floating_point_number &&
305
305
  array == o.array &&
306
306
  null == o.null
307
307
  end
@@ -313,7 +313,7 @@ module PureCloud
313
313
 
314
314
  # Calculate hash code according to all attributes.
315
315
  def hash
316
- [node_type, float, object, boolean, number, container_node, missing_node, pojo, integral_number, short, int, long, double, big_decimal, big_integer, textual, binary, value_node, floating_point_number, array, null].hash
316
+ [node_type, float, object, boolean, number, container_node, missing_node, pojo, integral_number, floating_point_number, short, int, long, double, big_decimal, big_integer, textual, binary, value_node, array, null].hash
317
317
  end
318
318
 
319
319
  # build the object from hash
@@ -36,6 +36,8 @@ module PureCloud
36
36
 
37
37
  attr_accessor :results
38
38
 
39
+ attr_accessor :aggregations
40
+
39
41
  # Attribute mapping from ruby-style variable name to JSON key.
40
42
  def self.attribute_map
41
43
  {
@@ -56,7 +58,9 @@ module PureCloud
56
58
 
57
59
  :'types' => :'types',
58
60
 
59
- :'results' => :'results'
61
+ :'results' => :'results',
62
+
63
+ :'aggregations' => :'aggregations'
60
64
 
61
65
  }
62
66
  end
@@ -72,7 +76,8 @@ module PureCloud
72
76
  :'current_page' => :'String',
73
77
  :'next_page' => :'String',
74
78
  :'types' => :'Array<String>',
75
- :'results' => :'JsonNode'
79
+ :'results' => :'JsonNode',
80
+ :'aggregations' => :'JsonNode'
76
81
 
77
82
  }
78
83
  end
@@ -122,6 +127,10 @@ module PureCloud
122
127
  self.results = attributes[:'results']
123
128
  end
124
129
 
130
+ if attributes[:'aggregations']
131
+ self.aggregations = attributes[:'aggregations']
132
+ end
133
+
125
134
  end
126
135
 
127
136
  # Check equality by comparing each attribute.
@@ -136,7 +145,8 @@ module PureCloud
136
145
  current_page == o.current_page &&
137
146
  next_page == o.next_page &&
138
147
  types == o.types &&
139
- results == o.results
148
+ results == o.results &&
149
+ aggregations == o.aggregations
140
150
  end
141
151
 
142
152
  # @see the `==` method
@@ -146,7 +156,7 @@ module PureCloud
146
156
 
147
157
  # Calculate hash code according to all attributes.
148
158
  def hash
149
- [total, page_count, page_size, page_number, previous_page, current_page, next_page, types, results].hash
159
+ [total, page_count, page_size, page_number, previous_page, current_page, next_page, types, results, aggregations].hash
150
160
  end
151
161
 
152
162
  # build the object from hash
@@ -0,0 +1,260 @@
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@inin.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
+ class LocationSearchCriteria
21
+ attr_accessor :end_value
22
+
23
+ attr_accessor :values
24
+
25
+ attr_accessor :start_value
26
+
27
+ attr_accessor :fields
28
+
29
+ attr_accessor :value
30
+
31
+ attr_accessor :operator
32
+
33
+ attr_accessor :group
34
+
35
+ # Search Type
36
+ attr_accessor :type
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+
42
+ :'end_value' => :'endValue',
43
+
44
+ :'values' => :'values',
45
+
46
+ :'start_value' => :'startValue',
47
+
48
+ :'fields' => :'fields',
49
+
50
+ :'value' => :'value',
51
+
52
+ :'operator' => :'operator',
53
+
54
+ :'group' => :'group',
55
+
56
+ :'type' => :'type'
57
+
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ :'end_value' => :'String',
65
+ :'values' => :'Array<String>',
66
+ :'start_value' => :'String',
67
+ :'fields' => :'Array<String>',
68
+ :'value' => :'String',
69
+ :'operator' => :'String',
70
+ :'group' => :'Array<LocationSearchCriteria>',
71
+ :'type' => :'String'
72
+
73
+ }
74
+ end
75
+
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
81
+
82
+
83
+ if attributes[:'endValue']
84
+ self.end_value = attributes[:'endValue']
85
+ end
86
+
87
+ if attributes[:'values']
88
+ if (value = attributes[:'values']).is_a?(Array)
89
+ self.values = value
90
+ end
91
+ end
92
+
93
+ if attributes[:'startValue']
94
+ self.start_value = attributes[:'startValue']
95
+ end
96
+
97
+ if attributes[:'fields']
98
+ if (value = attributes[:'fields']).is_a?(Array)
99
+ self.fields = value
100
+ end
101
+ end
102
+
103
+ if attributes[:'value']
104
+ self.value = attributes[:'value']
105
+ end
106
+
107
+ if attributes[:'operator']
108
+ self.operator = attributes[:'operator']
109
+ end
110
+
111
+ if attributes[:'group']
112
+ if (value = attributes[:'group']).is_a?(Array)
113
+ self.group = value
114
+ end
115
+ end
116
+
117
+ if attributes[:'type']
118
+ self.type = attributes[:'type']
119
+ end
120
+
121
+ end
122
+
123
+ # Custom attribute writer method checking allowed values (enum).
124
+ def operator=(operator)
125
+ allowed_values = ["AND", "OR", "NOT"]
126
+ if operator && !allowed_values.include?(operator)
127
+ fail "invalid value for 'operator', must be one of #{allowed_values}"
128
+ end
129
+ @operator = operator
130
+ end
131
+
132
+ # Custom attribute writer method checking allowed values (enum).
133
+ def type=(type)
134
+ allowed_values = ["EXACT", "STARTS_WITH", "CONTAINS", "REGEX", "TERM", "TERMS", "REQUIRED_FIELDS"]
135
+ if type && !allowed_values.include?(type)
136
+ fail "invalid value for 'type', must be one of #{allowed_values}"
137
+ end
138
+ @type = type
139
+ end
140
+
141
+ # Check equality by comparing each attribute.
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ end_value == o.end_value &&
146
+ values == o.values &&
147
+ start_value == o.start_value &&
148
+ fields == o.fields &&
149
+ value == o.value &&
150
+ operator == o.operator &&
151
+ group == o.group &&
152
+ type == o.type
153
+ end
154
+
155
+ # @see the `==` method
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculate hash code according to all attributes.
161
+ def hash
162
+ [end_value, values, start_value, fields, value, operator, group, type].hash
163
+ end
164
+
165
+ # build the object from hash
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.swagger_types.each_pair do |key, type|
169
+ if type =~ /^Array<(.*)>/i
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
172
+ else
173
+ #TODO show warning in debug mode
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ else
178
+ # data not found in attributes(hash), not an issue as the data can be optional
179
+ end
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :BOOLEAN
198
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ _model = Object.const_get("PureCloud").const_get(type).new
219
+ _model.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_body (backward compatibility))
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # return the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ next if value.nil?
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Method to output non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ def _to_hash(value)
246
+ if value.is_a?(Array)
247
+ value.compact.map{ |v| _to_hash(v) }
248
+ elsif value.is_a?(Hash)
249
+ {}.tap do |hash|
250
+ value.each { |k, v| hash[k] = _to_hash(v) }
251
+ end
252
+ elsif value.respond_to? :to_hash
253
+ value.to_hash
254
+ else
255
+ value
256
+ end
257
+ end
258
+
259
+ end
260
+ end