class Comet::B2DestinationLocation

Backblaze B2 native API (DESTINATIONTYPE_B2).
B2DestinationLocation allows configuring connection settings for storage locations using the
B2DestinationLocation is a typed class wrapper around the underlying Comet Server API data structure.

def clear

def clear
  @account_id = ''
  @key = ''
  @bucket = ''
  @prefix = ''
  @max_connections = 0
  @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 'AccountID'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @account_id = v
    when 'Key'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @key = v
    when 'Bucket'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @bucket = v
    when 'Prefix'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @prefix = v
    when 'MaxConnections'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
      @max_connections = v
    when 'HideDeletedFiles'
      @hide_deleted_files = 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 = {}
  unless @account_id.nil?
    ret['AccountID'] = @account_id
  end
  unless @key.nil?
    ret['Key'] = @key
  end
  unless @bucket.nil?
    ret['Bucket'] = @bucket
  end
  unless @prefix.nil?
    ret['Prefix'] = @prefix
  end
  unless @max_connections.nil?
    ret['MaxConnections'] = @max_connections
  end
  unless @hide_deleted_files.nil?
    ret['HideDeletedFiles'] = @hide_deleted_files
  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