Class: Vapi::UpdateAzureOpenAiCredentialDto

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/update_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: OMIT, models: OMIT, open_ai_key: OMIT, ocp_apim_subscription_key: OMIT, name: OMIT, open_ai_endpoint: OMIT, additional_properties: nil) ⇒ Vapi::UpdateAzureOpenAiCredentialDto



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/update_azure_open_ai_credential_dto.rb', line 38

def initialize(region: OMIT, models: OMIT, open_ai_key: OMIT, ocp_apim_subscription_key: OMIT, name: OMIT,
               open_ai_endpoint: OMIT, additional_properties: nil)
  @region = region if region != OMIT
  @models = models if models != OMIT
  @open_ai_key = open_ai_key if open_ai_key != OMIT
  @ocp_apim_subscription_key = ocp_apim_subscription_key if ocp_apim_subscription_key != OMIT
  @name = name if name != OMIT
  @open_ai_endpoint = open_ai_endpoint if open_ai_endpoint != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "region": region,
    "models": models,
    "openAIKey": open_ai_key,
    "ocpApimSubscriptionKey": ocp_apim_subscription_key,
    "name": name,
    "openAIEndpoint": open_ai_endpoint
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



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

def additional_properties
  @additional_properties
end

#modelsArray<Vapi::UpdateAzureOpenAiCredentialDtoModelsItem> (readonly)



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

def models
  @models
end

#nameString (readonly)



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

def name
  @name
end

#ocp_apim_subscription_keyString (readonly)



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

def ocp_apim_subscription_key
  @ocp_apim_subscription_key
end

#open_ai_endpointString (readonly)



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

def open_ai_endpoint
  @open_ai_endpoint
end

#open_ai_keyString (readonly)



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

def open_ai_key
  @open_ai_key
end

#regionVapi::UpdateAzureOpenAiCredentialDtoRegion (readonly)



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

def region
  @region
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::UpdateAzureOpenAiCredentialDto

Deserialize a JSON object to an instance of UpdateAzureOpenAiCredentialDto



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/update_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"]
  name = parsed_json["name"]
  open_ai_endpoint = parsed_json["openAIEndpoint"]
  new(
    region: region,
    models: models,
    open_ai_key: open_ai_key,
    ocp_apim_subscription_key: ocp_apim_subscription_key,
    name: name,
    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.


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

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



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

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