Class: Vapi::UpdateMakeCredentialDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(team_id: OMIT, region: OMIT, api_key: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::UpdateMakeCredentialDto

Parameters:

  • team_id (String) (defaults to: OMIT)

    Team ID

  • region (String) (defaults to: OMIT)

    Region of your application. For example: eu1, eu2, us1, us2

  • api_key (String) (defaults to: OMIT)

    This is not returned in the API.

  • 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



30
31
32
33
34
35
36
37
38
39
# File 'lib/vapi_server_sdk/types/update_make_credential_dto.rb', line 30

def initialize(team_id: OMIT, region: OMIT, api_key: OMIT, name: OMIT, additional_properties: nil)
  @team_id = team_id if team_id != OMIT
  @region = region if region != OMIT
  @api_key = api_key if api_key != OMIT
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = { "teamId": team_id, "region": region, "apiKey": api_key, "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



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

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.



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

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



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

def name
  @name
end

#regionString (readonly)

Returns Region of your application. For example: eu1, eu2, us1, us2.

Returns:

  • (String)

    Region of your application. For example: eu1, eu2, us1, us2



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

def region
  @region
end

#team_idString (readonly)

Returns Team ID.

Returns:

  • (String)

    Team ID



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

def team_id
  @team_id
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::UpdateMakeCredentialDto

Deserialize a JSON object to an instance of UpdateMakeCredentialDto

Parameters:

  • json_object (String)

Returns:



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

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


74
75
76
77
78
79
# File 'lib/vapi_server_sdk/types/update_make_credential_dto.rb', line 74

def self.validate_raw(obj:)
  obj.team_id&.is_a?(String) != false || raise("Passed value for field obj.team_id is not the expected type, validation failed.")
  obj.region&.is_a?(String) != 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.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 UpdateMakeCredentialDto to a JSON object

Returns:

  • (String)


64
65
66
# File 'lib/vapi_server_sdk/types/update_make_credential_dto.rb', line 64

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