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(region:, models:, open_ai_key:, open_ai_endpoint:, ocp_apim_subscription_key: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateAzureOpenAiCredentialDto

Parameters:

  • region (Vapi::CreateAzureOpenAiCredentialDtoRegion)
  • models (Array<Vapi::CreateAzureOpenAiCredentialDtoModelsItem>)
  • open_ai_key (String)

    This is not returned in the API.

  • ocp_apim_subscription_key (String) (defaults to: OMIT)

    This is not returned in the API.

  • open_ai_endpoint (String)
  • 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



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 38

def initialize(region:, models:, open_ai_key:, open_ai_endpoint:, ocp_apim_subscription_key: OMIT, name: OMIT,
               additional_properties: nil)
  @region = region
  @models = models
  @open_ai_key = open_ai_key
  @ocp_apim_subscription_key = ocp_apim_subscription_key if ocp_apim_subscription_key != OMIT
  @open_ai_endpoint = open_ai_endpoint
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "region": region,
    "models": models,
    "openAIKey": open_ai_key,
    "ocpApimSubscriptionKey": ocp_apim_subscription_key,
    "openAIEndpoint": open_ai_endpoint,
    "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



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

def additional_properties
  @additional_properties
end

#modelsArray<Vapi::CreateAzureOpenAiCredentialDtoModelsItem> (readonly)



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

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



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

def name
  @name
end

#ocp_apim_subscription_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 ocp_apim_subscription_key
  @ocp_apim_subscription_key
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.



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

def open_ai_key
  @open_ai_key
end

#regionVapi::CreateAzureOpenAiCredentialDtoRegion (readonly)



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

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:



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/create_azure_open_ai_credential_dto.rb', line 63

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


96
97
98
99
100
101
102
103
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 96

def self.validate_raw(obj:)
  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.ocp_apim_subscription_key&.is_a?(String) != false || raise("Passed value for field obj.ocp_apim_subscription_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.")
  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 CreateAzureOpenAiCredentialDto to a JSON object

Returns:

  • (String)


86
87
88
# File 'lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb', line 86

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