Class: Vapi::UpdateGcpCredentialDto
- Inherits:
-
Object
- Object
- Vapi::UpdateGcpCredentialDto
- Defined in:
- lib/vapi_server_sdk/types/update_gcp_credential_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#bucket_plan ⇒ Vapi::BucketPlan
readonly
This is the bucket plan that can be provided to store call artifacts in GCP.
-
#gcp_key ⇒ Vapi::GcpKey
readonly
This is the GCP key.
-
#name ⇒ String
readonly
This is the name of credential.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::UpdateGcpCredentialDto
Deserialize a JSON object to an instance of UpdateGcpCredentialDto.
-
.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(name: OMIT, gcp_key: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::UpdateGcpCredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateGcpCredentialDto to a JSON object.
Constructor Details
#initialize(name: OMIT, gcp_key: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::UpdateGcpCredentialDto
35 36 37 38 39 40 41 42 43 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 35 def initialize(name: OMIT, gcp_key: OMIT, bucket_plan: OMIT, additional_properties: nil) @name = name if name != OMIT @gcp_key = gcp_key if gcp_key != OMIT @bucket_plan = bucket_plan if bucket_plan != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "gcpKey": gcp_key, "bucketPlan": bucket_plan }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 20 def additional_properties @additional_properties end |
#bucket_plan ⇒ Vapi::BucketPlan (readonly)
Returns This is the bucket plan that can be provided to store call artifacts in GCP.
18 19 20 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 18 def bucket_plan @bucket_plan end |
#gcp_key ⇒ Vapi::GcpKey (readonly)
Returns This is the GCP key. This is the JSON that can be generated in the Google Cloud
Console at
le.cloud.google.com/iam-admin/serviceaccounts/details/
16 17 18 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 16 def gcp_key @gcp_key end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
11 12 13 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 11 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::UpdateGcpCredentialDto
Deserialize a JSON object to an instance of UpdateGcpCredentialDto
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 49 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] if parsed_json["gcpKey"].nil? gcp_key = nil else gcp_key = parsed_json["gcpKey"].to_json gcp_key = Vapi::GcpKey.from_json(json_object: gcp_key) end if parsed_json["bucketPlan"].nil? bucket_plan = nil else bucket_plan = parsed_json["bucketPlan"].to_json bucket_plan = Vapi::BucketPlan.from_json(json_object: bucket_plan) end new( name: name, gcp_key: gcp_key, bucket_plan: bucket_plan, 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.
86 87 88 89 90 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 86 def self.validate_raw(obj:) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.gcp_key.nil? || Vapi::GcpKey.validate_raw(obj: obj.gcp_key) obj.bucket_plan.nil? || Vapi::BucketPlan.validate_raw(obj: obj.bucket_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateGcpCredentialDto to a JSON object
76 77 78 |
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 76 def to_json(*_args) @_field_set&.to_json end |