Class: Vapi::CreateSupabaseCredentialDto

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/create_supabase_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, bucket_plan: OMIT, name: OMIT, additional_properties: nil) ⇒ Vapi::CreateSupabaseCredentialDto

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.

  • bucket_plan (Vapi::SupabaseBucketPlan) (defaults to: OMIT)
  • name (String) (defaults to: OMIT)

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

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



30
31
32
33
34
35
36
37
38
# File 'lib/vapi_server_sdk/types/create_supabase_credential_dto.rb', line 30

def initialize(fallback_index: OMIT, bucket_plan: OMIT, name: OMIT, additional_properties: nil)
  @fallback_index = fallback_index if fallback_index != OMIT
  @bucket_plan = bucket_plan if bucket_plan != OMIT
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = { "fallbackIndex": fallback_index, "bucketPlan": bucket_plan, "name": name }.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



17
18
19
# File 'lib/vapi_server_sdk/types/create_supabase_credential_dto.rb', line 17

def additional_properties
  @additional_properties
end

#bucket_planVapi::SupabaseBucketPlan (readonly)



13
14
15
# File 'lib/vapi_server_sdk/types/create_supabase_credential_dto.rb', line 13

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.



11
12
13
# File 'lib/vapi_server_sdk/types/create_supabase_credential_dto.rb', line 11

def fallback_index
  @fallback_index
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.



15
16
17
# File 'lib/vapi_server_sdk/types/create_supabase_credential_dto.rb', line 15

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::CreateSupabaseCredentialDto

Deserialize a JSON object to an instance of CreateSupabaseCredentialDto

Parameters:

  • json_object (String)

Returns:



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

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"]
  if parsed_json["bucketPlan"].nil?
    bucket_plan = nil
  else
    bucket_plan = parsed_json["bucketPlan"].to_json
    bucket_plan = Vapi::SupabaseBucketPlan.from_json(json_object: bucket_plan)
  end
  name = parsed_json["name"]
  new(
    fallback_index: fallback_index,
    bucket_plan: bucket_plan,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


76
77
78
79
80
# File 'lib/vapi_server_sdk/types/create_supabase_credential_dto.rb', line 76

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.bucket_plan.nil? || Vapi::SupabaseBucketPlan.validate_raw(obj: obj.bucket_plan)
  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 CreateSupabaseCredentialDto to a JSON object

Returns:

  • (String)


66
67
68
# File 'lib/vapi_server_sdk/types/create_supabase_credential_dto.rb', line 66

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