Class: Cadenya::Types::AIProviderKeySpec
- Inherits:
-
Object
- Object
- Cadenya::Types::AIProviderKeySpec
- Defined in:
- lib/cadenya/types.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(provider: nil, credentials: nil, config: nil) ⇒ AIProviderKeySpec
constructor
A new instance of AIProviderKeySpec.
- #to_h ⇒ Object
Constructor Details
#initialize(provider: nil, credentials: nil, config: nil) ⇒ AIProviderKeySpec
Returns a new instance of AIProviderKeySpec.
92 93 94 95 96 |
# File 'lib/cadenya/types.rb', line 92 def initialize(provider: nil, credentials: nil, config: nil) @provider = provider @credentials = credentials @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
90 91 92 |
# File 'lib/cadenya/types.rb', line 90 def config @config end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
90 91 92 |
# File 'lib/cadenya/types.rb', line 90 def credentials @credentials end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
90 91 92 |
# File 'lib/cadenya/types.rb', line 90 def provider @provider end |
Class Method Details
.from_json(data) ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/cadenya/types.rb', line 98 def self.from_json(data) new( provider: data["provider"], credentials: data["credentials"].nil? ? nil : Types.decode_AIProviderCredential(data["credentials"]), config: data["config"].nil? ? nil : Types.decode_AIProviderConfig(data["config"]), ) end |