Class: OpenAI::Resources::Admin::Organization::Projects::Certificates

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/resources/admin/organization/projects/certificates.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Certificates

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

Parameters:



102
103
104
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 102

def initialize(client:)
  @client = client
end

Instance Method Details

#activate(project_id, certificate_ids:, request_options: {}) ⇒ OpenAI::Internal::Page<OpenAI::Models::Admin::Organization::Projects::CertificateActivateResponse>

Activate certificates at the project level.

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

Parameters:

  • project_id (String)

    The ID of the project.

  • certificate_ids (Array<String>)
  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 59

def activate(project_id, params)
  parsed, options = OpenAI::Admin::Organization::Projects::CertificateActivateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["organization/projects/%1$s/certificates/activate", project_id],
    body: parsed,
    page: OpenAI::Internal::Page,
    model: OpenAI::Models::Admin::Organization::Projects::CertificateActivateResponse,
    security: {admin_api_key_auth: true},
    options: options
  )
end

#deactivate(project_id, certificate_ids:, request_options: {}) ⇒ OpenAI::Internal::Page<OpenAI::Models::Admin::Organization::Projects::CertificateDeactivateResponse>

Deactivate certificates at the project level. You can atomically and idempotently deactivate up to 10 certificates at a time.

Parameters:

  • project_id (String)

    The ID of the project.

  • certificate_ids (Array<String>)
  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 86

def deactivate(project_id, params)
  parsed, options = OpenAI::Admin::Organization::Projects::CertificateDeactivateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["organization/projects/%1$s/certificates/deactivate", project_id],
    body: parsed,
    page: OpenAI::Internal::Page,
    model: OpenAI::Models::Admin::Organization::Projects::CertificateDeactivateResponse,
    security: {admin_api_key_auth: true},
    options: options
  )
end

#list(project_id, after: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Admin::Organization::Projects::CertificateListResponse>

Some parameter documentations has been truncated, see Models::Admin::Organization::Projects::CertificateListParams for more details.

List certificates for this project.

Parameters:

  • project_id (String)

    The ID of the project.

  • after (String)

    A cursor for use in pagination. ‘after` is an object ID that defines your place

  • limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 1

  • order (Symbol, OpenAI::Models::Admin::Organization::Projects::CertificateListParams::Order)

    Sort order by the ‘created_at` timestamp of the objects. `asc` for ascending ord

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

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 30

def list(project_id, params = {})
  parsed, options = OpenAI::Admin::Organization::Projects::CertificateListParams.dump_request(params)
  query = OpenAI::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["organization/projects/%1$s/certificates", project_id],
    query: query,
    page: OpenAI::Internal::ConversationCursorPage,
    model: OpenAI::Models::Admin::Organization::Projects::CertificateListResponse,
    security: {admin_api_key_auth: true},
    options: options
  )
end