Class: Braintrust::Resources::ACLs
- Inherits:
-
Object
- Object
- Braintrust::Resources::ACLs
- Defined in:
- lib/braintrust/resources/acls.rb
Instance Method Summary collapse
-
#batch_update(params = {}, opts = {}) ⇒ Braintrust::Models::ACLBatchUpdateResponse
Batch update acls.
-
#create(params = {}, opts = {}) ⇒ Braintrust::Models::ACL
Create a new acl.
-
#delete(acl_id, opts = {}) ⇒ Braintrust::Models::ACL
Delete an acl object by its id.
-
#find_and_delete(params = {}, opts = {}) ⇒ Braintrust::Models::ACL
Delete a single acl.
-
#initialize(client:) ⇒ ACLs
constructor
A new instance of ACLs.
-
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::ACL>
List out all acls.
-
#retrieve(acl_id, opts = {}) ⇒ Braintrust::Models::ACL
Get an acl object by its id.
Constructor Details
#initialize(client:) ⇒ ACLs
Returns a new instance of ACLs.
6 7 8 |
# File 'lib/braintrust/resources/acls.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#batch_update(params = {}, opts = {}) ⇒ Braintrust::Models::ACLBatchUpdateResponse
Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect.
130 131 132 133 134 135 136 137 |
# File 'lib/braintrust/resources/acls.rb', line 130 def batch_update(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/v1/acl/batch-update" req[:body] = params req[:model] = Braintrust::Models::ACLBatchUpdateResponse @client.request(req, opts) end |
#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
31 32 33 34 35 36 37 38 |
# File 'lib/braintrust/resources/acls.rb', line 31 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
93 94 95 96 97 98 99 |
# File 'lib/braintrust/resources/acls.rb', line 93 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 |
#find_and_delete(params = {}, opts = {}) ⇒ Braintrust::Models::ACL
Delete a single acl
159 160 161 162 163 164 165 166 |
# File 'lib/braintrust/resources/acls.rb', line 159 def find_and_delete(params = {}, opts = {}) req = {} req[:method] = :delete req[:path] = "/v1/acl" req[:body] = params 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
77 78 79 80 81 82 83 84 85 |
# File 'lib/braintrust/resources/acls.rb', line 77 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 |
#retrieve(acl_id, opts = {}) ⇒ Braintrust::Models::ACL
Get an acl object by its id
46 47 48 49 50 51 52 |
# File 'lib/braintrust/resources/acls.rb', line 46 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 |