Class: CtdDocumentation::AddLicenseResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/ctd_documentation/models/add_license_response.rb

Overview

AddLicenseResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(success = nil, message = nil, status = SKIP, expiration_date = SKIP) ⇒ AddLicenseResponse

Returns a new instance of AddLicenseResponse.



51
52
53
54
55
56
57
58
59
# File 'lib/ctd_documentation/models/add_license_response.rb', line 51

def initialize(success = nil,
               message = nil,
               status = SKIP,
               expiration_date = SKIP)
  @success = success
  @message = message
  @status = status unless status == SKIP
  @expiration_date = expiration_date unless expiration_date == SKIP
end

Instance Attribute Details

#expiration_dateString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/ctd_documentation/models/add_license_response.rb', line 26

def expiration_date
  @expiration_date
end

#messageString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/ctd_documentation/models/add_license_response.rb', line 18

def message
  @message
end

#statusStatusEnum

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/ctd_documentation/models/add_license_response.rb', line 22

def status
  @status
end

#successTrueClass|FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass|FalseClass)


14
15
16
# File 'lib/ctd_documentation/models/add_license_response.rb', line 14

def success
  @success
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  success = hash.key?('success') ? hash['success'] : nil
  message = hash.key?('message') ? hash['message'] : nil
  status = hash.key?('status') ? hash['status'] : SKIP
  expiration_date =
    hash.key?('expiration_date') ? hash['expiration_date'] : SKIP

  # Create object from extracted values.

  AddLicenseResponse.new(success,
                         message,
                         status,
                         expiration_date)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/ctd_documentation/models/add_license_response.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['success'] = 'success'
  @_hash['message'] = 'message'
  @_hash['status'] = 'status'
  @_hash['expiration_date'] = 'expiration_date'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/ctd_documentation/models/add_license_response.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
# File 'lib/ctd_documentation/models/add_license_response.rb', line 39

def self.optionals
  %w[
    status
    expiration_date
  ]
end