Class: Vapi::CreateAzureOpenAiCredentialDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider:, region:, models:, open_ai_key:, open_ai_endpoint:, additional_properties: nil) ⇒ Vapi::CreateAzureOpenAiCredentialDto

Parameters:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 35

def initialize(provider:, region:, models:, open_ai_key:, open_ai_endpoint:, additional_properties: nil)
  @provider = provider
  @region = region
  @models = models
  @open_ai_key = open_ai_key
  @open_ai_endpoint = open_ai_endpoint
  @additional_properties = additional_properties
  @_field_set = {
    "provider": provider,
    "region": region,
    "models": models,
    "openAIKey": open_ai_key,
    "openAIEndpoint": open_ai_endpoint
  }
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



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

def additional_properties
  @additional_properties
end

#modelsArray<Vapi::CreateAzureOpenAiCredentialDtoModelsItem> (readonly)



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

def models
  @models
end

#open_ai_endpointString (readonly)

Returns:

  • (String)


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

def open_ai_endpoint
  @open_ai_endpoint
end

#open_ai_keyString (readonly)

Returns This is not returned in the API.

Returns:

  • (String)

    This is not returned in the API.



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

def open_ai_key
  @open_ai_key
end

#providerString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 11

def provider
  @provider
end

#regionVapi::CreateAzureOpenAiCredentialDtoRegion (readonly)



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

def region
  @region
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::CreateAzureOpenAiCredentialDto

Deserialize a JSON object to an instance of CreateAzureOpenAiCredentialDto

Parameters:

  • json_object (String)

Returns:



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 55

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  provider = parsed_json["provider"]
  region = parsed_json["region"]
  models = parsed_json["models"]
  open_ai_key = parsed_json["openAIKey"]
  open_ai_endpoint = parsed_json["openAIEndpoint"]
  new(
    provider: provider,
    region: region,
    models: models,
    open_ai_key: open_ai_key,
    open_ai_endpoint: open_ai_endpoint,
    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)


86
87
88
89
90
91
92
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 86

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.region.is_a?(Vapi::CreateAzureOpenAiCredentialDtoRegion) != false || raise("Passed value for field obj.region is not the expected type, validation failed.")
  obj.models.is_a?(Array) != false || raise("Passed value for field obj.models is not the expected type, validation failed.")
  obj.open_ai_key.is_a?(String) != false || raise("Passed value for field obj.open_ai_key is not the expected type, validation failed.")
  obj.open_ai_endpoint.is_a?(String) != false || raise("Passed value for field obj.open_ai_endpoint is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of CreateAzureOpenAiCredentialDto to a JSON object

Returns:

  • (String)


76
77
78
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 76

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