Class: SongtradrApiClientRuby::AdminApiUserDTO

Inherits:
Object
  • Object
show all
Defined in:
lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AdminApiUserDTO

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
232
233
234
235
236
237
238
239
240
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
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 151

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `SongtradrApiClientRuby::AdminApiUserDTO` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `SongtradrApiClientRuby::AdminApiUserDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'username')
    self.username = attributes[:'username']
  end

  if attributes.key?(:'email')
    self.email = attributes[:'email']
  end

  if attributes.key?(:'full_name')
    self.full_name = attributes[:'full_name']
  end

  if attributes.key?(:'language')
    self.language = attributes[:'language']
  end

  if attributes.key?(:'is_admin')
    self.is_admin = attributes[:'is_admin']
  end

  if attributes.key?(:'widgets_allowed')
    self.widgets_allowed = attributes[:'widgets_allowed']
  end

  if attributes.key?(:'full_search_allowed')
    self.full_search_allowed = attributes[:'full_search_allowed']
  end

  if attributes.key?(:'voice_search_allowed')
    self.voice_search_allowed = attributes[:'voice_search_allowed']
  end

  if attributes.key?(:'recording_detail_allowed')
    self.recording_detail_allowed = attributes[:'recording_detail_allowed']
  end

  if attributes.key?(:'artist_detail_allowed')
    self.artist_detail_allowed = attributes[:'artist_detail_allowed']
  end

  if attributes.key?(:'playlist_prediction_allowed')
    self.playlist_prediction_allowed = attributes[:'playlist_prediction_allowed']
  end

  if attributes.key?(:'signup_allowed')
    self. = attributes[:'signup_allowed']
  end

  if attributes.key?(:'upload_allowed')
    self.upload_allowed = attributes[:'upload_allowed']
  end

  if attributes.key?(:'fingerprint_allowed')
    self.fingerprint_allowed = attributes[:'fingerprint_allowed']
  end

  if attributes.key?(:'audiotagging_allowed')
    self.audiotagging_allowed = attributes[:'audiotagging_allowed']
  end

  if attributes.key?(:'b2b_allowed')
    self.b2b_allowed = attributes[:'b2b_allowed']
  end

  if attributes.key?(:'editor_allowed')
    self.editor_allowed = attributes[:'editor_allowed']
  end

  if attributes.key?(:'reduced_musical_features')
    self.reduced_musical_features = attributes[:'reduced_musical_features']
  end

  if attributes.key?(:'confirmed')
    self.confirmed = attributes[:'confirmed']
  end

  if attributes.key?(:'gdpr_confirmation_timestamp')
    self.gdpr_confirmation_timestamp = attributes[:'gdpr_confirmation_timestamp']
  end

  if attributes.key?(:'last_login')
    self. = attributes[:'last_login']
  end

  if attributes.key?(:'total_logins')
    self.total_logins = attributes[:'total_logins']
  end

  if attributes.key?(:'total_searches')
    self.total_searches = attributes[:'total_searches']
  end

  if attributes.key?(:'total_uploads')
    self.total_uploads = attributes[:'total_uploads']
  end

  if attributes.key?(:'total_downloads')
    self.total_downloads = attributes[:'total_downloads']
  end

  if attributes.key?(:'total_updates')
    self.total_updates = attributes[:'total_updates']
  end
end

Instance Attribute Details

#artist_detail_allowedObject

Returns the value of attribute artist_detail_allowed.



38
39
40
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 38

def artist_detail_allowed
  @artist_detail_allowed
end

#audiotagging_allowedObject

Returns the value of attribute audiotagging_allowed.



48
49
50
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 48

def audiotagging_allowed
  @audiotagging_allowed
end

#b2b_allowedObject

Returns the value of attribute b2b_allowed.



50
51
52
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 50

def b2b_allowed
  @b2b_allowed
end

#confirmedObject

Returns the value of attribute confirmed.



56
57
58
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 56

def confirmed
  @confirmed
end

#editor_allowedObject

Returns the value of attribute editor_allowed.



52
53
54
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 52

def editor_allowed
  @editor_allowed
end

#emailObject

Returns the value of attribute email.



22
23
24
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 22

def email
  @email
end

#fingerprint_allowedObject

Returns the value of attribute fingerprint_allowed.



46
47
48
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 46

def fingerprint_allowed
  @fingerprint_allowed
end

#full_nameObject

Returns the value of attribute full_name.



24
25
26
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 24

def full_name
  @full_name
end

#full_search_allowedObject

Returns the value of attribute full_search_allowed.



32
33
34
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 32

def full_search_allowed
  @full_search_allowed
end

#gdpr_confirmation_timestampObject

Returns the value of attribute gdpr_confirmation_timestamp.



58
59
60
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 58

def gdpr_confirmation_timestamp
  @gdpr_confirmation_timestamp
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 18

def id
  @id
end

#is_adminObject

Returns the value of attribute is_admin.



28
29
30
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 28

def is_admin
  @is_admin
end

#languageObject

Returns the value of attribute language.



26
27
28
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 26

def language
  @language
end

#last_loginObject

Returns the value of attribute last_login.



60
61
62
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 60

def 
  @last_login
end

#playlist_prediction_allowedObject

Returns the value of attribute playlist_prediction_allowed.



40
41
42
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 40

def playlist_prediction_allowed
  @playlist_prediction_allowed
end

#recording_detail_allowedObject

Returns the value of attribute recording_detail_allowed.



36
37
38
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 36

def recording_detail_allowed
  @recording_detail_allowed
end

#reduced_musical_featuresObject

Returns the value of attribute reduced_musical_features.



54
55
56
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 54

def reduced_musical_features
  @reduced_musical_features
end

#signup_allowedObject

Returns the value of attribute signup_allowed.



42
43
44
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 42

def 
  @signup_allowed
end

#total_downloadsObject

Returns the value of attribute total_downloads.



68
69
70
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 68

def total_downloads
  @total_downloads
end

#total_loginsObject

Returns the value of attribute total_logins.



62
63
64
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 62

def total_logins
  @total_logins
end

#total_searchesObject

Returns the value of attribute total_searches.



64
65
66
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 64

def total_searches
  @total_searches
end

#total_updatesObject

Returns the value of attribute total_updates.



70
71
72
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 70

def total_updates
  @total_updates
end

#total_uploadsObject

Returns the value of attribute total_uploads.



66
67
68
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 66

def total_uploads
  @total_uploads
end

#upload_allowedObject

Returns the value of attribute upload_allowed.



44
45
46
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 44

def upload_allowed
  @upload_allowed
end

#usernameObject

Returns the value of attribute username.



20
21
22
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 20

def username
  @username
end

#voice_search_allowedObject

Returns the value of attribute voice_search_allowed.



34
35
36
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 34

def voice_search_allowed
  @voice_search_allowed
end

#widgets_allowedObject

Returns the value of attribute widgets_allowed.



30
31
32
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 30

def widgets_allowed
  @widgets_allowed
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 361

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = SongtradrApiClientRuby.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



106
107
108
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 106

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 73

def self.attribute_map
  {
    :'id' => :'id',
    :'username' => :'username',
    :'email' => :'email',
    :'full_name' => :'fullName',
    :'language' => :'language',
    :'is_admin' => :'isAdmin',
    :'widgets_allowed' => :'widgetsAllowed',
    :'full_search_allowed' => :'fullSearchAllowed',
    :'voice_search_allowed' => :'voiceSearchAllowed',
    :'recording_detail_allowed' => :'recordingDetailAllowed',
    :'artist_detail_allowed' => :'artistDetailAllowed',
    :'playlist_prediction_allowed' => :'playlistPredictionAllowed',
    :'signup_allowed' => :'signupAllowed',
    :'upload_allowed' => :'uploadAllowed',
    :'fingerprint_allowed' => :'fingerprintAllowed',
    :'audiotagging_allowed' => :'audiotaggingAllowed',
    :'b2b_allowed' => :'b2bAllowed',
    :'editor_allowed' => :'editorAllowed',
    :'reduced_musical_features' => :'reducedMusicalFeatures',
    :'confirmed' => :'confirmed',
    :'gdpr_confirmation_timestamp' => :'gdprConfirmationTimestamp',
    :'last_login' => :'lastLogin',
    :'total_logins' => :'totalLogins',
    :'total_searches' => :'totalSearches',
    :'total_uploads' => :'totalUploads',
    :'total_downloads' => :'totalDownloads',
    :'total_updates' => :'totalUpdates'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 337

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



144
145
146
147
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 144

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 111

def self.openapi_types
  {
    :'id' => :'Integer',
    :'username' => :'String',
    :'email' => :'String',
    :'full_name' => :'String',
    :'language' => :'String',
    :'is_admin' => :'Boolean',
    :'widgets_allowed' => :'Boolean',
    :'full_search_allowed' => :'Boolean',
    :'voice_search_allowed' => :'Boolean',
    :'recording_detail_allowed' => :'Boolean',
    :'artist_detail_allowed' => :'Boolean',
    :'playlist_prediction_allowed' => :'Boolean',
    :'signup_allowed' => :'Boolean',
    :'upload_allowed' => :'Boolean',
    :'fingerprint_allowed' => :'Boolean',
    :'audiotagging_allowed' => :'Boolean',
    :'b2b_allowed' => :'Boolean',
    :'editor_allowed' => :'Boolean',
    :'reduced_musical_features' => :'Boolean',
    :'confirmed' => :'Boolean',
    :'gdpr_confirmation_timestamp' => :'Time',
    :'last_login' => :'Time',
    :'total_logins' => :'Integer',
    :'total_searches' => :'Integer',
    :'total_uploads' => :'Integer',
    :'total_downloads' => :'Integer',
    :'total_updates' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 290

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      username == o.username &&
      email == o.email &&
      full_name == o.full_name &&
      language == o.language &&
      is_admin == o.is_admin &&
      widgets_allowed == o.widgets_allowed &&
      full_search_allowed == o.full_search_allowed &&
      voice_search_allowed == o.voice_search_allowed &&
      recording_detail_allowed == o.recording_detail_allowed &&
      artist_detail_allowed == o.artist_detail_allowed &&
      playlist_prediction_allowed == o.playlist_prediction_allowed &&
       == o. &&
      upload_allowed == o.upload_allowed &&
      fingerprint_allowed == o.fingerprint_allowed &&
      audiotagging_allowed == o.audiotagging_allowed &&
      b2b_allowed == o.b2b_allowed &&
      editor_allowed == o.editor_allowed &&
      reduced_musical_features == o.reduced_musical_features &&
      confirmed == o.confirmed &&
      gdpr_confirmation_timestamp == o.gdpr_confirmation_timestamp &&
       == o. &&
      total_logins == o.total_logins &&
      total_searches == o.total_searches &&
      total_uploads == o.total_uploads &&
      total_downloads == o.total_downloads &&
      total_updates == o.total_updates
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 432

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


324
325
326
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 324

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



330
331
332
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 330

def hash
  [id, username, email, full_name, language, is_admin, widgets_allowed, full_search_allowed, voice_search_allowed, recording_detail_allowed, artist_detail_allowed, playlist_prediction_allowed, , upload_allowed, fingerprint_allowed, audiotagging_allowed, b2b_allowed, editor_allowed, reduced_musical_features, confirmed, gdpr_confirmation_timestamp, , total_logins, total_searches, total_uploads, total_downloads, total_updates].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



275
276
277
278
279
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 275

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



408
409
410
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 408

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 414

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



402
403
404
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 402

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



283
284
285
286
# File 'lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb', line 283

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end