Class: Braintrust::Resources::AISecrets
- Inherits:
-
Object
- Object
- Braintrust::Resources::AISecrets
- Defined in:
- lib/braintrust/resources/ai_secrets.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Create a new ai_secret.
-
#delete(ai_secret_id, opts = {}) ⇒ Braintrust::Models::AISecret
Delete an ai_secret object by its id.
-
#find_and_delete(params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Delete a single ai_secret.
-
#initialize(client:) ⇒ AISecrets
constructor
A new instance of AISecrets.
-
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::AISecret>
List out all ai_secrets.
-
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Create or replace ai_secret.
-
#retrieve(ai_secret_id, opts = {}) ⇒ Braintrust::Models::AISecret
Get an ai_secret object by its id.
-
#update(ai_secret_id, params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Partially update an ai_secret object.
Constructor Details
#initialize(client:) ⇒ AISecrets
Returns a new instance of AISecrets.
6 7 8 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified
26 27 28 29 30 31 32 33 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 26 def create(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/v1/ai_secret" req[:body] = params req[:model] = Braintrust::Models::AISecret @client.request(req, opts) end |
#delete(ai_secret_id, opts = {}) ⇒ Braintrust::Models::AISecret
Delete an ai_secret object by its id
113 114 115 116 117 118 119 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 113 def delete(ai_secret_id, opts = {}) req = {} req[:method] = :delete req[:path] = "/v1/ai_secret/#{ai_secret_id}" req[:model] = Braintrust::Models::AISecret @client.request(req, opts) end |
#find_and_delete(params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Delete a single ai_secret
132 133 134 135 136 137 138 139 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 132 def find_and_delete(params = {}, opts = {}) req = {} req[:method] = :delete req[:path] = "/v1/ai_secret" req[:body] = params req[:model] = Braintrust::Models::AISecret @client.request(req, opts) end |
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::AISecret>
List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first
97 98 99 100 101 102 103 104 105 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 97 def list(params = {}, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/ai_secret" req[:query] = params req[:page] = Braintrust::ListObjects req[:model] = Braintrust::Models::AISecret @client.request(req, opts) end |
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields
158 159 160 161 162 163 164 165 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 158 def replace(params = {}, opts = {}) req = {} req[:method] = :put req[:path] = "/v1/ai_secret" req[:body] = params req[:model] = Braintrust::Models::AISecret @client.request(req, opts) end |
#retrieve(ai_secret_id, opts = {}) ⇒ Braintrust::Models::AISecret
Get an ai_secret object by its id
41 42 43 44 45 46 47 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 41 def retrieve(ai_secret_id, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/ai_secret/#{ai_secret_id}" req[:model] = Braintrust::Models::AISecret @client.request(req, opts) end |
#update(ai_secret_id, params = {}, opts = {}) ⇒ Braintrust::Models::AISecret
Partially update an ai_secret object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
64 65 66 67 68 69 70 71 |
# File 'lib/braintrust/resources/ai_secrets.rb', line 64 def update(ai_secret_id, params = {}, opts = {}) req = {} req[:method] = :patch req[:path] = "/v1/ai_secret/#{ai_secret_id}" req[:body] = params req[:model] = Braintrust::Models::AISecret @client.request(req, opts) end |