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
User Password, or Application Credential Key, or token if the Username field is blank.
-
#auth_token ⇒ Object
deprecated
Deprecated.
This member has been deprecated since Comet version 17.8.0
-
#auth_url ⇒ Object
Mandatory.
-
#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
Tenant name (v2) or Project name (v3).
-
#tenant_domain ⇒ Object
Project domain name (v3).
-
#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
Username or UserID or Application Credential name or Application Credential ID, or blank for token authentication.
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.
64 65 66 |
# File 'lib/comet/models/swift_destination_location.rb', line 64 def initialize clear end |
Instance Attribute Details
#apikey ⇒ Object
User Password, or Application Credential Key, or token if the Username field is blank
22 23 24 |
# File 'lib/comet/models/swift_destination_location.rb', line 22 def apikey @apikey end |
#auth_token ⇒ Object
This member has been deprecated since Comet version 17.8.0
50 51 52 |
# File 'lib/comet/models/swift_destination_location.rb', line 50 def auth_token @auth_token end |
#auth_url ⇒ Object
Mandatory
29 30 31 |
# File 'lib/comet/models/swift_destination_location.rb', line 29 def auth_url @auth_url end |
#container ⇒ Object
Returns the value of attribute container.
56 57 58 |
# File 'lib/comet/models/swift_destination_location.rb', line 56 def container @container end |
#default_container_policy ⇒ Object
Returns the value of attribute default_container_policy.
59 60 61 |
# File 'lib/comet/models/swift_destination_location.rb', line 59 def default_container_policy @default_container_policy end |
#domain ⇒ Object
Returns the value of attribute domain.
32 33 34 |
# File 'lib/comet/models/swift_destination_location.rb', line 32 def domain @domain end |
#prefix ⇒ Object
Returns the value of attribute prefix.
53 54 55 |
# File 'lib/comet/models/swift_destination_location.rb', line 53 def prefix @prefix end |
#region ⇒ Object
Returns the value of attribute region.
25 26 27 |
# File 'lib/comet/models/swift_destination_location.rb', line 25 def region @region end |
#tenant ⇒ Object
Tenant name (v2) or Project name (v3)
36 37 38 |
# File 'lib/comet/models/swift_destination_location.rb', line 36 def tenant @tenant end |
#tenant_domain ⇒ Object
Project domain name (v3)
40 41 42 |
# File 'lib/comet/models/swift_destination_location.rb', line 40 def tenant_domain @tenant_domain end |
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
43 44 45 |
# File 'lib/comet/models/swift_destination_location.rb', line 43 def tenant_id @tenant_id end |
#trust_id ⇒ Object
Returns the value of attribute trust_id.
46 47 48 |
# File 'lib/comet/models/swift_destination_location.rb', line 46 def trust_id @trust_id end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
62 63 64 |
# File 'lib/comet/models/swift_destination_location.rb', line 62 def unknown_json_fields @unknown_json_fields end |
#username ⇒ Object
Username or UserID or Application Credential name or Application Credential ID, or blank for token authentication
18 19 20 |
# File 'lib/comet/models/swift_destination_location.rb', line 18 def username @username end |
Instance Method Details
#clear ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/comet/models/swift_destination_location.rb', line 68 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
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 148 149 150 151 152 153 154 |
# File 'lib/comet/models/swift_destination_location.rb', line 93 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
86 87 88 89 90 |
# File 'lib/comet/models/swift_destination_location.rb', line 86 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.
205 206 207 |
# File 'lib/comet/models/swift_destination_location.rb', line 205 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
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 196 197 198 199 200 201 202 |
# File 'lib/comet/models/swift_destination_location.rb', line 157 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.
210 211 212 |
# File 'lib/comet/models/swift_destination_location.rb', line 210 def to_json( = {}) to_hash.to_json() end |