Class: Vapi::S3Credential
- Inherits:
-
Object
- Object
- Vapi::S3Credential
- Defined in:
- lib/vapi_server_sdk/types/s_3_credential.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.
-
#created_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the credential was created.
-
#fallback_index ⇒ Float
readonly
This is the order in which this storage provider is tried during upload retries.
-
#id ⇒ String
readonly
This is the unique identifier for the credential.
-
#name ⇒ String
readonly
This is the name of credential.
-
#org_id ⇒ String
readonly
This is the unique identifier for the org that this credential belongs to.
-
#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.
-
#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::S3Credential
Deserialize a JSON object to an instance of S3Credential.
-
.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:, id:, org_id:, created_at:, updated_at:, fallback_index: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::S3Credential constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of S3Credential 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:, id:, org_id:, created_at:, updated_at:, fallback_index: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::S3Credential
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 84 85 86 87 88 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 57 def initialize(provider:, aws_access_key_id:, aws_secret_access_key:, region:, s_3_bucket_name:, s_3_path_prefix:, id:, org_id:, created_at:, updated_at:, fallback_index: OMIT, name: OMIT, 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 @fallback_index = fallback_index if fallback_index != OMIT @id = id @org_id = org_id @created_at = created_at @updated_at = updated_at @name = name if name != OMIT @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, "fallbackIndex": fallback_index, "id": id, "orgId": org_id, "createdAt": created_at, "updatedAt": updated_at, "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.
35 36 37 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 35 def additional_properties @additional_properties end |
#aws_access_key_id ⇒ String (readonly)
Returns AWS access key ID.
12 13 14 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 12 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.
14 15 16 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 14 def aws_secret_access_key @aws_secret_access_key end |
#created_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the credential was created.
29 30 31 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 29 def created_at @created_at 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.
23 24 25 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 23 def fallback_index @fallback_index end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the credential.
25 26 27 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 25 def id @id end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
33 34 35 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 33 def name @name end |
#org_id ⇒ String (readonly)
Returns This is the unique identifier for the org that this credential belongs to.
27 28 29 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 27 def org_id @org_id end |
#provider ⇒ String (readonly)
Returns Credential provider. Only allowed value is s3.
10 11 12 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 10 def provider @provider end |
#region ⇒ String (readonly)
Returns AWS region in which the S3 bucket is located.
16 17 18 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 16 def region @region end |
#s_3_bucket_name ⇒ String (readonly)
Returns AWS S3 bucket name.
18 19 20 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 18 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/”.
20 21 22 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 20 def s_3_path_prefix @s_3_path_prefix end |
#updated_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the assistant was last updated.
31 32 33 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 31 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::S3Credential
Deserialize a JSON object to an instance of S3Credential
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 94 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"] fallback_index = parsed_json["fallbackIndex"] 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"] 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, fallback_index: fallback_index, id: id, org_id: org_id, created_at: created_at, updated_at: updated_at, 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.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 139 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.") obj.fallback_index&.is_a?(Float) != false || raise("Passed value for field obj.fallback_index 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.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of S3Credential to a JSON object
129 130 131 |
# File 'lib/vapi_server_sdk/types/s_3_credential.rb', line 129 def to_json(*_args) @_field_set&.to_json end |