purecloud 0.18.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +2 -2
  4. data/README.md +1 -7
  5. data/config-ruby.json +1 -1
  6. data/extensions/auth.rb +2 -2
  7. data/lib/purecloud.rb +110 -75
  8. data/lib/purecloud/api/architect_api.rb +3127 -74
  9. data/lib/purecloud/api/attributes_api.rb +33 -33
  10. data/lib/purecloud/api/authorization_api.rb +83 -83
  11. data/lib/purecloud/api/compliance_api.rb +5 -5
  12. data/lib/purecloud/api/configuration_api.rb +594 -397
  13. data/lib/purecloud/api/content_management_api.rb +183 -183
  14. data/lib/purecloud/api/conversations_api.rb +289 -159
  15. data/lib/purecloud/api/downloads_api.rb +6 -6
  16. data/lib/purecloud/api/external_contacts_api.rb +1693 -0
  17. data/lib/purecloud/api/fax_api.rb +24 -24
  18. data/lib/purecloud/api/geolocation_api.rb +14 -14
  19. data/lib/purecloud/api/greetings_api.rb +68 -68
  20. data/lib/purecloud/api/groups_api.rb +31 -20
  21. data/lib/purecloud/api/languages_api.rb +18 -11
  22. data/lib/purecloud/api/licensing_api.rb +5 -5
  23. data/lib/purecloud/api/locations_api.rb +11 -11
  24. data/lib/purecloud/api/notifications_api.rb +41 -41
  25. data/lib/purecloud/api/o_auth_api.rb +69 -69
  26. data/lib/purecloud/api/outbound_api.rb +505 -325
  27. data/lib/purecloud/api/presence_api.rb +65 -65
  28. data/lib/purecloud/api/quality_api.rb +66 -639
  29. data/lib/purecloud/api/recording_api.rb +1343 -0
  30. data/lib/purecloud/api/response_management_api.rb +687 -0
  31. data/lib/purecloud/api/routing_api.rb +224 -170
  32. data/lib/purecloud/api/scripts_api.rb +52 -52
  33. data/lib/purecloud/api/search_api.rb +5 -5
  34. data/lib/purecloud/api/stations_api.rb +8 -8
  35. data/lib/purecloud/api/telephony_providers_edge_api.rb +138 -138
  36. data/lib/purecloud/api/user_recordings_api.rb +29 -29
  37. data/lib/purecloud/api/users_api.rb +123 -123
  38. data/lib/purecloud/api/utilities_api.rb +71 -15
  39. data/lib/purecloud/api/voicemail_api.rb +42 -42
  40. data/lib/purecloud/api_client.rb +1 -1
  41. data/lib/purecloud/models/address.rb +49 -51
  42. data/lib/purecloud/models/attribute_filter_item.rb +177 -0
  43. data/lib/purecloud/models/automate_queue_member_entity_listing.rb +238 -0
  44. data/lib/purecloud/models/available_additional_service.rb +40 -1
  45. data/lib/purecloud/models/{topic_entity_listing.rb → available_topic_entity_listing.rb} +1 -1
  46. data/lib/purecloud/models/call.rb +36 -5
  47. data/lib/purecloud/models/{line_properties.rb → call_command.rb} +13 -3
  48. data/lib/purecloud/models/callback.rb +15 -4
  49. data/lib/purecloud/models/campaign.rb +219 -17
  50. data/lib/purecloud/models/campaign_progress.rb +186 -0
  51. data/lib/purecloud/models/channel_topic_entity_listing.rb +238 -0
  52. data/lib/purecloud/models/charge.rb +14 -4
  53. data/lib/purecloud/models/{attribute_value.rb → client_text_table_transform.rb} +52 -82
  54. data/lib/purecloud/models/contact.rb +1 -1
  55. data/lib/purecloud/models/contact_list.rb +111 -1
  56. data/lib/purecloud/models/contact_listing.rb +238 -0
  57. data/lib/purecloud/models/content_attribute_filter_item.rb +177 -0
  58. data/lib/purecloud/models/content_facet_filter_item.rb +1 -1
  59. data/lib/purecloud/models/content_query_request.rb +16 -4
  60. data/lib/purecloud/models/control.rb +221 -0
  61. data/lib/purecloud/models/{flow_activate_request.rb → control_options.rb} +18 -12
  62. data/lib/purecloud/models/create_callback_command.rb +200 -0
  63. data/lib/purecloud/models/discount.rb +220 -0
  64. data/lib/purecloud/models/document.rb +13 -1
  65. data/lib/purecloud/models/document_attribute.rb +158 -0
  66. data/lib/purecloud/models/document_update.rb +28 -16
  67. data/lib/purecloud/models/document_upload.rb +4 -16
  68. data/lib/purecloud/models/domain_voice_rate_extended_response_item_entity_listing.rb +238 -0
  69. data/lib/purecloud/models/domain_voice_rate_international_response_item_entity_listing.rb +238 -0
  70. data/lib/purecloud/models/domain_voice_rate_response_item_entity_listing.rb +1 -1
  71. data/lib/purecloud/models/edge_line.rb +1 -1
  72. data/lib/purecloud/models/edge_logs_job.rb +181 -0
  73. data/lib/purecloud/models/edge_logs_job_file.rb +243 -0
  74. data/lib/purecloud/models/edge_logs_job_request.rb +168 -0
  75. data/lib/purecloud/models/{backend_work_item_data_element.rb → edge_logs_job_response.rb} +16 -24
  76. data/lib/purecloud/models/{flow_lock_request.rb → edge_logs_job_upload_request.rb} +10 -12
  77. data/lib/purecloud/models/email.rb +15 -4
  78. data/lib/purecloud/models/endpoint.rb +1 -1
  79. data/lib/purecloud/models/{flow_associate_workspaces_request.rb → estimated_wait_time_predictions.rb} +10 -11
  80. data/lib/purecloud/models/external_contact.rb +320 -0
  81. data/lib/purecloud/models/external_organization.rb +306 -0
  82. data/lib/purecloud/models/external_organization_listing.rb +238 -0
  83. data/lib/purecloud/models/facet_filter_item.rb +1 -1
  84. data/lib/purecloud/models/flow_body.rb +1 -1
  85. data/lib/purecloud/models/flow_body_format.rb +10 -20
  86. data/lib/purecloud/models/flow_terminate_request.rb +3 -16
  87. data/lib/purecloud/models/form.rb +148 -0
  88. data/lib/purecloud/models/group.rb +11 -1
  89. data/lib/purecloud/models/health_check_info.rb +268 -0
  90. data/lib/purecloud/models/{body_2.rb → inline_response_200.rb} +1 -1
  91. data/lib/purecloud/models/integration_type.rb +209 -0
  92. data/lib/purecloud/models/integration_type_entity_listing.rb +238 -0
  93. data/lib/purecloud/models/key_rotation_schedule.rb +1 -0
  94. data/lib/purecloud/models/language.rb +41 -1
  95. data/lib/purecloud/models/line.rb +1 -1
  96. data/lib/purecloud/models/line_base.rb +1 -1
  97. data/lib/purecloud/models/media_policies.rb +169 -0
  98. data/lib/purecloud/models/media_policy.rb +171 -0
  99. data/lib/purecloud/models/note.rb +200 -0
  100. data/lib/purecloud/models/{user_station_resource.rb → note_listing.rb} +68 -58
  101. data/lib/purecloud/models/o_auth_client.rb +1 -1
  102. data/lib/purecloud/models/page.rb +2 -2
  103. data/lib/purecloud/models/{byte_buffer.rb → payment_method.rb} +48 -61
  104. data/lib/purecloud/models/payment_method_listing.rb +238 -0
  105. data/lib/purecloud/models/payment_token_provider.rb +180 -0
  106. data/lib/purecloud/models/phone.rb +1 -1
  107. data/lib/purecloud/models/phone_base.rb +1 -1
  108. data/lib/purecloud/models/phone_number.rb +198 -0
  109. data/lib/purecloud/models/phones_reboot.rb +14 -4
  110. data/lib/purecloud/models/policy.rb +14 -1
  111. data/lib/purecloud/models/prediction_results.rb +167 -0
  112. data/lib/purecloud/models/query_request.rb +16 -4
  113. data/lib/purecloud/models/queue_member_entity_listing.rb +1 -1
  114. data/lib/purecloud/models/quote.rb +13 -1
  115. data/lib/purecloud/models/recording_settings.rb +146 -0
  116. data/lib/purecloud/models/relationship.rb +201 -0
  117. data/lib/purecloud/models/relationship_listing.rb +238 -0
  118. data/lib/purecloud/models/report_schedule.rb +3 -2
  119. data/lib/purecloud/models/service_type.rb +12 -1
  120. data/lib/purecloud/models/social_expression.rb +25 -4
  121. data/lib/purecloud/models/spreadsheet_transform_entity_listing.rb +1 -1
  122. data/lib/purecloud/models/template.rb +1 -1
  123. data/lib/purecloud/models/text_table_transform_entity_listing.rb +1 -1
  124. data/lib/purecloud/models/ticker.rb +158 -0
  125. data/lib/purecloud/models/time_slot.rb +1 -0
  126. data/lib/purecloud/models/trunk_base.rb +1 -1
  127. data/lib/purecloud/models/vendor_connection_request.rb +166 -0
  128. data/lib/purecloud/models/video.rb +15 -4
  129. data/lib/purecloud/models/work_item_definition.rb +8 -10
  130. data/lib/purecloud/version.rb +1 -1
  131. data/ossindex.json +17 -0
  132. data/purecloud.gemspec +4 -3
  133. data/rakefile +3 -15
  134. data/spec/test.rb +6 -3
  135. data/swagger.json +1 -1
  136. data/swagger_template/api_client.mustache +304 -0
  137. data/swagger_template/base_object.mustache +90 -0
  138. data/{PureCloud.gemspec → swagger_template/gemspec.mustache} +12 -11
  139. data/version.json +1 -1
  140. metadata +76 -25
  141. data/lib/purecloud/api/analytics_api.rb +0 -1554
  142. data/lib/purecloud/api/orphaned_recordings_api.rb +0 -205
  143. data/newVersion.md +0 -1
@@ -0,0 +1,238 @@
1
+ require 'date'
2
+
3
+ module PureCloud
4
+ class DomainVoiceRateInternationalResponseItemEntityListing
5
+ attr_accessor :page_size
6
+
7
+ attr_accessor :page_number
8
+
9
+ attr_accessor :total
10
+
11
+ attr_accessor :entities
12
+
13
+ attr_accessor :self_uri
14
+
15
+ attr_accessor :first_uri
16
+
17
+ attr_accessor :previous_uri
18
+
19
+ attr_accessor :next_uri
20
+
21
+ attr_accessor :last_uri
22
+
23
+ attr_accessor :page_count
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'page_size' => :'pageSize',
30
+
31
+ :'page_number' => :'pageNumber',
32
+
33
+ :'total' => :'total',
34
+
35
+ :'entities' => :'entities',
36
+
37
+ :'self_uri' => :'selfUri',
38
+
39
+ :'first_uri' => :'firstUri',
40
+
41
+ :'previous_uri' => :'previousUri',
42
+
43
+ :'next_uri' => :'nextUri',
44
+
45
+ :'last_uri' => :'lastUri',
46
+
47
+ :'page_count' => :'pageCount'
48
+
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'page_size' => :'Integer',
56
+ :'page_number' => :'Integer',
57
+ :'total' => :'Integer',
58
+ :'entities' => :'Array<VoiceRateInternational>',
59
+ :'self_uri' => :'String',
60
+ :'first_uri' => :'String',
61
+ :'previous_uri' => :'String',
62
+ :'next_uri' => :'String',
63
+ :'last_uri' => :'String',
64
+ :'page_count' => :'Integer'
65
+
66
+ }
67
+ end
68
+
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
74
+
75
+
76
+ if attributes[:'pageSize']
77
+ self.page_size = attributes[:'pageSize']
78
+ end
79
+
80
+ if attributes[:'pageNumber']
81
+ self.page_number = attributes[:'pageNumber']
82
+ end
83
+
84
+ if attributes[:'total']
85
+ self.total = attributes[:'total']
86
+ end
87
+
88
+ if attributes[:'entities']
89
+ if (value = attributes[:'entities']).is_a?(Array)
90
+ self.entities = value
91
+ end
92
+ end
93
+
94
+ if attributes[:'selfUri']
95
+ self.self_uri = attributes[:'selfUri']
96
+ end
97
+
98
+ if attributes[:'firstUri']
99
+ self.first_uri = attributes[:'firstUri']
100
+ end
101
+
102
+ if attributes[:'previousUri']
103
+ self.previous_uri = attributes[:'previousUri']
104
+ end
105
+
106
+ if attributes[:'nextUri']
107
+ self.next_uri = attributes[:'nextUri']
108
+ end
109
+
110
+ if attributes[:'lastUri']
111
+ self.last_uri = attributes[:'lastUri']
112
+ end
113
+
114
+ if attributes[:'pageCount']
115
+ self.page_count = attributes[:'pageCount']
116
+ end
117
+
118
+ end
119
+
120
+ # Check equality by comparing each attribute.
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ page_size == o.page_size &&
125
+ page_number == o.page_number &&
126
+ total == o.total &&
127
+ entities == o.entities &&
128
+ self_uri == o.self_uri &&
129
+ first_uri == o.first_uri &&
130
+ previous_uri == o.previous_uri &&
131
+ next_uri == o.next_uri &&
132
+ last_uri == o.last_uri &&
133
+ page_count == o.page_count
134
+ end
135
+
136
+ # @see the `==` method
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculate hash code according to all attributes.
142
+ def hash
143
+ [page_size, page_number, total, entities, self_uri, first_uri, previous_uri, next_uri, last_uri, page_count].hash
144
+ end
145
+
146
+ # build the object from hash
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.swagger_types.each_pair do |key, type|
150
+ if type =~ /^Array<(.*)>/i
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
153
+ else
154
+ #TODO show warning in debug mode
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ else
159
+ # data not found in attributes(hash), not an issue as the data can be optional
160
+ end
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :DateTime
169
+ DateTime.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :BOOLEAN
179
+ if value =~ /^(true|t|yes|y|1)$/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ _model = Object.const_get("PureCloud").const_get(type).new
197
+ _model.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # to_body is an alias to to_body (backward compatibility))
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # return the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ next if value.nil?
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Method to output non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map{ |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+ end
@@ -55,7 +55,7 @@ module PureCloud
55
55
  :'page_size' => :'Integer',
56
56
  :'page_number' => :'Integer',
57
57
  :'total' => :'Integer',
58
- :'entities' => :'Array<VoiceRateExtended>',
58
+ :'entities' => :'Array<VoiceRate>',
59
59
  :'self_uri' => :'String',
60
60
  :'first_uri' => :'String',
61
61
  :'previous_uri' => :'String',
@@ -61,7 +61,7 @@ module PureCloud
61
61
  :'id' => :'String',
62
62
  :'name' => :'String',
63
63
  :'schema' => :'UriReference',
64
- :'properties' => :'Hash<String, Line_properties>',
64
+ :'properties' => :'Hash<String, inline_response_200>',
65
65
  :'edge' => :'Edge',
66
66
  :'edge_group' => :'EdgeGroup',
67
67
  :'line_type' => :'String',
@@ -0,0 +1,181 @@
1
+ require 'date'
2
+
3
+ module PureCloud
4
+ class EdgeLogsJob
5
+ # The globally unique identifier for the object.
6
+ attr_accessor :id
7
+
8
+ attr_accessor :name
9
+
10
+ # The files available to upload from the Edge to the cloud.
11
+ attr_accessor :files
12
+
13
+ # The URI for this object
14
+ attr_accessor :self_uri
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+
20
+ :'id' => :'id',
21
+
22
+ :'name' => :'name',
23
+
24
+ :'files' => :'files',
25
+
26
+ :'self_uri' => :'selfUri'
27
+
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'id' => :'String',
35
+ :'name' => :'String',
36
+ :'files' => :'Array<EdgeLogsJobFile>',
37
+ :'self_uri' => :'String'
38
+
39
+ }
40
+ end
41
+
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
47
+
48
+
49
+ if attributes[:'id']
50
+ self.id = attributes[:'id']
51
+ end
52
+
53
+ if attributes[:'name']
54
+ self.name = attributes[:'name']
55
+ end
56
+
57
+ if attributes[:'files']
58
+ if (value = attributes[:'files']).is_a?(Array)
59
+ self.files = value
60
+ end
61
+ end
62
+
63
+ if attributes[:'selfUri']
64
+ self.self_uri = attributes[:'selfUri']
65
+ end
66
+
67
+ end
68
+
69
+ # Check equality by comparing each attribute.
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ id == o.id &&
74
+ name == o.name &&
75
+ files == o.files &&
76
+ self_uri == o.self_uri
77
+ end
78
+
79
+ # @see the `==` method
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculate hash code according to all attributes.
85
+ def hash
86
+ [id, name, files, self_uri].hash
87
+ end
88
+
89
+ # build the object from hash
90
+ def build_from_hash(attributes)
91
+ return nil unless attributes.is_a?(Hash)
92
+ self.class.swagger_types.each_pair do |key, type|
93
+ if type =~ /^Array<(.*)>/i
94
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
95
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
96
+ else
97
+ #TODO show warning in debug mode
98
+ end
99
+ elsif !attributes[self.class.attribute_map[key]].nil?
100
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
+ else
102
+ # data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+ end
105
+
106
+ self
107
+ end
108
+
109
+ def _deserialize(type, value)
110
+ case type.to_sym
111
+ when :DateTime
112
+ DateTime.parse(value)
113
+ when :Date
114
+ Date.parse(value)
115
+ when :String
116
+ value.to_s
117
+ when :Integer
118
+ value.to_i
119
+ when :Float
120
+ value.to_f
121
+ when :BOOLEAN
122
+ if value =~ /^(true|t|yes|y|1)$/i
123
+ true
124
+ else
125
+ false
126
+ end
127
+ when /\AArray<(?<inner_type>.+)>\z/
128
+ inner_type = Regexp.last_match[:inner_type]
129
+ value.map { |v| _deserialize(inner_type, v) }
130
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
131
+ k_type = Regexp.last_match[:k_type]
132
+ v_type = Regexp.last_match[:v_type]
133
+ {}.tap do |hash|
134
+ value.each do |k, v|
135
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
136
+ end
137
+ end
138
+ else # model
139
+ _model = Object.const_get("PureCloud").const_get(type).new
140
+ _model.build_from_hash(value)
141
+ end
142
+ end
143
+
144
+ def to_s
145
+ to_hash.to_s
146
+ end
147
+
148
+ # to_body is an alias to to_body (backward compatibility))
149
+ def to_body
150
+ to_hash
151
+ end
152
+
153
+ # return the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ next if value.nil?
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ # Method to output non-array value in the form of hash
165
+ # For object, use to_hash. Otherwise, just return the value
166
+ def _to_hash(value)
167
+ if value.is_a?(Array)
168
+ value.compact.map{ |v| _to_hash(v) }
169
+ elsif value.is_a?(Hash)
170
+ {}.tap do |hash|
171
+ value.each { |k, v| hash[k] = _to_hash(v) }
172
+ end
173
+ elsif value.respond_to? :to_hash
174
+ value.to_hash
175
+ else
176
+ value
177
+ end
178
+ end
179
+
180
+ end
181
+ end
@@ -0,0 +1,243 @@
1
+ require 'date'
2
+
3
+ module PureCloud
4
+ class EdgeLogsJobFile
5
+ # The globally unique identifier for the object.
6
+ attr_accessor :id
7
+
8
+ attr_accessor :name
9
+
10
+ # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
11
+ attr_accessor :time_created
12
+
13
+ # The time this log file was last modified on the Edge. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
14
+ attr_accessor :time_modified
15
+
16
+ # The size of this file in bytes.
17
+ attr_accessor :size_bytes
18
+
19
+ # The status of the upload of this file from the Edge to the cloud. Use /upload to start an upload.
20
+ attr_accessor :upload_status
21
+
22
+ # The path of this file on the Edge.
23
+ attr_accessor :edge_path
24
+
25
+ # The download ID to use with the downloads API.
26
+ attr_accessor :download_id
27
+
28
+ # The URI for this object
29
+ attr_accessor :self_uri
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+
35
+ :'id' => :'id',
36
+
37
+ :'name' => :'name',
38
+
39
+ :'time_created' => :'timeCreated',
40
+
41
+ :'time_modified' => :'timeModified',
42
+
43
+ :'size_bytes' => :'sizeBytes',
44
+
45
+ :'upload_status' => :'uploadStatus',
46
+
47
+ :'edge_path' => :'edgePath',
48
+
49
+ :'download_id' => :'downloadId',
50
+
51
+ :'self_uri' => :'selfUri'
52
+
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'id' => :'String',
60
+ :'name' => :'String',
61
+ :'time_created' => :'DateTime',
62
+ :'time_modified' => :'DateTime',
63
+ :'size_bytes' => :'Float',
64
+ :'upload_status' => :'String',
65
+ :'edge_path' => :'String',
66
+ :'download_id' => :'String',
67
+ :'self_uri' => :'String'
68
+
69
+ }
70
+ end
71
+
72
+ def initialize(attributes = {})
73
+ return unless attributes.is_a?(Hash)
74
+
75
+ # convert string to symbol for hash key
76
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
77
+
78
+
79
+ if attributes[:'id']
80
+ self.id = attributes[:'id']
81
+ end
82
+
83
+ if attributes[:'name']
84
+ self.name = attributes[:'name']
85
+ end
86
+
87
+ if attributes[:'timeCreated']
88
+ self.time_created = attributes[:'timeCreated']
89
+ end
90
+
91
+ if attributes[:'timeModified']
92
+ self.time_modified = attributes[:'timeModified']
93
+ end
94
+
95
+ if attributes[:'sizeBytes']
96
+ self.size_bytes = attributes[:'sizeBytes']
97
+ end
98
+
99
+ if attributes[:'uploadStatus']
100
+ self.upload_status = attributes[:'uploadStatus']
101
+ end
102
+
103
+ if attributes[:'edgePath']
104
+ self.edge_path = attributes[:'edgePath']
105
+ end
106
+
107
+ if attributes[:'downloadId']
108
+ self.download_id = attributes[:'downloadId']
109
+ end
110
+
111
+ if attributes[:'selfUri']
112
+ self.self_uri = attributes[:'selfUri']
113
+ end
114
+
115
+ end
116
+
117
+ # Custom attribute writer method checking allowed values (enum).
118
+ def upload_status=(upload_status)
119
+ allowed_values = ["UPLOADING", "NOT_UPLOADED", "UPLOADED", "ERROR_ON_UPLOAD"]
120
+ if upload_status && !allowed_values.include?(upload_status)
121
+ fail "invalid value for 'upload_status', must be one of #{allowed_values}"
122
+ end
123
+ @upload_status = upload_status
124
+ end
125
+
126
+ # Check equality by comparing each attribute.
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ id == o.id &&
131
+ name == o.name &&
132
+ time_created == o.time_created &&
133
+ time_modified == o.time_modified &&
134
+ size_bytes == o.size_bytes &&
135
+ upload_status == o.upload_status &&
136
+ edge_path == o.edge_path &&
137
+ download_id == o.download_id &&
138
+ self_uri == o.self_uri
139
+ end
140
+
141
+ # @see the `==` method
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculate hash code according to all attributes.
147
+ def hash
148
+ [id, name, time_created, time_modified, size_bytes, upload_status, edge_path, download_id, self_uri].hash
149
+ end
150
+
151
+ # build the object from hash
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.swagger_types.each_pair do |key, type|
155
+ if type =~ /^Array<(.*)>/i
156
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
158
+ else
159
+ #TODO show warning in debug mode
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ else
164
+ # data not found in attributes(hash), not an issue as the data can be optional
165
+ end
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :DateTime
174
+ DateTime.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :BOOLEAN
184
+ if value =~ /^(true|t|yes|y|1)$/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ _model = Object.const_get("PureCloud").const_get(type).new
202
+ _model.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_body (backward compatibility))
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # return the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ next if value.nil?
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Method to output non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map{ |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+ end