Class: TrinsicApi::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/trinsic_api/models/provider.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Provider

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/trinsic_api/models/provider.rb', line 183

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::Provider` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::Provider`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  else
    self.name = nil
  end

  if attributes.key?(:'logo_url')
    self.logo_url = attributes[:'logo_url']
  else
    self.logo_url = nil
  end

  if attributes.key?(:'subtext')
    self.subtext = attributes[:'subtext']
  else
    self.subtext = nil
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  else
    self.description = nil
  end

  if attributes.key?(:'geography')
    if (value = attributes[:'geography']).is_a?(Array)
      self.geography = value
    end
  else
    self.geography = nil
  end

  if attributes.key?(:'regions')
    if (value = attributes[:'regions']).is_a?(Array)
      self.regions = value
    end
  else
    self.regions = nil
  end

  if attributes.key?(:'countries')
    if (value = attributes[:'countries']).is_a?(Array)
      self.countries = value
    end
  else
    self.countries = nil
  end

  if attributes.key?(:'subdivisions')
    if (value = attributes[:'subdivisions']).is_a?(Array)
      self.subdivisions = value
    end
  else
    self.subdivisions = nil
  end

  if attributes.key?(:'licensed')
    self.licensed = attributes[:'licensed']
  else
    self.licensed = nil
  end

  if attributes.key?(:'launch_method')
    self.launch_method = attributes[:'launch_method']
  else
    self.launch_method = nil
  end

  if attributes.key?(:'collection_method')
    self.collection_method = attributes[:'collection_method']
  else
    self.collection_method = nil
  end

  if attributes.key?(:'results_may_be_delayed_after_redirect')
    self.results_may_be_delayed_after_redirect = attributes[:'results_may_be_delayed_after_redirect']
  else
    self.results_may_be_delayed_after_redirect = nil
  end

  if attributes.key?(:'has_refreshable_content')
    self.has_refreshable_content = attributes[:'has_refreshable_content']
  else
    self.has_refreshable_content = nil
  end

  if attributes.key?(:'requires_input')
    self.requires_input = attributes[:'requires_input']
  else
    self.requires_input = nil
  end

  if attributes.key?(:'has_trinsic_interface')
    self.has_trinsic_interface = attributes[:'has_trinsic_interface']
  else
    self.has_trinsic_interface = nil
  end

  if attributes.key?(:'supports_direct_provider_sessions')
    self.supports_direct_provider_sessions = attributes[:'supports_direct_provider_sessions']
  else
    self.supports_direct_provider_sessions = nil
  end

  if attributes.key?(:'available_attributes')
    if (value = attributes[:'available_attributes']).is_a?(Array)
      self.available_attributes = value
    end
  end

  if attributes.key?(:'available_attachments')
    if (value = attributes[:'available_attachments']).is_a?(Array)
      self.available_attachments = value
    end
  end

  if attributes.key?(:'sub_providers')
    if (value = attributes[:'sub_providers']).is_a?(Array)
      self.sub_providers = value
    end
  end

  if attributes.key?(:'live_health')
    self.live_health = attributes[:'live_health']
  else
    self.live_health = nil
  end

  if attributes.key?(:'test_health')
    self.test_health = attributes[:'test_health']
  else
    self.test_health = nil
  end
end

Instance Attribute Details

#available_attachmentsObject

Information about the attachments that this Provider will return in verification results.



73
74
75
# File 'lib/trinsic_api/models/provider.rb', line 73

def available_attachments
  @available_attachments
end

#available_attributesObject

Information about the user attributes that this Provider will return in verification results.



70
71
72
# File 'lib/trinsic_api/models/provider.rb', line 70

def available_attributes
  @available_attributes
end

#collection_methodObject

Relevant only to Direct Provider Sessions. The ‘CollectionMethod` which must be supported to launch the Provider Session in Direct Provider Sessions.



52
53
54
# File 'lib/trinsic_api/models/provider.rb', line 52

def collection_method
  @collection_method
end

#countriesObject

The countries where this Provider is available (as alpha-2 ISO codes).



40
41
42
# File 'lib/trinsic_api/models/provider.rb', line 40

def countries
  @countries
end

#descriptionObject

A description of the provider’s capabilities



31
32
33
# File 'lib/trinsic_api/models/provider.rb', line 31

def description
  @description
end

#geographyObject

Geographic regions where this provider operates



34
35
36
# File 'lib/trinsic_api/models/provider.rb', line 34

def geography
  @geography
end

#has_refreshable_contentObject

Relevant only to Direct Provider Sessions. Whether the Provider requires the ‘RefreshStepContent` capability. For example, Samsung Wallet’s deep links expire every 30 seconds, and must be refreshed periodically for a resilient user flow.



58
59
60
# File 'lib/trinsic_api/models/provider.rb', line 58

def has_refreshable_content
  @has_refreshable_content
end

#has_trinsic_interfaceObject

Whether there exists a Trinsic-hosted UI for this Provider. This is ‘true` for any Provider which is not a simple, OIDC-like redirect flow.



64
65
66
# File 'lib/trinsic_api/models/provider.rb', line 64

def has_trinsic_interface
  @has_trinsic_interface
end

#idObject

The unique identifier of the provider



19
20
21
# File 'lib/trinsic_api/models/provider.rb', line 19

def id
  @id
end

#launch_methodObject

Relevant only to Direct Provider Sessions. The ‘LaunchMethod` which must be supported to launch the Provider Session in Direct Provider Sessions.



49
50
51
# File 'lib/trinsic_api/models/provider.rb', line 49

def launch_method
  @launch_method
end

#licensedObject

Whether this provider is licensed for use by your organization



46
47
48
# File 'lib/trinsic_api/models/provider.rb', line 46

def licensed
  @licensed
end

#live_healthObject

The health for a provider in the live environment



79
80
81
# File 'lib/trinsic_api/models/provider.rb', line 79

def live_health
  @live_health
end

#logo_urlObject

The URL of the provider’s logo



25
26
27
# File 'lib/trinsic_api/models/provider.rb', line 25

def logo_url
  @logo_url
end

#nameObject

The display name of the provider



22
23
24
# File 'lib/trinsic_api/models/provider.rb', line 22

def name
  @name
end

#regionsObject

Specific regions supported by this provider



37
38
39
# File 'lib/trinsic_api/models/provider.rb', line 37

def regions
  @regions
end

#requires_inputObject

Relevant to Hosted Provider Sessions and Direct Provider Sessions. If ‘true`, this Provider requires provider-specific input on Session creation. If this input is not provided, Trinsic’s Hosted UI will be invoked to collect the input from the user.



61
62
63
# File 'lib/trinsic_api/models/provider.rb', line 61

def requires_input
  @requires_input
end

#results_may_be_delayed_after_redirectObject

If ‘true`, then the results for this Provider may not be available immediately after the user is redirected back to your application. In this case, the `GetSessionResults` API must be called until results are available. This is an uncommon scenario, and only applies to Providers which cannot guarantee the availability of results immediately after the user is redirected back to your application.



55
56
57
# File 'lib/trinsic_api/models/provider.rb', line 55

def results_may_be_delayed_after_redirect
  @results_may_be_delayed_after_redirect
end

#sub_providersObject

Metadata about the sub-providers which are available for this Provider in the current Environment. For example, Italy’s SPID is a Provider which aggregates access to multiple sub-providers.



76
77
78
# File 'lib/trinsic_api/models/provider.rb', line 76

def sub_providers
  @sub_providers
end

#subdivisionsObject

The subdivisions (states, provinces, etc.) where this Provider is available (as alpha-2 ISO codes).



43
44
45
# File 'lib/trinsic_api/models/provider.rb', line 43

def subdivisions
  @subdivisions
end

#subtextObject

The Provider’s subtext recommended to be shown next to the name. This is flavor text, not a full, human-readable description of the provider.



28
29
30
# File 'lib/trinsic_api/models/provider.rb', line 28

def subtext
  @subtext
end

#supports_direct_provider_sessionsObject

Whether this Provider can be fully whitelabeled/OEMed through the Direct Provider Sessions API. If ‘false`, the Provider may still be launched through Direct Provider Sessions; however, it will necessarily require a Trinsic-hosted UI to function.



67
68
69
# File 'lib/trinsic_api/models/provider.rb', line 67

def supports_direct_provider_sessions
  @supports_direct_provider_sessions
end

#test_healthObject

The health for a provider in the test environment



82
83
84
# File 'lib/trinsic_api/models/provider.rb', line 82

def test_health
  @test_health
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/trinsic_api/models/provider.rb', line 706

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = TrinsicApi.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



135
136
137
# File 'lib/trinsic_api/models/provider.rb', line 135

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



140
141
142
# File 'lib/trinsic_api/models/provider.rb', line 140

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/trinsic_api/models/provider.rb', line 107

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'logo_url' => :'logoUrl',
    :'subtext' => :'subtext',
    :'description' => :'description',
    :'geography' => :'geography',
    :'regions' => :'regions',
    :'countries' => :'countries',
    :'subdivisions' => :'subdivisions',
    :'licensed' => :'licensed',
    :'launch_method' => :'launchMethod',
    :'collection_method' => :'collectionMethod',
    :'results_may_be_delayed_after_redirect' => :'resultsMayBeDelayedAfterRedirect',
    :'has_refreshable_content' => :'hasRefreshableContent',
    :'requires_input' => :'requiresInput',
    :'has_trinsic_interface' => :'hasTrinsicInterface',
    :'supports_direct_provider_sessions' => :'supportsDirectProviderSessions',
    :'available_attributes' => :'availableAttributes',
    :'available_attachments' => :'availableAttachments',
    :'sub_providers' => :'subProviders',
    :'live_health' => :'liveHealth',
    :'test_health' => :'testHealth'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/trinsic_api/models/provider.rb', line 682

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



173
174
175
176
177
178
179
# File 'lib/trinsic_api/models/provider.rb', line 173

def self.openapi_nullable
  Set.new([
    :'available_attributes',
    :'available_attachments',
    :'sub_providers',
  ])
end

.openapi_typesObject

Attribute type mapping.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/trinsic_api/models/provider.rb', line 145

def self.openapi_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'logo_url' => :'String',
    :'subtext' => :'String',
    :'description' => :'String',
    :'geography' => :'Array<String>',
    :'regions' => :'Array<String>',
    :'countries' => :'Array<String>',
    :'subdivisions' => :'Array<String>',
    :'licensed' => :'Boolean',
    :'launch_method' => :'IntegrationLaunchMethod',
    :'collection_method' => :'ResultCollectionMethod',
    :'results_may_be_delayed_after_redirect' => :'Boolean',
    :'has_refreshable_content' => :'Boolean',
    :'requires_input' => :'Boolean',
    :'has_trinsic_interface' => :'Boolean',
    :'supports_direct_provider_sessions' => :'Boolean',
    :'available_attributes' => :'Array<ContractAttribute>',
    :'available_attachments' => :'Array<ContractAttachment>',
    :'sub_providers' => :'Array<SubProviderMetadata>',
    :'live_health' => :'ProviderHealth',
    :'test_health' => :'ProviderHealth'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
# File 'lib/trinsic_api/models/provider.rb', line 640

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      logo_url == o.logo_url &&
      subtext == o.subtext &&
      description == o.description &&
      geography == o.geography &&
      regions == o.regions &&
      countries == o.countries &&
      subdivisions == o.subdivisions &&
      licensed == o.licensed &&
      launch_method == o.launch_method &&
      collection_method == o.collection_method &&
      results_may_be_delayed_after_redirect == o.results_may_be_delayed_after_redirect &&
      has_refreshable_content == o.has_refreshable_content &&
      requires_input == o.requires_input &&
      has_trinsic_interface == o.has_trinsic_interface &&
      supports_direct_provider_sessions == o.supports_direct_provider_sessions &&
      available_attributes == o.available_attributes &&
      available_attachments == o.available_attachments &&
      sub_providers == o.sub_providers &&
      live_health == o.live_health &&
      test_health == o.test_health
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



777
778
779
780
781
782
783
784
785
786
787
788
789
# File 'lib/trinsic_api/models/provider.rb', line 777

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


669
670
671
# File 'lib/trinsic_api/models/provider.rb', line 669

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



675
676
677
# File 'lib/trinsic_api/models/provider.rb', line 675

def hash
  [id, name, logo_url, subtext, description, geography, regions, countries, subdivisions, licensed, launch_method, collection_method, results_may_be_delayed_after_redirect, has_refreshable_content, requires_input, has_trinsic_interface, supports_direct_provider_sessions, available_attributes, available_attachments, sub_providers, live_health, test_health].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/trinsic_api/models/provider.rb', line 340

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @logo_url.nil?
    invalid_properties.push('invalid value for "logo_url", logo_url cannot be nil.')
  end

  if @subtext.nil?
    invalid_properties.push('invalid value for "subtext", subtext cannot be nil.')
  end

  if @description.nil?
    invalid_properties.push('invalid value for "description", description cannot be nil.')
  end

  if @geography.nil?
    invalid_properties.push('invalid value for "geography", geography cannot be nil.')
  end

  if @regions.nil?
    invalid_properties.push('invalid value for "regions", regions cannot be nil.')
  end

  if @countries.nil?
    invalid_properties.push('invalid value for "countries", countries cannot be nil.')
  end

  if @subdivisions.nil?
    invalid_properties.push('invalid value for "subdivisions", subdivisions cannot be nil.')
  end

  if @licensed.nil?
    invalid_properties.push('invalid value for "licensed", licensed cannot be nil.')
  end

  if @launch_method.nil?
    invalid_properties.push('invalid value for "launch_method", launch_method cannot be nil.')
  end

  if @collection_method.nil?
    invalid_properties.push('invalid value for "collection_method", collection_method cannot be nil.')
  end

  if @results_may_be_delayed_after_redirect.nil?
    invalid_properties.push('invalid value for "results_may_be_delayed_after_redirect", results_may_be_delayed_after_redirect cannot be nil.')
  end

  if @has_refreshable_content.nil?
    invalid_properties.push('invalid value for "has_refreshable_content", has_refreshable_content cannot be nil.')
  end

  if @requires_input.nil?
    invalid_properties.push('invalid value for "requires_input", requires_input cannot be nil.')
  end

  if @has_trinsic_interface.nil?
    invalid_properties.push('invalid value for "has_trinsic_interface", has_trinsic_interface cannot be nil.')
  end

  if @supports_direct_provider_sessions.nil?
    invalid_properties.push('invalid value for "supports_direct_provider_sessions", supports_direct_provider_sessions cannot be nil.')
  end

  if @live_health.nil?
    invalid_properties.push('invalid value for "live_health", live_health cannot be nil.')
  end

  if @test_health.nil?
    invalid_properties.push('invalid value for "test_health", test_health cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



753
754
755
# File 'lib/trinsic_api/models/provider.rb', line 753

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



759
760
761
762
763
764
765
766
767
768
769
770
771
# File 'lib/trinsic_api/models/provider.rb', line 759

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



747
748
749
# File 'lib/trinsic_api/models/provider.rb', line 747

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/trinsic_api/models/provider.rb', line 424

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @name.nil?
  return false if @logo_url.nil?
  return false if @subtext.nil?
  return false if @description.nil?
  return false if @geography.nil?
  return false if @regions.nil?
  return false if @countries.nil?
  return false if @subdivisions.nil?
  return false if @licensed.nil?
  return false if @launch_method.nil?
  return false if @collection_method.nil?
  return false if @results_may_be_delayed_after_redirect.nil?
  return false if @has_refreshable_content.nil?
  return false if @requires_input.nil?
  return false if @has_trinsic_interface.nil?
  return false if @supports_direct_provider_sessions.nil?
  return false if @live_health.nil?
  return false if @test_health.nil?
  true
end