Class: Vapi::GoHighLevelMcpCredential
- Inherits:
-
Object
- Object
- Vapi::GoHighLevelMcpCredential
- Defined in:
- lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#authentication_session ⇒ Vapi::Oauth2AuthenticationSession
readonly
This is the authentication session for the credential.
-
#created_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the credential was created.
-
#id ⇒ String
readonly
This is the unique identifier for the credential.
-
#name ⇒ String
readonly
This is the name of credential.
-
#org_id ⇒ String
readonly
This is the unique identifier for the org that this credential belongs to.
- #provider ⇒ String readonly
-
#updated_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the assistant was last updated.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::GoHighLevelMcpCredential
Deserialize a JSON object to an instance of GoHighLevelMcpCredential.
-
.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(provider:, authentication_session:, id:, org_id:, created_at:, updated_at:, name: OMIT, additional_properties: nil) ⇒ Vapi::GoHighLevelMcpCredential constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of GoHighLevelMcpCredential to a JSON object.
Constructor Details
#initialize(provider:, authentication_session:, id:, org_id:, created_at:, updated_at:, name: OMIT, additional_properties: nil) ⇒ Vapi::GoHighLevelMcpCredential
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 41 def initialize(provider:, authentication_session:, id:, org_id:, created_at:, updated_at:, name: OMIT, additional_properties: nil) @provider = provider @authentication_session = authentication_session @id = id @org_id = org_id @created_at = created_at @updated_at = updated_at @name = name if name != OMIT @additional_properties = additional_properties @_field_set = { "provider": provider, "authenticationSession": authentication_session, "id": id, "orgId": org_id, "createdAt": created_at, "updatedAt": updated_at, "name": name }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
25 26 27 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 25 def additional_properties @additional_properties end |
#authentication_session ⇒ Vapi::Oauth2AuthenticationSession (readonly)
Returns This is the authentication session for the credential.
13 14 15 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 13 def authentication_session @authentication_session end |
#created_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the credential was created.
19 20 21 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 19 def created_at @created_at end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the credential.
15 16 17 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 15 def id @id end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
23 24 25 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 23 def name @name end |
#org_id ⇒ String (readonly)
Returns This is the unique identifier for the org that this credential belongs to.
17 18 19 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 17 def org_id @org_id end |
#provider ⇒ String (readonly)
11 12 13 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 11 def provider @provider end |
#updated_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the assistant was last updated.
21 22 23 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 21 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::GoHighLevelMcpCredential
Deserialize a JSON object to an instance of GoHighLevelMcpCredential
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 68 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider = parsed_json["provider"] if parsed_json["authenticationSession"].nil? authentication_session = nil else authentication_session = parsed_json["authenticationSession"].to_json authentication_session = Vapi::Oauth2AuthenticationSession.from_json(json_object: authentication_session) end id = parsed_json["id"] org_id = parsed_json["orgId"] created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?) updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?) name = parsed_json["name"] new( provider: provider, authentication_session: authentication_session, id: id, org_id: org_id, created_at: created_at, updated_at: updated_at, 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.
108 109 110 111 112 113 114 115 116 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 108 def self.validate_raw(obj:) obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.") Vapi::Oauth2AuthenticationSession.validate_raw(obj: obj.authentication_session) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.") obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at 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 GoHighLevelMcpCredential to a JSON object
98 99 100 |
# File 'lib/vapi_server_sdk/types/go_high_level_mcp_credential.rb', line 98 def to_json(*_args) @_field_set&.to_json end |