Class: FdxV660Api::FdxOauthTokenIntrospectionResponse

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

Overview

FDX-extended response enabling transport of ConsentGrant 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(active:, iss:, sub:, aud:, exp:, scope:, fdx_consent_id:, iat: SKIP, nbf: SKIP, jti: SKIP, client_id: SKIP, additional_properties: nil) ⇒ FdxOauthTokenIntrospectionResponse

Returns a new instance of FdxOauthTokenIntrospectionResponse.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 95

def initialize(active:, iss:, sub:, aud:, exp:, scope:, fdx_consent_id:,
               iat: SKIP, nbf: SKIP, jti: SKIP, client_id: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @active = active
  @iss = iss
  @sub = sub
  @aud = aud
  @exp = exp
  @iat = iat unless iat == SKIP
  @nbf = nbf unless nbf == SKIP
  @jti = jti unless jti == SKIP
  @client_id = client_id unless client_id == SKIP
  @scope = scope
  @fdx_consent_id = fdx_consent_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#activeTrueClass | FalseClass

Flag indicating whether ConsentGrant is active

Returns:

  • (TrueClass | FalseClass)


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

def active
  @active
end

#audString

Identifies the relevant Consent party (Data Recipient)

Returns:

  • (String)


26
27
28
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 26

def aud
  @aud
end

#client_idString

Identifies the relevant OAuth Client if not the same entity as the audience (intermediary)

Returns:

  • (String)


50
51
52
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 50

def client_id
  @client_id
end

#expFloat

Expiration time of the token, formatted as NumericDate as defined by JSON Web Token (JWT)

Returns:

  • (Float)


31
32
33
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 31

def exp
  @exp
end

Space-delimited array of FDX consentIds as #/components/schemas/ConsentId an empty array is acceptable and may be necessary in some implementations

Returns:

  • (String)


61
62
63
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 61

def fdx_consent_id
  @fdx_consent_id
end

#iatFloat

Issuance time of the token, formatted as NumericDate as defined by JSON Web Token (JWT)

Returns:

  • (Float)


36
37
38
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 36

def iat
  @iat
end

#issString

Identifies the relevant Consent party (Data Provider)

Returns:

  • (String)


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

def iss
  @iss
end

#jtiString

Unique identifier for the token

Returns:

  • (String)


45
46
47
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 45

def jti
  @jti
end

#nbfFloat

Not-before time of the token, formatted as NumericDate as defined by JSON Web Token (JWT)

Returns:

  • (Float)


41
42
43
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 41

def nbf
  @nbf
end

#scopeString

Space-delimited array of scopes from FdxOauthScope plus openid and/or offline_access. Other (private) scopes may be also included.

Returns:

  • (String)


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

def scope
  @scope
end

#subString

Identifies the relevant End User using customerId

Returns:

  • (String)


22
23
24
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 22

def sub
  @sub
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 116

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  active = hash.key?('active') ? hash['active'] : nil
  iss = hash.key?('iss') ? hash['iss'] : nil
  sub = hash.key?('sub') ? hash['sub'] : nil
  aud = hash.key?('aud') ? hash['aud'] : nil
  exp = hash.key?('exp') ? hash['exp'] : nil
  scope = hash.key?('scope') ? hash['scope'] : nil
  fdx_consent_id = hash.key?('fdxConsentId') ? hash['fdxConsentId'] : nil
  iat = hash.key?('iat') ? hash['iat'] : SKIP
  nbf = hash.key?('nbf') ? hash['nbf'] : SKIP
  jti = hash.key?('jti') ? hash['jti'] : SKIP
  client_id = hash.key?('client_id') ? hash['client_id'] : 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.
  FdxOauthTokenIntrospectionResponse.new(active: active,
                                         iss: iss,
                                         sub: sub,
                                         aud: aud,
                                         exp: exp,
                                         scope: scope,
                                         fdx_consent_id: fdx_consent_id,
                                         iat: iat,
                                         nbf: nbf,
                                         jti: jti,
                                         client_id: client_id,
                                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 64

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['active'] = 'active'
  @_hash['iss'] = 'iss'
  @_hash['sub'] = 'sub'
  @_hash['aud'] = 'aud'
  @_hash['exp'] = 'exp'
  @_hash['iat'] = 'iat'
  @_hash['nbf'] = 'nbf'
  @_hash['jti'] = 'jti'
  @_hash['client_id'] = 'client_id'
  @_hash['scope'] = 'scope'
  @_hash['fdx_consent_id'] = 'fdxConsentId'
  @_hash
end

.nullablesObject

An array for nullable fields



91
92
93
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 91

def self.nullables
  []
end

.optionalsObject

An array for optional fields



81
82
83
84
85
86
87
88
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 81

def self.optionals
  %w[
    iat
    nbf
    jti
    client_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



163
164
165
166
167
168
169
170
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 163

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} active: #{@active.inspect}, iss: #{@iss.inspect}, sub: #{@sub.inspect},"\
  " aud: #{@aud.inspect}, exp: #{@exp.inspect}, iat: #{@iat.inspect}, nbf: #{@nbf.inspect},"\
  " jti: #{@jti.inspect}, client_id: #{@client_id.inspect}, scope: #{@scope.inspect},"\
  " fdx_consent_id: #{@fdx_consent_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



155
156
157
158
159
160
# File 'lib/fdx_v660_api/models/fdx_oauth_token_introspection_response.rb', line 155

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} active: #{@active}, iss: #{@iss}, sub: #{@sub}, aud: #{@aud}, exp: #{@exp},"\
  " iat: #{@iat}, nbf: #{@nbf}, jti: #{@jti}, client_id: #{@client_id}, scope: #{@scope},"\
  " fdx_consent_id: #{@fdx_consent_id}, additional_properties: #{@additional_properties}>"
end