Class: Vapi::UpdateGcpCredentialDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fallback_index: OMIT, name: OMIT, gcp_key: OMIT, region: OMIT, bucket_plan: OMIT, additional_properties: nil) ⇒ Vapi::UpdateGcpCredentialDto

Parameters:

  • fallback_index (Float) (defaults to: OMIT)

    This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.

  • name (String) (defaults to: OMIT)

    This is the name of credential. This is just for your reference.

  • gcp_key (Vapi::GcpKey) (defaults to: OMIT)

    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/<service-account-id>/keys. The schema is identical to the JSON that GCP outputs.

  • region (String) (defaults to: OMIT)

    This is the region of the GCP resource.

  • bucket_plan (Vapi::BucketPlan) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

def initialize(fallback_index: OMIT, name: OMIT, gcp_key: OMIT, region: OMIT, bucket_plan: OMIT,
               additional_properties: nil)
  @fallback_index = fallback_index if fallback_index != OMIT
  @name = name if name != OMIT
  @gcp_key = gcp_key if gcp_key != OMIT
  @region = region if region != OMIT
  @bucket_plan = bucket_plan if bucket_plan != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "fallbackIndex": fallback_index,
    "name": name,
    "gcpKey": gcp_key,
    "region": region,
    "bucketPlan": bucket_plan
  }.reject do |_k, v|
    v == OMIT
  end
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



25
26
27
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 25

def additional_properties
  @additional_properties
end

#bucket_planVapi::BucketPlan (readonly)

Returns:



23
24
25
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 23

def bucket_plan
  @bucket_plan
end

#fallback_indexFloat (readonly)

Returns This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.

Returns:

  • (Float)

    This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.



12
13
14
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 12

def fallback_index
  @fallback_index
end

#gcp_keyVapi::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/<service-account-id>/keys. The schema is identical to the JSON that GCP outputs.

Returns:

  • (Vapi::GcpKey)

    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/<service-account-id>/keys. The schema is identical to the JSON that GCP outputs.



19
20
21
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 19

def gcp_key
  @gcp_key
end

#nameString (readonly)

Returns This is the name of credential. This is just for your reference.

Returns:

  • (String)

    This is the name of credential. This is just for your reference.



14
15
16
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 14

def name
  @name
end

#regionString (readonly)

Returns This is the region of the GCP resource.

Returns:

  • (String)

    This is the region of the GCP resource.



21
22
23
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 21

def region
  @region
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::UpdateGcpCredentialDto

Deserialize a JSON object to an instance of UpdateGcpCredentialDto

Parameters:

  • json_object (String)

Returns:



66
67
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
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 66

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  fallback_index = parsed_json["fallbackIndex"]
  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
  region = parsed_json["region"]
  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(
    fallback_index: fallback_index,
    name: name,
    gcp_key: gcp_key,
    region: region,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


107
108
109
110
111
112
113
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 107

def self.validate_raw(obj:)
  obj.fallback_index&.is_a?(Float) != false || raise("Passed value for field obj.fallback_index 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.")
  obj.gcp_key.nil? || Vapi::GcpKey.validate_raw(obj: obj.gcp_key)
  obj.region&.is_a?(String) != false || raise("Passed value for field obj.region is not the expected type, validation failed.")
  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

Returns:

  • (String)


97
98
99
# File 'lib/vapi_server_sdk/types/update_gcp_credential_dto.rb', line 97

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