Class: AdvancedBilling::PortalManagementLink

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

Overview

PortalManagementLink Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(url = SKIP, fetch_count = SKIP, created_at = SKIP, new_link_available_at = SKIP, expires_at = SKIP, last_invite_sent_at = SKIP) ⇒ PortalManagementLink

Returns a new instance of PortalManagementLink.



67
68
69
70
71
72
73
74
75
76
# File 'lib/advanced_billing/models/portal_management_link.rb', line 67

def initialize(url = SKIP, fetch_count = SKIP, created_at = SKIP,
               new_link_available_at = SKIP, expires_at = SKIP,
               last_invite_sent_at = SKIP)
  @url = url unless url == SKIP
  @fetch_count = fetch_count unless fetch_count == SKIP
  @created_at = created_at unless created_at == SKIP
  @new_link_available_at = new_link_available_at unless new_link_available_at == SKIP
  @expires_at = expires_at unless expires_at == SKIP
  @last_invite_sent_at = last_invite_sent_at unless last_invite_sent_at == SKIP
end

Instance Attribute Details

#created_atString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/advanced_billing/models/portal_management_link.rb', line 22

def created_at
  @created_at
end

#expires_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def expires_at
  @expires_at
end

#fetch_countInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/advanced_billing/models/portal_management_link.rb', line 18

def fetch_count
  @fetch_count
end

#last_invite_sent_atString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/advanced_billing/models/portal_management_link.rb', line 34

def last_invite_sent_at
  @last_invite_sent_at
end

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/advanced_billing/models/portal_management_link.rb', line 26

def new_link_available_at
  @new_link_available_at
end

#urlString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/advanced_billing/models/portal_management_link.rb', line 14

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/advanced_billing/models/portal_management_link.rb', line 79

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  url = hash.key?('url') ? hash['url'] : SKIP
  fetch_count = hash.key?('fetch_count') ? hash['fetch_count'] : SKIP
  created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
  new_link_available_at =
    hash.key?('new_link_available_at') ? hash['new_link_available_at'] : SKIP
  expires_at = hash.key?('expires_at') ? hash['expires_at'] : SKIP
  last_invite_sent_at =
    hash.key?('last_invite_sent_at') ? hash['last_invite_sent_at'] : SKIP

  # Create object from extracted values.
  PortalManagementLink.new(url,
                           fetch_count,
                           created_at,
                           new_link_available_at,
                           expires_at,
                           last_invite_sent_at)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/advanced_billing/models/portal_management_link.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['url'] = 'url'
  @_hash['fetch_count'] = 'fetch_count'
  @_hash['created_at'] = 'created_at'
  @_hash['new_link_available_at'] = 'new_link_available_at'
  @_hash['expires_at'] = 'expires_at'
  @_hash['last_invite_sent_at'] = 'last_invite_sent_at'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
64
65
# File 'lib/advanced_billing/models/portal_management_link.rb', line 61

def self.nullables
  %w[
    last_invite_sent_at
  ]
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/advanced_billing/models/portal_management_link.rb', line 49

def self.optionals
  %w[
    url
    fetch_count
    created_at
    new_link_available_at
    expires_at
    last_invite_sent_at
  ]
end