Class: Vapi::UpdateCloudflareCredentialDto
- Inherits:
-
Object
- Object
- Vapi::UpdateCloudflareCredentialDto
- Defined in:
- lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#account_email ⇒ String
readonly
Cloudflare Account Email.
-
#account_id ⇒ String
readonly
Cloudflare Account Id.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#api_key ⇒ String
readonly
Cloudflare API Key / Token.
-
#bucket_plan ⇒ Vapi::CloudflareR2BucketPlan
readonly
This is the bucket plan that can be provided to store call artifacts in R2.
-
#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.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::UpdateCloudflareCredentialDto
Deserialize a JSON object to an instance of UpdateCloudflareCredentialDto.
-
.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(account_id: OMIT, api_key: OMIT, account_email: OMIT, fallback_index: OMIT, name: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::UpdateCloudflareCredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCloudflareCredentialDto to a JSON object.
Constructor Details
#initialize(account_id: OMIT, api_key: OMIT, account_email: OMIT, fallback_index: OMIT, name: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::UpdateCloudflareCredentialDto
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 39 def initialize(account_id: OMIT, api_key: OMIT, account_email: OMIT, fallback_index: OMIT, name: OMIT, bucket_plan: OMIT, additional_properties: nil) @account_id = account_id if account_id != OMIT @api_key = api_key if api_key != OMIT @account_email = account_email if account_email != OMIT @fallback_index = fallback_index if fallback_index != OMIT @name = name if name != OMIT @bucket_plan = bucket_plan if bucket_plan != OMIT @additional_properties = additional_properties @_field_set = { "accountId": account_id, "apiKey": api_key, "accountEmail": account_email, "fallbackIndex": fallback_index, "name": name, "bucketPlan": bucket_plan }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account_email ⇒ String (readonly)
Returns Cloudflare Account Email.
14 15 16 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 14 def account_email @account_email end |
#account_id ⇒ String (readonly)
Returns Cloudflare Account Id.
10 11 12 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 10 def account_id @account_id end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
23 24 25 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 23 def additional_properties @additional_properties end |
#api_key ⇒ String (readonly)
Returns Cloudflare API Key / Token.
12 13 14 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 12 def api_key @api_key end |
#bucket_plan ⇒ Vapi::CloudflareR2BucketPlan (readonly)
Returns This is the bucket plan that can be provided to store call artifacts in R2.
21 22 23 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 21 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.
17 18 19 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 17 def fallback_index @fallback_index end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
19 20 21 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 19 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::UpdateCloudflareCredentialDto
Deserialize a JSON object to an instance of UpdateCloudflareCredentialDto
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 64 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) account_id = parsed_json["accountId"] api_key = parsed_json["apiKey"] account_email = parsed_json["accountEmail"] fallback_index = parsed_json["fallbackIndex"] name = parsed_json["name"] if parsed_json["bucketPlan"].nil? bucket_plan = nil else bucket_plan = parsed_json["bucketPlan"].to_json bucket_plan = Vapi::CloudflareR2BucketPlan.from_json(json_object: bucket_plan) end new( account_id: account_id, api_key: api_key, account_email: account_email, fallback_index: fallback_index, name: name, bucket_plan: bucket_plan, 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.
102 103 104 105 106 107 108 109 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 102 def self.validate_raw(obj:) obj.account_id&.is_a?(String) != false || raise("Passed value for field obj.account_id 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.account_email&.is_a?(String) != false || raise("Passed value for field obj.account_email 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.") obj.bucket_plan.nil? || Vapi::CloudflareR2BucketPlan.validate_raw(obj: obj.bucket_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCloudflareCredentialDto to a JSON object
92 93 94 |
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 92 def to_json(*_args) @_field_set&.to_json end |