Class: AdvancedBilling::PortalManagementLink
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::PortalManagementLink
- Defined in:
- lib/advanced_billing/models/portal_management_link.rb
Overview
PortalManagementLink Model.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
TODO: Write general description for this method.
-
#expires_at ⇒ DateTime
TODO: Write general description for this method.
-
#fetch_count ⇒ Integer
TODO: Write general description for this method.
-
#last_invite_sent_at ⇒ DateTime
TODO: Write general description for this method.
-
#new_link_available_at ⇒ DateTime
TODO: Write general description for this method.
-
#url ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(url: SKIP, fetch_count: SKIP, created_at: SKIP, new_link_available_at: SKIP, expires_at: SKIP, last_invite_sent_at: SKIP, additional_properties: {}) ⇒ PortalManagementLink
constructor
A new instance of PortalManagementLink.
- #to_custom_created_at ⇒ Object
- #to_custom_expires_at ⇒ Object
- #to_custom_last_invite_sent_at ⇒ Object
- #to_custom_new_link_available_at ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #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, additional_properties: {}) ⇒ PortalManagementLink
Returns a new instance of PortalManagementLink.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 68 def initialize(url: SKIP, fetch_count: SKIP, created_at: SKIP, new_link_available_at: SKIP, expires_at: SKIP, last_invite_sent_at: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end @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_at ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 23 def created_at @created_at end |
#expires_at ⇒ DateTime
TODO: Write general description for this method
31 32 33 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 31 def expires_at @expires_at end |
#fetch_count ⇒ Integer
TODO: Write general description for this method
19 20 21 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 19 def fetch_count @fetch_count end |
#last_invite_sent_at ⇒ DateTime
TODO: Write general description for this method
35 36 37 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 35 def last_invite_sent_at @last_invite_sent_at end |
#new_link_available_at ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 27 def new_link_available_at @new_link_available_at end |
#url ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 15 def url @url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 85 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 = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else SKIP end 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']) else SKIP end expires_at = if hash.key?('expires_at') (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at']) else SKIP end last_invite_sent_at = if hash.key?('last_invite_sent_at') (DateTimeHelper.from_rfc3339(hash['last_invite_sent_at']) if hash['last_invite_sent_at']) else SKIP end # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. PortalManagementLink.new(url: url, fetch_count: fetch_count, created_at: created_at, new_link_available_at: new_link_available_at, expires_at: expires_at, last_invite_sent_at: last_invite_sent_at, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 38 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 |
.nullables ⇒ Object
An array for nullable fields
62 63 64 65 66 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 62 def self.nullables %w[ last_invite_sent_at ] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 50 def self.optionals %w[ url fetch_count created_at new_link_available_at expires_at last_invite_sent_at ] end |
Instance Method Details
#to_custom_created_at ⇒ Object
125 126 127 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 125 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_expires_at ⇒ Object
133 134 135 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 133 def to_custom_expires_at DateTimeHelper.to_rfc3339(expires_at) end |
#to_custom_last_invite_sent_at ⇒ Object
137 138 139 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 137 def to_custom_last_invite_sent_at DateTimeHelper.to_rfc3339(last_invite_sent_at) end |
#to_custom_new_link_available_at ⇒ Object
129 130 131 |
# File 'lib/advanced_billing/models/portal_management_link.rb', line 129 def to_custom_new_link_available_at DateTimeHelper.to_rfc3339(new_link_available_at) end |