Class: Vapi::CreateCustomLlmCredentialDto
- Inherits:
-
Object
- Object
- Vapi::CreateCustomLlmCredentialDto
- Defined in:
- lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#api_key ⇒ String
readonly
This is not returned in the API.
-
#authentication_plan ⇒ Vapi::OAuth2AuthenticationPlan
readonly
This is the authentication plan.
-
#name ⇒ String
readonly
This is the name of credential.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateCustomLlmCredentialDto
Deserialize a JSON object to an instance of CreateCustomLlmCredentialDto.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(api_key:, authentication_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateCustomLlmCredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateCustomLlmCredentialDto to a JSON object.
Constructor Details
#initialize(api_key:, authentication_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateCustomLlmCredentialDto
30 31 32 33 34 35 36 37 38 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 30 def initialize(api_key:, authentication_plan: OMIT, name: OMIT, additional_properties: nil) @api_key = api_key @authentication_plan = authentication_plan if authentication_plan != OMIT @name = name if name != OMIT @additional_properties = additional_properties @_field_set = { "apiKey": api_key, "authenticationPlan": authentication_plan, "name": name }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 17 def additional_properties @additional_properties end |
#api_key ⇒ String (readonly)
Returns This is not returned in the API.
10 11 12 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 10 def api_key @api_key end |
#authentication_plan ⇒ Vapi::OAuth2AuthenticationPlan (readonly)
Returns This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey.
13 14 15 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 13 def authentication_plan @authentication_plan end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
15 16 17 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 15 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateCustomLlmCredentialDto
Deserialize a JSON object to an instance of CreateCustomLlmCredentialDto
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) api_key = parsed_json["apiKey"] if parsed_json["authenticationPlan"].nil? authentication_plan = nil else authentication_plan = parsed_json["authenticationPlan"].to_json authentication_plan = Vapi::OAuth2AuthenticationPlan.from_json(json_object: authentication_plan) end name = parsed_json["name"] new( api_key: api_key, authentication_plan: authentication_plan, name: name, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
76 77 78 79 80 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 76 def self.validate_raw(obj:) obj.api_key.is_a?(String) != false || raise("Passed value for field obj.api_key is not the expected type, validation failed.") obj.authentication_plan.nil? || Vapi::OAuth2AuthenticationPlan.validate_raw(obj: obj.authentication_plan) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateCustomLlmCredentialDto to a JSON object
66 67 68 |
# File 'lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb', line 66 def to_json(*_args) @_field_set&.to_json end |