Class: NewStoreApi::IdentityProviderResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/identity_provider_response.rb

Overview

Configured identity provider

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(malias = SKIP, config = SKIP, enabled = true, protocol = SKIP, vendor = SKIP) ⇒ IdentityProviderResponse

Returns a new instance of IdentityProviderResponse.



59
60
61
62
63
64
65
66
# File 'lib/new_store_api/models/identity_provider_response.rb', line 59

def initialize(malias = SKIP, config = SKIP, enabled = true,
               protocol = SKIP, vendor = SKIP)
  @malias = malias unless malias == SKIP
  @config = config unless config == SKIP
  @enabled = enabled unless enabled == SKIP
  @protocol = protocol unless protocol == SKIP
  @vendor = vendor unless vendor == SKIP
end

Instance Attribute Details

#configIdentityProviderConfig

Identity Provider configuration



18
19
20
# File 'lib/new_store_api/models/identity_provider_response.rb', line 18

def config
  @config
end

#enabledTrueClass | FalseClass

Identity Provider configuration

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/new_store_api/models/identity_provider_response.rb', line 22

def enabled
  @enabled
end

#maliasString

The unique name of the configured IdP

Returns:

  • (String)


14
15
16
# File 'lib/new_store_api/models/identity_provider_response.rb', line 14

def malias
  @malias
end

#protocolIdentityProviderProtocolEnum

Supported Protocols for Identity Providers



26
27
28
# File 'lib/new_store_api/models/identity_provider_response.rb', line 26

def protocol
  @protocol
end

#vendorIdentityProviderVendorEnum

Supported Vendors for Identity Providers



30
31
32
# File 'lib/new_store_api/models/identity_provider_response.rb', line 30

def vendor
  @vendor
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/new_store_api/models/identity_provider_response.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  malias = hash.key?('alias') ? hash['alias'] : SKIP
  config = IdentityProviderConfig.from_hash(hash['config']) if hash['config']
  enabled = hash['enabled'] ||= true
  protocol = hash.key?('protocol') ? hash['protocol'] : SKIP
  vendor = hash.key?('vendor') ? hash['vendor'] : SKIP

  # Create object from extracted values.
  IdentityProviderResponse.new(malias,
                               config,
                               enabled,
                               protocol,
                               vendor)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/new_store_api/models/identity_provider_response.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['malias'] = 'alias'
  @_hash['config'] = 'config'
  @_hash['enabled'] = 'enabled'
  @_hash['protocol'] = 'protocol'
  @_hash['vendor'] = 'vendor'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/new_store_api/models/identity_provider_response.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/new_store_api/models/identity_provider_response.rb', line 44

def self.optionals
  %w[
    malias
    config
    enabled
    protocol
    vendor
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



95
96
97
98
99
# File 'lib/new_store_api/models/identity_provider_response.rb', line 95

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} malias: #{@malias.inspect}, config: #{@config.inspect}, enabled:"\
  " #{@enabled.inspect}, protocol: #{@protocol.inspect}, vendor: #{@vendor.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



88
89
90
91
92
# File 'lib/new_store_api/models/identity_provider_response.rb', line 88

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} malias: #{@malias}, config: #{@config}, enabled: #{@enabled}, protocol:"\
  " #{@protocol}, vendor: #{@vendor}>"
end