Class: OpenAI::Resources::Admin::Organization::Projects::ServiceAccounts::APIKeys
- Inherits:
-
Object
- Object
- OpenAI::Resources::Admin::Organization::Projects::ServiceAccounts::APIKeys
- Defined in:
- lib/openai/resources/admin/organization/projects/service_accounts/api_keys.rb,
sig/openai/resources/admin/organization/projects/service_accounts/api_keys.rbs
Instance Method Summary collapse
-
#create(service_account_id, project_id:, name: nil, scopes: nil, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::Projects::ServiceAccounts::APIKeyCreateResponse
Creates an API key for a service account in the project.
-
#initialize(client:) ⇒ APIKeys
constructor
private
A new instance of APIKeys.
Constructor Details
#initialize(client:) ⇒ APIKeys
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 APIKeys.
51 52 53 |
# File 'lib/openai/resources/admin/organization/projects/service_accounts/api_keys.rb', line 51 def initialize(client:) @client = client end |
Instance Method Details
#create(service_account_id, project_id:, name: nil, scopes: nil, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::Projects::ServiceAccounts::APIKeyCreateResponse
Creates an API key for a service account in the project.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/openai/resources/admin/organization/projects/service_accounts/api_keys.rb', line 27 def create(service_account_id, params) parsed, = OpenAI::Admin::Organization::Projects::ServiceAccounts::APIKeyCreateParams.dump_request(params) project_id = parsed.delete(:project_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: [ "organization/projects/%1$s/service_accounts/%2$s/api_keys", project_id, service_account_id ], body: parsed, model: OpenAI::Models::Admin::Organization::Projects::ServiceAccounts::APIKeyCreateResponse, security: {admin_api_key_auth: true}, options: ) end |