Class: Vapi::OAuth2AuthenticationPlan
- Inherits:
-
Object
- Object
- Vapi::OAuth2AuthenticationPlan
- Defined in:
- lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#client_id ⇒ String
readonly
This is the OAuth2 client ID.
-
#client_secret ⇒ String
readonly
This is the OAuth2 client secret.
-
#scope ⇒ String
readonly
This is the scope of the OAuth2 token.
-
#url ⇒ String
readonly
This is the OAuth2 URL.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::OAuth2AuthenticationPlan
Deserialize a JSON object to an instance of OAuth2AuthenticationPlan.
-
.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.
Instance Method Summary collapse
- #initialize(url:, client_id:, client_secret:, scope: OMIT, additional_properties: nil) ⇒ Vapi::OAuth2AuthenticationPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of OAuth2AuthenticationPlan to a JSON object.
Constructor Details
#initialize(url:, client_id:, client_secret:, scope: OMIT, additional_properties: nil) ⇒ Vapi::OAuth2AuthenticationPlan
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 30 def initialize(url:, client_id:, client_secret:, scope: OMIT, additional_properties: nil) @url = url @client_id = client_id @client_secret = client_secret @scope = scope if scope != OMIT @additional_properties = additional_properties @_field_set = { "url": url, "clientId": client_id, "clientSecret": client_secret, "scope": scope }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns 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_id ⇒ String (readonly)
Returns This is the OAuth2 client ID.
11 12 13 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 11 def client_id @client_id end |
#client_secret ⇒ String (readonly)
Returns This is the OAuth2 client secret.
13 14 15 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 13 def client_secret @client_secret end |
#scope ⇒ String (readonly)
Returns This is the scope of the OAuth2 token.
15 16 17 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 15 def scope @scope end |
#url ⇒ String (readonly)
Returns This is the OAuth2 URL.
9 10 11 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 9 def url @url end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::OAuth2AuthenticationPlan
Deserialize a JSON object to an instance of OAuth2AuthenticationPlan
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) url = parsed_json["url"] client_id = parsed_json["clientId"] client_secret = parsed_json["clientSecret"] scope = parsed_json["scope"] new( url: url, client_id: client_id, client_secret: client_secret, scope: scope, 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.
79 80 81 82 83 84 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 79 def self.validate_raw(obj:) 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.") obj.scope&.is_a?(String) != false || raise("Passed value for field obj.scope is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of OAuth2AuthenticationPlan to a JSON object
69 70 71 |
# File 'lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb', line 69 def to_json(*_args) @_field_set&.to_json end |