#[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§fn clone(&self) -> RequestPermissionRequest
fn clone(&self) -> RequestPermissionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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>,
Source§impl IntoV1 for RequestPermissionRequest
impl IntoV1 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§fn eq(&self, other: &RequestPermissionRequest) -> bool
fn eq(&self, other: &RequestPermissionRequest) -> bool
self and other values to be equal, and is used by ==.