Class: Comet::DestinationConfig
- Inherits:
-
Object
- Object
- Comet::DestinationConfig
- Defined in:
- lib/comet/models/destination_config.rb
Overview
DestinationConfig is a typed class wrapper around the underlying Comet Server API data structure.
Instance Attribute Summary collapse
-
#azbaccount_key ⇒ Object
Returns the value of attribute azbaccount_key.
-
#azbaccount_name ⇒ Object
Returns the value of attribute azbaccount_name.
-
#azbcontainer ⇒ Object
Returns the value of attribute azbcontainer.
-
#azbprefix ⇒ Object
Returns the value of attribute azbprefix.
-
#azbrealm ⇒ Object
Returns the value of attribute azbrealm.
-
#b2 ⇒ Object
Returns the value of attribute b2.
-
#comet_bucket ⇒ Object
Returns the value of attribute comet_bucket.
-
#comet_bucket_key ⇒ Object
Returns the value of attribute comet_bucket_key.
-
#comet_server ⇒ Object
Returns the value of attribute comet_server.
-
#create_time ⇒ Object
Returns the value of attribute create_time.
-
#default_retention ⇒ Object
Returns the value of attribute default_retention.
-
#description ⇒ Object
Returns the value of attribute description.
-
#destination_type ⇒ Object
Returns the value of attribute destination_type.
-
#encrypted_encryption_key ⇒ Object
Returns the value of attribute encrypted_encryption_key.
-
#encryption_key_encryption_method ⇒ Object
Returns the value of attribute encryption_key_encryption_method.
-
#ftpaccept_invalid_ssl ⇒ Object
Returns the value of attribute ftpaccept_invalid_ssl.
-
#ftpbase_use_home_directory ⇒ Object
Returns the value of attribute ftpbase_use_home_directory.
-
#ftpcustom_base_directory ⇒ Object
Returns the value of attribute ftpcustom_base_directory.
-
#ftpmax_connections ⇒ Object
Returns the value of attribute ftpmax_connections.
-
#ftppassword ⇒ Object
Returns the value of attribute ftppassword.
-
#ftpport ⇒ Object
Returns the value of attribute ftpport.
-
#ftpserver ⇒ Object
Returns the value of attribute ftpserver.
-
#ftpsmode ⇒ Object
Returns the value of attribute ftpsmode.
-
#ftpusername ⇒ Object
Returns the value of attribute ftpusername.
-
#localcopy_path ⇒ Object
Returns the value of attribute localcopy_path.
-
#localcopy_win_smbpassword ⇒ Object
Returns the value of attribute localcopy_win_smbpassword.
-
#localcopy_win_smbpassword_format ⇒ Object
Returns the value of attribute localcopy_win_smbpassword_format.
-
#localcopy_win_smbusername ⇒ Object
Returns the value of attribute localcopy_win_smbusername.
-
#modify_time ⇒ Object
Returns the value of attribute modify_time.
-
#post_exec ⇒ Object
Returns the value of attribute post_exec.
-
#pre_exec ⇒ Object
Returns the value of attribute pre_exec.
-
#rebrand_storage ⇒ Object
Returns the value of attribute rebrand_storage.
-
#repo_init_timestamp ⇒ Object
Returns the value of attribute repo_init_timestamp.
-
#s3access_key ⇒ Object
Returns the value of attribute s3access_key.
-
#s3bucket_name ⇒ Object
Returns the value of attribute s3bucket_name.
-
#s3secret_key ⇒ Object
Returns the value of attribute s3secret_key.
-
#s3server ⇒ Object
Returns the value of attribute s3server.
-
#s3subdir ⇒ Object
Returns the value of attribute s3subdir.
-
#s3uses_tls ⇒ Object
Returns the value of attribute s3uses_tls.
-
#s3uses_v2signing ⇒ Object
Returns the value of attribute s3uses_v2signing.
-
#sftpauth_mode ⇒ Object
Returns the value of attribute sftpauth_mode.
-
#sftpcustom_auth__known_hosts_file ⇒ Object
Returns the value of attribute sftpcustom_auth__known_hosts_file.
-
#sftpcustom_auth__use_known_hosts_file ⇒ Object
Returns the value of attribute sftpcustom_auth__use_known_hosts_file.
-
#sftppassword ⇒ Object
Returns the value of attribute sftppassword.
-
#sftpprivate_key ⇒ Object
Returns the value of attribute sftpprivate_key.
-
#sftpremote_path ⇒ Object
Returns the value of attribute sftpremote_path.
-
#sftpserver ⇒ Object
Returns the value of attribute sftpserver.
-
#sftpusername ⇒ Object
Returns the value of attribute sftpusername.
-
#span_targets ⇒ Object
Returns the value of attribute span_targets.
-
#statistics ⇒ Object
Returns the value of attribute statistics.
-
#storage_limit_bytes ⇒ Object
Returns the value of attribute storage_limit_bytes.
-
#storage_limit_enabled ⇒ Object
Returns the value of attribute storage_limit_enabled.
-
#swift ⇒ Object
Returns the value of attribute swift.
-
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
Instance Method Summary collapse
- #clear ⇒ Object
- #from_hash(obj) ⇒ Object
- #from_json(json_string) ⇒ Object
-
#initialize ⇒ DestinationConfig
constructor
A new instance of DestinationConfig.
-
#to_h ⇒ Hash
The complete object as a Ruby hash.
-
#to_hash ⇒ Hash
The complete object as a Ruby hash.
-
#to_json(options = {}) ⇒ String
The complete object as a JSON string.
Constructor Details
#initialize ⇒ DestinationConfig
Returns a new instance of DestinationConfig.
179 180 181 |
# File 'lib/comet/models/destination_config.rb', line 179 def initialize clear end |
Instance Attribute Details
#azbaccount_key ⇒ Object
Returns the value of attribute azbaccount_key.
120 121 122 |
# File 'lib/comet/models/destination_config.rb', line 120 def azbaccount_key @azbaccount_key end |
#azbaccount_name ⇒ Object
Returns the value of attribute azbaccount_name.
117 118 119 |
# File 'lib/comet/models/destination_config.rb', line 117 def azbaccount_name @azbaccount_name end |
#azbcontainer ⇒ Object
Returns the value of attribute azbcontainer.
123 124 125 |
# File 'lib/comet/models/destination_config.rb', line 123 def azbcontainer @azbcontainer end |
#azbprefix ⇒ Object
Returns the value of attribute azbprefix.
129 130 131 |
# File 'lib/comet/models/destination_config.rb', line 129 def azbprefix @azbprefix end |
#azbrealm ⇒ Object
Returns the value of attribute azbrealm.
126 127 128 |
# File 'lib/comet/models/destination_config.rb', line 126 def azbrealm @azbrealm end |
#b2 ⇒ Object
Returns the value of attribute b2.
147 148 149 |
# File 'lib/comet/models/destination_config.rb', line 147 def b2 @b2 end |
#comet_bucket ⇒ Object
Returns the value of attribute comet_bucket.
39 40 41 |
# File 'lib/comet/models/destination_config.rb', line 39 def comet_bucket @comet_bucket end |
#comet_bucket_key ⇒ Object
Returns the value of attribute comet_bucket_key.
42 43 44 |
# File 'lib/comet/models/destination_config.rb', line 42 def comet_bucket_key @comet_bucket_key end |
#comet_server ⇒ Object
Returns the value of attribute comet_server.
36 37 38 |
# File 'lib/comet/models/destination_config.rb', line 36 def comet_server @comet_server end |
#create_time ⇒ Object
Returns the value of attribute create_time.
21 22 23 |
# File 'lib/comet/models/destination_config.rb', line 21 def create_time @create_time end |
#default_retention ⇒ Object
Returns the value of attribute default_retention.
171 172 173 |
# File 'lib/comet/models/destination_config.rb', line 171 def default_retention @default_retention end |
#description ⇒ Object
Returns the value of attribute description.
18 19 20 |
# File 'lib/comet/models/destination_config.rb', line 18 def description @description end |
#destination_type ⇒ Object
Returns the value of attribute destination_type.
33 34 35 |
# File 'lib/comet/models/destination_config.rb', line 33 def destination_type @destination_type end |
#encrypted_encryption_key ⇒ Object
Returns the value of attribute encrypted_encryption_key.
156 157 158 |
# File 'lib/comet/models/destination_config.rb', line 156 def encrypted_encryption_key @encrypted_encryption_key end |
#encryption_key_encryption_method ⇒ Object
Returns the value of attribute encryption_key_encryption_method.
153 154 155 |
# File 'lib/comet/models/destination_config.rb', line 153 def encryption_key_encryption_method @encryption_key_encryption_method end |
#ftpaccept_invalid_ssl ⇒ Object
Returns the value of attribute ftpaccept_invalid_ssl.
114 115 116 |
# File 'lib/comet/models/destination_config.rb', line 114 def ftpaccept_invalid_ssl @ftpaccept_invalid_ssl end |
#ftpbase_use_home_directory ⇒ Object
Returns the value of attribute ftpbase_use_home_directory.
99 100 101 |
# File 'lib/comet/models/destination_config.rb', line 99 def ftpbase_use_home_directory @ftpbase_use_home_directory end |
#ftpcustom_base_directory ⇒ Object
Returns the value of attribute ftpcustom_base_directory.
102 103 104 |
# File 'lib/comet/models/destination_config.rb', line 102 def ftpcustom_base_directory @ftpcustom_base_directory end |
#ftpmax_connections ⇒ Object
Returns the value of attribute ftpmax_connections.
111 112 113 |
# File 'lib/comet/models/destination_config.rb', line 111 def ftpmax_connections @ftpmax_connections end |
#ftppassword ⇒ Object
Returns the value of attribute ftppassword.
96 97 98 |
# File 'lib/comet/models/destination_config.rb', line 96 def ftppassword @ftppassword end |
#ftpport ⇒ Object
Returns the value of attribute ftpport.
108 109 110 |
# File 'lib/comet/models/destination_config.rb', line 108 def ftpport @ftpport end |
#ftpserver ⇒ Object
Returns the value of attribute ftpserver.
90 91 92 |
# File 'lib/comet/models/destination_config.rb', line 90 def ftpserver @ftpserver end |
#ftpsmode ⇒ Object
Returns the value of attribute ftpsmode.
105 106 107 |
# File 'lib/comet/models/destination_config.rb', line 105 def ftpsmode @ftpsmode end |
#ftpusername ⇒ Object
Returns the value of attribute ftpusername.
93 94 95 |
# File 'lib/comet/models/destination_config.rb', line 93 def ftpusername @ftpusername end |
#localcopy_path ⇒ Object
Returns the value of attribute localcopy_path.
132 133 134 |
# File 'lib/comet/models/destination_config.rb', line 132 def localcopy_path @localcopy_path end |
#localcopy_win_smbpassword ⇒ Object
Returns the value of attribute localcopy_win_smbpassword.
138 139 140 |
# File 'lib/comet/models/destination_config.rb', line 138 def localcopy_win_smbpassword @localcopy_win_smbpassword end |
#localcopy_win_smbpassword_format ⇒ Object
Returns the value of attribute localcopy_win_smbpassword_format.
141 142 143 |
# File 'lib/comet/models/destination_config.rb', line 141 def localcopy_win_smbpassword_format @localcopy_win_smbpassword_format end |
#localcopy_win_smbusername ⇒ Object
Returns the value of attribute localcopy_win_smbusername.
135 136 137 |
# File 'lib/comet/models/destination_config.rb', line 135 def localcopy_win_smbusername @localcopy_win_smbusername end |
#modify_time ⇒ Object
Returns the value of attribute modify_time.
24 25 26 |
# File 'lib/comet/models/destination_config.rb', line 24 def modify_time @modify_time end |
#post_exec ⇒ Object
Returns the value of attribute post_exec.
30 31 32 |
# File 'lib/comet/models/destination_config.rb', line 30 def post_exec @post_exec end |
#pre_exec ⇒ Object
Returns the value of attribute pre_exec.
27 28 29 |
# File 'lib/comet/models/destination_config.rb', line 27 def pre_exec @pre_exec end |
#rebrand_storage ⇒ Object
Returns the value of attribute rebrand_storage.
174 175 176 |
# File 'lib/comet/models/destination_config.rb', line 174 def rebrand_storage @rebrand_storage end |
#repo_init_timestamp ⇒ Object
Returns the value of attribute repo_init_timestamp.
159 160 161 |
# File 'lib/comet/models/destination_config.rb', line 159 def end |
#s3access_key ⇒ Object
Returns the value of attribute s3access_key.
51 52 53 |
# File 'lib/comet/models/destination_config.rb', line 51 def s3access_key @s3access_key end |
#s3bucket_name ⇒ Object
Returns the value of attribute s3bucket_name.
57 58 59 |
# File 'lib/comet/models/destination_config.rb', line 57 def s3bucket_name @s3bucket_name end |
#s3secret_key ⇒ Object
Returns the value of attribute s3secret_key.
54 55 56 |
# File 'lib/comet/models/destination_config.rb', line 54 def s3secret_key @s3secret_key end |
#s3server ⇒ Object
Returns the value of attribute s3server.
45 46 47 |
# File 'lib/comet/models/destination_config.rb', line 45 def s3server @s3server end |
#s3subdir ⇒ Object
Returns the value of attribute s3subdir.
60 61 62 |
# File 'lib/comet/models/destination_config.rb', line 60 def s3subdir @s3subdir end |
#s3uses_tls ⇒ Object
Returns the value of attribute s3uses_tls.
48 49 50 |
# File 'lib/comet/models/destination_config.rb', line 48 def s3uses_tls @s3uses_tls end |
#s3uses_v2signing ⇒ Object
Returns the value of attribute s3uses_v2signing.
63 64 65 |
# File 'lib/comet/models/destination_config.rb', line 63 def s3uses_v2signing @s3uses_v2signing end |
#sftpauth_mode ⇒ Object
Returns the value of attribute sftpauth_mode.
75 76 77 |
# File 'lib/comet/models/destination_config.rb', line 75 def sftpauth_mode @sftpauth_mode end |
#sftpcustom_auth__known_hosts_file ⇒ Object
Returns the value of attribute sftpcustom_auth__known_hosts_file.
87 88 89 |
# File 'lib/comet/models/destination_config.rb', line 87 def sftpcustom_auth__known_hosts_file @sftpcustom_auth__known_hosts_file end |
#sftpcustom_auth__use_known_hosts_file ⇒ Object
Returns the value of attribute sftpcustom_auth__use_known_hosts_file.
84 85 86 |
# File 'lib/comet/models/destination_config.rb', line 84 def sftpcustom_auth__use_known_hosts_file @sftpcustom_auth__use_known_hosts_file end |
#sftppassword ⇒ Object
Returns the value of attribute sftppassword.
78 79 80 |
# File 'lib/comet/models/destination_config.rb', line 78 def sftppassword @sftppassword end |
#sftpprivate_key ⇒ Object
Returns the value of attribute sftpprivate_key.
81 82 83 |
# File 'lib/comet/models/destination_config.rb', line 81 def sftpprivate_key @sftpprivate_key end |
#sftpremote_path ⇒ Object
Returns the value of attribute sftpremote_path.
72 73 74 |
# File 'lib/comet/models/destination_config.rb', line 72 def sftpremote_path @sftpremote_path end |
#sftpserver ⇒ Object
Returns the value of attribute sftpserver.
66 67 68 |
# File 'lib/comet/models/destination_config.rb', line 66 def sftpserver @sftpserver end |
#sftpusername ⇒ Object
Returns the value of attribute sftpusername.
69 70 71 |
# File 'lib/comet/models/destination_config.rb', line 69 def sftpusername @sftpusername end |
#span_targets ⇒ Object
Returns the value of attribute span_targets.
150 151 152 |
# File 'lib/comet/models/destination_config.rb', line 150 def span_targets @span_targets end |
#statistics ⇒ Object
Returns the value of attribute statistics.
168 169 170 |
# File 'lib/comet/models/destination_config.rb', line 168 def statistics @statistics end |
#storage_limit_bytes ⇒ Object
Returns the value of attribute storage_limit_bytes.
165 166 167 |
# File 'lib/comet/models/destination_config.rb', line 165 def storage_limit_bytes @storage_limit_bytes end |
#storage_limit_enabled ⇒ Object
Returns the value of attribute storage_limit_enabled.
162 163 164 |
# File 'lib/comet/models/destination_config.rb', line 162 def storage_limit_enabled @storage_limit_enabled end |
#swift ⇒ Object
Returns the value of attribute swift.
144 145 146 |
# File 'lib/comet/models/destination_config.rb', line 144 def swift @swift end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
177 178 179 |
# File 'lib/comet/models/destination_config.rb', line 177 def unknown_json_fields @unknown_json_fields end |
Instance Method Details
#clear ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 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 |
# File 'lib/comet/models/destination_config.rb', line 183 def clear @description = '' @create_time = 0 @modify_time = 0 @pre_exec = [] @post_exec = [] @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 = [] @encryption_key_encryption_method = 0 @encrypted_encryption_key = '' = 0 @storage_limit_bytes = 0 @statistics = Comet::DestinationStatistics.new @default_retention = Comet::RetentionPolicy.new @unknown_json_fields = {} end |
#from_hash(obj) ⇒ Object
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 373 374 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 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/comet/models/destination_config.rb', line 241 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 'Description' raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String @description = v when 'CreateTime' raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @create_time = v when 'ModifyTime' raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @modify_time = v when 'PreExec' if v.nil? @pre_exec = [] else @pre_exec = Array.new(v.length) v.each_with_index do |v1, i1| raise TypeError "'v1' expected String, got #{v1.class}" unless v1.is_a? String @pre_exec[i1] = v1 end end when 'PostExec' if v.nil? @post_exec = [] else @post_exec = Array.new(v.length) v.each_with_index do |v1, i1| raise TypeError "'v1' expected String, got #{v1.class}" unless v1.is_a? String @post_exec[i1] = v1 end end 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 'EncryptionKeyEncryptionMethod' raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @encryption_key_encryption_method = v when 'EncryptedEncryptionKey' raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String @encrypted_encryption_key = v when 'RepoInitTimestamp' raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric = v when 'StorageLimitEnabled' @storage_limit_enabled = v when 'StorageLimitBytes' raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @storage_limit_bytes = v when 'Statistics' @statistics = Comet::DestinationStatistics.new @statistics.from_hash(v) when 'DefaultRetention' @default_retention = Comet::RetentionPolicy.new @default_retention.from_hash(v) when 'RebrandStorage' @rebrand_storage = v else @unknown_json_fields[k] = v end end end |
#from_json(json_string) ⇒ Object
234 235 236 237 238 |
# File 'lib/comet/models/destination_config.rb', line 234 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 ⇒ Hash
Returns The complete object as a Ruby hash.
531 532 533 |
# File 'lib/comet/models/destination_config.rb', line 531 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
# File 'lib/comet/models/destination_config.rb', line 467 def to_hash ret = {} ret['Description'] = @description ret['CreateTime'] = @create_time ret['ModifyTime'] = @modify_time ret['PreExec'] = @pre_exec ret['PostExec'] = @post_exec 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['EncryptionKeyEncryptionMethod'] = @encryption_key_encryption_method ret['EncryptedEncryptionKey'] = @encrypted_encryption_key ret['RepoInitTimestamp'] = ret['StorageLimitEnabled'] = @storage_limit_enabled ret['StorageLimitBytes'] = @storage_limit_bytes unless @statistics.nil? ret['Statistics'] = @statistics end ret['DefaultRetention'] = @default_retention ret['RebrandStorage'] = @rebrand_storage @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.
536 537 538 |
# File 'lib/comet/models/destination_config.rb', line 536 def to_json( = {}) to_hash.to_json() end |