Class: Comet::SwiftDestinationLocation
- Inherits:
-
Object
- Object
- Comet::SwiftDestinationLocation
- Defined in:
- lib/comet/models/swift_destination_location.rb
Overview
SwiftDestinationLocation is a typed class wrapper around the underlying Comet Server API data structure.
Instance Attribute Summary collapse
-
#apikey ⇒ Object
Returns the value of attribute apikey.
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#auth_url ⇒ Object
Returns the value of attribute auth_url.
-
#container ⇒ Object
Returns the value of attribute container.
-
#default_container_policy ⇒ Object
Returns the value of attribute default_container_policy.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#region ⇒ Object
Returns the value of attribute region.
-
#tenant ⇒ Object
Returns the value of attribute tenant.
-
#tenant_domain ⇒ Object
Returns the value of attribute tenant_domain.
-
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
-
#trust_id ⇒ Object
Returns the value of attribute trust_id.
-
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #clear ⇒ Object
- #from_hash(obj) ⇒ Object
- #from_json(json_string) ⇒ Object
-
#initialize ⇒ SwiftDestinationLocation
constructor
A new instance of SwiftDestinationLocation.
-
#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 ⇒ SwiftDestinationLocation
Returns a new instance of SwiftDestinationLocation.
57 58 59 |
# File 'lib/comet/models/swift_destination_location.rb', line 57 def initialize clear end |
Instance Attribute Details
#apikey ⇒ Object
Returns the value of attribute apikey.
19 20 21 |
# File 'lib/comet/models/swift_destination_location.rb', line 19 def apikey @apikey end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
43 44 45 |
# File 'lib/comet/models/swift_destination_location.rb', line 43 def auth_token @auth_token end |
#auth_url ⇒ Object
Returns the value of attribute auth_url.
25 26 27 |
# File 'lib/comet/models/swift_destination_location.rb', line 25 def auth_url @auth_url end |
#container ⇒ Object
Returns the value of attribute container.
49 50 51 |
# File 'lib/comet/models/swift_destination_location.rb', line 49 def container @container end |
#default_container_policy ⇒ Object
Returns the value of attribute default_container_policy.
52 53 54 |
# File 'lib/comet/models/swift_destination_location.rb', line 52 def default_container_policy @default_container_policy end |
#domain ⇒ Object
Returns the value of attribute domain.
28 29 30 |
# File 'lib/comet/models/swift_destination_location.rb', line 28 def domain @domain end |
#prefix ⇒ Object
Returns the value of attribute prefix.
46 47 48 |
# File 'lib/comet/models/swift_destination_location.rb', line 46 def prefix @prefix end |
#region ⇒ Object
Returns the value of attribute region.
22 23 24 |
# File 'lib/comet/models/swift_destination_location.rb', line 22 def region @region end |
#tenant ⇒ Object
Returns the value of attribute tenant.
31 32 33 |
# File 'lib/comet/models/swift_destination_location.rb', line 31 def tenant @tenant end |
#tenant_domain ⇒ Object
Returns the value of attribute tenant_domain.
34 35 36 |
# File 'lib/comet/models/swift_destination_location.rb', line 34 def tenant_domain @tenant_domain end |
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
37 38 39 |
# File 'lib/comet/models/swift_destination_location.rb', line 37 def tenant_id @tenant_id end |
#trust_id ⇒ Object
Returns the value of attribute trust_id.
40 41 42 |
# File 'lib/comet/models/swift_destination_location.rb', line 40 def trust_id @trust_id end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
55 56 57 |
# File 'lib/comet/models/swift_destination_location.rb', line 55 def unknown_json_fields @unknown_json_fields end |
#username ⇒ Object
Returns the value of attribute username.
16 17 18 |
# File 'lib/comet/models/swift_destination_location.rb', line 16 def username @username end |
Instance Method Details
#clear ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/comet/models/swift_destination_location.rb', line 61 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) ⇒ Object
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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/comet/models/swift_destination_location.rb', line 86 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) ⇒ Object
79 80 81 82 83 |
# File 'lib/comet/models/swift_destination_location.rb', line 79 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.
198 199 200 |
# File 'lib/comet/models/swift_destination_location.rb', line 198 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
150 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 191 192 193 194 195 |
# File 'lib/comet/models/swift_destination_location.rb', line 150 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 = {}) ⇒ String
Returns The complete object as a JSON string.
203 204 205 |
# File 'lib/comet/models/swift_destination_location.rb', line 203 def to_json( = {}) to_hash.to_json() end |