Class: Vapi::AzureCredential

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider:, service:, id:, org_id:, created_at:, updated_at:, region: OMIT, api_key: OMIT, name: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::AzureCredential

Parameters:

  • provider (String)
  • service (Vapi::AzureCredentialService)

    This is the service being used in Azure.

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

    This is the region of the Azure resource.

  • api_key (String) (defaults to: OMIT)

    This is not returned in the API.

  • id (String)

    This is the unique identifier for the credential.

  • org_id (String)

    This is the unique identifier for the org that this credential belongs to.

  • created_at (DateTime)

    This is the ISO 8601 date-time string of when the credential was created.

  • updated_at (DateTime)

    This is the ISO 8601 date-time string of when the assistant was last updated.

  • name (String) (defaults to: OMIT)

    This is the name of credential. This is just for your reference.

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

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

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



54
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
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 54

def initialize(provider:, service:, id:, org_id:, created_at:, updated_at:, region: OMIT, api_key: OMIT,
               name: OMIT, bucket_plan: OMIT, additional_properties: nil)
  @provider = provider
  @service = service
  @region = region if region != OMIT
  @api_key = api_key if api_key != 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,
    "service": service,
    "region": region,
    "apiKey": api_key,
    "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

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



34
35
36
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 34

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.



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

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:



32
33
34
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 32

def bucket_plan
  @bucket_plan
end

#created_atDateTime (readonly)

Returns This is the ISO 8601 date-time string of when the credential was created.

Returns:

  • (DateTime)

    This is the ISO 8601 date-time string of when the credential was created.



25
26
27
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 25

def created_at
  @created_at
end

#idString (readonly)

Returns This is the unique identifier for the credential.

Returns:

  • (String)

    This is the unique identifier for the credential.



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

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



29
30
31
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 29

def name
  @name
end

#org_idString (readonly)

Returns This is the unique identifier for the org that this credential belongs to.

Returns:

  • (String)

    This is the unique identifier for the org that this credential belongs to.



23
24
25
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 23

def org_id
  @org_id
end

#providerString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 13

def provider
  @provider
end

#regionVapi::AzureCredentialRegion (readonly)

Returns This is the region of the Azure resource.

Returns:



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

def region
  @region
end

#serviceVapi::AzureCredentialService (readonly)

Returns This is the service being used in Azure.

Returns:



15
16
17
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 15

def service
  @service
end

#updated_atDateTime (readonly)

Returns This is the ISO 8601 date-time string of when the assistant was last updated.

Returns:

  • (DateTime)

    This is the ISO 8601 date-time string of when the assistant was last updated.



27
28
29
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 27

def updated_at
  @updated_at
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::AzureCredential

Deserialize a JSON object to an instance of AzureCredential

Parameters:

  • json_object (String)

Returns:



87
88
89
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
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 87

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  provider = parsed_json["provider"]
  service = parsed_json["service"]
  region = parsed_json["region"]
  api_key = parsed_json["apiKey"]
  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::AzureBlobStorageBucketPlan.from_json(json_object: bucket_plan)
  end
  new(
    provider: provider,
    service: service,
    region: region,
    api_key: api_key,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 133

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.service.is_a?(Vapi::AzureCredentialService) != false || raise("Passed value for field obj.service is not the expected type, validation failed.")
  obj.region&.is_a?(Vapi::AzureCredentialRegion) != 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.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::AzureBlobStorageBucketPlan.validate_raw(obj: obj.bucket_plan)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AzureCredential to a JSON object

Returns:

  • (String)


123
124
125
# File 'lib/vapi_server_sdk/types/azure_credential.rb', line 123

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