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
Configuration for delivering task updates to a webhook endpoint.
In v1.0, this is a single flat type combining the previous
PushNotificationConfig and TaskPushNotificationConfig.
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§
§tenant: Option<String>Optional tenant identifier for multi-tenancy.
id: Option<String>Server-assigned configuration identifier.
Absent when first creating the config; populated in the server response.
task_id: Option<String>The task for which push notifications are configured.
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: StringHTTPS URL of the client’s webhook endpoint.
token: Option<String>Optional shared secret for request verification.
authentication: Option<AuthenticationInfo>Authentication details the agent should use when calling the webhook.
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.
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 Freeze 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§
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request