class Comet::BackupJobDetail

BackupJobDetail is a typed class wrapper around the underlying Comet Server API data structure.

def clear

def clear
  @guid = ''
  @username = ''
  @classification = 0
  @status = 0
  @start_time = 0
  @end_time = 0
  @retry_count = 0
  @source_guid = ''
  @destination_guid = ''
  @device_id = ''
  @snapshot_id = ''
  @backup_rule_guid = ''
  @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
  @conflicting_job_id = ''
  @cancellation_id = ''
  @progress = Comet::BackupJobProgress.new
  @destination_size_start = Comet::SizeMeasurement.new
  @destination_size_end = Comet::SizeMeasurement.new
  @unknown_json_fields = {}
end

def from_hash(obj)

Parameters:
  • obj (Hash) -- The complete object as a Ruby hash
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 'RetryCount'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
      @retry_count = 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 'BackupRuleGUID'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @backup_rule_guid = 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 'ConflictingJobID'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @conflicting_job_id = 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

def from_json(json_string)

Parameters:
  • json_string (String) -- The complete object in JSON format
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

def initialize

def initialize
  clear
end

def to_h

Returns:
  • (Hash) - The complete object as a Ruby hash
def to_h
  to_hash
end

def to_hash

Returns:
  • (Hash) - The complete object as a Ruby hash
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['RetryCount'] = @retry_count
  ret['SourceGUID'] = @source_guid
  ret['DestinationGUID'] = @destination_guid
  ret['DeviceID'] = @device_id
  unless @snapshot_id.nil?
    ret['SnapshotID'] = @snapshot_id
  end
  unless @backup_rule_guid.nil?
    ret['BackupRuleGUID'] = @backup_rule_guid
  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 @conflicting_job_id.nil?
    ret['ConflictingJobID'] = @conflicting_job_id
  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

def to_json(options = {})

Returns:
  • (String) - The complete object as a JSON string
def to_json(options = {})
  to_hash.to_json(options)
end