Class: Anthropic::Resources::Beta::UserProfiles
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::UserProfiles
- Defined in:
- lib/anthropic/resources/beta/user_profiles.rb
Instance Method Summary collapse
-
#create(external_id: nil, metadata: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Some parameter documentations has been truncated, see Models::Beta::UserProfileCreateParams for more details.
-
#create_enrollment_url(user_profile_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfileEnrollmentURL
Create Enrollment URL.
-
#initialize(client:) ⇒ UserProfiles
constructor
private
A new instance of UserProfiles.
-
#list(limit: nil, order: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaUserProfile>
List User Profiles.
-
#retrieve(user_profile_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Get User Profile.
-
#update(user_profile_id, external_id: nil, metadata: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Some parameter documentations has been truncated, see Models::Beta::UserProfileUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ UserProfiles
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 UserProfiles.
154 155 156 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 154 def initialize(client:) @client = client end |
Instance Method Details
#create(external_id: nil, metadata: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Some parameter documentations has been truncated, see Models::Beta::UserProfileCreateParams for more details.
Create User Profile
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 25 def create(params = {}) parsed, = Anthropic::Beta::UserProfileCreateParams.dump_request(params) header_params = {betas: "anthropic-beta"} @client.request( method: :post, path: "v1/user_profiles?beta=true", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::BetaUserProfile, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-03-24"}, **} ) end |
#create_enrollment_url(user_profile_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfileEnrollmentURL
Create Enrollment URL
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 140 def create_enrollment_url(user_profile_id, params = {}) parsed, = Anthropic::Beta::UserProfileCreateEnrollmentURLParams.dump_request(params) @client.request( method: :post, path: ["v1/user_profiles/%1$s/enrollment_url?beta=true", user_profile_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::BetaUserProfileEnrollmentURL, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-03-24"}, **} ) end |
#list(limit: nil, order: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaUserProfile>
List User Profiles
112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 112 def list(params = {}) query_params = [:limit, :order, :page] parsed, = Anthropic::Beta::UserProfileListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/user_profiles?beta=true", query: query, headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"), page: Anthropic::Internal::PageCursor, model: Anthropic::Beta::BetaUserProfile, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-03-24"}, **} ) end |
#retrieve(user_profile_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Get User Profile
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 51 def retrieve(user_profile_id, params = {}) parsed, = Anthropic::Beta::UserProfileRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/user_profiles/%1$s?beta=true", user_profile_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::BetaUserProfile, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-03-24"}, **} ) end |
#update(user_profile_id, external_id: nil, metadata: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Some parameter documentations has been truncated, see Models::Beta::UserProfileUpdateParams for more details.
Update User Profile
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 82 def update(user_profile_id, params = {}) parsed, = Anthropic::Beta::UserProfileUpdateParams.dump_request(params) header_params = {betas: "anthropic-beta"} @client.request( method: :post, path: ["v1/user_profiles/%1$s?beta=true", user_profile_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::BetaUserProfile, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-03-24"}, **} ) end |