Class: Vapi::CreateAzureCredentialDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service:, region: OMIT, api_key: OMIT, fallback_index: OMIT, bucket_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateAzureCredentialDto

Parameters:

  • service (Vapi::CreateAzureCredentialDtoService)

    This is the service being used in Azure.

  • region (Vapi::CreateAzureCredentialDtoRegion) (defaults to: OMIT)

    This is the region of the Azure resource.

  • api_key (String) (defaults to: OMIT)

    This is not returned in the API.

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

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

    This is the bucket plan that can be provided to store call artifacts in Azure Blob Storage.

  • 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



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/create_azure_credential_dto.rb', line 43

def initialize(service:, region: OMIT, api_key: OMIT, fallback_index: OMIT, bucket_plan: OMIT, name: OMIT,
               additional_properties: nil)
  @service = service
  @region = region if region != OMIT
  @api_key = api_key if api_key != OMIT
  @fallback_index = fallback_index if fallback_index != OMIT
  @bucket_plan = bucket_plan if bucket_plan != OMIT
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "service": service,
    "region": region,
    "apiKey": api_key,
    "fallbackIndex": fallback_index,
    "bucketPlan": bucket_plan,
    "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



26
27
28
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 26

def additional_properties
  @additional_properties
end

#api_keyString (readonly)

Returns This is not returned in the API.

Returns:

  • (String)

    This is not returned in the API.



16
17
18
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 16

def api_key
  @api_key
end

#bucket_planVapi::AzureBlobStorageBucketPlan (readonly)

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

Returns:



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

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.



19
20
21
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 19

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.



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

def name
  @name
end

#regionVapi::CreateAzureCredentialDtoRegion (readonly)

Returns This is the region of the Azure resource.

Returns:



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

def region
  @region
end

#serviceVapi::CreateAzureCredentialDtoService (readonly)

Returns This is the service being used in Azure.

Returns:



12
13
14
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 12

def service
  @service
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::CreateAzureCredentialDto

Deserialize a JSON object to an instance of CreateAzureCredentialDto

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
89
90
91
# File 'lib/vapi_server_sdk/types/create_azure_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)
  service = parsed_json["service"]
  region = parsed_json["region"]
  api_key = parsed_json["apiKey"]
  fallback_index = parsed_json["fallbackIndex"]
  if parsed_json["bucketPlan"].nil?
    bucket_plan = nil
  else
    bucket_plan = parsed_json["bucketPlan"].to_json
    bucket_plan = Vapi::AzureBlobStorageBucketPlan.from_json(json_object: bucket_plan)
  end
  name = parsed_json["name"]
  new(
    service: service,
    region: region,
    api_key: api_key,
    fallback_index: fallback_index,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


106
107
108
109
110
111
112
113
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 106

def self.validate_raw(obj:)
  obj.service.is_a?(Vapi::CreateAzureCredentialDtoService) != false || raise("Passed value for field obj.service is not the expected type, validation failed.")
  obj.region&.is_a?(Vapi::CreateAzureCredentialDtoRegion) != false || raise("Passed value for field obj.region 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.fallback_index&.is_a?(Float) != false || raise("Passed value for field obj.fallback_index is not the expected type, validation failed.")
  obj.bucket_plan.nil? || Vapi::AzureBlobStorageBucketPlan.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 CreateAzureCredentialDto to a JSON object

Returns:

  • (String)


96
97
98
# File 'lib/vapi_server_sdk/types/create_azure_credential_dto.rb', line 96

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