Class: Cadenya::Resources::AIProviderKeys
- Inherits:
-
Object
- Object
- Cadenya::Resources::AIProviderKeys
- Defined in:
- lib/cadenya/resources/ai_provider_keys.rb
Instance Method Summary collapse
-
#create(workspace_id, metadata:, spec:, request_options: {}) ⇒ Cadenya::Models::AIProviderKey
Some parameter documentations has been truncated, see Models::AIProviderKeyCreateParams for more details.
-
#delete(id, workspace_id:, request_options: {}) ⇒ nil
Deletes an AI provider key from the workspace.
-
#initialize(client:) ⇒ AIProviderKeys
constructor
private
A new instance of AIProviderKeys.
-
#list(workspace_id, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::AIProviderKey>
Some parameter documentations has been truncated, see Models::AIProviderKeyListParams for more details.
-
#retrieve(id, workspace_id:, request_options: {}) ⇒ Cadenya::Models::AIProviderKey
Retrieves an AI provider key by ID from the workspace.
-
#update(id, workspace_id:, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::AIProviderKey
Some parameter documentations has been truncated, see Models::AIProviderKeyUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ AIProviderKeys
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 AIProviderKeys.
168 169 170 |
# File 'lib/cadenya/resources/ai_provider_keys.rb', line 168 def initialize(client:) @client = client end |
Instance Method Details
#create(workspace_id, metadata:, spec:, request_options: {}) ⇒ Cadenya::Models::AIProviderKey
Some parameter documentations has been truncated, see Models::AIProviderKeyCreateParams for more details.
Creates a new customer-provided AI provider key in the workspace
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cadenya/resources/ai_provider_keys.rb', line 24 def create(workspace_id, params) parsed, = Cadenya::AIProviderKeyCreateParams.dump_request(params) @client.request( method: :post, path: ["v1/workspaces/%1$s/ai_provider_keys", workspace_id], body: parsed, model: Cadenya::AIProviderKey, options: ) end |
#delete(id, workspace_id:, request_options: {}) ⇒ nil
Deletes an AI provider key from the workspace
151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/cadenya/resources/ai_provider_keys.rb', line 151 def delete(id, params) parsed, = Cadenya::AIProviderKeyDeleteParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["v1/workspaces/%1$s/ai_provider_keys/%2$s", workspace_id, id], model: NilClass, options: ) end |
#list(workspace_id, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::AIProviderKey>
Some parameter documentations has been truncated, see Models::AIProviderKeyListParams for more details.
Lists all customer-provided AI provider keys in the workspace
125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/cadenya/resources/ai_provider_keys.rb', line 125 def list(workspace_id, params = {}) parsed, = Cadenya::AIProviderKeyListParams.dump_request(params) query = Cadenya::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/workspaces/%1$s/ai_provider_keys", workspace_id], query: query.transform_keys(include_info: "includeInfo", sort_order: "sortOrder"), page: Cadenya::Internal::CursorPagination, model: Cadenya::AIProviderKey, options: ) end |
#retrieve(id, workspace_id:, request_options: {}) ⇒ Cadenya::Models::AIProviderKey
Retrieves an AI provider key by ID from the workspace
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/cadenya/resources/ai_provider_keys.rb', line 48 def retrieve(id, params) parsed, = Cadenya::AIProviderKeyRetrieveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/workspaces/%1$s/ai_provider_keys/%2$s", workspace_id, id], model: Cadenya::AIProviderKey, options: ) end |
#update(id, workspace_id:, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::AIProviderKey
Some parameter documentations has been truncated, see Models::AIProviderKeyUpdateParams for more details.
Updates an AI provider key’s name or key value in the workspace
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/cadenya/resources/ai_provider_keys.rb', line 84 def update(id, params) parsed, = Cadenya::AIProviderKeyUpdateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["v1/workspaces/%1$s/ai_provider_keys/%2$s", workspace_id, id], body: parsed, model: Cadenya::AIProviderKey, options: ) end |