Class: Braintrust::Resources::ACL
- Inherits:
-
Object
- Object
- Braintrust::Resources::ACL
- Defined in:
- lib/braintrust/resources/acl.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Braintrust::Models::ACL
Create a new acl.
-
#delete(acl_id, opts = {}) ⇒ Braintrust::Models::ACL
Delete an acl object by its id.
-
#initialize(client:) ⇒ ACL
constructor
A new instance of ACL.
-
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::ACL>
List out all acls.
-
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::ACL
NOTE: This operation is deprecated and will be removed in a future revision of the API.
-
#retrieve(acl_id, opts = {}) ⇒ Braintrust::Models::ACL
Get an acl object by its id.
Constructor Details
#initialize(client:) ⇒ ACL
Returns a new instance of ACL.
6 7 8 |
# File 'lib/braintrust/resources/acl.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Braintrust::Models::ACL
Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified
29 30 31 32 33 34 35 36 |
# File 'lib/braintrust/resources/acl.rb', line 29 def create(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/v1/acl" req[:body] = params req[:model] = Braintrust::Models::ACL @client.request(req, opts) end |
#delete(acl_id, opts = {}) ⇒ Braintrust::Models::ACL
Delete an acl object by its id
89 90 91 92 93 94 95 |
# File 'lib/braintrust/resources/acl.rb', line 89 def delete(acl_id, opts = {}) req = {} req[:method] = :delete req[:path] = "/v1/acl/#{acl_id}" req[:model] = Braintrust::Models::ACL @client.request(req, opts) end |
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::ACL>
List out all acls. The acls are sorted by creation date, with the most recently-created acls coming first
73 74 75 76 77 78 79 80 81 |
# File 'lib/braintrust/resources/acl.rb', line 73 def list(params = {}, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/acl" req[:query] = params req[:page] = Braintrust::ListObjects req[:model] = Braintrust::Models::ACL @client.request(req, opts) end |
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::ACL
NOTE: This operation is deprecated and will be removed in a future revision of the API. Create or replace a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified, will replace the existing acl with the provided fields
118 119 120 121 122 123 124 125 |
# File 'lib/braintrust/resources/acl.rb', line 118 def replace(params = {}, opts = {}) req = {} req[:method] = :put req[:path] = "/v1/acl" req[:body] = params req[:model] = Braintrust::Models::ACL @client.request(req, opts) end |
#retrieve(acl_id, opts = {}) ⇒ Braintrust::Models::ACL
Get an acl object by its id
44 45 46 47 48 49 50 |
# File 'lib/braintrust/resources/acl.rb', line 44 def retrieve(acl_id, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/acl/#{acl_id}" req[:model] = Braintrust::Models::ACL @client.request(req, opts) end |