class Comet::SwiftDestinationLocation

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

def clear

def clear
  @username = ''
  @apikey = ''
  @region = ''
  @auth_url = ''
  @domain = ''
  @tenant = ''
  @tenant_domain = ''
  @tenant_id = ''
  @trust_id = ''
  @auth_token = ''
  @prefix = ''
  @container = ''
  @default_container_policy = ''
  @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 'Username'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @username = v
    when 'APIKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @apikey = v
    when 'Region'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @region = v
    when 'AuthURL'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @auth_url = v
    when 'Domain'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @domain = v
    when 'Tenant'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @tenant = v
    when 'TenantDomain'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @tenant_domain = v
    when 'TenantID'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @tenant_id = v
    when 'TrustID'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @trust_id = v
    when 'AuthToken'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @auth_token = v
    when 'Prefix'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @prefix = v
    when 'Container'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @container = v
    when 'DefaultContainerPolicy'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
      @default_container_policy = 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 @username.nil?
    ret['Username'] = @username
  end
  unless @apikey.nil?
    ret['APIKey'] = @apikey
  end
  unless @region.nil?
    ret['Region'] = @region
  end
  unless @auth_url.nil?
    ret['AuthURL'] = @auth_url
  end
  unless @domain.nil?
    ret['Domain'] = @domain
  end
  unless @tenant.nil?
    ret['Tenant'] = @tenant
  end
  unless @tenant_domain.nil?
    ret['TenantDomain'] = @tenant_domain
  end
  unless @tenant_id.nil?
    ret['TenantID'] = @tenant_id
  end
  unless @trust_id.nil?
    ret['TrustID'] = @trust_id
  end
  unless @auth_token.nil?
    ret['AuthToken'] = @auth_token
  end
  unless @prefix.nil?
    ret['Prefix'] = @prefix
  end
  unless @container.nil?
    ret['Container'] = @container
  end
  unless @default_container_policy.nil?
    ret['DefaultContainerPolicy'] = @default_container_policy
  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