Class: Vapi::CreateS3CredentialDto
- Inherits:
-
Object
- Object
- Vapi::CreateS3CredentialDto
- Defined in:
- lib/vapi_server_sdk/types/create_s_3_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.
-
#aws_access_key_id ⇒ String
readonly
AWS access key ID.
-
#aws_secret_access_key ⇒ String
readonly
AWS access key secret.
-
#provider ⇒ String
readonly
Credential provider.
-
#region ⇒ String
readonly
AWS region in which the S3 bucket is located.
-
#s_3_bucket_name ⇒ String
readonly
AWS S3 bucket name.
-
#s_3_path_prefix ⇒ String
readonly
The path prefix for the uploaded recording.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateS3CredentialDto
Deserialize a JSON object to an instance of CreateS3CredentialDto.
-
.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:, aws_access_key_id:, aws_secret_access_key:, region:, s_3_bucket_name:, s_3_path_prefix:, additional_properties: nil) ⇒ Vapi::CreateS3CredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateS3CredentialDto to a JSON object.
Constructor Details
#initialize(provider:, aws_access_key_id:, aws_secret_access_key:, region:, s_3_bucket_name:, s_3_path_prefix:, additional_properties: nil) ⇒ Vapi::CreateS3CredentialDto
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 36 def initialize(provider:, aws_access_key_id:, aws_secret_access_key:, region:, s_3_bucket_name:, s_3_path_prefix:, additional_properties: nil) @provider = provider @aws_access_key_id = aws_access_key_id @aws_secret_access_key = aws_secret_access_key @region = region @s_3_bucket_name = s_3_bucket_name @s_3_path_prefix = s_3_path_prefix @additional_properties = additional_properties @_field_set = { "provider": provider, "awsAccessKeyId": aws_access_key_id, "awsSecretAccessKey": aws_secret_access_key, "region": region, "s3BucketName": s_3_bucket_name, "s3PathPrefix": s_3_path_prefix } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 21 def additional_properties @additional_properties end |
#aws_access_key_id ⇒ String (readonly)
Returns AWS access key ID.
11 12 13 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 11 def aws_access_key_id @aws_access_key_id end |
#aws_secret_access_key ⇒ String (readonly)
Returns AWS access key secret. This is not returned in the API.
13 14 15 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 13 def aws_secret_access_key @aws_secret_access_key end |
#provider ⇒ String (readonly)
Returns Credential provider. Only allowed value is s3.
9 10 11 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 9 def provider @provider end |
#region ⇒ String (readonly)
Returns AWS region in which the S3 bucket is located.
15 16 17 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 15 def region @region end |
#s_3_bucket_name ⇒ String (readonly)
Returns AWS S3 bucket name.
17 18 19 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 17 def s_3_bucket_name @s_3_bucket_name end |
#s_3_path_prefix ⇒ String (readonly)
Returns The path prefix for the uploaded recording. Ex. “recordings/”.
19 20 21 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 19 def s_3_path_prefix @s_3_path_prefix end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateS3CredentialDto
Deserialize a JSON object to an instance of CreateS3CredentialDto
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 59 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider = parsed_json["provider"] aws_access_key_id = parsed_json["awsAccessKeyId"] aws_secret_access_key = parsed_json["awsSecretAccessKey"] region = parsed_json["region"] s_3_bucket_name = parsed_json["s3BucketName"] s_3_path_prefix = parsed_json["s3PathPrefix"] new( provider: provider, aws_access_key_id: aws_access_key_id, aws_secret_access_key: aws_secret_access_key, region: region, s_3_bucket_name: s_3_bucket_name, s_3_path_prefix: s_3_path_prefix, 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.
92 93 94 95 96 97 98 99 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 92 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.aws_access_key_id.is_a?(String) != false || raise("Passed value for field obj.aws_access_key_id is not the expected type, validation failed.") obj.aws_secret_access_key.is_a?(String) != false || raise("Passed value for field obj.aws_secret_access_key is not the expected type, validation failed.") obj.region.is_a?(String) != false || raise("Passed value for field obj.region is not the expected type, validation failed.") obj.s_3_bucket_name.is_a?(String) != false || raise("Passed value for field obj.s_3_bucket_name is not the expected type, validation failed.") obj.s_3_path_prefix.is_a?(String) != false || raise("Passed value for field obj.s_3_path_prefix is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateS3CredentialDto to a JSON object
82 83 84 |
# File 'lib/vapi_server_sdk/types/create_s_3_credential_dto.rb', line 82 def to_json(*_args) @_field_set&.to_json end |