Class: Vapi::GcpKey
- Inherits:
-
Object
- Object
- Vapi::GcpKey
- Defined in:
- lib/vapi_server_sdk/types/gcp_key.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#auth_provider_x_509_cert_url ⇒ String
readonly
This is the URL of the public x509 certificate for the auth provider.
-
#auth_uri ⇒ String
readonly
This is the URI for the auth provider’s authorization endpoint.
-
#client_email ⇒ String
readonly
This is the email address associated with the service account.
-
#client_id ⇒ String
readonly
This is the unique identifier for the client.
-
#client_x_509_cert_url ⇒ String
readonly
This is the URL of the public x509 certificate for the client.
-
#private_key ⇒ String
readonly
This is the private key in PEM format.
-
#private_key_id ⇒ String
readonly
This is the unique identifier for the private key.
-
#project_id ⇒ String
readonly
This is the ID of the Google Cloud project associated with this key.
-
#token_uri ⇒ String
readonly
This is the URI for the auth provider’s token endpoint.
-
#type ⇒ String
readonly
This is the type of the key.
-
#universe_domain ⇒ String
readonly
This is the domain associated with the universe this service account belongs to.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::GcpKey
Deserialize a JSON object to an instance of GcpKey.
-
.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(type:, project_id:, private_key_id:, private_key:, client_email:, client_id:, auth_uri:, token_uri:, auth_provider_x_509_cert_url:, client_x_509_cert_url:, universe_domain:, additional_properties: nil) ⇒ Vapi::GcpKey constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of GcpKey to a JSON object.
Constructor Details
#initialize(type:, project_id:, private_key_id:, private_key:, client_email:, client_id:, auth_uri:, token_uri:, auth_provider_x_509_cert_url:, client_x_509_cert_url:, universe_domain:, additional_properties: nil) ⇒ Vapi::GcpKey
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 53 def initialize(type:, project_id:, private_key_id:, private_key:, client_email:, client_id:, auth_uri:, token_uri:, auth_provider_x_509_cert_url:, client_x_509_cert_url:, universe_domain:, additional_properties: nil) @type = type @project_id = project_id @private_key_id = private_key_id @private_key = private_key @client_email = client_email @client_id = client_id @auth_uri = auth_uri @token_uri = token_uri @auth_provider_x_509_cert_url = auth_provider_x_509_cert_url @client_x_509_cert_url = client_x_509_cert_url @universe_domain = universe_domain @additional_properties = additional_properties @_field_set = { "type": type, "projectId": project_id, "privateKeyId": private_key_id, "privateKey": private_key, "clientEmail": client_email, "clientId": client_id, "authUri": auth_uri, "tokenUri": token_uri, "authProviderX509CertUrl": auth_provider_x_509_cert_url, "clientX509CertUrl": client_x_509_cert_url, "universeDomain": universe_domain } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
32 33 34 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 32 def additional_properties @additional_properties end |
#auth_provider_x_509_cert_url ⇒ String (readonly)
Returns This is the URL of the public x509 certificate for the auth provider.
26 27 28 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 26 def auth_provider_x_509_cert_url @auth_provider_x_509_cert_url end |
#auth_uri ⇒ String (readonly)
Returns This is the URI for the auth provider’s authorization endpoint.
22 23 24 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 22 def auth_uri @auth_uri end |
#client_email ⇒ String (readonly)
Returns This is the email address associated with the service account.
18 19 20 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 18 def client_email @client_email end |
#client_id ⇒ String (readonly)
Returns This is the unique identifier for the client.
20 21 22 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 20 def client_id @client_id end |
#client_x_509_cert_url ⇒ String (readonly)
Returns This is the URL of the public x509 certificate for the client.
28 29 30 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 28 def client_x_509_cert_url @client_x_509_cert_url end |
#private_key ⇒ String (readonly)
Returns This is the private key in PEM format. Note: This is not returned in the API.
16 17 18 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 16 def private_key @private_key end |
#private_key_id ⇒ String (readonly)
Returns This is the unique identifier for the private key.
13 14 15 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 13 def private_key_id @private_key_id end |
#project_id ⇒ String (readonly)
Returns This is the ID of the Google Cloud project associated with this key.
11 12 13 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 11 def project_id @project_id end |
#token_uri ⇒ String (readonly)
Returns This is the URI for the auth provider’s token endpoint.
24 25 26 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 24 def token_uri @token_uri end |
#type ⇒ String (readonly)
Returns This is the type of the key. Most likely, this is “service_account”.
9 10 11 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 9 def type @type end |
#universe_domain ⇒ String (readonly)
Returns This is the domain associated with the universe this service account belongs to.
30 31 32 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 30 def universe_domain @universe_domain end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::GcpKey
Deserialize a JSON object to an instance of GcpKey
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 86 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) type = parsed_json["type"] project_id = parsed_json["projectId"] private_key_id = parsed_json["privateKeyId"] private_key = parsed_json["privateKey"] client_email = parsed_json["clientEmail"] client_id = parsed_json["clientId"] auth_uri = parsed_json["authUri"] token_uri = parsed_json["tokenUri"] auth_provider_x_509_cert_url = parsed_json["authProviderX509CertUrl"] client_x_509_cert_url = parsed_json["clientX509CertUrl"] universe_domain = parsed_json["universeDomain"] new( type: type, project_id: project_id, private_key_id: private_key_id, private_key: private_key, client_email: client_email, client_id: client_id, auth_uri: auth_uri, token_uri: token_uri, auth_provider_x_509_cert_url: auth_provider_x_509_cert_url, client_x_509_cert_url: client_x_509_cert_url, universe_domain: universe_domain, 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.
129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 129 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.project_id.is_a?(String) != false || raise("Passed value for field obj.project_id is not the expected type, validation failed.") obj.private_key_id.is_a?(String) != false || raise("Passed value for field obj.private_key_id is not the expected type, validation failed.") obj.private_key.is_a?(String) != false || raise("Passed value for field obj.private_key is not the expected type, validation failed.") obj.client_email.is_a?(String) != false || raise("Passed value for field obj.client_email 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.auth_uri.is_a?(String) != false || raise("Passed value for field obj.auth_uri is not the expected type, validation failed.") obj.token_uri.is_a?(String) != false || raise("Passed value for field obj.token_uri is not the expected type, validation failed.") obj.auth_provider_x_509_cert_url.is_a?(String) != false || raise("Passed value for field obj.auth_provider_x_509_cert_url is not the expected type, validation failed.") obj.client_x_509_cert_url.is_a?(String) != false || raise("Passed value for field obj.client_x_509_cert_url is not the expected type, validation failed.") obj.universe_domain.is_a?(String) != false || raise("Passed value for field obj.universe_domain is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of GcpKey to a JSON object
119 120 121 |
# File 'lib/vapi_server_sdk/types/gcp_key.rb', line 119 def to_json(*_args) @_field_set&.to_json end |