Class: Vapi::UpdateS3CredentialDto

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/update_s_3_credential_dto.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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::UpdateS3CredentialDto

Parameters:

  • provider (String)

    Credential provider. Only allowed value is s3

  • aws_access_key_id (String)

    AWS access key ID.

  • aws_secret_access_key (String)

    AWS access key secret. This is not returned in the API.

  • region (String)

    AWS region in which the S3 bucket is located.

  • s_3_bucket_name (String)

    AWS S3 bucket name.

  • s_3_path_prefix (String)

    The path prefix for the uploaded recording. Ex. “recordings/”

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/vapi_server_sdk/types/update_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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



21
22
23
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 21

def additional_properties
  @additional_properties
end

#aws_access_key_idString (readonly)

Returns AWS access key ID.

Returns:

  • (String)

    AWS access key ID.



11
12
13
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 11

def aws_access_key_id
  @aws_access_key_id
end

#aws_secret_access_keyString (readonly)

Returns AWS access key secret. This is not returned in the API.

Returns:

  • (String)

    AWS access key secret. This is not returned in the API.



13
14
15
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 13

def aws_secret_access_key
  @aws_secret_access_key
end

#providerString (readonly)

Returns Credential provider. Only allowed value is s3.

Returns:

  • (String)

    Credential provider. Only allowed value is s3



9
10
11
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 9

def provider
  @provider
end

#regionString (readonly)

Returns AWS region in which the S3 bucket is located.

Returns:

  • (String)

    AWS region in which the S3 bucket is located.



15
16
17
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 15

def region
  @region
end

#s_3_bucket_nameString (readonly)

Returns AWS S3 bucket name.

Returns:

  • (String)

    AWS S3 bucket name.



17
18
19
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 17

def s_3_bucket_name
  @s_3_bucket_name
end

#s_3_path_prefixString (readonly)

Returns The path prefix for the uploaded recording. Ex. “recordings/”.

Returns:

  • (String)

    The path prefix for the uploaded recording. Ex. “recordings/”



19
20
21
# File 'lib/vapi_server_sdk/types/update_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::UpdateS3CredentialDto

Deserialize a JSON object to an instance of UpdateS3CredentialDto

Parameters:

  • json_object (String)

Returns:



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/update_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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


92
93
94
95
96
97
98
99
# File 'lib/vapi_server_sdk/types/update_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 UpdateS3CredentialDto to a JSON object

Returns:

  • (String)


82
83
84
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 82

def to_json(*_args)
  @_field_set&.to_json
end