|
34 | 34 | import com.google.longrunning.Operation;
|
35 | 35 | import com.google.protobuf.Empty;
|
36 | 36 | import com.google.protobuf.FieldMask;
|
| 37 | +import com.google.protobuf.Struct; |
37 | 38 | import java.io.IOException;
|
38 | 39 | import java.util.List;
|
39 | 40 | import java.util.concurrent.TimeUnit;
|
|
56 | 57 | * // - It may require specifying regional endpoints when creating the service client as shown in
|
57 | 58 | * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
|
58 | 59 | * try (LineageClient lineageClient = LineageClient.create()) {
|
59 |
| - * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); |
60 |
| - * Process process = Process.newBuilder().build(); |
61 |
| - * Process response = lineageClient.createProcess(parent, process); |
| 60 | + * String parent = "parent-995424086"; |
| 61 | + * Struct openLineage = Struct.newBuilder().build(); |
| 62 | + * ProcessOpenLineageRunEventResponse response = |
| 63 | + * lineageClient.processOpenLineageRunEvent(parent, openLineage); |
62 | 64 | * }
|
63 | 65 | * }</pre>
|
64 | 66 | *
|
@@ -203,6 +205,111 @@ public final OperationsClient getHttpJsonOperationsClient() {
|
203 | 205 | return httpJsonOperationsClient;
|
204 | 206 | }
|
205 | 207 |
|
| 208 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 209 | + /** |
| 210 | + * Creates new lineage events together with their parents: process and run. Updates the process |
| 211 | + * and run if they already exist. Mapped from Open Lineage specification: |
| 212 | + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. |
| 213 | + * |
| 214 | + * <p>Sample code: |
| 215 | + * |
| 216 | + * <pre>{@code |
| 217 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 218 | + * // It will require modifications to work: |
| 219 | + * // - It may require correct/in-range values for request initialization. |
| 220 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 221 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 222 | + * try (LineageClient lineageClient = LineageClient.create()) { |
| 223 | + * String parent = "parent-995424086"; |
| 224 | + * Struct openLineage = Struct.newBuilder().build(); |
| 225 | + * ProcessOpenLineageRunEventResponse response = |
| 226 | + * lineageClient.processOpenLineageRunEvent(parent, openLineage); |
| 227 | + * } |
| 228 | + * }</pre> |
| 229 | + * |
| 230 | + * @param parent Required. The name of the project and its location that should own the process, |
| 231 | + * run, and lineage event. |
| 232 | + * @param openLineage Required. OpenLineage message following OpenLineage format: |
| 233 | + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json |
| 234 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 235 | + */ |
| 236 | + public final ProcessOpenLineageRunEventResponse processOpenLineageRunEvent( |
| 237 | + String parent, Struct openLineage) { |
| 238 | + ProcessOpenLineageRunEventRequest request = |
| 239 | + ProcessOpenLineageRunEventRequest.newBuilder() |
| 240 | + .setParent(parent) |
| 241 | + .setOpenLineage(openLineage) |
| 242 | + .build(); |
| 243 | + return processOpenLineageRunEvent(request); |
| 244 | + } |
| 245 | + |
| 246 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 247 | + /** |
| 248 | + * Creates new lineage events together with their parents: process and run. Updates the process |
| 249 | + * and run if they already exist. Mapped from Open Lineage specification: |
| 250 | + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. |
| 251 | + * |
| 252 | + * <p>Sample code: |
| 253 | + * |
| 254 | + * <pre>{@code |
| 255 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 256 | + * // It will require modifications to work: |
| 257 | + * // - It may require correct/in-range values for request initialization. |
| 258 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 259 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 260 | + * try (LineageClient lineageClient = LineageClient.create()) { |
| 261 | + * ProcessOpenLineageRunEventRequest request = |
| 262 | + * ProcessOpenLineageRunEventRequest.newBuilder() |
| 263 | + * .setParent("parent-995424086") |
| 264 | + * .setOpenLineage(Struct.newBuilder().build()) |
| 265 | + * .setRequestId("requestId693933066") |
| 266 | + * .build(); |
| 267 | + * ProcessOpenLineageRunEventResponse response = |
| 268 | + * lineageClient.processOpenLineageRunEvent(request); |
| 269 | + * } |
| 270 | + * }</pre> |
| 271 | + * |
| 272 | + * @param request The request object containing all of the parameters for the API call. |
| 273 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 274 | + */ |
| 275 | + public final ProcessOpenLineageRunEventResponse processOpenLineageRunEvent( |
| 276 | + ProcessOpenLineageRunEventRequest request) { |
| 277 | + return processOpenLineageRunEventCallable().call(request); |
| 278 | + } |
| 279 | + |
| 280 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 281 | + /** |
| 282 | + * Creates new lineage events together with their parents: process and run. Updates the process |
| 283 | + * and run if they already exist. Mapped from Open Lineage specification: |
| 284 | + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. |
| 285 | + * |
| 286 | + * <p>Sample code: |
| 287 | + * |
| 288 | + * <pre>{@code |
| 289 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 290 | + * // It will require modifications to work: |
| 291 | + * // - It may require correct/in-range values for request initialization. |
| 292 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 293 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 294 | + * try (LineageClient lineageClient = LineageClient.create()) { |
| 295 | + * ProcessOpenLineageRunEventRequest request = |
| 296 | + * ProcessOpenLineageRunEventRequest.newBuilder() |
| 297 | + * .setParent("parent-995424086") |
| 298 | + * .setOpenLineage(Struct.newBuilder().build()) |
| 299 | + * .setRequestId("requestId693933066") |
| 300 | + * .build(); |
| 301 | + * ApiFuture<ProcessOpenLineageRunEventResponse> future = |
| 302 | + * lineageClient.processOpenLineageRunEventCallable().futureCall(request); |
| 303 | + * // Do something. |
| 304 | + * ProcessOpenLineageRunEventResponse response = future.get(); |
| 305 | + * } |
| 306 | + * }</pre> |
| 307 | + */ |
| 308 | + public final UnaryCallable<ProcessOpenLineageRunEventRequest, ProcessOpenLineageRunEventResponse> |
| 309 | + processOpenLineageRunEventCallable() { |
| 310 | + return stub.processOpenLineageRunEventCallable(); |
| 311 | + } |
| 312 | + |
206 | 313 | // AUTO-GENERATED DOCUMENTATION AND METHOD.
|
207 | 314 | /**
|
208 | 315 | * Creates a new process.
|
@@ -993,6 +1100,7 @@ public final Run updateRun(Run run, FieldMask updateMask) {
|
993 | 1100 | * UpdateRunRequest.newBuilder()
|
994 | 1101 | * .setRun(Run.newBuilder().build())
|
995 | 1102 | * .setUpdateMask(FieldMask.newBuilder().build())
|
| 1103 | + * .setAllowMissing(true) |
996 | 1104 | * .build();
|
997 | 1105 | * Run response = lineageClient.updateRun(request);
|
998 | 1106 | * }
|
@@ -1022,6 +1130,7 @@ public final Run updateRun(UpdateRunRequest request) {
|
1022 | 1130 | * UpdateRunRequest.newBuilder()
|
1023 | 1131 | * .setRun(Run.newBuilder().build())
|
1024 | 1132 | * .setUpdateMask(FieldMask.newBuilder().build())
|
| 1133 | + * .setAllowMissing(true) |
1025 | 1134 | * .build();
|
1026 | 1135 | * ApiFuture<Run> future = lineageClient.updateRunCallable().futureCall(request);
|
1027 | 1136 | * // Do something.
|
|
0 commit comments