#[non_exhaustive]pub struct RequestPermissionRequest {
pub session_id: SessionId,
pub title: String,
pub description: Option<String>,
pub subject: Option<RequestPermissionSubject>,
pub options: Vec<PermissionOption>,
pub meta: Option<Meta>,
}unstable_protocol_v2 only.Expand description
Request for user permission to proceed with an operation.
Sent when the agent needs authorization before performing a sensitive operation.
See protocol docs: Requesting Permission
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.session_id: SessionIdThe session ID for this request.
title: StringHuman-readable title for the permission prompt.
This title is specific to the permission prompt and does not update any subject’s displayed title.
description: Option<String>Optional human-readable explanation of why permission is needed.
This text is specific to the permission prompt and does not update any
subject’s displayed content. Omitted or null both mean no separate
permission description was provided.
subject: Option<RequestPermissionSubject>Optional structured context about the operation requiring permission.
Omitted or null both mean no structured subject was provided.
options: Vec<PermissionOption>Available permission options for the user to choose from. Must contain at least one option.
meta: Option<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl RequestPermissionRequest
impl RequestPermissionRequest
Sourcepub fn new(
session_id: impl Into<SessionId>,
title: impl Into<String>,
options: Vec<PermissionOption>,
) -> Self
pub fn new( session_id: impl Into<SessionId>, title: impl Into<String>, options: Vec<PermissionOption>, ) -> Self
Builds RequestPermissionRequest with the required request fields set; optional fields start unset or empty.
Sourcepub fn description(self, description: impl IntoOption<String>) -> Self
pub fn description(self, description: impl IntoOption<String>) -> Self
Sets or clears the optional description field.
Sourcepub fn subject(self, subject: impl IntoOption<RequestPermissionSubject>) -> Self
pub fn subject(self, subject: impl IntoOption<RequestPermissionSubject>) -> Self
Sets or clears the optional subject field.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for RequestPermissionRequest
impl Clone for RequestPermissionRequest
Source§impl Debug for RequestPermissionRequest
impl Debug for RequestPermissionRequest
Source§impl<'de> Deserialize<'de> for RequestPermissionRequest
impl<'de> Deserialize<'de> for RequestPermissionRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RequestPermissionRequest
Source§impl JsonSchema for RequestPermissionRequest
impl JsonSchema for RequestPermissionRequest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for RequestPermissionRequest
impl PartialEq for RequestPermissionRequest
Source§impl Serialize for RequestPermissionRequest
impl Serialize for RequestPermissionRequest
impl StructuralPartialEq for RequestPermissionRequest
Auto Trait Implementations§
impl Freeze for RequestPermissionRequest
impl RefUnwindSafe for RequestPermissionRequest
impl Send for RequestPermissionRequest
impl Sync for RequestPermissionRequest
impl Unpin for RequestPermissionRequest
impl UnsafeUnpin for RequestPermissionRequest
impl UnwindSafe for RequestPermissionRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.