Class: AdvancedBilling::TooManyManagementLinkRequests

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/too_many_management_link_requests.rb

Overview

TooManyManagementLinkRequests Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(error = nil, new_link_available_at = nil) ⇒ TooManyManagementLinkRequests

Returns a new instance of TooManyManagementLinkRequests.



39
40
41
42
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 39

def initialize(error = nil, new_link_available_at = nil)
  @error = error
  @new_link_available_at = new_link_available_at
end

Instance Attribute Details

#errorString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 15

def error
  @error
end

TODO: Write general description for this method

Returns:

  • (DateTime)


19
20
21
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 19

def new_link_available_at
  @new_link_available_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 45

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  error = hash.key?('error') ? hash['error'] : nil
  new_link_available_at = if hash.key?('new_link_available_at')
                            (DateTimeHelper.from_rfc3339(hash['new_link_available_at']) if hash['new_link_available_at'])
                          end

  # Create object from extracted values.
  TooManyManagementLinkRequests.new(error,
                                    new_link_available_at)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
27
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 22

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['error'] = 'error'
  @_hash['new_link_available_at'] = 'new_link_available_at'
  @_hash
end

.nullablesObject

An array for nullable fields



35
36
37
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 35

def self.nullables
  []
end

.optionalsObject

An array for optional fields



30
31
32
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 30

def self.optionals
  []
end

Instance Method Details



59
60
61
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 59

def to_custom_new_link_available_at
  DateTimeHelper.to_rfc3339(new_link_available_at)
end