Class: Comet::SwiftDestinationLocation

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeSwiftDestinationLocation

Returns a new instance of SwiftDestinationLocation.



59
60
61
# File 'lib/comet/models/swift_destination_location.rb', line 59

def initialize
  clear
end

Instance Attribute Details

#apikeyObject

Returns the value of attribute apikey.



21
22
23
# File 'lib/comet/models/swift_destination_location.rb', line 21

def apikey
  @apikey
end

#auth_tokenObject

Returns the value of attribute auth_token.



45
46
47
# File 'lib/comet/models/swift_destination_location.rb', line 45

def auth_token
  @auth_token
end

#auth_urlObject

Returns the value of attribute auth_url.



27
28
29
# File 'lib/comet/models/swift_destination_location.rb', line 27

def auth_url
  @auth_url
end

#containerObject

Returns the value of attribute container.



51
52
53
# File 'lib/comet/models/swift_destination_location.rb', line 51

def container
  @container
end

#default_container_policyObject

Returns the value of attribute default_container_policy.



54
55
56
# File 'lib/comet/models/swift_destination_location.rb', line 54

def default_container_policy
  @default_container_policy
end

#domainObject

Returns the value of attribute domain.



30
31
32
# File 'lib/comet/models/swift_destination_location.rb', line 30

def domain
  @domain
end

#prefixObject

Returns the value of attribute prefix.



48
49
50
# File 'lib/comet/models/swift_destination_location.rb', line 48

def prefix
  @prefix
end

#regionObject

Returns the value of attribute region.



24
25
26
# File 'lib/comet/models/swift_destination_location.rb', line 24

def region
  @region
end

#tenantObject

Returns the value of attribute tenant.



33
34
35
# File 'lib/comet/models/swift_destination_location.rb', line 33

def tenant
  @tenant
end

#tenant_domainObject

Returns the value of attribute tenant_domain.



36
37
38
# File 'lib/comet/models/swift_destination_location.rb', line 36

def tenant_domain
  @tenant_domain
end

#tenant_idObject

Returns the value of attribute tenant_id.



39
40
41
# File 'lib/comet/models/swift_destination_location.rb', line 39

def tenant_id
  @tenant_id
end

#trust_idObject

Returns the value of attribute trust_id.



42
43
44
# File 'lib/comet/models/swift_destination_location.rb', line 42

def trust_id
  @trust_id
end

#unknown_json_fieldsObject

Returns the value of attribute unknown_json_fields.



57
58
59
# File 'lib/comet/models/swift_destination_location.rb', line 57

def unknown_json_fields
  @unknown_json_fields
end

#usernameObject

Returns the value of attribute username.



18
19
20
# File 'lib/comet/models/swift_destination_location.rb', line 18

def username
  @username
end

Instance Method Details

#clearObject



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/comet/models/swift_destination_location.rb', line 63

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

Parameters:

  • obj (Hash)

    The complete object as a Ruby hash

Raises:

  • (TypeError)


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
148
149
# File 'lib/comet/models/swift_destination_location.rb', line 88

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

Parameters:

  • json_string (String)

    The complete object in JSON format

Raises:

  • (TypeError)


81
82
83
84
85
# File 'lib/comet/models/swift_destination_location.rb', line 81

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



200
201
202
# File 'lib/comet/models/swift_destination_location.rb', line 200

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



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
196
197
# File 'lib/comet/models/swift_destination_location.rb', line 152

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.

Returns:

  • (String)

    The complete object as a JSON string



205
206
207
# File 'lib/comet/models/swift_destination_location.rb', line 205

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