Class: Comet::BackupJobDetail
- Inherits:
-
Object
- Object
- Comet::BackupJobDetail
- Defined in:
- lib/comet/models/backup_job_detail.rb
Overview
BackupJobDetail is a typed class wrapper around the underlying Comet Server API data structure.
Instance Attribute Summary collapse
-
#cancellation_id ⇒ Object
Returns the value of attribute cancellation_id.
-
#classification ⇒ Object
Returns the value of attribute classification.
-
#client_version ⇒ Object
Returns the value of attribute client_version.
-
#destination_guid ⇒ Object
Returns the value of attribute destination_guid.
-
#destination_size_end ⇒ Object
Returns the value of attribute destination_size_end.
-
#destination_size_start ⇒ Object
Returns the value of attribute destination_size_start.
-
#device_id ⇒ Object
Returns the value of attribute device_id.
-
#download_size ⇒ Object
Returns the value of attribute download_size.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#guid ⇒ Object
Returns the value of attribute guid.
-
#progress ⇒ Object
Returns the value of attribute progress.
-
#snapshot_id ⇒ Object
Returns the value of attribute snapshot_id.
-
#source_guid ⇒ Object
Returns the value of attribute source_guid.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#status ⇒ Object
Returns the value of attribute status.
-
#total_accounts_count ⇒ Object
Returns the value of attribute total_accounts_count.
-
#total_chunks ⇒ Object
Returns the value of attribute total_chunks.
-
#total_directories ⇒ Object
Returns the value of attribute total_directories.
-
#total_files ⇒ Object
Returns the value of attribute total_files.
-
#total_licensed_mails_count ⇒ Object
Returns the value of attribute total_licensed_mails_count.
-
#total_mails_count ⇒ Object
Returns the value of attribute total_mails_count.
-
#total_sites_count ⇒ Object
Returns the value of attribute total_sites_count.
-
#total_size ⇒ Object
Returns the value of attribute total_size.
-
#total_unlicensed_mails_count ⇒ Object
Returns the value of attribute total_unlicensed_mails_count.
-
#total_vm_count ⇒ Object
Returns the value of attribute total_vm_count.
-
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
-
#upload_size ⇒ Object
Returns the value of attribute upload_size.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #clear ⇒ Object
- #from_hash(obj) ⇒ Object
- #from_json(json_string) ⇒ Object
-
#initialize ⇒ BackupJobDetail
constructor
A new instance of BackupJobDetail.
-
#to_h ⇒ Hash
The complete object as a Ruby hash.
-
#to_hash ⇒ Hash
The complete object as a Ruby hash.
-
#to_json(options = {}) ⇒ String
The complete object as a JSON string.
Constructor Details
#initialize ⇒ BackupJobDetail
Returns a new instance of BackupJobDetail.
99 100 101 |
# File 'lib/comet/models/backup_job_detail.rb', line 99 def initialize clear end |
Instance Attribute Details
#cancellation_id ⇒ Object
Returns the value of attribute cancellation_id.
85 86 87 |
# File 'lib/comet/models/backup_job_detail.rb', line 85 def cancellation_id @cancellation_id end |
#classification ⇒ Object
Returns the value of attribute classification.
22 23 24 |
# File 'lib/comet/models/backup_job_detail.rb', line 22 def classification @classification end |
#client_version ⇒ Object
Returns the value of attribute client_version.
46 47 48 |
# File 'lib/comet/models/backup_job_detail.rb', line 46 def client_version @client_version end |
#destination_guid ⇒ Object
Returns the value of attribute destination_guid.
37 38 39 |
# File 'lib/comet/models/backup_job_detail.rb', line 37 def destination_guid @destination_guid end |
#destination_size_end ⇒ Object
Returns the value of attribute destination_size_end.
94 95 96 |
# File 'lib/comet/models/backup_job_detail.rb', line 94 def destination_size_end @destination_size_end end |
#destination_size_start ⇒ Object
Returns the value of attribute destination_size_start.
91 92 93 |
# File 'lib/comet/models/backup_job_detail.rb', line 91 def destination_size_start @destination_size_start end |
#device_id ⇒ Object
Returns the value of attribute device_id.
40 41 42 |
# File 'lib/comet/models/backup_job_detail.rb', line 40 def device_id @device_id end |
#download_size ⇒ Object
Returns the value of attribute download_size.
64 65 66 |
# File 'lib/comet/models/backup_job_detail.rb', line 64 def download_size @download_size end |
#end_time ⇒ Object
Returns the value of attribute end_time.
31 32 33 |
# File 'lib/comet/models/backup_job_detail.rb', line 31 def end_time @end_time end |
#guid ⇒ Object
Returns the value of attribute guid.
16 17 18 |
# File 'lib/comet/models/backup_job_detail.rb', line 16 def guid @guid end |
#progress ⇒ Object
Returns the value of attribute progress.
88 89 90 |
# File 'lib/comet/models/backup_job_detail.rb', line 88 def progress @progress end |
#snapshot_id ⇒ Object
Returns the value of attribute snapshot_id.
43 44 45 |
# File 'lib/comet/models/backup_job_detail.rb', line 43 def snapshot_id @snapshot_id end |
#source_guid ⇒ Object
Returns the value of attribute source_guid.
34 35 36 |
# File 'lib/comet/models/backup_job_detail.rb', line 34 def source_guid @source_guid end |
#start_time ⇒ Object
Returns the value of attribute start_time.
28 29 30 |
# File 'lib/comet/models/backup_job_detail.rb', line 28 def start_time @start_time end |
#status ⇒ Object
Returns the value of attribute status.
25 26 27 |
# File 'lib/comet/models/backup_job_detail.rb', line 25 def status @status end |
#total_accounts_count ⇒ Object
Returns the value of attribute total_accounts_count.
76 77 78 |
# File 'lib/comet/models/backup_job_detail.rb', line 76 def total_accounts_count @total_accounts_count end |
#total_chunks ⇒ Object
Returns the value of attribute total_chunks.
58 59 60 |
# File 'lib/comet/models/backup_job_detail.rb', line 58 def total_chunks @total_chunks end |
#total_directories ⇒ Object
Returns the value of attribute total_directories.
49 50 51 |
# File 'lib/comet/models/backup_job_detail.rb', line 49 def total_directories @total_directories end |
#total_files ⇒ Object
Returns the value of attribute total_files.
52 53 54 |
# File 'lib/comet/models/backup_job_detail.rb', line 52 def total_files @total_files end |
#total_licensed_mails_count ⇒ Object
Returns the value of attribute total_licensed_mails_count.
79 80 81 |
# File 'lib/comet/models/backup_job_detail.rb', line 79 def total_licensed_mails_count @total_licensed_mails_count end |
#total_mails_count ⇒ Object
Returns the value of attribute total_mails_count.
70 71 72 |
# File 'lib/comet/models/backup_job_detail.rb', line 70 def total_mails_count @total_mails_count end |
#total_sites_count ⇒ Object
Returns the value of attribute total_sites_count.
73 74 75 |
# File 'lib/comet/models/backup_job_detail.rb', line 73 def total_sites_count @total_sites_count end |
#total_size ⇒ Object
Returns the value of attribute total_size.
55 56 57 |
# File 'lib/comet/models/backup_job_detail.rb', line 55 def total_size @total_size end |
#total_unlicensed_mails_count ⇒ Object
Returns the value of attribute total_unlicensed_mails_count.
82 83 84 |
# File 'lib/comet/models/backup_job_detail.rb', line 82 def total_unlicensed_mails_count @total_unlicensed_mails_count end |
#total_vm_count ⇒ Object
Returns the value of attribute total_vm_count.
67 68 69 |
# File 'lib/comet/models/backup_job_detail.rb', line 67 def total_vm_count @total_vm_count end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
97 98 99 |
# File 'lib/comet/models/backup_job_detail.rb', line 97 def unknown_json_fields @unknown_json_fields end |
#upload_size ⇒ Object
Returns the value of attribute upload_size.
61 62 63 |
# File 'lib/comet/models/backup_job_detail.rb', line 61 def upload_size @upload_size end |
#username ⇒ Object
Returns the value of attribute username.
19 20 21 |
# File 'lib/comet/models/backup_job_detail.rb', line 19 def username @username end |
Instance Method Details
#clear ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/comet/models/backup_job_detail.rb', line 103 def clear @guid = '' @username = '' @classification = 0 @status = 0 @start_time = 0 @end_time = 0 @source_guid = '' @destination_guid = '' @device_id = '' @snapshot_id = '' @client_version = '' @total_directories = 0 @total_files = 0 @total_size = 0 @total_chunks = 0 @upload_size = 0 @download_size = 0 @total_vm_count = 0 @total_mails_count = 0 @total_sites_count = 0 @total_accounts_count = 0 @total_licensed_mails_count = 0 @total_unlicensed_mails_count = 0 @cancellation_id = '' @progress = Comet::BackupJobProgress.new @destination_size_start = Comet::SizeMeasurement.new @destination_size_end = Comet::SizeMeasurement.new @unknown_json_fields = {} end |
#from_hash(obj) ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/comet/models/backup_job_detail.rb', line 142 def from_hash(obj) raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash obj.each do |k, v| case k when 'GUID' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @guid = v when 'Username' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @username = v when 'Classification' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @classification = v when 'Status' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @status = v when 'StartTime' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @start_time = v when 'EndTime' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @end_time = v when 'SourceGUID' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @source_guid = v when 'DestinationGUID' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @destination_guid = v when 'DeviceID' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @device_id = v when 'SnapshotID' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @snapshot_id = v when 'ClientVersion' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @client_version = v when 'TotalDirectories' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_directories = v when 'TotalFiles' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_files = v when 'TotalSize' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_size = v when 'TotalChunks' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_chunks = v when 'UploadSize' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @upload_size = v when 'DownloadSize' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @download_size = v when 'TotalVmCount' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_vm_count = v when 'TotalMailsCount' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_mails_count = v when 'TotalSitesCount' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_sites_count = v when 'TotalAccountsCount' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_accounts_count = v when 'TotalLicensedMailsCount' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_licensed_mails_count = v when 'TotalUnlicensedMailsCount' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @total_unlicensed_mails_count = v when 'CancellationID' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @cancellation_id = v when 'Progress' @progress = Comet::BackupJobProgress.new @progress.from_hash(v) when 'DestinationSizeStart' @destination_size_start = Comet::SizeMeasurement.new @destination_size_start.from_hash(v) when 'DestinationSizeEnd' @destination_size_end = Comet::SizeMeasurement.new @destination_size_end.from_hash(v) else @unknown_json_fields[k] = v end end end |
#from_json(json_string) ⇒ Object
135 136 137 138 139 |
# File 'lib/comet/models/backup_job_detail.rb', line 135 def from_json(json_string) raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String from_hash(JSON.parse(json_string)) end |
#to_h ⇒ Hash
Returns The complete object as a Ruby hash.
317 318 319 |
# File 'lib/comet/models/backup_job_detail.rb', line 317 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/comet/models/backup_job_detail.rb', line 259 def to_hash ret = {} ret['GUID'] = @guid ret['Username'] = @username ret['Classification'] = @classification ret['Status'] = @status ret['StartTime'] = @start_time ret['EndTime'] = @end_time ret['SourceGUID'] = @source_guid ret['DestinationGUID'] = @destination_guid ret['DeviceID'] = @device_id unless @snapshot_id.nil? ret['SnapshotID'] = @snapshot_id end ret['ClientVersion'] = @client_version ret['TotalDirectories'] = @total_directories ret['TotalFiles'] = @total_files ret['TotalSize'] = @total_size ret['TotalChunks'] = @total_chunks ret['UploadSize'] = @upload_size ret['DownloadSize'] = @download_size unless @total_vm_count.nil? ret['TotalVmCount'] = @total_vm_count end unless @total_mails_count.nil? ret['TotalMailsCount'] = @total_mails_count end unless @total_sites_count.nil? ret['TotalSitesCount'] = @total_sites_count end unless @total_accounts_count.nil? ret['TotalAccountsCount'] = @total_accounts_count end unless @total_licensed_mails_count.nil? ret['TotalLicensedMailsCount'] = @total_licensed_mails_count end unless @total_unlicensed_mails_count.nil? ret['TotalUnlicensedMailsCount'] = @total_unlicensed_mails_count end unless @cancellation_id.nil? ret['CancellationID'] = @cancellation_id end unless @progress.nil? ret['Progress'] = @progress end unless @destination_size_start.nil? ret['DestinationSizeStart'] = @destination_size_start end unless @destination_size_end.nil? ret['DestinationSizeEnd'] = @destination_size_end end @unknown_json_fields.each do |k, v| ret[k] = v end ret end |
#to_json(options = {}) ⇒ String
Returns The complete object as a JSON string.
322 323 324 |
# File 'lib/comet/models/backup_job_detail.rb', line 322 def to_json( = {}) to_hash.to_json() end |