Class: Comet::DestinationLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/comet/models/destination_location.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDestinationLocation

Returns a new instance of DestinationLocation.



147
148
149
# File 'lib/comet/models/destination_location.rb', line 147

def initialize
  clear
end

Instance Attribute Details

#azbaccount_keyObject

Returns the value of attribute azbaccount_key.



106
107
108
# File 'lib/comet/models/destination_location.rb', line 106

def azbaccount_key
  @azbaccount_key
end

#azbaccount_nameObject

Returns the value of attribute azbaccount_name.



103
104
105
# File 'lib/comet/models/destination_location.rb', line 103

def azbaccount_name
  @azbaccount_name
end

#azbcontainerObject

Returns the value of attribute azbcontainer.



109
110
111
# File 'lib/comet/models/destination_location.rb', line 109

def azbcontainer
  @azbcontainer
end

#azbprefixObject

Returns the value of attribute azbprefix.



115
116
117
# File 'lib/comet/models/destination_location.rb', line 115

def azbprefix
  @azbprefix
end

#azbrealmObject

Returns the value of attribute azbrealm.



112
113
114
# File 'lib/comet/models/destination_location.rb', line 112

def azbrealm
  @azbrealm
end

#b2Object

Returns the value of attribute b2.



133
134
135
# File 'lib/comet/models/destination_location.rb', line 133

def b2
  @b2
end

#comet_bucketObject

Returns the value of attribute comet_bucket.



22
23
24
# File 'lib/comet/models/destination_location.rb', line 22

def comet_bucket
  @comet_bucket
end

#comet_bucket_keyObject

Returns the value of attribute comet_bucket_key.



25
26
27
# File 'lib/comet/models/destination_location.rb', line 25

def comet_bucket_key
  @comet_bucket_key
end

#comet_serverObject

Returns the value of attribute comet_server.



19
20
21
# File 'lib/comet/models/destination_location.rb', line 19

def comet_server
  @comet_server
end

#destination_typeObject

Returns the value of attribute destination_type.



16
17
18
# File 'lib/comet/models/destination_location.rb', line 16

def destination_type
  @destination_type
end

#ftpaccept_invalid_sslObject

Returns the value of attribute ftpaccept_invalid_ssl.



100
101
102
# File 'lib/comet/models/destination_location.rb', line 100

def ftpaccept_invalid_ssl
  @ftpaccept_invalid_ssl
end

#ftpbase_use_home_directoryObject

Returns the value of attribute ftpbase_use_home_directory.



85
86
87
# File 'lib/comet/models/destination_location.rb', line 85

def ftpbase_use_home_directory
  @ftpbase_use_home_directory
end

#ftpcustom_base_directoryObject

Returns the value of attribute ftpcustom_base_directory.



88
89
90
# File 'lib/comet/models/destination_location.rb', line 88

def ftpcustom_base_directory
  @ftpcustom_base_directory
end

#ftpmax_connectionsObject

Returns the value of attribute ftpmax_connections.



97
98
99
# File 'lib/comet/models/destination_location.rb', line 97

def ftpmax_connections
  @ftpmax_connections
end

#ftppasswordObject

Returns the value of attribute ftppassword.



82
83
84
# File 'lib/comet/models/destination_location.rb', line 82

def ftppassword
  @ftppassword
end

#ftpportObject

Returns the value of attribute ftpport.



94
95
96
# File 'lib/comet/models/destination_location.rb', line 94

def ftpport
  @ftpport
end

#ftpserverObject

Returns the value of attribute ftpserver.



76
77
78
# File 'lib/comet/models/destination_location.rb', line 76

def ftpserver
  @ftpserver
end

#ftpsmodeObject

Returns the value of attribute ftpsmode.



91
92
93
# File 'lib/comet/models/destination_location.rb', line 91

def ftpsmode
  @ftpsmode
end

#ftpusernameObject

Returns the value of attribute ftpusername.



79
80
81
# File 'lib/comet/models/destination_location.rb', line 79

def ftpusername
  @ftpusername
end

#localcopy_pathObject

Returns the value of attribute localcopy_path.



118
119
120
# File 'lib/comet/models/destination_location.rb', line 118

def localcopy_path
  @localcopy_path
end

#localcopy_win_smbpasswordObject

Returns the value of attribute localcopy_win_smbpassword.



124
125
126
# File 'lib/comet/models/destination_location.rb', line 124

def localcopy_win_smbpassword
  @localcopy_win_smbpassword
end

#localcopy_win_smbpassword_formatObject

Returns the value of attribute localcopy_win_smbpassword_format.



127
128
129
# File 'lib/comet/models/destination_location.rb', line 127

def localcopy_win_smbpassword_format
  @localcopy_win_smbpassword_format
end

#localcopy_win_smbusernameObject

Returns the value of attribute localcopy_win_smbusername.



121
122
123
# File 'lib/comet/models/destination_location.rb', line 121

def localcopy_win_smbusername
  @localcopy_win_smbusername
end

#s3access_keyObject

Returns the value of attribute s3access_key.



34
35
36
# File 'lib/comet/models/destination_location.rb', line 34

def s3access_key
  @s3access_key
end

#s3bucket_nameObject

Returns the value of attribute s3bucket_name.



40
41
42
# File 'lib/comet/models/destination_location.rb', line 40

def s3bucket_name
  @s3bucket_name
end

#s3custom_regionObject

Returns the value of attribute s3custom_region.



46
47
48
# File 'lib/comet/models/destination_location.rb', line 46

def s3custom_region
  @s3custom_region
end

#s3secret_keyObject

Returns the value of attribute s3secret_key.



37
38
39
# File 'lib/comet/models/destination_location.rb', line 37

def s3secret_key
  @s3secret_key
end

#s3serverObject

Returns the value of attribute s3server.



28
29
30
# File 'lib/comet/models/destination_location.rb', line 28

def s3server
  @s3server
end

#s3subdirObject

Returns the value of attribute s3subdir.



43
44
45
# File 'lib/comet/models/destination_location.rb', line 43

def s3subdir
  @s3subdir
end

#s3uses_tlsObject

Returns the value of attribute s3uses_tls.



31
32
33
# File 'lib/comet/models/destination_location.rb', line 31

def s3uses_tls
  @s3uses_tls
end

#s3uses_v2signingObject

Returns the value of attribute s3uses_v2signing.



49
50
51
# File 'lib/comet/models/destination_location.rb', line 49

def s3uses_v2signing
  @s3uses_v2signing
end

#sftpauth_modeObject

Returns the value of attribute sftpauth_mode.



61
62
63
# File 'lib/comet/models/destination_location.rb', line 61

def sftpauth_mode
  @sftpauth_mode
end

#sftpcustom_auth__known_hosts_fileObject

Returns the value of attribute sftpcustom_auth__known_hosts_file.



73
74
75
# File 'lib/comet/models/destination_location.rb', line 73

def sftpcustom_auth__known_hosts_file
  @sftpcustom_auth__known_hosts_file
end

#sftpcustom_auth__use_known_hosts_fileObject

Returns the value of attribute sftpcustom_auth__use_known_hosts_file.



70
71
72
# File 'lib/comet/models/destination_location.rb', line 70

def sftpcustom_auth__use_known_hosts_file
  @sftpcustom_auth__use_known_hosts_file
end

#sftppasswordObject

Returns the value of attribute sftppassword.



64
65
66
# File 'lib/comet/models/destination_location.rb', line 64

def sftppassword
  @sftppassword
end

#sftpprivate_keyObject

Returns the value of attribute sftpprivate_key.



67
68
69
# File 'lib/comet/models/destination_location.rb', line 67

def sftpprivate_key
  @sftpprivate_key
end

#sftpremote_pathObject

Returns the value of attribute sftpremote_path.



58
59
60
# File 'lib/comet/models/destination_location.rb', line 58

def sftpremote_path
  @sftpremote_path
end

#sftpserverObject

Returns the value of attribute sftpserver.



52
53
54
# File 'lib/comet/models/destination_location.rb', line 52

def sftpserver
  @sftpserver
end

#sftpusernameObject

Returns the value of attribute sftpusername.



55
56
57
# File 'lib/comet/models/destination_location.rb', line 55

def sftpusername
  @sftpusername
end

#span_targetsObject

Returns the value of attribute span_targets.



139
140
141
# File 'lib/comet/models/destination_location.rb', line 139

def span_targets
  @span_targets
end

#span_use_static_slotsObject

Returns the value of attribute span_use_static_slots.



142
143
144
# File 'lib/comet/models/destination_location.rb', line 142

def span_use_static_slots
  @span_use_static_slots
end

#storjObject

Returns the value of attribute storj.



136
137
138
# File 'lib/comet/models/destination_location.rb', line 136

def storj
  @storj
end

#swiftObject

Returns the value of attribute swift.



130
131
132
# File 'lib/comet/models/destination_location.rb', line 130

def swift
  @swift
end

#unknown_json_fieldsObject

Returns the value of attribute unknown_json_fields.



145
146
147
# File 'lib/comet/models/destination_location.rb', line 145

def unknown_json_fields
  @unknown_json_fields
end

Instance Method Details

#clearObject



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/comet/models/destination_location.rb', line 151

def clear
  @destination_type = 0
  @comet_server = ''
  @comet_bucket = ''
  @comet_bucket_key = ''
  @s3server = ''
  @s3access_key = ''
  @s3secret_key = ''
  @s3bucket_name = ''
  @s3subdir = ''
  @s3custom_region = ''
  @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
  @storj = Comet::StorjDestinationLocation.new
  @span_targets = []
  @unknown_json_fields = {}
end

#from_hash(obj) ⇒ Object

Parameters:

  • obj (Hash)

    The complete object as a Ruby hash

Raises:

  • (TypeError)


200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/comet/models/destination_location.rb', line 200

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 'S3CustomRegion'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3custom_region = 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 'Storj'
      @storj = Comet::StorjDestinationLocation.new
      @storj.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) ⇒ Object

Parameters:

  • json_string (String)

    The complete object in JSON format

Raises:

  • (TypeError)


193
194
195
196
197
# File 'lib/comet/models/destination_location.rb', line 193

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_hHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



427
428
429
# File 'lib/comet/models/destination_location.rb', line 427

def to_h
  to_hash
end

#to_hashHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/comet/models/destination_location.rb', line 375

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['S3CustomRegion'] = @s3custom_region
  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['Storj'] = @storj
  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 = {}) ⇒ String

Returns The complete object as a JSON string.

Returns:

  • (String)

    The complete object as a JSON string



432
433
434
# File 'lib/comet/models/destination_location.rb', line 432

def to_json(options = {})
  to_hash.to_json(options)
end