Class: Vapi::SupabaseBucketPlan

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(region:, url:, access_key_id:, secret_access_key:, name:, path: OMIT, additional_properties: nil) ⇒ Vapi::SupabaseBucketPlan

Parameters:

  • region (Vapi::SupabaseBucketPlanRegion)

    This is the S3 Region. It should look like us-east-1 It should be one of the supabase regions defined in the SUPABASE_REGION enum Check supabase.com/docs/guides/platform/regions for up to date regions

  • url (String)

    This is the S3 compatible URL for Supabase S3 This should look like https://<project-ID>.supabase.co/storage/v1/s3

  • access_key_id (String)

    This is the Supabase S3 Access Key ID. The user creates this in the Supabase project Storage settings

  • secret_access_key (String)

    This is the Supabase S3 Secret Access Key. The user creates this in the Supabase project Storage settings along with the access key id

  • name (String)

    This is the Supabase S3 Bucket Name. The user must create this in Supabase under Storage > Buckets A bucket that does not exist will not be checked now, but file uploads will fail

  • path (String) (defaults to: OMIT)

    This is the Supabase S3 Bucket Folder Path. The user can create this in Supabase under Storage > Buckets A path that does not exist will not be checked now, but file uploads will fail A Path is like a folder in the bucket Eg. If the bucket is called “my-bucket” and the path is “my-folder”, the full path is “my-bucket/my-folder”

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 63

def initialize(region:, url:, access_key_id:, secret_access_key:, name:, path: OMIT, additional_properties: nil)
  @region = region
  @url = url
  @access_key_id = access_key_id
  @secret_access_key = secret_access_key
  @name = name
  @path = path if path != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "region": region,
    "url": url,
    "accessKeyId": access_key_id,
    "secretAccessKey": secret_access_key,
    "name": name,
    "path": path
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#access_key_idString (readonly)

Returns This is the Supabase S3 Access Key ID. The user creates this in the Supabase project Storage settings.

Returns:

  • (String)

    This is the Supabase S3 Access Key ID. The user creates this in the Supabase project Storage settings



18
19
20
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 18

def access_key_id
  @access_key_id
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



35
36
37
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 35

def additional_properties
  @additional_properties
end

#nameString (readonly)

Returns This is the Supabase S3 Bucket Name. The user must create this in Supabase under Storage > Buckets A bucket that does not exist will not be checked now, but file uploads will fail.

Returns:

  • (String)

    This is the Supabase S3 Bucket Name. The user must create this in Supabase under Storage > Buckets A bucket that does not exist will not be checked now, but file uploads will fail



26
27
28
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 26

def name
  @name
end

#pathString (readonly)

Returns This is the Supabase S3 Bucket Folder Path. The user can create this in Supabase under Storage > Buckets A path that does not exist will not be checked now, but file uploads will fail A Path is like a folder in the bucket Eg. If the bucket is called “my-bucket” and the path is “my-folder”, the full path is “my-bucket/my-folder”.

Returns:

  • (String)

    This is the Supabase S3 Bucket Folder Path. The user can create this in Supabase under Storage > Buckets A path that does not exist will not be checked now, but file uploads will fail A Path is like a folder in the bucket Eg. If the bucket is called “my-bucket” and the path is “my-folder”, the full path is “my-bucket/my-folder”



33
34
35
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 33

def path
  @path
end

#regionVapi::SupabaseBucketPlanRegion (readonly)

Returns This is the S3 Region. It should look like us-east-1 It should be one of the supabase regions defined in the SUPABASE_REGION enum Check supabase.com/docs/guides/platform/regions for up to date regions.

Returns:



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

def region
  @region
end

#secret_access_keyString (readonly)

Returns This is the Supabase S3 Secret Access Key. The user creates this in the Supabase project Storage settings along with the access key id.

Returns:

  • (String)

    This is the Supabase S3 Secret Access Key. The user creates this in the Supabase project Storage settings along with the access key id



22
23
24
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 22

def secret_access_key
  @secret_access_key
end

#urlString (readonly)

Returns This is the S3 compatible URL for Supabase S3 This should look like https://<project-ID>.supabase.co/storage/v1/s3.

Returns:

  • (String)

    This is the S3 compatible URL for Supabase S3 This should look like https://<project-ID>.supabase.co/storage/v1/s3



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

def url
  @url
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::SupabaseBucketPlan

Deserialize a JSON object to an instance of SupabaseBucketPlan

Parameters:

  • json_object (String)

Returns:



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 87

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  region = parsed_json["region"]
  url = parsed_json["url"]
  access_key_id = parsed_json["accessKeyId"]
  secret_access_key = parsed_json["secretAccessKey"]
  name = parsed_json["name"]
  path = parsed_json["path"]
  new(
    region: region,
    url: url,
    access_key_id: access_key_id,
    secret_access_key: secret_access_key,
    name: name,
    path: path,
    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)


120
121
122
123
124
125
126
127
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 120

def self.validate_raw(obj:)
  obj.region.is_a?(Vapi::SupabaseBucketPlanRegion) != false || raise("Passed value for field obj.region is not the expected type, validation failed.")
  obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
  obj.access_key_id.is_a?(String) != false || raise("Passed value for field obj.access_key_id is not the expected type, validation failed.")
  obj.secret_access_key.is_a?(String) != false || raise("Passed value for field obj.secret_access_key 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.path&.is_a?(String) != false || raise("Passed value for field obj.path is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of SupabaseBucketPlan to a JSON object

Returns:

  • (String)


110
111
112
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 110

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