View Source OpenAi.Certificates (OpenAI REST API Client v1.0.0)

Provides API endpoints related to certificates

Summary

Functions

Activate certificates at the organization level.

Activate certificates at the project level.

Deactivate certificates at the organization level.

Deactivate certificates at the project level.

Delete a certificate from the organization.

Get a certificate that has been uploaded to the organization.

List uploaded certificates for this organization.

List certificates for this project.

Modify a certificate. Note that only the name can be modified.

Upload a certificate to the organization. This does not automatically activate the certificate.

Functions

Link to this function

activate_organization_certificates(body, opts \\ [])

View Source
@spec activate_organization_certificates(
  body :: OpenAi.Certificate.ToggleRequest.t(),
  opts :: keyword()
) :: {:ok, OpenAi.Certificate.ListResponse.t()} | {:error, OpenAi.Error.error()}

Activate certificates at the organization level.

You can atomically and idempotently activate up to 10 certificates at a time.

Link to this function

activate_project_certificates(project_id, body, opts \\ [])

View Source
@spec activate_project_certificates(
  project_id :: String.t(),
  body :: OpenAi.Certificate.ToggleRequest.t(),
  opts :: keyword()
) :: {:ok, OpenAi.Certificate.ListResponse.t()} | {:error, OpenAi.Error.error()}

Activate certificates at the project level.

You can atomically and idempotently activate up to 10 certificates at a time.

Link to this function

deactivate_organization_certificates(body, opts \\ [])

View Source
@spec deactivate_organization_certificates(
  body :: OpenAi.Certificate.ToggleRequest.t(),
  opts :: keyword()
) :: {:ok, OpenAi.Certificate.ListResponse.t()} | {:error, OpenAi.Error.error()}

Deactivate certificates at the organization level.

You can atomically and idempotently deactivate up to 10 certificates at a time.

Link to this function

deactivate_project_certificates(project_id, body, opts \\ [])

View Source
@spec deactivate_project_certificates(
  project_id :: String.t(),
  body :: OpenAi.Certificate.ToggleRequest.t(),
  opts :: keyword()
) :: {:ok, OpenAi.Certificate.ListResponse.t()} | {:error, OpenAi.Error.error()}

Deactivate certificates at the project level.

You can atomically and idempotently deactivate up to 10 certificates at a time.

Link to this function

delete_certificate(certificate_id, opts \\ [])

View Source
@spec delete_certificate(certificate_id :: String.t(), opts :: keyword()) ::
  {:ok, OpenAi.Certificate.DeleteResponse.t()} | {:error, OpenAi.Error.error()}

Delete a certificate from the organization.

The certificate must be inactive for the organization and all projects.

Link to this function

get_certificate(certificate_id, opts \\ [])

View Source
@spec get_certificate(certificate_id :: String.t(), opts :: keyword()) ::
  {:ok, OpenAi.Certificate.t()} | {:error, OpenAi.Error.error()}

Get a certificate that has been uploaded to the organization.

You can get a certificate regardless of whether it is active or not.

Options

  • include: A list of additional fields to include in the response. Currently the only supported value is content to fetch the PEM content of the certificate.
Link to this function

list_organization_certificates(opts \\ [])

View Source
@spec list_organization_certificates(opts :: keyword()) ::
  {:ok, OpenAi.Certificate.ListResponse.t()} | {:error, OpenAi.Error.error()}

List uploaded certificates for this organization.

Options

  • limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

Link to this function

list_project_certificates(project_id, opts \\ [])

View Source
@spec list_project_certificates(project_id :: String.t(), opts :: keyword()) ::
  {:ok, OpenAi.Certificate.ListResponse.t()} | {:error, OpenAi.Error.error()}

List certificates for this project.

Options

  • limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

Link to this function

modify_certificate(certificate_id, body, opts \\ [])

View Source
@spec modify_certificate(
  certificate_id :: String.t(),
  body :: OpenAi.Certificate.UpdateRequest.t(),
  opts :: keyword()
) :: {:ok, OpenAi.Certificate.t()} | {:error, OpenAi.Error.error()}

Modify a certificate. Note that only the name can be modified.

Link to this function

upload_certificate(body, opts \\ [])

View Source
@spec upload_certificate(
  body :: OpenAi.Certificate.UploadRequest.t(),
  opts :: keyword()
) ::
  {:ok, OpenAi.Certificate.t()} | {:error, OpenAi.Error.error()}

Upload a certificate to the organization. This does not automatically activate the certificate.

Organizations can upload up to 50 certificates.