Class: Vapi::CloudflareCredential
- Inherits:
-
Object
- Object
- Vapi::CloudflareCredential
- Defined in:
- lib/vapi_server_sdk/types/cloudflare_credential.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.
-
#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.
-
#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::CloudflareCredential
Deserialize a JSON object to an instance of CloudflareCredential.
-
.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:, id:, org_id:, created_at:, updated_at:, account_id: OMIT, api_key: OMIT, account_email: OMIT, fallback_index: OMIT, name: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::CloudflareCredential constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CloudflareCredential to a JSON object.
Constructor Details
#initialize(provider:, id:, org_id:, created_at:, updated_at:, account_id: OMIT, api_key: OMIT, account_email: OMIT, fallback_index: OMIT, name: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::CloudflareCredential
55 56 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 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 55 def initialize(provider:, id:, org_id:, created_at:, updated_at:, account_id: OMIT, api_key: OMIT, account_email: OMIT, fallback_index: OMIT, name: OMIT, bucket_plan: OMIT, additional_properties: nil) @provider = provider @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 @id = id @org_id = org_id @created_at = created_at @updated_at = updated_at @name = name if name != OMIT @bucket_plan = bucket_plan if bucket_plan != OMIT @additional_properties = additional_properties @_field_set = { "provider": provider, "accountId": account_id, "apiKey": api_key, "accountEmail": account_email, "fallbackIndex": fallback_index, "id": id, "orgId": org_id, "createdAt": created_at, "updatedAt": updated_at, "name": name, "bucketPlan": bucket_plan }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account_email ⇒ String (readonly)
Returns Cloudflare Account Email.
17 18 19 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 17 def account_email @account_email end |
#account_id ⇒ String (readonly)
Returns Cloudflare Account Id.
13 14 15 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 13 def account_id @account_id end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
34 35 36 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 34 def additional_properties @additional_properties end |
#api_key ⇒ String (readonly)
Returns Cloudflare API Key / Token.
15 16 17 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 15 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.
32 33 34 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 32 def bucket_plan @bucket_plan end |
#created_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the credential was created.
26 27 28 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 26 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.
20 21 22 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 20 def fallback_index @fallback_index end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the credential.
22 23 24 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 22 def id @id end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
30 31 32 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 30 def name @name end |
#org_id ⇒ String (readonly)
Returns This is the unique identifier for the org that this credential belongs to.
24 25 26 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 24 def org_id @org_id end |
#provider ⇒ String (readonly)
Returns Credential provider. Only allowed value is cloudflare.
11 12 13 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 11 def provider @provider end |
#updated_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the assistant was last updated.
28 29 30 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 28 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CloudflareCredential
Deserialize a JSON object to an instance of CloudflareCredential
90 91 92 93 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 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 90 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider = parsed_json["provider"] account_id = parsed_json["accountId"] api_key = parsed_json["apiKey"] account_email = parsed_json["accountEmail"] 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"] 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( provider: provider, account_id: account_id, api_key: api_key, account_email: account_email, fallback_index: fallback_index, id: id, org_id: org_id, created_at: created_at, updated_at: updated_at, 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.
138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 138 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.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.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.") obj.bucket_plan.nil? || Vapi::CloudflareR2BucketPlan.validate_raw(obj: obj.bucket_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CloudflareCredential to a JSON object
128 129 130 |
# File 'lib/vapi_server_sdk/types/cloudflare_credential.rb', line 128 def to_json(*_args) @_field_set&.to_json end |