class Comet::DestinationLocation

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

Attributes

azbaccount_key[RW]

@type [String] azbaccount_key

azbaccount_name[RW]

@type [String] azbaccount_name

azbcontainer[RW]

@type [String] azbcontainer

azbprefix[RW]

@type [String] azbprefix

azbrealm[RW]

@type [String] azbrealm

b2[RW]

@type [Comet::B2DestinationLocation] b2

comet_bucket[RW]

@type [String] comet_bucket

comet_bucket_key[RW]

@type [String] comet_bucket_key

comet_server[RW]

@type [String] comet_server

destination_type[RW]

@type [Number] destination_type

ftpaccept_invalid_ssl[RW]

@type [Boolean] ftpaccept_invalid_ssl

ftpbase_use_home_directory[RW]

@type [Boolean] ftpbase_use_home_directory

ftpcustom_base_directory[RW]

@type [String] ftpcustom_base_directory

ftpmax_connections[RW]

@type [Number] ftpmax_connections

ftppassword[RW]

@type [String] ftppassword

ftpport[RW]

@type [Number] ftpport

ftpserver[RW]

@type [String] ftpserver

ftpsmode[RW]

@type [Number] ftpsmode

ftpusername[RW]

@type [String] ftpusername

localcopy_path[RW]

@type [String] localcopy_path

localcopy_win_smbpassword[RW]

@type [String] localcopy_win_smbpassword

localcopy_win_smbpassword_format[RW]
localcopy_win_smbusername[RW]

@type [String] localcopy_win_smbusername

s3access_key[RW]

@type [String] s3access_key

s3bucket_name[RW]

@type [String] s3bucket_name

s3secret_key[RW]

@type [String] s3secret_key

s3server[RW]

@type [String] s3server

s3subdir[RW]

@type [String] s3subdir

s3uses_tls[RW]

@type [Boolean] s3uses_tls

s3uses_v2signing[RW]

@type [Boolean] s3uses_v2signing

sftpauth_mode[RW]

@type [Number] sftpauth_mode

sftpcustom_auth__known_hosts_file[RW]
sftpcustom_auth__use_known_hosts_file[RW]
sftppassword[RW]

@type [String] sftppassword

sftpprivate_key[RW]

@type [String] sftpprivate_key

sftpremote_path[RW]

@type [String] sftpremote_path

sftpserver[RW]

@type [String] sftpserver

sftpusername[RW]

@type [String] sftpusername

span_targets[RW]

@type [Array<Comet::DestinationLocation>] span_targets

span_use_static_slots[RW]

@type [Boolean] span_use_static_slots

swift[RW]

@type [Comet::SwiftDestinationLocation] swift

unknown_json_fields[RW]

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

Public Class Methods

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

Public Instance Methods

clear() click to toggle source
# File lib/comet/models/destination_location.rb, line 147
def clear
  @destination_type = 0
  @comet_server = ''
  @comet_bucket = ''
  @comet_bucket_key = ''
  @s3server = ''
  @s3access_key = ''
  @s3secret_key = ''
  @s3bucket_name = ''
  @s3subdir = ''
  @sftpserver = ''
  @sftpusername = ''
  @sftpremote_path = ''
  @sftpauth_mode = 0
  @sftppassword = ''
  @sftpprivate_key = ''
  @sftpcustom_auth__known_hosts_file = ''
  @ftpserver = ''
  @ftpusername = ''
  @ftppassword = ''
  @ftpcustom_base_directory = ''
  @ftpsmode = 0
  @ftpport = 0
  @ftpmax_connections = 0
  @azbaccount_name = ''
  @azbaccount_key = ''
  @azbcontainer = ''
  @azbrealm = ''
  @azbprefix = ''
  @localcopy_path = ''
  @localcopy_win_smbusername = ''
  @localcopy_win_smbpassword = ''
  @localcopy_win_smbpassword_format = 0
  @swift = Comet::SwiftDestinationLocation.new
  @b2 = Comet::B2DestinationLocation.new
  @span_targets = []
  @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/destination_location.rb, line 194
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 'DestinationType'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @destination_type = v
    when 'CometServer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @comet_server = v
    when 'CometBucket'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @comet_bucket = v
    when 'CometBucketKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @comet_bucket_key = v
    when 'S3Server'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3server = v
    when 'S3UsesTLS'
      @s3uses_tls = v
    when 'S3AccessKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3access_key = v
    when 'S3SecretKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3secret_key = v
    when 'S3BucketName'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3bucket_name = v
    when 'S3Subdir'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3subdir = v
    when 'S3UsesV2Signing'
      @s3uses_v2signing = v
    when 'SFTPServer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpserver = v
    when 'SFTPUsername'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpusername = v
    when 'SFTPRemotePath'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpremote_path = v
    when 'SFTPAuthMode'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @sftpauth_mode = v
    when 'SFTPPassword'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftppassword = v
    when 'SFTPPrivateKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpprivate_key = v
    when 'SFTPCustomAuth_UseKnownHostsFile'
      @sftpcustom_auth__use_known_hosts_file = v
    when 'SFTPCustomAuth_KnownHostsFile'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpcustom_auth__known_hosts_file = v
    when 'FTPServer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftpserver = v
    when 'FTPUsername'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftpusername = v
    when 'FTPPassword'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftppassword = v
    when 'FTPBaseUseHomeDirectory'
      @ftpbase_use_home_directory = v
    when 'FTPCustomBaseDirectory'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftpcustom_base_directory = v
    when 'FTPSMode'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @ftpsmode = v
    when 'FTPPort'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @ftpport = v
    when 'FTPMaxConnections'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @ftpmax_connections = v
    when 'FTPAcceptInvalidSSL'
      @ftpaccept_invalid_ssl = v
    when 'AZBAccountName'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbaccount_name = v
    when 'AZBAccountKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbaccount_key = v
    when 'AZBContainer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbcontainer = v
    when 'AZBRealm'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbrealm = v
    when 'AZBPrefix'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbprefix = v
    when 'LocalcopyPath'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @localcopy_path = v
    when 'LocalcopyWinSMBUsername'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @localcopy_win_smbusername = v
    when 'LocalcopyWinSMBPassword'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @localcopy_win_smbpassword = v
    when 'LocalcopyWinSMBPasswordFormat'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @localcopy_win_smbpassword_format = v
    when 'Swift'
      @swift = Comet::SwiftDestinationLocation.new
      @swift.from_hash(v)
    when 'B2'
      @b2 = Comet::B2DestinationLocation.new
      @b2.from_hash(v)
    when 'SpanTargets'
      if v.nil?
        @span_targets = []
      else
        @span_targets = Array.new(v.length)
        v.each_with_index do |v1, i1|
          @span_targets[i1] = Comet::DestinationLocation.new
          @span_targets[i1].from_hash(v1)
        end
      end
    when 'SpanUseStaticSlots'
      @span_use_static_slots = 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/destination_location.rb, line 187
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/destination_location.rb, line 412
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/destination_location.rb, line 362
def to_hash
  ret = {}
  ret['DestinationType'] = @destination_type
  ret['CometServer'] = @comet_server
  ret['CometBucket'] = @comet_bucket
  ret['CometBucketKey'] = @comet_bucket_key
  ret['S3Server'] = @s3server
  ret['S3UsesTLS'] = @s3uses_tls
  ret['S3AccessKey'] = @s3access_key
  ret['S3SecretKey'] = @s3secret_key
  ret['S3BucketName'] = @s3bucket_name
  ret['S3Subdir'] = @s3subdir
  ret['S3UsesV2Signing'] = @s3uses_v2signing
  ret['SFTPServer'] = @sftpserver
  ret['SFTPUsername'] = @sftpusername
  ret['SFTPRemotePath'] = @sftpremote_path
  ret['SFTPAuthMode'] = @sftpauth_mode
  ret['SFTPPassword'] = @sftppassword
  ret['SFTPPrivateKey'] = @sftpprivate_key
  ret['SFTPCustomAuth_UseKnownHostsFile'] = @sftpcustom_auth__use_known_hosts_file
  ret['SFTPCustomAuth_KnownHostsFile'] = @sftpcustom_auth__known_hosts_file
  ret['FTPServer'] = @ftpserver
  ret['FTPUsername'] = @ftpusername
  ret['FTPPassword'] = @ftppassword
  ret['FTPBaseUseHomeDirectory'] = @ftpbase_use_home_directory
  ret['FTPCustomBaseDirectory'] = @ftpcustom_base_directory
  ret['FTPSMode'] = @ftpsmode
  ret['FTPPort'] = @ftpport
  ret['FTPMaxConnections'] = @ftpmax_connections
  ret['FTPAcceptInvalidSSL'] = @ftpaccept_invalid_ssl
  ret['AZBAccountName'] = @azbaccount_name
  ret['AZBAccountKey'] = @azbaccount_key
  ret['AZBContainer'] = @azbcontainer
  ret['AZBRealm'] = @azbrealm
  ret['AZBPrefix'] = @azbprefix
  ret['LocalcopyPath'] = @localcopy_path
  ret['LocalcopyWinSMBUsername'] = @localcopy_win_smbusername
  ret['LocalcopyWinSMBPassword'] = @localcopy_win_smbpassword
  ret['LocalcopyWinSMBPasswordFormat'] = @localcopy_win_smbpassword_format
  ret['Swift'] = @swift
  ret['B2'] = @b2
  ret['SpanTargets'] = @span_targets
  ret['SpanUseStaticSlots'] = @span_use_static_slots
  @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/destination_location.rb, line 417
def to_json(options = {})
  to_hash.to_json(options)
end