Class: Vapi::SupabaseBucketPlan
- Inherits:
-
Object
- Object
- Vapi::SupabaseBucketPlan
- Defined in:
- lib/vapi_server_sdk/types/supabase_bucket_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#access_key_id ⇒ String
readonly
This is the Supabase S3 Access Key ID.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#name ⇒ String
readonly
This is the Supabase S3 Bucket Name.
-
#path ⇒ String
readonly
This is the Supabase S3 Bucket Folder Path.
-
#region ⇒ Vapi::SupabaseBucketPlanRegion
readonly
This is the S3 Region.
-
#secret_access_key ⇒ String
readonly
This is the Supabase S3 Secret Access Key.
-
#url ⇒ String
readonly
This is the S3 compatible URL for Supabase S3 This should look like https://<project-ID>.supabase.co/storage/v1/s3.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::SupabaseBucketPlan
Deserialize a JSON object to an instance of SupabaseBucketPlan.
-
.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(region:, url:, access_key_id:, secret_access_key:, name:, path: OMIT, additional_properties: nil) ⇒ Vapi::SupabaseBucketPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of SupabaseBucketPlan to a JSON object.
Constructor Details
#initialize(region:, url:, access_key_id:, secret_access_key:, name:, path: OMIT, additional_properties: nil) ⇒ Vapi::SupabaseBucketPlan
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_id ⇒ String (readonly)
Returns 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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#name ⇒ String (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.
26 27 28 |
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 26 def name @name end |
#path ⇒ String (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”.
33 34 35 |
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 33 def path @path end |
#region ⇒ Vapi::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.
12 13 14 |
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 12 def region @region end |
#secret_access_key ⇒ String (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.
22 23 24 |
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 22 def secret_access_key @secret_access_key end |
#url ⇒ String (readonly)
Returns 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
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.
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
110 111 112 |
# File 'lib/vapi_server_sdk/types/supabase_bucket_plan.rb', line 110 def to_json(*_args) @_field_set&.to_json end |