Class: Vapi::OAuth2AuthenticationPlan

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, url:, client_id:, client_secret:, additional_properties: nil) ⇒ Vapi::OAuth2AuthenticationPlan

Parameters:

  • type (String)
  • url (String)

    This is the OAuth2 URL.

  • client_id (String)

    This is the OAuth2 client ID.

  • client_secret (String)

    This is the OAuth2 client secret.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

def initialize(type:, url:, client_id:, client_secret:, additional_properties: nil)
  @type = type
  @url = url
  @client_id = client_id
  @client_secret = client_secret
  @additional_properties = additional_properties
  @_field_set = { "type": type, "url": url, "clientId": client_id, "clientSecret": client_secret }
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/o_auth_2_authentication_plan.rb', line 17

def additional_properties
  @additional_properties
end

#client_idString (readonly)

Returns This is the OAuth2 client ID.

Returns:

  • (String)

    This is the OAuth2 client ID.



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

def client_id
  @client_id
end

#client_secretString (readonly)

Returns This is the OAuth2 client secret.

Returns:

  • (String)

    This is the OAuth2 client secret.



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

def client_secret
  @client_secret
end

#typeString (readonly)

Returns:

  • (String)


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

def type
  @type
end

#urlString (readonly)

Returns This is the OAuth2 URL.

Returns:

  • (String)

    This is the OAuth2 URL.



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

def url
  @url
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::OAuth2AuthenticationPlan

Deserialize a JSON object to an instance of OAuth2AuthenticationPlan

Parameters:

  • json_object (String)

Returns:



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

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  type = parsed_json["type"]
  url = parsed_json["url"]
  client_id = parsed_json["clientId"]
  client_secret = parsed_json["clientSecret"]
  new(
    type: type,
    url: url,
    client_id: client_id,
    client_secret: client_secret,
    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)


72
73
74
75
76
77
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 72

def self.validate_raw(obj:)
  obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
  obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
  obj.client_id.is_a?(String) != false || raise("Passed value for field obj.client_id is not the expected type, validation failed.")
  obj.client_secret.is_a?(String) != false || raise("Passed value for field obj.client_secret is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of OAuth2AuthenticationPlan to a JSON object

Returns:

  • (String)


62
63
64
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 62

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