Class: Vapi::AzureOpenAiCredential
- Inherits:
-
Object
- Object
- Vapi::AzureOpenAiCredential
- Defined in:
- lib/vapi_server_sdk/types/azure_open_ai_credential.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#created_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the credential was created.
-
#id ⇒ String
readonly
This is the unique identifier for the credential.
- #models ⇒ Array<Vapi::AzureOpenAiCredentialModelsItem> readonly
-
#name ⇒ String
readonly
This is the name of credential.
-
#ocp_apim_subscription_key ⇒ String
readonly
This is not returned in the API.
- #open_ai_endpoint ⇒ String readonly
-
#open_ai_key ⇒ String
readonly
This is not returned in the API.
-
#org_id ⇒ String
readonly
This is the unique identifier for the org that this credential belongs to.
- #provider ⇒ String readonly
- #region ⇒ Vapi::AzureOpenAiCredentialRegion readonly
-
#updated_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the assistant was last updated.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::AzureOpenAiCredential
Deserialize a JSON object to an instance of AzureOpenAiCredential.
-
.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(provider:, region:, models:, open_ai_key:, id:, org_id:, created_at:, updated_at:, open_ai_endpoint:, ocp_apim_subscription_key: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::AzureOpenAiCredential constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AzureOpenAiCredential to a JSON object.
Constructor Details
#initialize(provider:, region:, models:, open_ai_key:, id:, org_id:, created_at:, updated_at:, open_ai_endpoint:, ocp_apim_subscription_key: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::AzureOpenAiCredential
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 54 def initialize(provider:, region:, models:, open_ai_key:, id:, org_id:, created_at:, updated_at:, open_ai_endpoint:, ocp_apim_subscription_key: OMIT, name: OMIT, additional_properties: nil) @provider = provider @region = region @models = models @open_ai_key = open_ai_key @ocp_apim_subscription_key = ocp_apim_subscription_key if ocp_apim_subscription_key != OMIT @id = id @org_id = org_id @created_at = created_at @updated_at = updated_at @name = name if name != OMIT @open_ai_endpoint = open_ai_endpoint @additional_properties = additional_properties @_field_set = { "provider": provider, "region": region, "models": models, "openAIKey": open_ai_key, "ocpApimSubscriptionKey": ocp_apim_subscription_key, "id": id, "orgId": org_id, "createdAt": created_at, "updatedAt": updated_at, "name": name, "openAIEndpoint": open_ai_endpoint }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
34 35 36 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 34 def additional_properties @additional_properties end |
#created_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the credential was created.
26 27 28 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 26 def created_at @created_at end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the credential.
22 23 24 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 22 def id @id end |
#models ⇒ Array<Vapi::AzureOpenAiCredentialModelsItem> (readonly)
16 17 18 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 16 def models @models end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
30 31 32 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 30 def name @name end |
#ocp_apim_subscription_key ⇒ String (readonly)
Returns This is not returned in the API.
20 21 22 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 20 def ocp_apim_subscription_key @ocp_apim_subscription_key end |
#open_ai_endpoint ⇒ String (readonly)
32 33 34 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 32 def open_ai_endpoint @open_ai_endpoint end |
#open_ai_key ⇒ String (readonly)
Returns This is not returned in the API.
18 19 20 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 18 def open_ai_key @open_ai_key end |
#org_id ⇒ String (readonly)
Returns This is the unique identifier for the org that this credential belongs to.
24 25 26 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 24 def org_id @org_id end |
#provider ⇒ String (readonly)
12 13 14 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 12 def provider @provider end |
#region ⇒ Vapi::AzureOpenAiCredentialRegion (readonly)
14 15 16 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 14 def region @region end |
#updated_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the assistant was last updated.
28 29 30 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 28 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::AzureOpenAiCredential
Deserialize a JSON object to an instance of AzureOpenAiCredential
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 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 89 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider = parsed_json["provider"] region = parsed_json["region"] models = parsed_json["models"] open_ai_key = parsed_json["openAIKey"] ocp_apim_subscription_key = parsed_json["ocpApimSubscriptionKey"] id = parsed_json["id"] org_id = parsed_json["orgId"] created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?) updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?) name = parsed_json["name"] open_ai_endpoint = parsed_json["openAIEndpoint"] new( provider: provider, region: region, models: models, open_ai_key: open_ai_key, ocp_apim_subscription_key: ocp_apim_subscription_key, id: id, org_id: org_id, created_at: created_at, updated_at: updated_at, name: name, open_ai_endpoint: open_ai_endpoint, 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.
132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 132 def self.validate_raw(obj:) obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.") obj.region.is_a?(Vapi::AzureOpenAiCredentialRegion) != false || raise("Passed value for field obj.region is not the expected type, validation failed.") obj.models.is_a?(Array) != false || raise("Passed value for field obj.models is not the expected type, validation failed.") obj.open_ai_key.is_a?(String) != false || raise("Passed value for field obj.open_ai_key is not the expected type, validation failed.") obj.ocp_apim_subscription_key&.is_a?(String) != false || raise("Passed value for field obj.ocp_apim_subscription_key is not the expected type, validation failed.") obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.") obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.") obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.open_ai_endpoint.is_a?(String) != false || raise("Passed value for field obj.open_ai_endpoint is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AzureOpenAiCredential to a JSON object
122 123 124 |
# File 'lib/vapi_server_sdk/types/azure_open_ai_credential.rb', line 122 def to_json(*_args) @_field_set&.to_json end |