Class: Telnyx::Resources::Storage::Buckets
- Inherits:
-
Object
- Object
- Telnyx::Resources::Storage::Buckets
- Defined in:
- lib/telnyx/resources/storage/buckets.rb,
lib/telnyx/resources/storage/buckets/usage.rb,
lib/telnyx/resources/storage/buckets/ssl_certificate.rb
Defined Under Namespace
Classes: SslCertificate, Usage
Instance Attribute Summary collapse
- #ssl_certificate ⇒ Telnyx::Resources::Storage::Buckets::SslCertificate readonly
- #usage ⇒ Telnyx::Resources::Storage::Buckets::Usage readonly
Instance Method Summary collapse
-
#create_presigned_url(object_name, bucket_name:, ttl: nil, request_options: {}) ⇒ Telnyx::Models::Storage::BucketCreatePresignedURLResponse
Returns a timed and authenticated URL to download (GET) or upload (PUT) an object.
-
#initialize(client:) ⇒ Buckets
constructor
private
A new instance of Buckets.
Constructor Details
#initialize(client:) ⇒ Buckets
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Buckets.
51 52 53 54 55 |
# File 'lib/telnyx/resources/storage/buckets.rb', line 51 def initialize(client:) @client = client @ssl_certificate = Telnyx::Resources::Storage::Buckets::SslCertificate.new(client: client) @usage = Telnyx::Resources::Storage::Buckets::Usage.new(client: client) end |
Instance Attribute Details
#ssl_certificate ⇒ Telnyx::Resources::Storage::Buckets::SslCertificate (readonly)
8 9 10 |
# File 'lib/telnyx/resources/storage/buckets.rb', line 8 def ssl_certificate @ssl_certificate end |
#usage ⇒ Telnyx::Resources::Storage::Buckets::Usage (readonly)
11 12 13 |
# File 'lib/telnyx/resources/storage/buckets.rb', line 11 def usage @usage end |
Instance Method Details
#create_presigned_url(object_name, bucket_name:, ttl: nil, request_options: {}) ⇒ Telnyx::Models::Storage::BucketCreatePresignedURLResponse
Returns a timed and authenticated URL to download (GET) or upload (PUT) an object. This is the equivalent to AWS S3’s “presigned” URL. Please note that Telnyx performs authentication differently from AWS S3 and you MUST NOT use the presign method of AWS s3api CLI or SDK to generate the presigned URL.
Refer to: developers.telnyx.com/docs/cloud-storage/presigned-urls
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/telnyx/resources/storage/buckets.rb', line 33 def create_presigned_url(object_name, params) parsed, = Telnyx::Storage::BucketCreatePresignedURLParams.dump_request(params) bucket_name = parsed.delete(:bucket_name) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["storage/buckets/%1$s/%2$s/presigned_url", bucket_name, object_name], body: parsed, model: Telnyx::Models::Storage::BucketCreatePresignedURLResponse, options: ) end |