Class: Comet::S3DestinationLocation
- Inherits:
-
Object
- Object
- Comet::S3DestinationLocation
- Defined in:
- lib/comet/models/s3destination_location.rb
Overview
S3DestinationLocation is a typed class wrapper around the underlying Comet Server API data structure.
Instance Attribute Summary collapse
-
#s3access_key ⇒ Object
Returns the value of attribute s3access_key.
-
#s3bucket_name ⇒ Object
Returns the value of attribute s3bucket_name.
-
#s3custom_region ⇒ Object
Returns the value of attribute s3custom_region.
-
#s3object_lock_days ⇒ Object
Returns the value of attribute s3object_lock_days.
-
#s3remove_deleted ⇒ Object
Returns the value of attribute s3remove_deleted.
-
#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
If true, use legacy v2 signing.
-
#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 ⇒ S3DestinationLocation
constructor
A new instance of S3DestinationLocation.
-
#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 ⇒ S3DestinationLocation
Returns a new instance of S3DestinationLocation.
49 50 51 |
# File 'lib/comet/models/s3destination_location.rb', line 49 def initialize clear end |
Instance Attribute Details
#s3access_key ⇒ Object
Returns the value of attribute s3access_key.
22 23 24 |
# File 'lib/comet/models/s3destination_location.rb', line 22 def s3access_key @s3access_key end |
#s3bucket_name ⇒ Object
Returns the value of attribute s3bucket_name.
28 29 30 |
# File 'lib/comet/models/s3destination_location.rb', line 28 def s3bucket_name @s3bucket_name end |
#s3custom_region ⇒ Object
Returns the value of attribute s3custom_region.
34 35 36 |
# File 'lib/comet/models/s3destination_location.rb', line 34 def s3custom_region @s3custom_region end |
#s3object_lock_days ⇒ Object
Returns the value of attribute s3object_lock_days.
44 45 46 |
# File 'lib/comet/models/s3destination_location.rb', line 44 def s3object_lock_days @s3object_lock_days end |
#s3remove_deleted ⇒ Object
Returns the value of attribute s3remove_deleted.
41 42 43 |
# File 'lib/comet/models/s3destination_location.rb', line 41 def s3remove_deleted @s3remove_deleted end |
#s3secret_key ⇒ Object
Returns the value of attribute s3secret_key.
25 26 27 |
# File 'lib/comet/models/s3destination_location.rb', line 25 def s3secret_key @s3secret_key end |
#s3server ⇒ Object
Returns the value of attribute s3server.
16 17 18 |
# File 'lib/comet/models/s3destination_location.rb', line 16 def s3server @s3server end |
#s3subdir ⇒ Object
Returns the value of attribute s3subdir.
31 32 33 |
# File 'lib/comet/models/s3destination_location.rb', line 31 def s3subdir @s3subdir end |
#s3uses_tls ⇒ Object
Returns the value of attribute s3uses_tls.
19 20 21 |
# File 'lib/comet/models/s3destination_location.rb', line 19 def s3uses_tls @s3uses_tls end |
#s3uses_v2signing ⇒ Object
If true, use legacy v2 signing. If false (default), use modern v4 signing
38 39 40 |
# File 'lib/comet/models/s3destination_location.rb', line 38 def s3uses_v2signing @s3uses_v2signing end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
47 48 49 |
# File 'lib/comet/models/s3destination_location.rb', line 47 def unknown_json_fields @unknown_json_fields end |
Instance Method Details
#clear ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/comet/models/s3destination_location.rb', line 53 def clear @s3server = '' @s3access_key = '' @s3secret_key = '' @s3bucket_name = '' @s3subdir = '' @s3custom_region = '' @s3object_lock_days = 0 @unknown_json_fields = {} end |
#from_hash(obj) ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/comet/models/s3destination_location.rb', line 72 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 '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 'S3RemoveDeleted' @s3remove_deleted = v when 'S3ObjectLockDays' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @s3object_lock_days = v else @unknown_json_fields[k] = v end end end |
#from_json(json_string) ⇒ Object
65 66 67 68 69 |
# File 'lib/comet/models/s3destination_location.rb', line 65 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.
137 138 139 |
# File 'lib/comet/models/s3destination_location.rb', line 137 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/comet/models/s3destination_location.rb', line 118 def to_hash ret = {} 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['S3RemoveDeleted'] = @s3remove_deleted ret['S3ObjectLockDays'] = @s3object_lock_days @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.
142 143 144 |
# File 'lib/comet/models/s3destination_location.rb', line 142 def to_json( = {}) to_hash.to_json() end |