Class: PaypalServerSdk::ActivityTimestamps

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/activity_timestamps.rb

Overview

The date and time stamps that are common to authorized payment, captured payment, and refund transactions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(create_time: SKIP, update_time: SKIP) ⇒ ActivityTimestamps

Returns a new instance of ActivityTimestamps.



48
49
50
51
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 48

def initialize(create_time: SKIP, update_time: SKIP)
  @create_time = create_time unless create_time == SKIP
  @update_time = update_time unless update_time == SKIP
end

Instance Attribute Details

#create_timeString

The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

Returns:

  • (String)


18
19
20
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 18

def create_time
  @create_time
end

#update_timeString

The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

Returns:

  • (String)


25
26
27
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 25

def update_time
  @update_time
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 54

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  create_time = hash.key?('create_time') ? hash['create_time'] : SKIP
  update_time = hash.key?('update_time') ? hash['update_time'] : SKIP

  # Create object from extracted values.
  ActivityTimestamps.new(create_time: create_time,
                         update_time: update_time)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 28

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

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



36
37
38
39
40
41
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 36

def self.optionals
  %w[
    create_time
    update_time
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



73
74
75
76
77
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 73

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} create_time: #{@create_time.inspect}, update_time:"\
  " #{@update_time.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



67
68
69
70
# File 'lib/paypal_server_sdk/models/activity_timestamps.rb', line 67

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} create_time: #{@create_time}, update_time: #{@update_time}>"
end