Class: Vapi::CreateCloudflareCredentialDto
- Inherits:
-
Object
- Object
- Vapi::CreateCloudflareCredentialDto
- Defined in:
- lib/vapi_server_sdk/types/create_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.
-
#name ⇒ String
readonly
This is the name of credential.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateCloudflareCredentialDto
Deserialize a JSON object to an instance of CreateCloudflareCredentialDto.
-
.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, bucket_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateCloudflareCredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateCloudflareCredentialDto to a JSON object.
Constructor Details
#initialize(account_id: OMIT, api_key: OMIT, account_email: OMIT, bucket_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateCloudflareCredentialDto
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb', line 34 def initialize(account_id: OMIT, api_key: OMIT, account_email: OMIT, bucket_plan: OMIT, name: 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 @bucket_plan = bucket_plan if bucket_plan != OMIT @name = name if name != OMIT @additional_properties = additional_properties @_field_set = { "accountId": account_id, "apiKey": api_key, "accountEmail": account_email, "bucketPlan": bucket_plan, "name": name }.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/create_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/create_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.
20 21 22 |
# File 'lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb', line 20 def additional_properties @additional_properties end |
#api_key ⇒ String (readonly)
Returns Cloudflare API Key / Token.
12 13 14 |
# File 'lib/vapi_server_sdk/types/create_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.
16 17 18 |
# File 'lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb', line 16 def bucket_plan @bucket_plan end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
18 19 20 |
# File 'lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb', line 18 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateCloudflareCredentialDto
Deserialize a JSON object to an instance of CreateCloudflareCredentialDto
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb', line 57 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"] 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 name = parsed_json["name"] new( account_id: account_id, api_key: api_key, account_email: account_email, bucket_plan: bucket_plan, 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.
93 94 95 96 97 98 99 |
# File 'lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb', line 93 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.bucket_plan.nil? || Vapi::CloudflareR2BucketPlan.validate_raw(obj: obj.bucket_plan) 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 CreateCloudflareCredentialDto to a JSON object
83 84 85 |
# File 'lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb', line 83 def to_json(*_args) @_field_set&.to_json end |