Class: FdxV660Api::HateoasLink7

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/hateoas_link7.rb

Overview

Resource URL for retrieving full request for payment details

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(href:, action: SKIP, rel: SKIP, types: SKIP, additional_properties: nil) ⇒ HateoasLink7

Returns a new instance of HateoasLink7.



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 84

def initialize(href:, action: SKIP, rel: SKIP, types: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @href = href
  @action = action unless action == SKIP
  @rel = rel unless rel == SKIP
  @types = types unless types == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#actionHttpActionType2

HTTP Method to use for the request

Returns:



18
19
20
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 18

def action
  @action
end

#hrefString

URL to invoke the action on the resource

Returns:

  • (String)


14
15
16
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 14

def href
  @href
end

#relString

Relation of this link to its containing entity, as defined by IETF RFC5988 with many relation values specified in its Section 6.2.2, for example:

* `self` - Link to the current resource latest state or with more detail
* `prev` - Previous page in a paginated result set
* `next` - Subsequent page in a paginated result set
* `first` - First page in a paginated result set
* `last` - Last page in a paginated result set
* `related` - Link to a related resource, like a Transaction's

referenceTransactionId

  • up - Link to a related 'parent' resource, like a child account's parent account
  • payment - Link to a payment-scheduling endpoint Specific to FDX, rel values can contain a data cluster or space-delimited list of data clusters which link to the referenced data type(s), for example:
  • ACCOUNT_DETAILED - Link to the account's details via /accounts/{accountId}
  • PAYMENT_SUPPORT - Link to the account's ID and bank ID for payments or transfers via /accounts/{accountId}/payment-networks
  • CUSTOMER_CONTACT - Link to the account's customer contact details via /accounts/{accountId}/contact
  • TRANSACTIONS - Link to the account's transactions list via /accounts/{accountId}/transactions
  • REWARDS - Link to the account's reward program via /reward-programs/{rewardProgramId}
  • TRANSACTIONS REWARDS - Specific link to the account's transaction rewards via /accounts/{accountId}/reward-transactions
  • STATEMENTS - Link to the account's statements list via /accounts/{accountId}/statements
  • IMAGES - Link to the transaction's images list via /accounts/{accountId}/transaction-images/{imageId}

Returns:

  • (String)


54
55
56
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 54

def rel
  @rel
end

#typesArray[ContentTypes]

Content-types that can be used in the Accept header

Returns:



58
59
60
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 58

def types
  @types
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 97

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  href = hash.key?('href') ? hash['href'] : nil
  action = hash.key?('action') ? hash['action'] : SKIP
  rel = hash.key?('rel') ? hash['rel'] : SKIP
  types = hash.key?('types') ? hash['types'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  HateoasLink7.new(href: href,
                   action: action,
                   rel: rel,
                   types: types,
                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['href'] = 'href'
  @_hash['action'] = 'action'
  @_hash['rel'] = 'rel'
  @_hash['types'] = 'types'
  @_hash
end

.nullablesObject

An array for nullable fields



80
81
82
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 80

def self.nullables
  []
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
77
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 71

def self.optionals
  %w[
    action
    rel
    types
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



129
130
131
132
133
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 129

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} href: #{@href.inspect}, action: #{@action.inspect}, rel: #{@rel.inspect},"\
  " types: #{@types.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
# File 'lib/fdx_v660_api/models/hateoas_link7.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} href: #{@href}, action: #{@action}, rel: #{@rel}, types: #{@types},"\
  " additional_properties: #{@additional_properties}>"
end