Class: PaypalServerSdk::RelatedIdentifiers

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

Overview

Identifiers related to a specific resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(order_id: SKIP, authorization_id: SKIP, capture_id: SKIP) ⇒ RelatedIdentifiers

Returns a new instance of RelatedIdentifiers.



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

def initialize(order_id: SKIP, authorization_id: SKIP, capture_id: SKIP)
  @order_id = order_id unless order_id == SKIP
  @authorization_id = authorization_id unless authorization_id == SKIP
  @capture_id = capture_id unless capture_id == SKIP
end

Instance Attribute Details

#authorization_idString

Authorization ID related to the resource.

Returns:

  • (String)


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

def authorization_id
  @authorization_id
end

#capture_idString

Capture ID related to the resource.

Returns:

  • (String)


22
23
24
# File 'lib/paypal_server_sdk/models/related_identifiers.rb', line 22

def capture_id
  @capture_id
end

#order_idString

Order ID related to the resource.

Returns:

  • (String)


14
15
16
# File 'lib/paypal_server_sdk/models/related_identifiers.rb', line 14

def order_id
  @order_id
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
65
66
67
# File 'lib/paypal_server_sdk/models/related_identifiers.rb', line 54

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  order_id = hash.key?('order_id') ? hash['order_id'] : SKIP
  authorization_id =
    hash.key?('authorization_id') ? hash['authorization_id'] : SKIP
  capture_id = hash.key?('capture_id') ? hash['capture_id'] : SKIP

  # Create object from extracted values.
  RelatedIdentifiers.new(order_id: order_id,
                         authorization_id: authorization_id,
                         capture_id: capture_id)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/paypal_server_sdk/models/related_identifiers.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['order_id'] = 'order_id'
  @_hash['authorization_id'] = 'authorization_id'
  @_hash['capture_id'] = 'capture_id'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/paypal_server_sdk/models/related_identifiers.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/paypal_server_sdk/models/related_identifiers.rb', line 34

def self.optionals
  %w[
    order_id
    authorization_id
    capture_id
  ]
end