Class: FdxV660Api::RecipientProvider

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

Overview

Record of Recipient at the Provider. Properties in this structure use 'snake_case' names to match the properties in IETF RFC 7591

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(client_name:, redirect_uris:, client_id:, grant_types:, token_endpoint_auth_method:, status:, dap_client_id: SKIP, description: SKIP, logo_uri: SKIP, client_uri: SKIP, contacts: SKIP, scope: SKIP, duration_type: SKIP, duration_period: SKIP, lookback_period: SKIP, registry_references: SKIP, intermediaries: SKIP, client_secret: SKIP, registration_client_uri: SKIP, registration_access_token: SKIP, additional_properties: nil) ⇒ RecipientProvider

Returns a new instance of RecipientProvider.



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 163

def initialize(client_name:, redirect_uris:, client_id:, grant_types:,
               token_endpoint_auth_method:, status:, dap_client_id: SKIP,
               description: SKIP, logo_uri: SKIP, client_uri: SKIP,
               contacts: SKIP, scope: SKIP, duration_type: SKIP,
               duration_period: SKIP, lookback_period: SKIP,
               registry_references: SKIP, intermediaries: SKIP,
               client_secret: SKIP, registration_client_uri: SKIP,
               registration_access_token: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @dap_client_id = dap_client_id unless dap_client_id == SKIP
  @client_name = client_name
  @description = description unless description == SKIP
  @redirect_uris = redirect_uris
  @logo_uri = logo_uri unless logo_uri == SKIP
  @client_uri = client_uri unless client_uri == SKIP
  @contacts = contacts unless contacts == SKIP
  @scope = scope unless scope == SKIP
  @duration_type = duration_type unless duration_type == SKIP
  @duration_period = duration_period unless duration_period == SKIP
  @lookback_period = lookback_period unless lookback_period == SKIP
  @registry_references = registry_references unless registry_references == SKIP
  @intermediaries = intermediaries unless intermediaries == SKIP
  @client_id = client_id
  @client_secret = client_secret unless client_secret == SKIP
  @grant_types = grant_types
  @token_endpoint_auth_method = token_endpoint_auth_method
  @registration_client_uri = registration_client_uri unless registration_client_uri == SKIP
  @status = status
  unless registration_access_token == SKIP
    @registration_access_token =
      registration_access_token
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_idString

OAuth 2.0 client identifier. Unique ID representing Data Recipient and Identity Chain combination. Returned without client_secret for DRs registered by a Data Access Platform (DAP) which will be making all API calls on the DR's behalf

Returns:

  • (String)


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

def client_id
  @client_id
end

#client_nameString

The Data Recipient or Data Recipient Application name displayed by Data Provider during the consent Flow as well as in the Consent Dashboard

Returns:

  • (String)


23
24
25
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 23

def client_name
  @client_name
end

#client_secretString

OAuth 2.0 client secret string for a Data Recipient that will be calling data APIs directly. This value is only returned when the DR is not registered by a DAP and will operate independently. If the DR is registered by a DAP, this field will be omitted

Returns:

  • (String)


88
89
90
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 88

def client_secret
  @client_secret
end

#client_uriString

The URI which provides additional information about the Data Recipient

Returns:

  • (String)


39
40
41
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 39

def client_uri
  @client_uri
end

#contactsArray[String]

Array of strings representing ways to contact individuals responsible for the Data Recipient application

Returns:

  • (Array[String])


44
45
46
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 44

def contacts
  @contacts
end

#dap_client_idString

Data Access Platform's client_id. If this field is populated, then return the Data Recipient's identifier client_id, not a client_id and client_secret

Returns:

  • (String)


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

def dap_client_id
  @dap_client_id
end

#descriptionString

A short description of the Data Recipient application

Returns:

  • (String)


27
28
29
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 27

def description
  @description
end

#duration_periodInteger

The maximum consent duration in days for duration_type TIME_BOUND for the Data Recipient, effective from the date of consent

Returns:

  • (Integer)


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

def duration_period
  @duration_period
end

#duration_typeArray[ConsentDurationType]

The duration of consent for the Data Recipient consumers

Returns:



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

def duration_type
  @duration_type
end

#grant_typesArray[String]

Array of OAuth 2.0 grants made available to the Data Recipient

Returns:

  • (Array[String])


92
93
94
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 92

def grant_types
  @grant_types
end

#intermediariesArray[Intermediary]

An array of the intermediaries for this data recipient

Returns:



74
75
76
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 74

def intermediaries
  @intermediaries
end

#logo_uriString

Data Recipient Logo URL location

Returns:

  • (String)


35
36
37
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 35

def logo_uri
  @logo_uri
end

#lookback_periodInteger

The maximum number of days allowed for Data Recipient to obtain in transaction history, effective from the current date

Returns:

  • (Integer)


64
65
66
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 64

def lookback_period
  @lookback_period
end

#redirect_urisArray[String]

An array of eligible Redirect URI targets

Returns:

  • (Array[String])


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

def redirect_uris
  @redirect_uris
end

#registration_access_tokenString

String containing a unique DCR access token to be used in subsequent operations to manage the Data Recipient

Returns:

  • (String)


110
111
112
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 110

def registration_access_token
  @registration_access_token
end

#registration_client_uriString

Fully qualified URI for subsequent DCR calls (GET, PUT, DELETE) for managing the Data Recipient registration

Returns:

  • (String)


101
102
103
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 101

def registration_client_uri
  @registration_client_uri
end

#registry_referencesArray[RegistryReference]

An array of external registries containing registered entity name, registered entity id and registry fields for the registries where the data recipient is registered

Returns:



70
71
72
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 70

def registry_references
  @registry_references
end

#scopeString

String containing a space-separated list of scope values. Applicable FDX scopes are defined in OauthScope and FdxOauthScope enumerations. Prior use of DataCluster enumeration for scopes is deprecated with release V6.3

Returns:

  • (String)


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

def scope
  @scope
end

#statusString

Status of Recipient created through dynamic client registration

Returns:

  • (String)


105
106
107
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 105

def status
  @status
end

#token_endpoint_auth_methodString

Requested Authentication method for Authorization Server

Returns:

  • (String)


96
97
98
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 96

def token_endpoint_auth_method
  @token_endpoint_auth_method
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 201

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_name = hash.key?('client_name') ? hash['client_name'] : nil
  redirect_uris = hash.key?('redirect_uris') ? hash['redirect_uris'] : nil
  client_id = hash.key?('client_id') ? hash['client_id'] : nil
  grant_types = hash.key?('grant_types') ? hash['grant_types'] : nil
  token_endpoint_auth_method =
    hash.key?('token_endpoint_auth_method') ? hash['token_endpoint_auth_method'] : nil
  status = hash.key?('status') ? hash['status'] : nil
  dap_client_id = hash.key?('dap_client_id') ? hash['dap_client_id'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  logo_uri = hash.key?('logo_uri') ? hash['logo_uri'] : SKIP
  client_uri = hash.key?('client_uri') ? hash['client_uri'] : SKIP
  contacts = hash.key?('contacts') ? hash['contacts'] : SKIP
  scope = hash.key?('scope') ? hash['scope'] : SKIP
  duration_type = hash.key?('duration_type') ? hash['duration_type'] : SKIP
  duration_period =
    hash.key?('duration_period') ? hash['duration_period'] : SKIP
  lookback_period =
    hash.key?('lookback_period') ? hash['lookback_period'] : SKIP
  # Parameter is an array, so we need to iterate through it
  registry_references = nil
  unless hash['registry_references'].nil?
    registry_references = []
    hash['registry_references'].each do |structure|
      registry_references << (RegistryReference.from_hash(structure) if structure)
    end
  end

  registry_references = SKIP unless hash.key?('registry_references')
  # Parameter is an array, so we need to iterate through it
  intermediaries = nil
  unless hash['intermediaries'].nil?
    intermediaries = []
    hash['intermediaries'].each do |structure|
      intermediaries << (Intermediary.from_hash(structure) if structure)
    end
  end

  intermediaries = SKIP unless hash.key?('intermediaries')
  client_secret = hash.key?('client_secret') ? hash['client_secret'] : SKIP
  registration_client_uri =
    hash.key?('registration_client_uri') ? hash['registration_client_uri'] : SKIP
  registration_access_token =
    hash.key?('registration_access_token') ? hash['registration_access_token'] : 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.
  RecipientProvider.new(client_name: client_name,
                        redirect_uris: redirect_uris,
                        client_id: client_id,
                        grant_types: grant_types,
                        token_endpoint_auth_method: token_endpoint_auth_method,
                        status: status,
                        dap_client_id: dap_client_id,
                        description: description,
                        logo_uri: logo_uri,
                        client_uri: client_uri,
                        contacts: contacts,
                        scope: scope,
                        duration_type: duration_type,
                        duration_period: duration_period,
                        lookback_period: lookback_period,
                        registry_references: registry_references,
                        intermediaries: intermediaries,
                        client_secret: client_secret,
                        registration_client_uri: registration_client_uri,
                        registration_access_token: registration_access_token,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 113

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dap_client_id'] = 'dap_client_id'
  @_hash['client_name'] = 'client_name'
  @_hash['description'] = 'description'
  @_hash['redirect_uris'] = 'redirect_uris'
  @_hash['logo_uri'] = 'logo_uri'
  @_hash['client_uri'] = 'client_uri'
  @_hash['contacts'] = 'contacts'
  @_hash['scope'] = 'scope'
  @_hash['duration_type'] = 'duration_type'
  @_hash['duration_period'] = 'duration_period'
  @_hash['lookback_period'] = 'lookback_period'
  @_hash['registry_references'] = 'registry_references'
  @_hash['intermediaries'] = 'intermediaries'
  @_hash['client_id'] = 'client_id'
  @_hash['client_secret'] = 'client_secret'
  @_hash['grant_types'] = 'grant_types'
  @_hash['token_endpoint_auth_method'] = 'token_endpoint_auth_method'
  @_hash['registration_client_uri'] = 'registration_client_uri'
  @_hash['status'] = 'status'
  @_hash['registration_access_token'] = 'registration_access_token'
  @_hash
end

.nullablesObject

An array for nullable fields



159
160
161
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 159

def self.nullables
  []
end

.optionalsObject

An array for optional fields



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 139

def self.optionals
  %w[
    dap_client_id
    description
    logo_uri
    client_uri
    contacts
    scope
    duration_type
    duration_period
    lookback_period
    registry_references
    intermediaries
    client_secret
    registration_client_uri
    registration_access_token
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 296

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} dap_client_id: #{@dap_client_id.inspect}, client_name:"\
  " #{@client_name.inspect}, description: #{@description.inspect}, redirect_uris:"\
  " #{@redirect_uris.inspect}, logo_uri: #{@logo_uri.inspect}, client_uri:"\
  " #{@client_uri.inspect}, contacts: #{@contacts.inspect}, scope: #{@scope.inspect},"\
  " duration_type: #{@duration_type.inspect}, duration_period: #{@duration_period.inspect},"\
  " lookback_period: #{@lookback_period.inspect}, registry_references:"\
  " #{@registry_references.inspect}, intermediaries: #{@intermediaries.inspect}, client_id:"\
  " #{@client_id.inspect}, client_secret: #{@client_secret.inspect}, grant_types:"\
  " #{@grant_types.inspect}, token_endpoint_auth_method:"\
  " #{@token_endpoint_auth_method.inspect}, registration_client_uri:"\
  " #{@registration_client_uri.inspect}, status: #{@status.inspect},"\
  " registration_access_token: #{@registration_access_token.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/fdx_v660_api/models/recipient_provider.rb', line 281

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} dap_client_id: #{@dap_client_id}, client_name: #{@client_name},"\
  " description: #{@description}, redirect_uris: #{@redirect_uris}, logo_uri: #{@logo_uri},"\
  " client_uri: #{@client_uri}, contacts: #{@contacts}, scope: #{@scope}, duration_type:"\
  " #{@duration_type}, duration_period: #{@duration_period}, lookback_period:"\
  " #{@lookback_period}, registry_references: #{@registry_references}, intermediaries:"\
  " #{@intermediaries}, client_id: #{@client_id}, client_secret: #{@client_secret},"\
  " grant_types: #{@grant_types}, token_endpoint_auth_method: #{@token_endpoint_auth_method},"\
  " registration_client_uri: #{@registration_client_uri}, status: #{@status},"\
  " registration_access_token: #{@registration_access_token}, additional_properties:"\
  " #{@additional_properties}>"
end