#[non_exhaustive]pub struct TaskPushNotificationConfig {
pub tenant: Option<String>,
pub id: Option<String>,
pub task_id: Option<String>,
pub url: String,
pub token: Option<String>,
pub authentication: Option<AuthenticationInfo>,
}Expand description
A container associating a push notification configuration with a specific task.
token is a secret and is redacted in the Debug representation
(presence shown, value hidden), as is any credentials inside
authentication, so a {:?} of a config tree cannot leak the shared
secret into logs. Serialization is unaffected.
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.tenant: Option<String>Optional. Opaque routing identifier. Must match the tenant value from
the selected AgentInterface in the Agent Card when that field is set.
id: Option<String>The push notification configuration details. A unique identifier (e.g. UUID) for this push notification configuration.
task_id: Option<String>The ID of the task this configuration is associated with.
Optional in the canonical protocol schema: a config nested in
SendMessageConfiguration legitimately omits it (the task does not
exist yet), and servers assign it from context. A standalone
CreateTaskPushNotificationConfig call does require it — the server
rejects a missing task ID there with an invalid-params error.
url: StringThe URL where the notification should be sent.
token: Option<String>A token unique for this task or session.
authentication: Option<AuthenticationInfo>Authentication information required to send the notification.
Implementations§
Source§impl TaskPushNotificationConfig
impl TaskPushNotificationConfig
Sourcepub fn new(
task_id: impl Into<String>,
url: impl Into<String>,
) -> TaskPushNotificationConfig
pub fn new( task_id: impl Into<String>, url: impl Into<String>, ) -> TaskPushNotificationConfig
Creates a minimal config with a task ID and URL.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validates this configuration.
§Errors
Returns an error string if:
- The URL is empty or uses an unsupported scheme
- The task ID is present but empty (an absent task ID is valid on
the wire; whether it is required depends on context — e.g. the
server’s
CreateTaskPushNotificationConfighandler requires it)
Note: http URLs are accepted for development/testing environments.
Production deployments should enforce HTTPS.
Source§impl TaskPushNotificationConfig
impl TaskPushNotificationConfig
Sourcepub fn for_url(url: impl Into<String>) -> TaskPushNotificationConfig
pub fn for_url(url: impl Into<String>) -> TaskPushNotificationConfig
A config for url that names no task: what a request body is before
the task id is taken from the path or the method’s parameters.
Sourcepub fn with_id(self, id: impl Into<String>) -> TaskPushNotificationConfig
pub fn with_id(self, id: impl Into<String>) -> TaskPushNotificationConfig
Sets the config’s id (the server assigns one when it is absent).
Sourcepub fn with_token(self, token: impl Into<String>) -> TaskPushNotificationConfig
pub fn with_token(self, token: impl Into<String>) -> TaskPushNotificationConfig
Sets the token the webhook receives to know a notification is for this config (spec §13.2).
Sourcepub fn with_authentication(
self,
authentication: AuthenticationInfo,
) -> TaskPushNotificationConfig
pub fn with_authentication( self, authentication: AuthenticationInfo, ) -> TaskPushNotificationConfig
Sets the credentials the webhook asks to be sent.
Sourcepub fn with_tenant(
self,
tenant: impl Into<String>,
) -> TaskPushNotificationConfig
pub fn with_tenant( self, tenant: impl Into<String>, ) -> TaskPushNotificationConfig
Sets the tenant the config belongs to.
Trait Implementations§
Source§impl AcceptedFields for TaskPushNotificationConfig
impl AcceptedFields for TaskPushNotificationConfig
Source§fn accepted_fields() -> &'static [&'static str]
fn accepted_fields() -> &'static [&'static str]
Source§impl Clone for TaskPushNotificationConfig
impl Clone for TaskPushNotificationConfig
Source§fn clone(&self) -> TaskPushNotificationConfig
fn clone(&self) -> TaskPushNotificationConfig
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 TaskPushNotificationConfig
impl Debug for TaskPushNotificationConfig
Source§impl<'de> Deserialize<'de> for TaskPushNotificationConfig
impl<'de> Deserialize<'de> for TaskPushNotificationConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TaskPushNotificationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TaskPushNotificationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<TaskPushNotificationConfig> for TaskPushNotificationConfig
impl From<TaskPushNotificationConfig> for TaskPushNotificationConfig
Source§fn from(value: TaskPushNotificationConfig) -> TaskPushNotificationConfig
fn from(value: TaskPushNotificationConfig) -> TaskPushNotificationConfig
Source§impl From<TaskPushNotificationConfig> for TaskPushNotificationConfig
impl From<TaskPushNotificationConfig> for TaskPushNotificationConfig
Source§fn from(value: TaskPushNotificationConfig) -> TaskPushNotificationConfig
fn from(value: TaskPushNotificationConfig) -> TaskPushNotificationConfig
Source§impl Serialize for TaskPushNotificationConfig
impl Serialize for TaskPushNotificationConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Forget for TaskPushNotificationConfig
impl Freeze for TaskPushNotificationConfig
impl Move for TaskPushNotificationConfig
impl RefUnwindSafe for TaskPushNotificationConfig
impl Send for TaskPushNotificationConfig
impl Sync for TaskPushNotificationConfig
impl Unpin for TaskPushNotificationConfig
impl UnsafeUnpin for TaskPushNotificationConfig
impl UnwindSafe for TaskPushNotificationConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].