MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / user_context

Method user_context

crates/chat-cli/src/telemetry/mod.rs:721–746  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

719 }
720
721 fn user_context(&self) -> Option<UserContext> {
722 let operating_system = match std::env::consts::OS {
723 "linux" => OperatingSystem::Linux,
724 "macos" => OperatingSystem::Mac,
725 "windows" => OperatingSystem::Windows,
726 os => {
727 error!(%os, "Unsupported operating system");
728 return None;
729 },
730 };
731
732 match UserContext::builder()
733 .client_id(self.client_id.hyphenated().to_string())
734 .operating_system(operating_system)
735 .product(PRODUCT)
736 .ide_category(IdeCategory::Cli)
737 .ide_version(PRODUCT_VERSION)
738 .build()
739 {
740 Ok(user_context) => Some(user_context),
741 Err(err) => {
742 error!(%err, "Failed to build user context");
743 None
744 },
745 }
746 }
747}
748
749pub trait ReasonCode: std::error::Error {

Callers 4

send_telemetry_eventMethod · 0.45
client_contextFunction · 0.45
test_without_optoutFunction · 0.45

Calls 7

ide_versionMethod · 0.80
to_stringMethod · 0.80
buildMethod · 0.45
ide_categoryMethod · 0.45
productMethod · 0.45
operating_systemMethod · 0.45
client_idMethod · 0.45

Tested by 1

test_without_optoutFunction · 0.36