|
21 | 21 | * Used for managing task-specific push notification settings via the push notification |
22 | 22 | * management methods ({@code tasks/pushNotificationConfig/set}, {@code tasks/pushNotificationConfig/get}, etc.). |
23 | 23 | * |
24 | | - * @param id unique identifier (e.g. UUID) for this push notification configuration |
| 24 | + * @param id optional unique identifier (e.g. UUID) for this push notification configuration. |
| 25 | + * When omitted while creating a configuration, the server assigns one. |
25 | 26 | * @param taskId the unique identifier of the task to receive push notifications for |
26 | 27 | * @param url the HTTP/HTTPS endpoint URL to receive push notifications (required) |
27 | 28 | * @param token optional bearer token for simple authentication |
|
31 | 32 | * @see MessageSendConfiguration for configuring push notifications on message send |
32 | 33 | * @see <a href="https://a2a-protocol.org/latest/">A2A Protocol Specification</a> |
33 | 34 | */ |
34 | | -public record TaskPushNotificationConfig(String id, @Nullable String taskId, String url, @Nullable String token, |
| 35 | +public record TaskPushNotificationConfig(@Nullable String id, @Nullable String taskId, String url, @Nullable String token, |
35 | 36 | @Nullable AuthenticationInfo authentication, @Nullable String tenant) { |
36 | 37 |
|
37 | 38 | /** |
38 | 39 | * Compact constructor for validation. |
39 | 40 | * Validates that required parameters are not null. |
40 | 41 | * |
41 | | - * @param id the configuration identifier |
| 42 | + * @param id the optional configuration identifier |
42 | 43 | * @param taskId the task identifier |
43 | 44 | * @param url the notification endpoint URL |
44 | 45 | * @param token optional bearer token |
45 | 46 | * @param authentication optional authentication info |
46 | 47 | * @param tenant the tenant identifier |
47 | 48 | */ |
48 | 49 | public TaskPushNotificationConfig { |
49 | | - Assert.checkNotNullParam("id", id); |
50 | 50 | Assert.checkNotNullParam("url", url); |
51 | 51 | Utils.validateTenant(tenant); |
52 | 52 | } |
@@ -105,10 +105,10 @@ private Builder(TaskPushNotificationConfig config) { |
105 | 105 | /** |
106 | 106 | * Sets the configuration identifier. |
107 | 107 | * |
108 | | - * @param id the configuration ID |
| 108 | + * @param id the optional configuration ID |
109 | 109 | * @return this builder |
110 | 110 | */ |
111 | | - public Builder id(String id) { |
| 111 | + public Builder id(@Nullable String id) { |
112 | 112 | this.id = id; |
113 | 113 | return this; |
114 | 114 | } |
@@ -172,11 +172,11 @@ public Builder tenant(String tenant) { |
172 | 172 | * Builds the {@link TaskPushNotificationConfig}. |
173 | 173 | * |
174 | 174 | * @return a new push notification configuration |
175 | | - * @throws IllegalArgumentException if id or url is null |
| 175 | + * @throws IllegalArgumentException if url is null |
176 | 176 | */ |
177 | 177 | public TaskPushNotificationConfig build() { |
178 | 178 | return new TaskPushNotificationConfig( |
179 | | - Assert.checkNotNullParam("id", id), |
| 179 | + id, |
180 | 180 | taskId, |
181 | 181 | Assert.checkNotNullParam("url", url), |
182 | 182 | token, |
|
0 commit comments