Class: Telnyx::Resources::Storage::Buckets::SslCertificate

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/storage/buckets/ssl_certificate.rb

Overview

SSL certificate operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SslCertificate

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 SslCertificate.

Parameters:



80
81
82
# File 'lib/telnyx/resources/storage/buckets/ssl_certificate.rb', line 80

def initialize(client:)
  @client = client
end

Instance Method Details

#create(bucket_name, certificate: nil, private_key: nil, request_options: {}) ⇒ Telnyx::Models::Storage::Buckets::SslCertificateCreateResponse

Uploads an SSL certificate and its matching secret so that you can use Telnyx’s storage as your CDN.

Parameters:

  • bucket_name (String)

    The name of the bucket

  • certificate (Pathname, StringIO, IO, String, Telnyx::FilePart)

    The SSL certificate file

  • private_key (Pathname, StringIO, IO, String, Telnyx::FilePart)

    The private key file

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/telnyx/resources/storage/buckets/ssl_certificate.rb', line 25

def create(bucket_name, params = {})
  parsed, options = Telnyx::Storage::Buckets::SslCertificateCreateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["storage/buckets/%1$s/ssl_certificate", bucket_name],
    headers: {"content-type" => "multipart/form-data"},
    body: parsed,
    model: Telnyx::Models::Storage::Buckets::SslCertificateCreateResponse,
    options: options
  )
end

#delete(bucket_name, request_options: {}) ⇒ Telnyx::Models::Storage::Buckets::SslCertificateDeleteResponse

Deletes an SSL certificate and its matching secret.

Parameters:

Returns:

See Also:



68
69
70
71
72
73
74
75
# File 'lib/telnyx/resources/storage/buckets/ssl_certificate.rb', line 68

def delete(bucket_name, params = {})
  @client.request(
    method: :delete,
    path: ["storage/buckets/%1$s/ssl_certificate", bucket_name],
    model: Telnyx::Models::Storage::Buckets::SslCertificateDeleteResponse,
    options: params[:request_options]
  )
end

#retrieve(bucket_name, request_options: {}) ⇒ Telnyx::Models::Storage::Buckets::SslCertificateRetrieveResponse

Returns the stored certificate detail of a bucket, if applicable.

Parameters:

  • bucket_name (String)

    The name of the bucket

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



48
49
50
51
52
53
54
55
# File 'lib/telnyx/resources/storage/buckets/ssl_certificate.rb', line 48

def retrieve(bucket_name, params = {})
  @client.request(
    method: :get,
    path: ["storage/buckets/%1$s/ssl_certificate", bucket_name],
    model: Telnyx::Models::Storage::Buckets::SslCertificateRetrieveResponse,
    options: params[:request_options]
  )
end