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(aws_access_key_id: OMIT, aws_secret_access_key: OMIT, region: OMIT, s_3_bucket_name: OMIT, s_3_path_prefix: OMIT, fallback_index: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::UpdateS3CredentialDto

Parameters:

  • aws_access_key_id (String) (defaults to: OMIT)

    AWS access key ID.

  • aws_secret_access_key (String) (defaults to: OMIT)

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

  • region (String) (defaults to: OMIT)

    AWS region in which the S3 bucket is located.

  • s_3_bucket_name (String) (defaults to: OMIT)

    AWS S3 bucket name.

  • s_3_path_prefix (String) (defaults to: OMIT)

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

  • fallback_index (Float) (defaults to: OMIT)

    This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.

  • name (String) (defaults to: OMIT)

    This is the name of credential. This is just for your reference.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



41
42
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/update_s_3_credential_dto.rb', line 41

def initialize(aws_access_key_id: OMIT, aws_secret_access_key: OMIT, region: OMIT, s_3_bucket_name: OMIT,
               s_3_path_prefix: OMIT, fallback_index: OMIT, name: OMIT, additional_properties: nil)
  @aws_access_key_id = aws_access_key_id if aws_access_key_id != OMIT
  @aws_secret_access_key = aws_secret_access_key if aws_secret_access_key != OMIT
  @region = region if region != OMIT
  @s_3_bucket_name = s_3_bucket_name if s_3_bucket_name != OMIT
  @s_3_path_prefix = s_3_path_prefix if s_3_path_prefix != OMIT
  @fallback_index = fallback_index if fallback_index != OMIT
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "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,
    "name": name
  }.reject do |_k, v|
    v == OMIT
  end
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



24
25
26
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 24

def additional_properties
  @additional_properties
end

#aws_access_key_idString (readonly)

Returns AWS access key ID.

Returns:

  • (String)

    AWS access key ID.



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

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.



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

def aws_secret_access_key
  @aws_secret_access_key
end

#fallback_indexFloat (readonly)

Returns This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.

Returns:

  • (Float)

    This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.



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

def fallback_index
  @fallback_index
end

#nameString (readonly)

Returns This is the name of credential. This is just for your reference.

Returns:

  • (String)

    This is the name of credential. This is just for your reference.



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

def name
  @name
end

#regionString (readonly)

Returns AWS region in which the S3 bucket is located.

Returns:

  • (String)

    AWS region in which the S3 bucket is located.



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

def region
  @region
end

#s_3_bucket_nameString (readonly)

Returns AWS S3 bucket name.

Returns:

  • (String)

    AWS S3 bucket name.



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

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/”



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

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:



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/update_s_3_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)
  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"]
  name = parsed_json["name"]
  new(
    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,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


103
104
105
106
107
108
109
110
111
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 103

def self.validate_raw(obj:)
  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.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 UpdateS3CredentialDto to a JSON object

Returns:

  • (String)


93
94
95
# File 'lib/vapi_server_sdk/types/update_s_3_credential_dto.rb', line 93

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