Class: Vapi::CreateAzureCredentialDto
- Inherits:
-
Object
- Object
- Vapi::CreateAzureCredentialDto
- Defined in:
- lib/vapi_server_sdk/types/create_azure_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.
-
#bucket_plan ⇒ Vapi::AzureBlobStorageBucketPlan
readonly
This is the bucket plan that can be provided to store call artifacts in Azure Blob Storage.
-
#fallback_index ⇒ Float
readonly
This is the order in which this storage provider is tried during upload retries.
-
#name ⇒ String
readonly
This is the name of credential.
-
#region ⇒ Vapi::CreateAzureCredentialDtoRegion
readonly
This is the region of the Azure resource.
-
#service ⇒ Vapi::CreateAzureCredentialDtoService
readonly
This is the service being used in Azure.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateAzureCredentialDto
Deserialize a JSON object to an instance of CreateAzureCredentialDto.
-
.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(service:, region: OMIT, api_key: OMIT, fallback_index: OMIT, bucket_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateAzureCredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateAzureCredentialDto to a JSON object.
Constructor Details
#initialize(service:, region: OMIT, api_key: OMIT, fallback_index: OMIT, bucket_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateAzureCredentialDto
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 43 def initialize(service:, region: OMIT, api_key: OMIT, fallback_index: OMIT, bucket_plan: OMIT, name: OMIT, additional_properties: nil) @service = service @region = region if region != OMIT @api_key = api_key if api_key != OMIT @fallback_index = fallback_index if fallback_index != OMIT @bucket_plan = bucket_plan if bucket_plan != OMIT @name = name if name != OMIT @additional_properties = additional_properties @_field_set = { "service": service, "region": region, "apiKey": api_key, "fallbackIndex": fallback_index, "bucketPlan": bucket_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.
26 27 28 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 26 def additional_properties @additional_properties end |
#api_key ⇒ String (readonly)
Returns This is not returned in the API.
16 17 18 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 16 def api_key @api_key end |
#bucket_plan ⇒ Vapi::AzureBlobStorageBucketPlan (readonly)
Returns This is the bucket plan that can be provided to store call artifacts in Azure Blob Storage.
22 23 24 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 22 def bucket_plan @bucket_plan end |
#fallback_index ⇒ Float (readonly)
Returns This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.
19 20 21 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 19 def fallback_index @fallback_index end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
24 25 26 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 24 def name @name end |
#region ⇒ Vapi::CreateAzureCredentialDtoRegion (readonly)
Returns This is the region of the Azure resource.
14 15 16 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 14 def region @region end |
#service ⇒ Vapi::CreateAzureCredentialDtoService (readonly)
Returns This is the service being used in Azure.
12 13 14 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 12 def service @service end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateAzureCredentialDto
Deserialize a JSON object to an instance of CreateAzureCredentialDto
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 68 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) service = parsed_json["service"] region = parsed_json["region"] api_key = parsed_json["apiKey"] fallback_index = parsed_json["fallbackIndex"] if parsed_json["bucketPlan"].nil? bucket_plan = nil else bucket_plan = parsed_json["bucketPlan"].to_json bucket_plan = Vapi::AzureBlobStorageBucketPlan.from_json(json_object: bucket_plan) end name = parsed_json["name"] new( service: service, region: region, api_key: api_key, fallback_index: fallback_index, bucket_plan: bucket_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.
106 107 108 109 110 111 112 113 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 106 def self.validate_raw(obj:) obj.service.is_a?(Vapi::CreateAzureCredentialDtoService) != false || raise("Passed value for field obj.service is not the expected type, validation failed.") obj.region&.is_a?(Vapi::CreateAzureCredentialDtoRegion) != false || raise("Passed value for field obj.region is not the expected type, validation failed.") obj.api_key&.is_a?(String) != false || raise("Passed value for field obj.api_key is not the expected type, validation failed.") obj.fallback_index&.is_a?(Float) != false || raise("Passed value for field obj.fallback_index is not the expected type, validation failed.") obj.bucket_plan.nil? || Vapi::AzureBlobStorageBucketPlan.validate_raw(obj: obj.bucket_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 CreateAzureCredentialDto to a JSON object
96 97 98 |
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 96 def to_json(*_args) @_field_set&.to_json end |