Class: Vapi::CreateLangfuseCredentialDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(public_key:, api_key:, api_url:, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateLangfuseCredentialDto

Parameters:

  • public_key (String)

    The public key for Langfuse project. Eg: pk-lf-…

  • api_key (String)

    The secret key for Langfuse project. Eg: sk-lf-… .This is not returned in the API.

  • api_url (String)

    The host URL for Langfuse project. Eg: cloud.langfuse.com

  • 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



32
33
34
35
36
37
38
39
40
41
# File 'lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb', line 32

def initialize(public_key:, api_key:, api_url:, name: OMIT, additional_properties: nil)
  @public_key = public_key
  @api_key = api_key
  @api_url = api_url
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = { "publicKey": public_key, "apiKey": api_key, "apiUrl": api_url, "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



18
19
20
# File 'lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb', line 18

def additional_properties
  @additional_properties
end

#api_keyString (readonly)

Returns The secret key for Langfuse project. Eg: sk-lf-… .This is not returned in the API.

Returns:

  • (String)

    The secret key for Langfuse project. Eg: sk-lf-… .This is not returned in the API.



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

def api_key
  @api_key
end

#api_urlString (readonly)

Returns The host URL for Langfuse project. Eg: cloud.langfuse.com.

Returns:



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

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



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

def name
  @name
end

#public_keyString (readonly)

Returns The public key for Langfuse project. Eg: pk-lf-…

Returns:

  • (String)

    The public key for Langfuse project. Eg: pk-lf-…



9
10
11
# File 'lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb', line 9

def public_key
  @public_key
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::CreateLangfuseCredentialDto

Deserialize a JSON object to an instance of CreateLangfuseCredentialDto

Parameters:

  • json_object (String)

Returns:



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb', line 47

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  public_key = parsed_json["publicKey"]
  api_key = parsed_json["apiKey"]
  api_url = parsed_json["apiUrl"]
  name = parsed_json["name"]
  new(
    public_key: public_key,
    api_key: api_key,
    api_url: api_url,
    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)


76
77
78
79
80
81
# File 'lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb', line 76

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

Returns:

  • (String)


66
67
68
# File 'lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb', line 66

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