Class: Anthropic::Resources::Beta::Sessions::Resources
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Sessions::Resources
- Defined in:
- lib/anthropic/resources/beta/sessions/resources.rb
Instance Method Summary collapse
-
#add(session_id, file_id:, type:, mount_path: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource
Some parameter documentations has been truncated, see Models::Beta::Sessions::ResourceAddParams for more details.
-
#delete(resource_id, session_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsDeleteSessionResource
Delete Session Resource.
-
#initialize(client:) ⇒ Resources
constructor
private
A new instance of Resources.
-
#list(session_id, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Sessions::BetaManagedAgentsGitHubRepositoryResource, Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource>
Some parameter documentations has been truncated, see Models::Beta::Sessions::ResourceListParams for more details.
-
#retrieve(resource_id, session_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsGitHubRepositoryResource, Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource
Get Session Resource.
-
#update(resource_id, session_id:, authorization_token:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsGitHubRepositoryResource, Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource
Some parameter documentations has been truncated, see Models::Beta::Sessions::ResourceUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Resources
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 Resources.
178 179 180 |
# File 'lib/anthropic/resources/beta/sessions/resources.rb', line 178 def initialize(client:) @client = client end |
Instance Method Details
#add(session_id, file_id:, type:, mount_path: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource
Some parameter documentations has been truncated, see Models::Beta::Sessions::ResourceAddParams for more details.
Add Session Resource
162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/anthropic/resources/beta/sessions/resources.rb', line 162 def add(session_id, params) parsed, = Anthropic::Beta::Sessions::ResourceAddParams.dump_request(params) header_params = {betas: "anthropic-beta"} @client.request( method: :post, path: ["v1/sessions/%1$s/resources?beta=true", session_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::Sessions::BetaManagedAgentsFileResource, options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **} ) end |
#delete(resource_id, session_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsDeleteSessionResource
Delete Session Resource
125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/anthropic/resources/beta/sessions/resources.rb', line 125 def delete(resource_id, params) parsed, = Anthropic::Beta::Sessions::ResourceDeleteParams.dump_request(params) session_id = parsed.delete(:session_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["v1/sessions/%1$s/resources/%2$s?beta=true", session_id, resource_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::Sessions::BetaManagedAgentsDeleteSessionResource, options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **} ) end |
#list(session_id, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Sessions::BetaManagedAgentsGitHubRepositoryResource, Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource>
Some parameter documentations has been truncated, see Models::Beta::Sessions::ResourceListParams for more details.
List Session Resources
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/anthropic/resources/beta/sessions/resources.rb', line 95 def list(session_id, params = {}) query_params = [:limit, :page] parsed, = Anthropic::Beta::Sessions::ResourceListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["v1/sessions/%1$s/resources?beta=true", session_id], query: query, headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"), page: Anthropic::Internal::PageCursor, model: Anthropic::Beta::Sessions::BetaManagedAgentsSessionResource, options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **} ) end |
#retrieve(resource_id, session_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsGitHubRepositoryResource, Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource
Get Session Resource
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/anthropic/resources/beta/sessions/resources.rb', line 23 def retrieve(resource_id, params) parsed, = Anthropic::Beta::Sessions::ResourceRetrieveParams.dump_request(params) session_id = parsed.delete(:session_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/sessions/%1$s/resources/%2$s?beta=true", session_id, resource_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Models::Beta::Sessions::ResourceRetrieveResponse, options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **} ) end |
#update(resource_id, session_id:, authorization_token:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Sessions::BetaManagedAgentsGitHubRepositoryResource, Anthropic::Models::Beta::Sessions::BetaManagedAgentsFileResource
Some parameter documentations has been truncated, see Models::Beta::Sessions::ResourceUpdateParams for more details.
Update Session Resource
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/anthropic/resources/beta/sessions/resources.rb', line 58 def update(resource_id, params) parsed, = Anthropic::Beta::Sessions::ResourceUpdateParams.dump_request(params) session_id = parsed.delete(:session_id) do raise ArgumentError.new("missing required path argument #{_1}") end header_params = {betas: "anthropic-beta"} @client.request( method: :post, path: ["v1/sessions/%1$s/resources/%2$s?beta=true", session_id, resource_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Models::Beta::Sessions::ResourceUpdateResponse, options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **} ) end |