Class: Braintrust::Resources::ProjectTags
- Inherits:
-
Object
- Object
- Braintrust::Resources::ProjectTags
- Defined in:
- lib/braintrust/resources/project_tags.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectTag
Create a new project_tag.
-
#delete(project_tag_id, opts = {}) ⇒ Braintrust::Models::ProjectTag
Delete a project_tag object by its id.
-
#initialize(client:) ⇒ ProjectTags
constructor
A new instance of ProjectTags.
-
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::ProjectTag>
List out all project_tags.
-
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectTag
Create or replace project_tag.
-
#retrieve(project_tag_id, opts = {}) ⇒ Braintrust::Models::ProjectTag
Get a project_tag object by its id.
-
#update(project_tag_id, params = {}, opts = {}) ⇒ Braintrust::Models::ProjectTag
Partially update a project_tag object.
Constructor Details
#initialize(client:) ⇒ ProjectTags
Returns a new instance of ProjectTags.
6 7 8 |
# File 'lib/braintrust/resources/project_tags.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectTag
Create a new project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will return the existing project_tag unmodified
23 24 25 26 27 28 29 30 |
# File 'lib/braintrust/resources/project_tags.rb', line 23 def create(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/v1/project_tag" req[:body] = params req[:model] = Braintrust::Models::ProjectTag @client.request(req, opts) end |
#delete(project_tag_id, opts = {}) ⇒ Braintrust::Models::ProjectTag
Delete a project_tag object by its id
110 111 112 113 114 115 116 |
# File 'lib/braintrust/resources/project_tags.rb', line 110 def delete(project_tag_id, opts = {}) req = {} req[:method] = :delete req[:path] = "/v1/project_tag/#{project_tag_id}" req[:model] = Braintrust::Models::ProjectTag @client.request(req, opts) end |
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::ProjectTag>
List out all project_tags. The project_tags are sorted by creation date, with the most recently-created project_tags coming first
94 95 96 97 98 99 100 101 102 |
# File 'lib/braintrust/resources/project_tags.rb', line 94 def list(params = {}, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/project_tag" req[:query] = params req[:page] = Braintrust::ListObjects req[:model] = Braintrust::Models::ProjectTag @client.request(req, opts) end |
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectTag
Create or replace project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will replace the existing project_tag with the provided fields
131 132 133 134 135 136 137 138 |
# File 'lib/braintrust/resources/project_tags.rb', line 131 def replace(params = {}, opts = {}) req = {} req[:method] = :put req[:path] = "/v1/project_tag" req[:body] = params req[:model] = Braintrust::Models::ProjectTag @client.request(req, opts) end |
#retrieve(project_tag_id, opts = {}) ⇒ Braintrust::Models::ProjectTag
Get a project_tag object by its id
38 39 40 41 42 43 44 |
# File 'lib/braintrust/resources/project_tags.rb', line 38 def retrieve(project_tag_id, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/project_tag/#{project_tag_id}" req[:model] = Braintrust::Models::ProjectTag @client.request(req, opts) end |
#update(project_tag_id, params = {}, opts = {}) ⇒ Braintrust::Models::ProjectTag
Partially update a project_tag 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.
60 61 62 63 64 65 66 67 |
# File 'lib/braintrust/resources/project_tags.rb', line 60 def update(project_tag_id, params = {}, opts = {}) req = {} req[:method] = :patch req[:path] = "/v1/project_tag/#{project_tag_id}" req[:body] = params req[:model] = Braintrust::Models::ProjectTag @client.request(req, opts) end |