#[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<Map<String, Value>>,
}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<Map<String, Value>>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>,
) -> RequestPermissionRequest
pub fn new( session_id: impl Into<SessionId>, title: impl Into<String>, options: Vec<PermissionOption>, ) -> RequestPermissionRequest
Builds RequestPermissionRequest with the required request fields set; optional fields start unset or empty.
Sourcepub fn description(
self,
description: impl IntoOption<String>,
) -> RequestPermissionRequest
pub fn description( self, description: impl IntoOption<String>, ) -> RequestPermissionRequest
Sets or clears the optional description field.
Sourcepub fn subject(
self,
subject: impl IntoOption<RequestPermissionSubject>,
) -> RequestPermissionRequest
pub fn subject( self, subject: impl IntoOption<RequestPermissionSubject>, ) -> RequestPermissionRequest
Sets or clears the optional subject field.
Sourcepub fn meta(
self,
meta: impl IntoOption<Map<String, Value>>,
) -> RequestPermissionRequest
pub fn meta( self, meta: impl IntoOption<Map<String, Value>>, ) -> RequestPermissionRequest
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<RequestPermissionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RequestPermissionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl IntoV1 for RequestPermissionRequest
impl IntoV1 for RequestPermissionRequest
Source§type Output = RequestPermissionRequest
type Output = RequestPermissionRequest
Source§fn into_v1(
self,
) -> Result<<RequestPermissionRequest as IntoV1>::Output, ProtocolConversionError>
fn into_v1( self, ) -> Result<<RequestPermissionRequest as IntoV1>::Output, ProtocolConversionError>
Source§impl JsonRpcMessage for RequestPermissionRequest
impl JsonRpcMessage for RequestPermissionRequest
Source§fn matches_method(method: &str) -> bool
fn matches_method(method: &str) -> bool
Source§fn to_untyped_message(&self) -> Result<UntypedMessage, Error>
fn to_untyped_message(&self) -> Result<UntypedMessage, Error>
Source§impl JsonRpcRequest for RequestPermissionRequest
impl JsonRpcRequest for RequestPermissionRequest
Source§type Response = RequestPermissionResponse
type Response = RequestPermissionResponse
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 ==.