Class: FdxV660Api::HateoasLink5

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

Overview

The URL to retrieve the JWKS public keys from the data provider, needed to enable payload level encryption above the TLS layer

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) ⇒ HateoasLink5

Returns a new instance of HateoasLink5.



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

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:



19
20
21
# File 'lib/fdx_v660_api/models/hateoas_link5.rb', line 19

def action
  @action
end

#hrefString

URL to invoke the action on the resource

Returns:

  • (String)


15
16
17
# File 'lib/fdx_v660_api/models/hateoas_link5.rb', line 15

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)


55
56
57
# File 'lib/fdx_v660_api/models/hateoas_link5.rb', line 55

def rel
  @rel
end

#typesArray[ContentTypes]

Content-types that can be used in the Accept header

Returns:



59
60
61
# File 'lib/fdx_v660_api/models/hateoas_link5.rb', line 59

def types
  @types
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

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.
  HateoasLink5.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.



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

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



81
82
83
# File 'lib/fdx_v660_api/models/hateoas_link5.rb', line 81

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



130
131
132
133
134
# File 'lib/fdx_v660_api/models/hateoas_link5.rb', line 130

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.



123
124
125
126
127
# File 'lib/fdx_v660_api/models/hateoas_link5.rb', line 123

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