Class: TrinsicApi::ProviderContract

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProviderContract

Initializes the object

Parameters:

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

    Model attributes in the form of hash



162
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
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
# File 'lib/trinsic_api/models/provider_contract.rb', line 162

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::ProviderContract` 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::ProviderContract`. 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?(:'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?(:'logo_url')
    self.logo_url = attributes[:'logo_url']
  else
    self.logo_url = nil
  end

  if attributes.key?(:'available')
    self.available = attributes[:'available']
  else
    self.available = 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?(:'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_advanced_provider_sessions')
    self.supports_advanced_provider_sessions = attributes[:'supports_advanced_provider_sessions']
  else
    self.supports_advanced_provider_sessions = nil
  end

  if attributes.key?(:'available_fields')
    if (value = attributes[:'available_fields']).is_a?(Array)
      self.available_fields = 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?(:'health')
    self.health = attributes[:'health']
  else
    self.health = nil
  end
end

Instance Attribute Details

#availableObject

Whether the Provider is available for use in your App. If ‘false`, you will need to contact Trinsic to enable this Provider for your App.



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

def available
  @available
end

#available_fieldsObject

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



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

def available_fields
  @available_fields
end

#collection_methodObject

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



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

def collection_method
  @collection_method
end

#descriptionObject

The Provider’s description as it appears in Trinsic’s Widget. This is flavor text, not a full, human-readable description of the provider.



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

def description
  @description
end

#geographyObject

The geographies within the Regions the Provider is available.



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

def geography
  @geography
end

#has_refreshable_contentObject

Relevant only to Advanced 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.



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

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.



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

def has_trinsic_interface
  @has_trinsic_interface
end

#healthObject

The health for an integration to be able to successfully perform a verification session.



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

def health
  @health
end

#idObject

The ID of the Provider for this contract.



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

def id
  @id
end

#launch_methodObject

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



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

def launch_method
  @launch_method
end

#logo_urlObject

A URL pointing to the Provider’s logo on Trinsic’s CDN. May be a PNG, JPG, or SVG image.



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

def logo_url
  @logo_url
end

#nameObject

The Provider’s Name as it appears in Trinsic’s Dashboard and Widget



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

def name
  @name
end

#regionsObject

The regions within which the Provider is available.



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

def regions
  @regions
end

#requires_inputObject

Relevant to Hosted Provider Sessions and Advanced 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.



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

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.



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

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. For example, Italy’s SPID is a Provider which aggregates access to multiple sub-providers.



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

def sub_providers
  @sub_providers
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.



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

def subtext
  @subtext
end

#supports_advanced_provider_sessionsObject

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



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

def supports_advanced_provider_sessions
  @supports_advanced_provider_sessions
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



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/trinsic_api/models/provider_contract.rb', line 608

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



119
120
121
# File 'lib/trinsic_api/models/provider_contract.rb', line 119

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



124
125
126
# File 'lib/trinsic_api/models/provider_contract.rb', line 124

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'subtext' => :'subtext',
    :'description' => :'description',
    :'logo_url' => :'logoUrl',
    :'available' => :'available',
    :'geography' => :'geography',
    :'regions' => :'regions',
    :'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_advanced_provider_sessions' => :'supportsAdvancedProviderSessions',
    :'available_fields' => :'availableFields',
    :'sub_providers' => :'subProviders',
    :'health' => :'health'
  }
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



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# File 'lib/trinsic_api/models/provider_contract.rb', line 584

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



153
154
155
156
157
158
# File 'lib/trinsic_api/models/provider_contract.rb', line 153

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

.openapi_typesObject

Attribute type mapping.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/trinsic_api/models/provider_contract.rb', line 129

def self.openapi_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'subtext' => :'String',
    :'description' => :'String',
    :'logo_url' => :'String',
    :'available' => :'Boolean',
    :'geography' => :'Array<String>',
    :'regions' => :'Array<String>',
    :'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_advanced_provider_sessions' => :'Boolean',
    :'available_fields' => :'Array<ContractField>',
    :'sub_providers' => :'Array<SubProviderMetadata>',
    :'health' => :'ProviderHealth'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/trinsic_api/models/provider_contract.rb', line 546

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      subtext == o.subtext &&
      description == o.description &&
      logo_url == o.logo_url &&
      available == o.available &&
      geography == o.geography &&
      regions == o.regions &&
      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_advanced_provider_sessions == o.supports_advanced_provider_sessions &&
      available_fields == o.available_fields &&
      sub_providers == o.sub_providers &&
      health == o.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



679
680
681
682
683
684
685
686
687
688
689
690
691
# File 'lib/trinsic_api/models/provider_contract.rb', line 679

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


571
572
573
# File 'lib/trinsic_api/models/provider_contract.rb', line 571

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



577
578
579
# File 'lib/trinsic_api/models/provider_contract.rb', line 577

def hash
  [id, name, subtext, description, logo_url, available, geography, regions, launch_method, collection_method, results_may_be_delayed_after_redirect, has_refreshable_content, requires_input, has_trinsic_interface, supports_advanced_provider_sessions, available_fields, sub_providers, 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



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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/trinsic_api/models/provider_contract.rb', line 291

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 @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 @logo_url.nil?
    invalid_properties.push('invalid value for "logo_url", logo_url cannot be nil.')
  end

  if @available.nil?
    invalid_properties.push('invalid value for "available", available 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 @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_advanced_provider_sessions.nil?
    invalid_properties.push('invalid value for "supports_advanced_provider_sessions", supports_advanced_provider_sessions cannot be nil.')
  end

  if @health.nil?
    invalid_properties.push('invalid value for "health", 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



655
656
657
# File 'lib/trinsic_api/models/provider_contract.rb', line 655

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



661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/trinsic_api/models/provider_contract.rb', line 661

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



649
650
651
# File 'lib/trinsic_api/models/provider_contract.rb', line 649

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



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/trinsic_api/models/provider_contract.rb', line 363

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @name.nil?
  return false if @subtext.nil?
  return false if @description.nil?
  return false if @logo_url.nil?
  return false if @available.nil?
  return false if @geography.nil?
  return false if @regions.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_advanced_provider_sessions.nil?
  return false if @health.nil?
  true
end