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

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

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:



109
110
111
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 109

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:



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 65

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:



93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 93

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>

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

  • limit (Integer) —

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

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

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

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

Returns:

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/openai/resources/admin/organization/projects/certificates.rb', line 35

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