Class: Vapi::UpdateCloudflareCredentialDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • account_id (String) (defaults to: OMIT)

    Cloudflare Account Id.

  • api_key (String) (defaults to: OMIT)

    Cloudflare API Key / Token.

  • account_email (String) (defaults to: OMIT)

    Cloudflare Account Email.

  • 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.

  • bucket_plan (Vapi::CloudflareR2BucketPlan) (defaults to: OMIT)

    This is the bucket plan that can be provided to store call artifacts in R2

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 =  if  != OMIT
  @api_key = api_key if api_key != OMIT
  @account_email =  if  != 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": ,
    "apiKey": api_key,
    "accountEmail": ,
    "fallbackIndex": fallback_index,
    "name": name,
    "bucketPlan": bucket_plan
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#account_emailString (readonly)

Returns Cloudflare Account Email.

Returns:

  • (String)

    Cloudflare Account Email.



14
15
16
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 14

def 
  @account_email
end

#account_idString (readonly)

Returns Cloudflare Account Id.

Returns:

  • (String)

    Cloudflare Account Id.



10
11
12
# File 'lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb', line 10

def 
  @account_id
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_keyString (readonly)

Returns Cloudflare API Key / Token.

Returns:

  • (String)

    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_planVapi::CloudflareR2BucketPlan (readonly)

Returns This is the bucket plan that can be provided to store call artifacts in R2.

Returns:



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

def bucket_plan
  @bucket_plan
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.



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

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.



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

Parameters:

  • json_object (String)

Returns:



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)
   = parsed_json["accountId"]
  api_key = parsed_json["apiKey"]
   = 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: ,
    api_key: api_key,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.&.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.&.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

Returns:

  • (String)


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