Class: AdvancedBilling::ScheduledRenewalConfigurationRequestBody
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::ScheduledRenewalConfigurationRequestBody
- Defined in:
- lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb
Overview
ScheduledRenewalConfigurationRequestBody Model.
Instance Attribute Summary collapse
-
#contract_id ⇒ Integer
(Optional) Existing contract to associate with the scheduled renewal.
-
#create_new_contract ⇒ TrueClass | FalseClass
(Optional) Set to true to create a new contract when contracts are enabled.
-
#ends_at ⇒ DateTime
(Optional) End of the renewal term.
-
#lock_in_at ⇒ DateTime
(Optional) Lock-in date for the renewal.
-
#starts_at ⇒ DateTime
(Optional) Start of the renewal term.
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(starts_at: SKIP, ends_at: SKIP, lock_in_at: SKIP, contract_id: SKIP, create_new_contract: SKIP, additional_properties: {}) ⇒ ScheduledRenewalConfigurationRequestBody
constructor
A new instance of ScheduledRenewalConfigurationRequestBody.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_ends_at ⇒ Object
- #to_custom_lock_in_at ⇒ Object
- #to_custom_starts_at ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #get_additional_properties, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(starts_at: SKIP, ends_at: SKIP, lock_in_at: SKIP, contract_id: SKIP, create_new_contract: SKIP, additional_properties: {}) ⇒ ScheduledRenewalConfigurationRequestBody
Returns a new instance of ScheduledRenewalConfigurationRequestBody.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 62 def initialize(starts_at: SKIP, ends_at: SKIP, lock_in_at: SKIP, contract_id: SKIP, create_new_contract: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end @starts_at = starts_at unless starts_at == SKIP @ends_at = ends_at unless ends_at == SKIP @lock_in_at = lock_in_at unless lock_in_at == SKIP @contract_id = contract_id unless contract_id == SKIP @create_new_contract = create_new_contract unless create_new_contract == SKIP end |
Instance Attribute Details
#contract_id ⇒ Integer
(Optional) Existing contract to associate with the scheduled renewal. Contracts must be enabled for your site.
28 29 30 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 28 def contract_id @contract_id end |
#create_new_contract ⇒ TrueClass | FalseClass
(Optional) Set to true to create a new contract when contracts are enabled. Contracts must be enabled for your site.
33 34 35 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 33 def create_new_contract @create_new_contract end |
#ends_at ⇒ DateTime
(Optional) End of the renewal term.
19 20 21 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 19 def ends_at @ends_at end |
#lock_in_at ⇒ DateTime
(Optional) Lock-in date for the renewal.
23 24 25 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 23 def lock_in_at @lock_in_at end |
#starts_at ⇒ DateTime
(Optional) Start of the renewal term.
15 16 17 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 15 def starts_at @starts_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 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 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. starts_at = if hash.key?('starts_at') (DateTimeHelper.from_rfc3339(hash['starts_at']) if hash['starts_at']) else SKIP end ends_at = if hash.key?('ends_at') (DateTimeHelper.from_rfc3339(hash['ends_at']) if hash['ends_at']) else SKIP end lock_in_at = if hash.key?('lock_in_at') (DateTimeHelper.from_rfc3339(hash['lock_in_at']) if hash['lock_in_at']) else SKIP end contract_id = hash.key?('contract_id') ? hash['contract_id'] : SKIP create_new_contract = hash.key?('create_new_contract') ? hash['create_new_contract'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. ScheduledRenewalConfigurationRequestBody.new(starts_at: starts_at, ends_at: ends_at, lock_in_at: lock_in_at, contract_id: contract_id, create_new_contract: create_new_contract, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 43 44 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['starts_at'] = 'starts_at' @_hash['ends_at'] = 'ends_at' @_hash['lock_in_at'] = 'lock_in_at' @_hash['contract_id'] = 'contract_id' @_hash['create_new_contract'] = 'create_new_contract' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 58 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 52 53 54 55 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 47 def self.optionals %w[ starts_at ends_at lock_in_at contract_id create_new_contract ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 139 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} starts_at: #{@starts_at.inspect}, ends_at: #{@ends_at.inspect}, lock_in_at:"\ " #{@lock_in_at.inspect}, contract_id: #{@contract_id.inspect}, create_new_contract:"\ " #{@create_new_contract.inspect}, additional_properties: #{get_additional_properties}>" end |
#to_custom_ends_at ⇒ Object
117 118 119 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 117 def to_custom_ends_at DateTimeHelper.to_rfc3339(ends_at) end |
#to_custom_lock_in_at ⇒ Object
121 122 123 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 121 def to_custom_lock_in_at DateTimeHelper.to_rfc3339(lock_in_at) end |
#to_custom_starts_at ⇒ Object
113 114 115 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 113 def to_custom_starts_at DateTimeHelper.to_rfc3339(starts_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
126 127 128 129 130 131 |
# File 'lib/advanced_billing/models/scheduled_renewal_configuration_request_body.rb', line 126 def to_s class_name = self.class.name.split('::').last "<#{class_name} starts_at: #{@starts_at}, ends_at: #{@ends_at}, lock_in_at: #{@lock_in_at},"\ " contract_id: #{@contract_id}, create_new_contract: #{@create_new_contract},"\ " additional_properties: #{get_additional_properties}>" end |