class Comet::SwiftDestinationLocation

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

Attributes

apikey[RW]

@type [String] apikey

auth_token[RW]

@type [String] auth_token

auth_url[RW]

@type [String] auth_url

container[RW]

@type [String] container

default_container_policy[RW]

@type [String] default_container_policy

domain[RW]

@type [String] domain

prefix[RW]

@type [String] prefix

region[RW]

@type [String] region

tenant[RW]

@type [String] tenant

tenant_domain[RW]

@type [String] tenant_domain

tenant_id[RW]

@type [String] tenant_id

trust_id[RW]

@type [String] trust_id

unknown_json_fields[RW]

@type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations

username[RW]

@type [String] username

Public Class Methods

new() click to toggle source
# File lib/comet/models/swift_destination_location.rb, line 59
def initialize
  clear
end

Public Instance Methods

clear() click to toggle source
# File lib/comet/models/swift_destination_location.rb, line 63
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
from_hash(obj) click to toggle source

@param [Hash] obj The complete object as a Ruby hash

# File lib/comet/models/swift_destination_location.rb, line 88
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
from_json(json_string) click to toggle source

@param [String] json_string The complete object in JSON format

# File lib/comet/models/swift_destination_location.rb, line 81
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() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/swift_destination_location.rb, line 200
def to_h
  to_hash
end
to_hash() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/swift_destination_location.rb, line 152
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
to_json(options = {}) click to toggle source

@return [String] The complete object as a JSON string

# File lib/comet/models/swift_destination_location.rb, line 205
def to_json(options = {})
  to_hash.to_json(options)
end