Class: FdxV660Api::CapabilityEntity

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

Overview

The response object for the API /capability request

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(fdx_versions: SKIP, allowed_connections: SKIP, active_connections: SKIP, message_format: SKIP, operations: SKIP, jwks_url: SKIP, additional_properties: nil) ⇒ CapabilityEntity

Returns a new instance of CapabilityEntity.



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

def initialize(fdx_versions: SKIP, allowed_connections: SKIP,
               active_connections: SKIP, message_format: SKIP,
               operations: SKIP, jwks_url: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @fdx_versions = fdx_versions unless fdx_versions == SKIP
  @allowed_connections = allowed_connections unless allowed_connections == SKIP
  @active_connections = active_connections unless active_connections == SKIP
  @message_format = message_format unless message_format == SKIP
  @operations = operations unless operations == SKIP
  @jwks_url = jwks_url unless jwks_url == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#active_connectionsInteger

The current number of active connections for this client

Returns:

  • (Integer)


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

def active_connections
  @active_connections
end

#allowed_connectionsInteger

The number of concurrent connections allowed for this client

Returns:

  • (Integer)


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

def allowed_connections
  @allowed_connections
end

#fdx_versionsArray[FdxVersion]

The FDX schema versions supported by one or more operations

Returns:



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

def fdx_versions
  @fdx_versions
end

#jwks_urlHateoasLink5

The URL to retrieve the JWKS public keys from the data provider, needed to enable payload level encryption above the TLS layer

Returns:



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

def jwks_url
  @jwks_url
end

#message_formatMessageFormat2

Defaults to JSON

Returns:



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

def message_format
  @message_format
end

#operationsArray[OperationEntity]

The FDX API endpoints supported

Returns:



30
31
32
# File 'lib/fdx_v660_api/models/capability_entity.rb', line 30

def operations
  @operations
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/fdx_v660_api/models/capability_entity.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  fdx_versions = hash.key?('fdxVersions') ? hash['fdxVersions'] : SKIP
  allowed_connections =
    hash.key?('allowedConnections') ? hash['allowedConnections'] : SKIP
  active_connections =
    hash.key?('activeConnections') ? hash['activeConnections'] : SKIP
  message_format = hash.key?('messageFormat') ? hash['messageFormat'] : SKIP
  # Parameter is an array, so we need to iterate through it
  operations = nil
  unless hash['operations'].nil?
    operations = []
    hash['operations'].each do |structure|
      operations << (OperationEntity.from_hash(structure) if structure)
    end
  end

  operations = SKIP unless hash.key?('operations')
  jwks_url = HateoasLink5.from_hash(hash['jwksUrl']) if hash['jwksUrl']

  # 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.
  CapabilityEntity.new(fdx_versions: fdx_versions,
                       allowed_connections: allowed_connections,
                       active_connections: active_connections,
                       message_format: message_format,
                       operations: operations,
                       jwks_url: jwks_url,
                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
47
# File 'lib/fdx_v660_api/models/capability_entity.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['fdx_versions'] = 'fdxVersions'
  @_hash['allowed_connections'] = 'allowedConnections'
  @_hash['active_connections'] = 'activeConnections'
  @_hash['message_format'] = 'messageFormat'
  @_hash['operations'] = 'operations'
  @_hash['jwks_url'] = 'jwksUrl'
  @_hash
end

.nullablesObject

An array for nullable fields



62
63
64
# File 'lib/fdx_v660_api/models/capability_entity.rb', line 62

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
59
# File 'lib/fdx_v660_api/models/capability_entity.rb', line 50

def self.optionals
  %w[
    fdx_versions
    allowed_connections
    active_connections
    message_format
    operations
    jwks_url
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
137
# File 'lib/fdx_v660_api/models/capability_entity.rb', line 131

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} fdx_versions: #{@fdx_versions.inspect}, allowed_connections:"\
  " #{@allowed_connections.inspect}, active_connections: #{@active_connections.inspect},"\
  " message_format: #{@message_format.inspect}, operations: #{@operations.inspect}, jwks_url:"\
  " #{@jwks_url.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
127
128
# File 'lib/fdx_v660_api/models/capability_entity.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} fdx_versions: #{@fdx_versions}, allowed_connections:"\
  " #{@allowed_connections}, active_connections: #{@active_connections}, message_format:"\
  " #{@message_format}, operations: #{@operations}, jwks_url: #{@jwks_url},"\
  " additional_properties: #{@additional_properties}>"
end