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:, new_link_available_at:, additional_properties: {}) ⇒ TooManyManagementLinkRequests

Returns a new instance of TooManyManagementLinkRequests.



39
40
41
42
43
44
45
46
47
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 39

def initialize(error:, new_link_available_at:, additional_properties: {})
  @error = error
  @new_link_available_at = new_link_available_at

  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end
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.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 50

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

  # Clean out expected properties from Hash.
  names.each_value { |k| hash.delete(k) }

  # Create object from extracted values.
  TooManyManagementLinkRequests.new(error: error,
                                    new_link_available_at: new_link_available_at,
                                    additional_properties: hash)
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



68
69
70
# File 'lib/advanced_billing/models/too_many_management_link_requests.rb', line 68

def to_custom_new_link_available_at
  DateTimeHelper.to_rfc3339(new_link_available_at)
end