diff --git a/README.md b/README.md index df172e1c..aef4fedd 100644 --- a/README.md +++ b/README.md @@ -644,7 +644,7 @@ The generated code includes resources that are compatible with the Temporal Go S *__Experimental__* -This plugin provides experimental support for cross-namespace and/or cross-cluster integration by enabling the `enable-xns` plugin option. When enabled, the plugin will generate an additional `path/to/generated/code/xns` go package containing types, methods, and helpers for calling workflows, queries, signals, and updates from other Temporal workflows via activities. The activities use [heartbeating](https://docs.temporal.io/activities#activity-heartbeat) to maintain liveness for long-running workflows or updates, and their associated timeouts can be configured using the generated options helpers. For an example of xns integration, see the [example/external](./example/external/external.go) package. +This plugin provides experimental support for cross-namespace and/or cross-cluster integration by enabling the `enable-xns` plugin option. When enabled, the plugin will generate an additional `path/to/generated/code/xns` go package containing types, methods, and helpers for calling workflows, queries, signals, and updates from other Temporal workflows via activities. The activities use [heartbeating](https://docs.temporal.io/activities#activity-heartbeat) to maintain liveness for long-running workflows or updates, and their associated timeouts can be configured using the generated options helpers. For an example of xns integration, see the [example/external](./example/external) package. ## Documentation diff --git a/docs/api/temporal/v1/api.md b/docs/api/temporal/v1/api.md index fc1cb94b..3556c02b 100644 --- a/docs/api/temporal/v1/api.md +++ b/docs/api/temporal/v1/api.md @@ -16,6 +16,7 @@ - [WorkflowOptions.Query](#temporal-v1-WorkflowOptions-Query) - [WorkflowOptions.Signal](#temporal-v1-WorkflowOptions-Signal) - [WorkflowOptions.Update](#temporal-v1-WorkflowOptions-Update) + - [XNSActivityOptions](#temporal-v1-XNSActivityOptions) - [CLIFeature](#temporal-v1-CLIFeature) - [IDReusePolicy](#temporal-v1-IDReusePolicy) @@ -104,6 +105,7 @@ available query configuration options | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | name | [string](#string) | | Fully-qualified query name | +| xns | [XNSActivityOptions](#temporal-v1-XNSActivityOptions) | | XNS can be used to configure default activity options for xns workflow executions | @@ -156,6 +158,7 @@ available signal configuration options | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | name | [string](#string) | | Fully-qualified signal name | +| xns | [XNSActivityOptions](#temporal-v1-XNSActivityOptions) | | XNS can be used to configure default activity options for xns workflow executions | @@ -175,6 +178,7 @@ available update configuration options | name | [string](#string) | | Fully-qualified update name | | validate | [bool](#bool) | | Include validation hook | | wait_policy | [WaitPolicy](#temporal-v1-WaitPolicy) | | Default wait policy if not specified | +| xns | [XNSActivityOptions](#temporal-v1-XNSActivityOptions) | | XNS can be used to configure default activity options for xns workflow executions | @@ -205,6 +209,7 @@ available workflow configuration options | task_queue | [string](#string) | | Override service task queeu | | task_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | The timeout for processing workflow task from the time the worker pulled this task. If a workflow task is lost, it is retried after this timeout. The resolution is seconds. | | wait_for_cancellation | [bool](#bool) | | WaitForCancellation specifies whether to wait for canceled child workflow to be ended (child workflow can be ended as: completed/failed/timedout/terminated/canceled) | +| xns | [XNSActivityOptions](#temporal-v1-XNSActivityOptions) | | XNS can be used to configure default activity options for xns workflow executions | @@ -220,6 +225,7 @@ Query identifies a query supported by the worklow | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | ref | [string](#string) | | Query name | +| xns | [XNSActivityOptions](#temporal-v1-XNSActivityOptions) | | XNS can be used to configure default activity options for xns workflow executions | @@ -236,6 +242,7 @@ Signal identifies a signal supported by the workflow | ----- | ---- | ----- | ----------- | | ref | [string](#string) | | Signal name | | start | [bool](#bool) | | Include convenience method for signal with start | +| xns | [XNSActivityOptions](#temporal-v1-XNSActivityOptions) | | XNS can be used to configure default activity options for xns workflow executions | @@ -251,6 +258,29 @@ Update identifies an update supported by the workflow | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | ref | [string](#string) | | Update name | +| xns | [XNSActivityOptions](#temporal-v1-XNSActivityOptions) | | XNS can be used to configure default activity options for xns workflow executions | + + + + + + + + +### XNSActivityOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | Fully-qualified xns activity name | +| task_queue | [string](#string) | | Override default task queue for activity | +| schedule_to_close_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | Total time that a workflow is willing to wait for Activity to complete | +| schedule_to_start_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | Time that the Activity Task can stay in the Task Queue before it is picked up by a Worker | +| start_to_close_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | Maximum time of a single Activity execution attempt | +| heartbeat_interval | [google.protobuf.Duration](#google-protobuf-Duration) | | HeartbeatInterval configures the default heartbeat interval | +| heartbeat_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | Heartbeat timeout. Activity must call Activity.RecordHeartbeat(ctx, "my-heartbeat") | +| retry_policy | [RetryPolicy](#temporal-v1-RetryPolicy) | | Specifies how to retry an Activity if an error occurs | diff --git a/docs/api/temporal/xns/v1/api.md b/docs/api/temporal/xns/v1/api.md index fc36b9f4..2fa26d60 100644 --- a/docs/api/temporal/xns/v1/api.md +++ b/docs/api/temporal/xns/v1/api.md @@ -38,6 +38,7 @@ QueryRequest can be used to configure xns query activities | run_id | [string](#string) | | | | workflow_id | [string](#string) | | | | request | [google.protobuf.Any](#google-protobuf-Any) | | | +| heartbeat_interval | [google.protobuf.Duration](#google-protobuf-Duration) | | | @@ -74,6 +75,7 @@ SignalRequest can be used to configure xns signal activities | run_id | [string](#string) | | | | workflow_id | [string](#string) | | | | request | [google.protobuf.Any](#google-protobuf-Any) | | | +| heartbeat_interval | [google.protobuf.Duration](#google-protobuf-Duration) | | | diff --git a/example/README.md b/example/README.md new file mode 100644 index 00000000..0d481dce --- /dev/null +++ b/example/README.md @@ -0,0 +1,36 @@ +# example protoc-gen-go-temporal usage + +In an initial terminal: +1. Start temporal + ```shell + temporal server start-dev --dynamic-config-value "frontend.enableUpdateWorkflowExecution=true" + ``` + +In a second terminal: +2. Create search attributes in default namespace + ```shell + temporal operator search-attribute create --name foo --type Text + temporal operator search-attribute create --name created_at --type Datetime + ``` +3. Create `external` namespace + ```shell + temporal operator namespace create external + temporal operator search-attribute create --namespace external --name foo --type Text + temporal operator search-attribute create --namespace external --name created_at --type Datetime + ``` +3. Run `example` worker + ```shell + go run example/main.go worker + ``` + +In a third terminal: +1. Run `external` worker + ```shell + go run example/main.go external worker + ``` + +In a fourth terminal: +1. Execute a workflow + ```shell + go run example/main.go external provision-foo --request-name test + ``` \ No newline at end of file diff --git a/example/main.go b/example/main.go index 189c07dd..d2cafd45 100644 --- a/example/main.go +++ b/example/main.go @@ -162,5 +162,3 @@ func main() { log.Fatal(err) } } - -// ============================================================================ diff --git a/example/proto/example/v1/example.proto b/example/proto/example/v1/example.proto index 9d0aa763..795b1a97 100644 --- a/example/proto/example/v1/example.proto +++ b/example/proto/example/v1/example.proto @@ -17,9 +17,14 @@ service Example { execution_timeout: { seconds: 3600 } id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE id: 'create-foo/${! name.slug() }' - // search_attributes: - // 'foo = name\n' - // 'created_at = now().ts_tz("UTC")\n' + xns: { + heartbeat_interval: { seconds: 10 } + heartbeat_timeout: { seconds: 20 } + start_to_close_timeout: { seconds: 3630 } + } + search_attributes: + 'foo = name\n' + 'created_at = now().ts_tz("UTC")\n' query: { ref: 'GetFooProgress' } signal: { ref: 'SetFooProgress', start: true } update: { ref: 'UpdateFooProgress' } @@ -28,7 +33,13 @@ service Example { // GetFooProgress returns the status of a CreateFoo operation rpc GetFooProgress(google.protobuf.Empty) returns (GetFooProgressResponse) { - option (temporal.v1.query) = {}; + option (temporal.v1.query) = { + xns: { + heartbeat_interval: { seconds: 10 } + heartbeat_timeout: { seconds: 20 } + start_to_close_timeout: { seconds: 60 } + } + }; } // Notify sends a notification @@ -43,13 +54,24 @@ service Example { // SetFooProgress sets the current status of a CreateFoo operation rpc SetFooProgress(SetFooProgressRequest) returns (google.protobuf.Empty) { - option (temporal.v1.signal) = {}; + option (temporal.v1.signal) = { + xns: { + heartbeat_interval: { seconds: 10 } + heartbeat_timeout: { seconds: 20 } + start_to_close_timeout: { seconds: 60 } + } + }; } // UpdateFooProgress sets the current status of a CreateFoo operation rpc UpdateFooProgress(SetFooProgressRequest) returns (GetFooProgressResponse) { option (temporal.v1.update) = { id: 'update-progress/${! progress.string() }', + xns: { + heartbeat_interval: { seconds: 10 } + heartbeat_timeout: { seconds: 20 } + start_to_close_timeout: { seconds: 60 } + } }; } } diff --git a/gen/example/v1/example.pb.go b/gen/example/v1/example.pb.go index 6068fc33..02e77cf5 100644 --- a/gen/example/v1/example.pb.go +++ b/gen/example/v1/example.pb.go @@ -525,64 +525,71 @@ var file_example_v1_example_proto_rawDesc = []byte{ 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, - 0x73, 0x32, 0xca, 0x04, 0x0a, 0x07, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0xae, 0x01, + 0x73, 0x32, 0xb3, 0x05, 0x0a, 0x07, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0xed, 0x01, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x8a, 0xc4, 0x03, 0x60, 0x0a, 0x10, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, - 0x73, 0x73, 0x10, 0x01, 0x1a, 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, - 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x03, 0x08, 0x90, 0x1c, 0x2a, 0x1c, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2d, 0x66, 0x6f, 0x6f, 0x2f, 0x24, 0x7b, 0x21, 0x20, 0x6e, - 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x75, 0x67, 0x28, 0x29, 0x20, 0x7d, 0x30, 0x01, 0x12, 0x52, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x04, 0x9a, 0xc4, - 0x03, 0x00, 0x12, 0x49, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x19, 0x2e, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x0c, 0x92, 0xc4, 0x03, 0x08, 0x22, 0x02, 0x08, 0x1e, 0x32, 0x02, 0x20, 0x03, 0x12, 0x51, 0x0a, - 0x0e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, - 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x04, 0xa2, 0xc4, 0x03, 0x00, - 0x12, 0x89, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x50, 0x72, - 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, - 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xaa, - 0xc4, 0x03, 0x29, 0x0a, 0x27, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x2f, 0x24, 0x7b, 0x21, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, - 0x73, 0x2e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x20, 0x7d, 0x1a, 0x10, 0x8a, 0xc4, - 0x03, 0x0c, 0x0a, 0x0a, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x76, 0x31, 0x32, 0x97, - 0x01, 0x0a, 0x08, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x78, 0x0a, 0x0c, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x6f, 0x12, 0x1f, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, - 0x8a, 0xc4, 0x03, 0x21, 0x2a, 0x1f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2d, - 0x66, 0x6f, 0x6f, 0x2f, 0x24, 0x7b, 0x21, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x75, - 0x67, 0x28, 0x29, 0x20, 0x7d, 0x1a, 0x11, 0x8a, 0xc4, 0x03, 0x0d, 0x0a, 0x0b, 0x65, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2d, 0x76, 0x31, 0x42, 0xab, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, - 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x75, 0x64, 0x64, 0x65, 0x6e, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x65, - 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa2, 0x01, 0x8a, 0xc4, 0x03, 0x9d, 0x01, + 0x0a, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x1a, 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x03, 0x08, 0x90, 0x1c, + 0x2a, 0x1c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2d, 0x66, 0x6f, 0x6f, 0x2f, 0x24, 0x7b, 0x21, + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x75, 0x67, 0x28, 0x29, 0x20, 0x7d, 0x30, 0x01, + 0x7a, 0x2b, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x77, 0x28, 0x29, 0x2e, + 0x74, 0x73, 0x5f, 0x74, 0x7a, 0x28, 0x22, 0x55, 0x54, 0x43, 0x22, 0x29, 0x0a, 0x82, 0x01, 0x0d, + 0x22, 0x03, 0x08, 0xae, 0x1c, 0x2a, 0x02, 0x08, 0x14, 0x42, 0x02, 0x08, 0x0a, 0x12, 0x60, 0x0a, + 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x9a, 0xc4, 0x03, + 0x0e, 0x12, 0x0c, 0x22, 0x02, 0x08, 0x3c, 0x2a, 0x02, 0x08, 0x14, 0x42, 0x02, 0x08, 0x0a, 0x12, + 0x49, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x19, 0x2e, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x0c, 0x92, 0xc4, + 0x03, 0x08, 0x22, 0x02, 0x08, 0x1e, 0x32, 0x02, 0x20, 0x03, 0x12, 0x5f, 0x0a, 0x0e, 0x53, 0x65, + 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x12, 0xa2, 0xc4, 0x03, 0x0e, 0x12, 0x0c, 0x22, + 0x02, 0x08, 0x3c, 0x2a, 0x02, 0x08, 0x14, 0x42, 0x02, 0x08, 0x0a, 0x12, 0x97, 0x01, 0x0a, 0x11, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0xaa, 0xc4, 0x03, 0x37, 0x0a, 0x27, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2f, + 0x24, 0x7b, 0x21, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x28, 0x29, 0x20, 0x7d, 0x2a, 0x0c, 0x22, 0x02, 0x08, 0x3c, 0x2a, 0x02, 0x08, + 0x14, 0x42, 0x02, 0x08, 0x0a, 0x1a, 0x10, 0x8a, 0xc4, 0x03, 0x0c, 0x0a, 0x0a, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x76, 0x31, 0x32, 0x97, 0x01, 0x0a, 0x08, 0x45, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x78, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x46, 0x6f, 0x6f, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x8a, 0xc4, 0x03, 0x21, 0x2a, 0x1f, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x66, 0x6f, 0x6f, 0x2f, 0x24, 0x7b, 0x21, + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x75, 0x67, 0x28, 0x29, 0x20, 0x7d, 0x1a, 0x11, + 0x8a, 0xc4, 0x03, 0x0d, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2d, 0x76, + 0x31, 0x42, 0xab, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6c, 0x75, 0x64, 0x64, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, + 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, + 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/gen/example/v1/example_temporal.pb.go b/gen/example/v1/example_temporal.pb.go index 006e2584..3e454c98 100644 --- a/gen/example/v1/example_temporal.pb.go +++ b/gen/example/v1/example_temporal.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go_temporal. DO NOT EDIT. // versions: // -// protoc-gen-go_temporal 1.3.1-next (c353d1f6bade74349cd27e45cddbfcf606d27591) +// protoc-gen-go_temporal 1.4.1-next (c041e56722c09ca8d2ca3d8c2eb424d1157d37c5) // go go1.21.5 // protoc (unknown) // @@ -45,6 +45,11 @@ var ( CreateFooIdexpression = expression.MustParseExpression("create-foo/${! name.slug() }") ) +// example.v1.Example workflow search attribute mappings +var ( + CreateFooSearchAttributesMapping = expression.MustParseMapping("foo = name\ncreated_at = now().ts_tz(\"UTC\")\n") +) + // example.v1.Example activity names const ( NotifyActivityName = "example.v1.Example.Notify" @@ -157,6 +162,21 @@ func (c *exampleClient) CreateFooAsync(ctx context.Context, req *CreateFooInput, if opts.WorkflowExecutionTimeout == 0 { opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes + } run, err := c.client.ExecuteWorkflow(ctx, *opts, CreateFooWorkflowName, req) if err != nil { return nil, err @@ -209,6 +229,21 @@ func (c *exampleClient) CreateFooWithSetFooProgressAsync(ctx context.Context, re if opts.WorkflowExecutionTimeout == 0 { opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes + } run, err := c.client.SignalWithStartWorkflow(ctx, opts.ID, SetFooProgressSignalName, signal, *opts, CreateFooWorkflowName, req) if run == nil || err != nil { return nil, err @@ -559,6 +594,21 @@ func CreateFooChildAsync(ctx workflow.Context, req *CreateFooInput, options ...* if opts.WorkflowExecutionTimeout == 0 { opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes + } ctx = workflow.WithChildOptions(ctx, *opts) return &CreateFooChildRun{Future: workflow.ExecuteChildWorkflow(ctx, CreateFooWorkflowName, req)}, nil } @@ -903,6 +953,21 @@ func (c *TestExampleClient) CreateFooAsync(ctx context.Context, req *CreateFooIn if opts.WorkflowExecutionTimeout == 0 { opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes + } return &testCreateFooRun{client: c, env: c.env, opts: opts, req: req, workflows: c.workflows}, nil } @@ -1713,6 +1778,8 @@ type ProvisionFooRun interface { ID() string // RunID returns the workflow instance ID RunID() string + // Run returns the inner client.WorkflowRun + Run() client.WorkflowRun // Get blocks until the workflow is complete and returns the result Get(ctx context.Context) (*ProvisionFooResponse, error) // Cancel requests cancellation of a workflow in execution, returning an error if applicable @@ -1732,6 +1799,11 @@ func (r *provisionFooRun) ID() string { return r.run.GetID() } +// Run returns the inner client.WorkflowRun +func (r *provisionFooRun) Run() client.WorkflowRun { + return r.run +} + // RunID returns the execution ID func (r *provisionFooRun) RunID() string { return r.run.GetRunID() @@ -2005,6 +2077,11 @@ func (r *testProvisionFooRun) ID() string { return "" } +// Run noop implementation +func (r *testProvisionFooRun) Run() client.WorkflowRun { + return nil +} + // RunID noop implementation func (r *testProvisionFooRun) RunID() string { return "" diff --git a/gen/example/v1/examplev1xns/example_xns_temporal.pb.go b/gen/example/v1/examplev1xns/example_xns_temporal.pb.go index 4d9e9069..358be6ab 100644 --- a/gen/example/v1/examplev1xns/example_xns_temporal.pb.go +++ b/gen/example/v1/examplev1xns/example_xns_temporal.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go_temporal. DO NOT EDIT. // versions: // -// protoc-gen-go_temporal 1.3.1-next (c353d1f6bade74349cd27e45cddbfcf606d27591) +// protoc-gen-go_temporal 1.4.1-next (c041e56722c09ca8d2ca3d8c2eb424d1157d37c5) // go go1.21.5 // protoc (unknown) // @@ -19,6 +19,7 @@ import ( uuid "github.com/google/uuid" activity "go.temporal.io/sdk/activity" client "go.temporal.io/sdk/client" + temporal "go.temporal.io/sdk/temporal" worker "go.temporal.io/sdk/worker" workflow "go.temporal.io/sdk/workflow" anypb "google.golang.org/protobuf/types/known/anypb" @@ -34,6 +35,35 @@ type CreateFooWorkflowOptions struct { StartWorkflowOptions *client.StartWorkflowOptions } +// NewCreateFooWorkflowOptions initializes a new CreateFooWorkflowOptions value +func NewCreateFooWorkflowOptions() *CreateFooWorkflowOptions { + return &CreateFooWorkflowOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *CreateFooWorkflowOptions) WithActivityOptions(ao workflow.ActivityOptions) *CreateFooWorkflowOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithDetached can be used to start a workflow execution and exit immediately +func (opts *CreateFooWorkflowOptions) WithDetached(d bool) *CreateFooWorkflowOptions { + opts.Detached = d + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *CreateFooWorkflowOptions) WithHeartbeatInterval(d time.Duration) *CreateFooWorkflowOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithStartWorkflowOptions can be used to customize the start workflow options +func (opts *CreateFooWorkflowOptions) WithStartWorkflow(swo client.StartWorkflowOptions) *CreateFooWorkflowOptions { + opts.StartWorkflowOptions = &swo + return opts +} + // CreateFooRun provides a handle to a CreateFoo workflow execution type CreateFooRun interface { // Cancel cancels the workflow @@ -137,26 +167,29 @@ func CreateFoo(ctx workflow.Context, req *v1.CreateFooInput, opts ...*CreateFooW // CreateFoo creates a new foo operation func CreateFooAsync(ctx workflow.Context, req *v1.CreateFooInput, opts ...*CreateFooWorkflowOptions) (CreateFooRun, error) { + // configure xns options opt := &CreateFooWorkflowOptions{} if len(opts) > 0 && opts[0] != nil { opt = opts[0] } if opt.HeartbeatInterval == 0 { - opt.HeartbeatInterval = time.Second * 30 + opt.HeartbeatInterval = 10000000000 // 10 seconds } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions } if ao.HeartbeatTimeout == 0 { - ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 + ao.HeartbeatTimeout = 20000000000 // 20 seconds } - if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.ScheduleToCloseTimeout = 3900000000000 // 1h5m0s + if ao.StartToCloseTimeout == 0 { + ao.StartToCloseTimeout = 3630000000000 // 1 hour 30 seconds } ctx = workflow.WithActivityOptions(ctx, ao) + // configure start workflow options wo := client.StartWorkflowOptions{} if opt.StartWorkflowOptions != nil { wo = *opt.StartWorkflowOptions @@ -176,16 +209,19 @@ func CreateFooAsync(ctx workflow.Context, req *v1.CreateFooInput, opts ...*Creat wo.ID = id.String() } + // marshal start workflow options protobuf message swo, err := xns.MarshalStartWorkflowOptions(wo) if err != nil { return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &createFooRun{ @@ -216,15 +252,19 @@ func CreateFooWithSetFooProgressAsync(ctx workflow.Context, req *v1.CreateFooInp opt = opts[0] } if opt.HeartbeatInterval == 0 { - opt.HeartbeatInterval = time.Second * 30 + opt.HeartbeatInterval = 10000000000 // 10 seconds } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions } if ao.HeartbeatTimeout == 0 { - ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 + ao.HeartbeatTimeout = 20000000000 // 20 seconds + } + if ao.StartToCloseTimeout == 0 { + ao.StartToCloseTimeout = 3630000000000 // 1 hour 30 seconds } ctx = workflow.WithActivityOptions(ctx, ao) @@ -252,16 +292,19 @@ func CreateFooWithSetFooProgressAsync(ctx workflow.Context, req *v1.CreateFooInp return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // marshal signal request protobuf message wsignal, err := anypb.New(signal) if err != nil { return nil, fmt.Errorf("error marshalling signal request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &createFooRun{ @@ -354,20 +397,21 @@ func GetFooProgressAsync(ctx workflow.Context, workflowID string, runID string, if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { - opt.HeartbeatInterval = time.Second * 30 + opt.HeartbeatInterval = 10000000000 // 10 seconds } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions } if ao.HeartbeatTimeout == 0 { - ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 + ao.HeartbeatTimeout = 20000000000 // 20 seconds } - if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + if ao.StartToCloseTimeout == 0 { + ao.StartToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -377,8 +421,9 @@ func GetFooProgressAsync(ctx workflow.Context, workflowID string, runID string, return &getFooProgressQueryHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, v1.GetFooProgressQueryName, &v11.QueryRequest{ - WorkflowId: workflowID, - RunId: runID, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, }), }, nil } @@ -456,20 +501,21 @@ func SetFooProgressAsync(ctx workflow.Context, workflowID string, runID string, if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { - opt.HeartbeatInterval = time.Second * 30 + opt.HeartbeatInterval = 10000000000 // 10 seconds } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions } if ao.HeartbeatTimeout == 0 { - ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 + ao.HeartbeatTimeout = 20000000000 // 20 seconds } - if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + if ao.StartToCloseTimeout == 0 { + ao.StartToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -485,9 +531,10 @@ func SetFooProgressAsync(ctx workflow.Context, workflowID string, runID string, return &setFooProgressSignalHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, v1.SetFooProgressSignalName, &v11.SignalRequest{ - WorkflowId: workflowID, - RunId: runID, - Request: wreq, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, + Request: wreq, }), }, nil } @@ -499,6 +546,29 @@ type UpdateFooProgressUpdateOptions struct { UpdateWorkflowOptions *client.UpdateWorkflowWithOptionsRequest } +// NewUpdateFooProgressUpdateOptions initializes a new UpdateFooProgressUpdateOptions value +func NewUpdateFooProgressUpdateOptions() *UpdateFooProgressUpdateOptions { + return &UpdateFooProgressUpdateOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *UpdateFooProgressUpdateOptions) WithActivityOptions(ao workflow.ActivityOptions) *UpdateFooProgressUpdateOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *UpdateFooProgressUpdateOptions) WithHeartbeatInterval(d time.Duration) *UpdateFooProgressUpdateOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithUpdateWorkflowOptions can be used to customize the update workflow options +func (opts *UpdateFooProgressUpdateOptions) WithUpdateWorkflowOptions(uwo client.UpdateWorkflowWithOptionsRequest) *UpdateFooProgressUpdateOptions { + opts.UpdateWorkflowOptions = &uwo + return opts +} + // UpdateFooProgressHandle provides a handle to a UpdateFooProgress workflow update type UpdateFooProgressHandle interface { // Cancel cancels the update activity @@ -565,15 +635,20 @@ func UpdateFooProgressAsync(ctx workflow.Context, workflowID string, runID strin opt.HeartbeatInterval = time.Second * 30 } + if opt.HeartbeatInterval == 0 { + opt.HeartbeatInterval = 10000000000 // 10 seconds + } + + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions } if ao.HeartbeatTimeout == 0 { - ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 + ao.HeartbeatTimeout = 20000000000 // 20 seconds } - if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + if ao.StartToCloseTimeout == 0 { + ao.StartToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -662,7 +737,11 @@ func (a *exampleActivities) CreateFoo(ctx context.Context, input *v11.WorkflowRe // unmarshal workflow request var req v1.CreateFooInput if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/example/v1.CreateFooInput", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution @@ -712,13 +791,21 @@ func (a *exampleActivities) CreateFooWithSetFooProgress(ctx context.Context, inp // unmarshal workflow request var req v1.CreateFooInput if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/example/v1.CreateFooInput", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // unmarshal signal request var signal v1.SetFooProgressRequest if err := input.Signal.UnmarshalTo(&signal); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling signal request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/example/v1.SetFooProgressRequest", input.Signal.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution @@ -764,18 +851,66 @@ func (a *exampleActivities) CreateFooWithSetFooProgress(ctx context.Context, inp } // GetFooProgress executes a(n) example.v1.Example.GetFooProgress query via an activity -func (a *exampleActivities) GetFooProgress(ctx context.Context, input *v11.QueryRequest) (*v1.GetFooProgressResponse, error) { - return a.client.GetFooProgress(ctx, input.GetWorkflowId(), input.GetRunId()) +func (a *exampleActivities) GetFooProgress(ctx context.Context, input *v11.QueryRequest) (resp *v1.GetFooProgressResponse, err error) { + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + resp, err = a.client.GetFooProgress(ctx, input.GetWorkflowId(), input.GetRunId()) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return nil, ctx.Err() + case <-doneCh: + return resp, err + } + } } // SetFooProgress executes a(n) example.v1.Example.SetFooProgress signal via an activity -func (a *exampleActivities) SetFooProgress(ctx context.Context, input *v11.SignalRequest) error { +func (a *exampleActivities) SetFooProgress(ctx context.Context, input *v11.SignalRequest) (err error) { // unmarshal signal request var req v1.SetFooProgressRequest if err := input.Request.UnmarshalTo(&req); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling signal request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/example/v1.SetFooProgressRequest", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) + } + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + err = a.client.SetFooProgress(ctx, input.GetWorkflowId(), input.GetRunId(), &req) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return ctx.Err() + case <-doneCh: + return err + } } - return a.client.SetFooProgress(ctx, input.GetWorkflowId(), input.GetRunId(), &req) } // UpdateFooProgress executes a(n) example.v1.Example.UpdateFooProgress update via an activity @@ -801,7 +936,11 @@ func (a *exampleActivities) UpdateFooProgress(ctx context.Context, input *v11.Up // unmarshal update request var req v1.SetFooProgressRequest if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling update request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/example/v1.SetFooProgressRequest", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize update execution @@ -853,6 +992,35 @@ type ProvisionFooWorkflowOptions struct { StartWorkflowOptions *client.StartWorkflowOptions } +// NewProvisionFooWorkflowOptions initializes a new ProvisionFooWorkflowOptions value +func NewProvisionFooWorkflowOptions() *ProvisionFooWorkflowOptions { + return &ProvisionFooWorkflowOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *ProvisionFooWorkflowOptions) WithActivityOptions(ao workflow.ActivityOptions) *ProvisionFooWorkflowOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithDetached can be used to start a workflow execution and exit immediately +func (opts *ProvisionFooWorkflowOptions) WithDetached(d bool) *ProvisionFooWorkflowOptions { + opts.Detached = d + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *ProvisionFooWorkflowOptions) WithHeartbeatInterval(d time.Duration) *ProvisionFooWorkflowOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithStartWorkflowOptions can be used to customize the start workflow options +func (opts *ProvisionFooWorkflowOptions) WithStartWorkflow(swo client.StartWorkflowOptions) *ProvisionFooWorkflowOptions { + opts.StartWorkflowOptions = &swo + return opts +} + // ProvisionFooRun provides a handle to a ProvisionFoo workflow execution type ProvisionFooRun interface { // Cancel cancels the workflow @@ -914,6 +1082,7 @@ func ProvisionFoo(ctx workflow.Context, req *v1.ProvisionFooInput, opts ...*Prov // ProvisionFooAsync executes a(n) example.v1.External.ProvisionFoo workflow and blocks until error or response received func ProvisionFooAsync(ctx workflow.Context, req *v1.ProvisionFooInput, opts ...*ProvisionFooWorkflowOptions) (ProvisionFooRun, error) { + // configure xns options opt := &ProvisionFooWorkflowOptions{} if len(opts) > 0 && opts[0] != nil { opt = opts[0] @@ -922,6 +1091,7 @@ func ProvisionFooAsync(ctx workflow.Context, req *v1.ProvisionFooInput, opts ... opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -930,10 +1100,11 @@ func ProvisionFooAsync(ctx workflow.Context, req *v1.ProvisionFooInput, opts ... ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + ao.ScheduleToCloseTimeout = 86400000000000 // 1 day } ctx = workflow.WithActivityOptions(ctx, ao) + // configure start workflow options wo := client.StartWorkflowOptions{} if opt.StartWorkflowOptions != nil { wo = *opt.StartWorkflowOptions @@ -953,16 +1124,19 @@ func ProvisionFooAsync(ctx workflow.Context, req *v1.ProvisionFooInput, opts ... wo.ID = id.String() } + // marshal start workflow options protobuf message swo, err := xns.MarshalStartWorkflowOptions(wo) if err != nil { return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &provisionFooRun{ @@ -1014,7 +1188,11 @@ func (a *externalActivities) ProvisionFoo(ctx context.Context, input *v11.Workfl // unmarshal workflow request var req v1.ProvisionFooInput if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/example/v1.ProvisionFooInput", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution diff --git a/gen/simple/simple_temporal.pb.go b/gen/simple/simple_temporal.pb.go index 836756dc..b844a283 100644 --- a/gen/simple/simple_temporal.pb.go +++ b/gen/simple/simple_temporal.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go_temporal. DO NOT EDIT. // versions: // -// protoc-gen-go_temporal 1.3.1-next (c353d1f6bade74349cd27e45cddbfcf606d27591) +// protoc-gen-go_temporal 1.4.1-next (c041e56722c09ca8d2ca3d8c2eb424d1157d37c5) // go go1.21.5 // protoc (unknown) // diff --git a/gen/simple/simplexns/simple_xns_temporal.pb.go b/gen/simple/simplexns/simple_xns_temporal.pb.go index 0e2f9101..867df8a7 100644 --- a/gen/simple/simplexns/simple_xns_temporal.pb.go +++ b/gen/simple/simplexns/simple_xns_temporal.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go_temporal. DO NOT EDIT. // versions: // -// protoc-gen-go_temporal 1.3.1-next (c353d1f6bade74349cd27e45cddbfcf606d27591) +// protoc-gen-go_temporal 1.4.1-next (c041e56722c09ca8d2ca3d8c2eb424d1157d37c5) // go go1.21.5 // protoc (unknown) // @@ -19,6 +19,7 @@ import ( uuid "github.com/google/uuid" activity "go.temporal.io/sdk/activity" client "go.temporal.io/sdk/client" + temporal "go.temporal.io/sdk/temporal" worker "go.temporal.io/sdk/worker" workflow "go.temporal.io/sdk/workflow" anypb "google.golang.org/protobuf/types/known/anypb" @@ -34,6 +35,35 @@ type SomeWorkflow1WorkflowOptions struct { StartWorkflowOptions *client.StartWorkflowOptions } +// NewSomeWorkflow1WorkflowOptions initializes a new SomeWorkflow1WorkflowOptions value +func NewSomeWorkflow1WorkflowOptions() *SomeWorkflow1WorkflowOptions { + return &SomeWorkflow1WorkflowOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *SomeWorkflow1WorkflowOptions) WithActivityOptions(ao workflow.ActivityOptions) *SomeWorkflow1WorkflowOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithDetached can be used to start a workflow execution and exit immediately +func (opts *SomeWorkflow1WorkflowOptions) WithDetached(d bool) *SomeWorkflow1WorkflowOptions { + opts.Detached = d + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *SomeWorkflow1WorkflowOptions) WithHeartbeatInterval(d time.Duration) *SomeWorkflow1WorkflowOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithStartWorkflowOptions can be used to customize the start workflow options +func (opts *SomeWorkflow1WorkflowOptions) WithStartWorkflow(swo client.StartWorkflowOptions) *SomeWorkflow1WorkflowOptions { + opts.StartWorkflowOptions = &swo + return opts +} + // SomeWorkflow1Run provides a handle to a SomeWorkflow1 workflow execution type SomeWorkflow1Run interface { // Cancel cancels the workflow @@ -151,6 +181,7 @@ func SomeWorkflow1(ctx workflow.Context, req *simple.SomeWorkflow1Request, opts // SomeWorkflow1 does some workflow thing. func SomeWorkflow1Async(ctx workflow.Context, req *simple.SomeWorkflow1Request, opts ...*SomeWorkflow1WorkflowOptions) (SomeWorkflow1Run, error) { + // configure xns options opt := &SomeWorkflow1WorkflowOptions{} if len(opts) > 0 && opts[0] != nil { opt = opts[0] @@ -159,6 +190,7 @@ func SomeWorkflow1Async(ctx workflow.Context, req *simple.SomeWorkflow1Request, opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -167,10 +199,11 @@ func SomeWorkflow1Async(ctx workflow.Context, req *simple.SomeWorkflow1Request, ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + ao.ScheduleToCloseTimeout = 86400000000000 // 1 day } ctx = workflow.WithActivityOptions(ctx, ao) + // configure start workflow options wo := client.StartWorkflowOptions{} if opt.StartWorkflowOptions != nil { wo = *opt.StartWorkflowOptions @@ -190,16 +223,19 @@ func SomeWorkflow1Async(ctx workflow.Context, req *simple.SomeWorkflow1Request, wo.ID = id.String() } + // marshal start workflow options protobuf message swo, err := xns.MarshalStartWorkflowOptions(wo) if err != nil { return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &someWorkflow1Run{ @@ -222,6 +258,35 @@ type SomeWorkflow2WorkflowOptions struct { StartWorkflowOptions *client.StartWorkflowOptions } +// NewSomeWorkflow2WorkflowOptions initializes a new SomeWorkflow2WorkflowOptions value +func NewSomeWorkflow2WorkflowOptions() *SomeWorkflow2WorkflowOptions { + return &SomeWorkflow2WorkflowOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *SomeWorkflow2WorkflowOptions) WithActivityOptions(ao workflow.ActivityOptions) *SomeWorkflow2WorkflowOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithDetached can be used to start a workflow execution and exit immediately +func (opts *SomeWorkflow2WorkflowOptions) WithDetached(d bool) *SomeWorkflow2WorkflowOptions { + opts.Detached = d + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *SomeWorkflow2WorkflowOptions) WithHeartbeatInterval(d time.Duration) *SomeWorkflow2WorkflowOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithStartWorkflowOptions can be used to customize the start workflow options +func (opts *SomeWorkflow2WorkflowOptions) WithStartWorkflow(swo client.StartWorkflowOptions) *SomeWorkflow2WorkflowOptions { + opts.StartWorkflowOptions = &swo + return opts +} + // SomeWorkflow2Run provides a handle to a SomeWorkflow2 workflow execution type SomeWorkflow2Run interface { // Cancel cancels the workflow @@ -310,6 +375,7 @@ func SomeWorkflow2(ctx workflow.Context, opts ...*SomeWorkflow2WorkflowOptions) // SomeWorkflow2 does some workflow thing. func SomeWorkflow2Async(ctx workflow.Context, opts ...*SomeWorkflow2WorkflowOptions) (SomeWorkflow2Run, error) { + // configure xns options opt := &SomeWorkflow2WorkflowOptions{} if len(opts) > 0 && opts[0] != nil { opt = opts[0] @@ -318,6 +384,7 @@ func SomeWorkflow2Async(ctx workflow.Context, opts ...*SomeWorkflow2WorkflowOpti opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -326,10 +393,11 @@ func SomeWorkflow2Async(ctx workflow.Context, opts ...*SomeWorkflow2WorkflowOpti ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + ao.ScheduleToCloseTimeout = 86400000000000 // 1 day } ctx = workflow.WithActivityOptions(ctx, ao) + // configure start workflow options wo := client.StartWorkflowOptions{} if opt.StartWorkflowOptions != nil { wo = *opt.StartWorkflowOptions @@ -342,11 +410,13 @@ func SomeWorkflow2Async(ctx workflow.Context, opts ...*SomeWorkflow2WorkflowOpti wo.ID = id.String() } + // marshal start workflow options protobuf message swo, err := xns.MarshalStartWorkflowOptions(wo) if err != nil { return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &someWorkflow2Run{ @@ -379,6 +449,7 @@ func SomeWorkflow2WithSomeSignal1Async(ctx workflow.Context, opts ...*SomeWorkfl opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -386,6 +457,9 @@ func SomeWorkflow2WithSomeSignal1Async(ctx workflow.Context, opts ...*SomeWorkfl if ao.HeartbeatTimeout == 0 { ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } + if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { + ao.ScheduleToCloseTimeout = 86400000000000 // 1 day + } ctx = workflow.WithActivityOptions(ctx, ao) wo := client.StartWorkflowOptions{} @@ -405,6 +479,7 @@ func SomeWorkflow2WithSomeSignal1Async(ctx workflow.Context, opts ...*SomeWorkfl return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &someWorkflow2Run{ @@ -426,6 +501,35 @@ type SomeWorkflow3WorkflowOptions struct { StartWorkflowOptions *client.StartWorkflowOptions } +// NewSomeWorkflow3WorkflowOptions initializes a new SomeWorkflow3WorkflowOptions value +func NewSomeWorkflow3WorkflowOptions() *SomeWorkflow3WorkflowOptions { + return &SomeWorkflow3WorkflowOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *SomeWorkflow3WorkflowOptions) WithActivityOptions(ao workflow.ActivityOptions) *SomeWorkflow3WorkflowOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithDetached can be used to start a workflow execution and exit immediately +func (opts *SomeWorkflow3WorkflowOptions) WithDetached(d bool) *SomeWorkflow3WorkflowOptions { + opts.Detached = d + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *SomeWorkflow3WorkflowOptions) WithHeartbeatInterval(d time.Duration) *SomeWorkflow3WorkflowOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithStartWorkflowOptions can be used to customize the start workflow options +func (opts *SomeWorkflow3WorkflowOptions) WithStartWorkflow(swo client.StartWorkflowOptions) *SomeWorkflow3WorkflowOptions { + opts.StartWorkflowOptions = &swo + return opts +} + // SomeWorkflow3Run provides a handle to a SomeWorkflow3 workflow execution type SomeWorkflow3Run interface { // Cancel cancels the workflow @@ -500,6 +604,7 @@ func SomeWorkflow3(ctx workflow.Context, req *simple.SomeWorkflow3Request, opts // SomeWorkflow3 does some workflow thing. func SomeWorkflow3Async(ctx workflow.Context, req *simple.SomeWorkflow3Request, opts ...*SomeWorkflow3WorkflowOptions) (SomeWorkflow3Run, error) { + // configure xns options opt := &SomeWorkflow3WorkflowOptions{} if len(opts) > 0 && opts[0] != nil { opt = opts[0] @@ -508,6 +613,7 @@ func SomeWorkflow3Async(ctx workflow.Context, req *simple.SomeWorkflow3Request, opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -516,10 +622,11 @@ func SomeWorkflow3Async(ctx workflow.Context, req *simple.SomeWorkflow3Request, ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.ScheduleToCloseTimeout = 3900000000000 // 1h5m0s + ao.ScheduleToCloseTimeout = 3600000000000 // 1 hour } ctx = workflow.WithActivityOptions(ctx, ao) + // configure start workflow options wo := client.StartWorkflowOptions{} if opt.StartWorkflowOptions != nil { wo = *opt.StartWorkflowOptions @@ -539,16 +646,19 @@ func SomeWorkflow3Async(ctx workflow.Context, req *simple.SomeWorkflow3Request, wo.ID = id.String() } + // marshal start workflow options protobuf message swo, err := xns.MarshalStartWorkflowOptions(wo) if err != nil { return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &someWorkflow3Run{ @@ -582,6 +692,7 @@ func SomeWorkflow3WithSomeSignal2Async(ctx workflow.Context, req *simple.SomeWor opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -589,6 +700,9 @@ func SomeWorkflow3WithSomeSignal2Async(ctx workflow.Context, req *simple.SomeWor if ao.HeartbeatTimeout == 0 { ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } + if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { + ao.ScheduleToCloseTimeout = 3600000000000 // 1 hour + } ctx = workflow.WithActivityOptions(ctx, ao) wo := client.StartWorkflowOptions{} @@ -615,16 +729,19 @@ func SomeWorkflow3WithSomeSignal2Async(ctx workflow.Context, req *simple.SomeWor return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // marshal signal request protobuf message wsignal, err := anypb.New(signal) if err != nil { return nil, fmt.Errorf("error marshalling signal request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &someWorkflow3Run{ @@ -717,11 +834,12 @@ func SomeQuery1Async(ctx workflow.Context, workflowID string, runID string, opts if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { opt.HeartbeatInterval = time.Second * 30 } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -730,7 +848,7 @@ func SomeQuery1Async(ctx workflow.Context, workflowID string, runID string, opts ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + ao.ScheduleToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -740,8 +858,9 @@ func SomeQuery1Async(ctx workflow.Context, workflowID string, runID string, opts return &someQuery1QueryHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, simple.SomeQuery1QueryName, &v1.QueryRequest{ - WorkflowId: workflowID, - RunId: runID, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, }), }, nil } @@ -823,11 +942,12 @@ func SomeQuery2Async(ctx workflow.Context, workflowID string, runID string, req if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { opt.HeartbeatInterval = time.Second * 30 } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -836,7 +956,7 @@ func SomeQuery2Async(ctx workflow.Context, workflowID string, runID string, req ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + ao.ScheduleToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -852,9 +972,10 @@ func SomeQuery2Async(ctx workflow.Context, workflowID string, runID string, req return &someQuery2QueryHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, simple.SomeQuery2QueryName, &v1.QueryRequest{ - WorkflowId: workflowID, - RunId: runID, - Request: wreq, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, + Request: wreq, }), }, nil } @@ -932,11 +1053,12 @@ func SomeSignal1Async(ctx workflow.Context, workflowID string, runID string, opt if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { opt.HeartbeatInterval = time.Second * 30 } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -945,7 +1067,7 @@ func SomeSignal1Async(ctx workflow.Context, workflowID string, runID string, opt ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + ao.ScheduleToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -955,8 +1077,9 @@ func SomeSignal1Async(ctx workflow.Context, workflowID string, runID string, opt return &someSignal1SignalHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, simple.SomeSignal1SignalName, &v1.SignalRequest{ - WorkflowId: workflowID, - RunId: runID, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, }), }, nil } @@ -1034,11 +1157,12 @@ func SomeSignal2Async(ctx workflow.Context, workflowID string, runID string, req if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { opt.HeartbeatInterval = time.Second * 30 } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -1047,7 +1171,7 @@ func SomeSignal2Async(ctx workflow.Context, workflowID string, runID string, req ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + ao.ScheduleToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -1063,9 +1187,10 @@ func SomeSignal2Async(ctx workflow.Context, workflowID string, runID string, req return &someSignal2SignalHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, simple.SomeSignal2SignalName, &v1.SignalRequest{ - WorkflowId: workflowID, - RunId: runID, - Request: wreq, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, + Request: wreq, }), }, nil } @@ -1143,11 +1268,12 @@ func SomeSignal3Async(ctx workflow.Context, workflowID string, runID string, req if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { opt.HeartbeatInterval = time.Second * 30 } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -1156,7 +1282,7 @@ func SomeSignal3Async(ctx workflow.Context, workflowID string, runID string, req ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + ao.ScheduleToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -1172,9 +1298,10 @@ func SomeSignal3Async(ctx workflow.Context, workflowID string, runID string, req return &someSignal3SignalHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, simple.SomeSignal3SignalName, &v1.SignalRequest{ - WorkflowId: workflowID, - RunId: runID, - Request: wreq, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, + Request: wreq, }), }, nil } @@ -1186,6 +1313,29 @@ type SomeUpdate1UpdateOptions struct { UpdateWorkflowOptions *client.UpdateWorkflowWithOptionsRequest } +// NewSomeUpdate1UpdateOptions initializes a new SomeUpdate1UpdateOptions value +func NewSomeUpdate1UpdateOptions() *SomeUpdate1UpdateOptions { + return &SomeUpdate1UpdateOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *SomeUpdate1UpdateOptions) WithActivityOptions(ao workflow.ActivityOptions) *SomeUpdate1UpdateOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *SomeUpdate1UpdateOptions) WithHeartbeatInterval(d time.Duration) *SomeUpdate1UpdateOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithUpdateWorkflowOptions can be used to customize the update workflow options +func (opts *SomeUpdate1UpdateOptions) WithUpdateWorkflowOptions(uwo client.UpdateWorkflowWithOptionsRequest) *SomeUpdate1UpdateOptions { + opts.UpdateWorkflowOptions = &uwo + return opts +} + // SomeUpdate1Handle provides a handle to a SomeUpdate1 workflow update type SomeUpdate1Handle interface { // Cancel cancels the update activity @@ -1252,6 +1402,11 @@ func SomeUpdate1Async(ctx workflow.Context, workflowID string, runID string, req opt.HeartbeatInterval = time.Second * 30 } + if opt.HeartbeatInterval == 0 { + opt.HeartbeatInterval = time.Second * 30 + } + + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -1260,7 +1415,7 @@ func SomeUpdate1Async(ctx workflow.Context, workflowID string, runID string, req ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + ao.ScheduleToCloseTimeout = 300000000000 // 5 minutes } ctx = workflow.WithActivityOptions(ctx, ao) @@ -1355,7 +1510,11 @@ func (a *simpleActivities) SomeWorkflow1(ctx context.Context, input *v1.Workflow // unmarshal workflow request var req simple.SomeWorkflow1Request if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeWorkflow1Request", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution @@ -1493,7 +1652,11 @@ func (a *simpleActivities) SomeWorkflow3(ctx context.Context, input *v1.Workflow // unmarshal workflow request var req simple.SomeWorkflow3Request if err := input.Request.UnmarshalTo(&req); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeWorkflow3Request", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution @@ -1543,13 +1706,21 @@ func (a *simpleActivities) SomeWorkflow3WithSomeSignal2(ctx context.Context, inp // unmarshal workflow request var req simple.SomeWorkflow3Request if err := input.Request.UnmarshalTo(&req); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeWorkflow3Request", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // unmarshal signal request var signal simple.SomeSignal2Request if err := input.Signal.UnmarshalTo(&signal); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling signal request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeSignal2Request", input.Signal.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution @@ -1595,43 +1766,165 @@ func (a *simpleActivities) SomeWorkflow3WithSomeSignal2(ctx context.Context, inp } // SomeQuery1 executes a(n) mycompany.simple.Simple.SomeQuery1 query via an activity -func (a *simpleActivities) SomeQuery1(ctx context.Context, input *v1.QueryRequest) (*simple.SomeQuery1Response, error) { - return a.client.SomeQuery1(ctx, input.GetWorkflowId(), input.GetRunId()) +func (a *simpleActivities) SomeQuery1(ctx context.Context, input *v1.QueryRequest) (resp *simple.SomeQuery1Response, err error) { + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + resp, err = a.client.SomeQuery1(ctx, input.GetWorkflowId(), input.GetRunId()) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return nil, ctx.Err() + case <-doneCh: + return resp, err + } + } } // SomeQuery2 executes a(n) mycompany.simple.Simple.SomeQuery2 query via an activity -func (a *simpleActivities) SomeQuery2(ctx context.Context, input *v1.QueryRequest) (*simple.SomeQuery2Response, error) { +func (a *simpleActivities) SomeQuery2(ctx context.Context, input *v1.QueryRequest) (resp *simple.SomeQuery2Response, err error) { // unmarshal query request var req simple.SomeQuery2Request if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling query request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeQuery2Request", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) + } + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + resp, err = a.client.SomeQuery2(ctx, input.GetWorkflowId(), input.GetRunId(), &req) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return nil, ctx.Err() + case <-doneCh: + return resp, err + } } - return a.client.SomeQuery2(ctx, input.GetWorkflowId(), input.GetRunId(), &req) } // SomeSignal1 executes a(n) mycompany.simple.Simple.SomeSignal1 signal via an activity -func (a *simpleActivities) SomeSignal1(ctx context.Context, input *v1.SignalRequest) error { - return a.client.SomeSignal1(ctx, input.GetWorkflowId(), input.GetRunId()) +func (a *simpleActivities) SomeSignal1(ctx context.Context, input *v1.SignalRequest) (err error) { + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + err = a.client.SomeSignal1(ctx, input.GetWorkflowId(), input.GetRunId()) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return ctx.Err() + case <-doneCh: + return err + } + } } // SomeSignal2 executes a(n) mycompany.simple.Simple.SomeSignal2 signal via an activity -func (a *simpleActivities) SomeSignal2(ctx context.Context, input *v1.SignalRequest) error { +func (a *simpleActivities) SomeSignal2(ctx context.Context, input *v1.SignalRequest) (err error) { // unmarshal signal request var req simple.SomeSignal2Request if err := input.Request.UnmarshalTo(&req); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling signal request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeSignal2Request", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) + } + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + err = a.client.SomeSignal2(ctx, input.GetWorkflowId(), input.GetRunId(), &req) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return ctx.Err() + case <-doneCh: + return err + } } - return a.client.SomeSignal2(ctx, input.GetWorkflowId(), input.GetRunId(), &req) } // SomeSignal3 executes a(n) mycompany.simple.Simple.SomeSignal3 signal via an activity -func (a *simpleActivities) SomeSignal3(ctx context.Context, input *v1.SignalRequest) error { +func (a *simpleActivities) SomeSignal3(ctx context.Context, input *v1.SignalRequest) (err error) { // unmarshal signal request var req simple.SomeSignal3Request if err := input.Request.UnmarshalTo(&req); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling signal request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeSignal3Request", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) + } + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + err = a.client.SomeSignal3(ctx, input.GetWorkflowId(), input.GetRunId(), &req) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return ctx.Err() + case <-doneCh: + return err + } } - return a.client.SomeSignal3(ctx, input.GetWorkflowId(), input.GetRunId(), &req) } // SomeUpdate1 executes a(n) mycompany.simple.Simple.SomeUpdate1 update via an activity @@ -1657,7 +1950,11 @@ func (a *simpleActivities) SomeUpdate1(ctx context.Context, input *v1.UpdateRequ // unmarshal update request var req simple.SomeUpdate1Request if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling update request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.SomeUpdate1Request", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize update execution @@ -1709,6 +2006,35 @@ type OtherWorkflowWorkflowOptions struct { StartWorkflowOptions *client.StartWorkflowOptions } +// NewOtherWorkflowWorkflowOptions initializes a new OtherWorkflowWorkflowOptions value +func NewOtherWorkflowWorkflowOptions() *OtherWorkflowWorkflowOptions { + return &OtherWorkflowWorkflowOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *OtherWorkflowWorkflowOptions) WithActivityOptions(ao workflow.ActivityOptions) *OtherWorkflowWorkflowOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithDetached can be used to start a workflow execution and exit immediately +func (opts *OtherWorkflowWorkflowOptions) WithDetached(d bool) *OtherWorkflowWorkflowOptions { + opts.Detached = d + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *OtherWorkflowWorkflowOptions) WithHeartbeatInterval(d time.Duration) *OtherWorkflowWorkflowOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithStartWorkflowOptions can be used to customize the start workflow options +func (opts *OtherWorkflowWorkflowOptions) WithStartWorkflow(swo client.StartWorkflowOptions) *OtherWorkflowWorkflowOptions { + opts.StartWorkflowOptions = &swo + return opts +} + // OtherWorkflowRun provides a handle to a OtherWorkflow workflow execution type OtherWorkflowRun interface { // Cancel cancels the workflow @@ -1770,6 +2096,7 @@ func OtherWorkflow(ctx workflow.Context, req *simple.OtherWorkflowRequest, opts // OtherWorkflowAsync executes a(n) mycompany.simple.Other.OtherWorkflow workflow and blocks until error or response received func OtherWorkflowAsync(ctx workflow.Context, req *simple.OtherWorkflowRequest, opts ...*OtherWorkflowWorkflowOptions) (OtherWorkflowRun, error) { + // configure xns options opt := &OtherWorkflowWorkflowOptions{} if len(opts) > 0 && opts[0] != nil { opt = opts[0] @@ -1778,6 +2105,7 @@ func OtherWorkflowAsync(ctx workflow.Context, req *simple.OtherWorkflowRequest, opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -1786,10 +2114,11 @@ func OtherWorkflowAsync(ctx workflow.Context, req *simple.OtherWorkflowRequest, ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + ao.ScheduleToCloseTimeout = 86400000000000 // 1 day } ctx = workflow.WithActivityOptions(ctx, ao) + // configure start workflow options wo := client.StartWorkflowOptions{} if opt.StartWorkflowOptions != nil { wo = *opt.StartWorkflowOptions @@ -1809,16 +2138,19 @@ func OtherWorkflowAsync(ctx workflow.Context, req *simple.OtherWorkflowRequest, wo.ID = id.String() } + // marshal start workflow options protobuf message swo, err := xns.MarshalStartWorkflowOptions(wo) if err != nil { return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &otherWorkflowRun{ @@ -1910,11 +2242,12 @@ func OtherQueryAsync(ctx workflow.Context, workflowID string, runID string, opts if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { opt.HeartbeatInterval = time.Second * 30 } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -1923,7 +2256,7 @@ func OtherQueryAsync(ctx workflow.Context, workflowID string, runID string, opts ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + ao.ScheduleToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -1933,8 +2266,9 @@ func OtherQueryAsync(ctx workflow.Context, workflowID string, runID string, opts return &otherQueryQueryHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, simple.OtherQueryQueryName, &v1.QueryRequest{ - WorkflowId: workflowID, - RunId: runID, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, }), }, nil } @@ -2012,11 +2346,12 @@ func OtherSignalAsync(ctx workflow.Context, workflowID string, runID string, req if len(opts) > 0 && opts[0] != nil { opt = opts[0] } + if opt.HeartbeatInterval == 0 { opt.HeartbeatInterval = time.Second * 30 } - // build and set activity options + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -2025,7 +2360,7 @@ func OtherSignalAsync(ctx workflow.Context, workflowID string, runID string, req ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Minute * 2 + ao.ScheduleToCloseTimeout = 60000000000 // 1 minute } ctx = workflow.WithActivityOptions(ctx, ao) @@ -2041,9 +2376,10 @@ func OtherSignalAsync(ctx workflow.Context, workflowID string, runID string, req return &otherSignalSignalHandle{ cancel: cancel, future: workflow.ExecuteActivity(ctx, simple.OtherSignalSignalName, &v1.SignalRequest{ - WorkflowId: workflowID, - RunId: runID, - Request: wreq, + HeartbeatInterval: durationpb.New(opt.HeartbeatInterval), + WorkflowId: workflowID, + RunId: runID, + Request: wreq, }), }, nil } @@ -2055,6 +2391,29 @@ type OtherUpdateUpdateOptions struct { UpdateWorkflowOptions *client.UpdateWorkflowWithOptionsRequest } +// NewOtherUpdateUpdateOptions initializes a new OtherUpdateUpdateOptions value +func NewOtherUpdateUpdateOptions() *OtherUpdateUpdateOptions { + return &OtherUpdateUpdateOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *OtherUpdateUpdateOptions) WithActivityOptions(ao workflow.ActivityOptions) *OtherUpdateUpdateOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *OtherUpdateUpdateOptions) WithHeartbeatInterval(d time.Duration) *OtherUpdateUpdateOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithUpdateWorkflowOptions can be used to customize the update workflow options +func (opts *OtherUpdateUpdateOptions) WithUpdateWorkflowOptions(uwo client.UpdateWorkflowWithOptionsRequest) *OtherUpdateUpdateOptions { + opts.UpdateWorkflowOptions = &uwo + return opts +} + // OtherUpdateHandle provides a handle to a OtherUpdate workflow update type OtherUpdateHandle interface { // Cancel cancels the update activity @@ -2121,6 +2480,11 @@ func OtherUpdateAsync(ctx workflow.Context, workflowID string, runID string, req opt.HeartbeatInterval = time.Second * 30 } + if opt.HeartbeatInterval == 0 { + opt.HeartbeatInterval = time.Second * 30 + } + + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -2129,7 +2493,7 @@ func OtherUpdateAsync(ctx workflow.Context, workflowID string, runID string, req ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + ao.ScheduleToCloseTimeout = 300000000000 // 5 minutes } ctx = workflow.WithActivityOptions(ctx, ao) @@ -2217,7 +2581,11 @@ func (a *otherActivities) OtherWorkflow(ctx context.Context, input *v1.WorkflowR // unmarshal workflow request var req simple.OtherWorkflowRequest if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.OtherWorkflowRequest", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution @@ -2263,18 +2631,66 @@ func (a *otherActivities) OtherWorkflow(ctx context.Context, input *v1.WorkflowR } // OtherQuery executes a(n) mycompany.simple.Other.OtherQuery query via an activity -func (a *otherActivities) OtherQuery(ctx context.Context, input *v1.QueryRequest) (*simple.OtherQueryResponse, error) { - return a.client.OtherQuery(ctx, input.GetWorkflowId(), input.GetRunId()) +func (a *otherActivities) OtherQuery(ctx context.Context, input *v1.QueryRequest) (resp *simple.OtherQueryResponse, err error) { + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + resp, err = a.client.OtherQuery(ctx, input.GetWorkflowId(), input.GetRunId()) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return nil, ctx.Err() + case <-doneCh: + return resp, err + } + } } // OtherSignal executes a(n) mycompany.simple.Other.OtherSignal signal via an activity -func (a *otherActivities) OtherSignal(ctx context.Context, input *v1.SignalRequest) error { +func (a *otherActivities) OtherSignal(ctx context.Context, input *v1.SignalRequest) (err error) { // unmarshal signal request var req simple.OtherSignalRequest if err := input.Request.UnmarshalTo(&req); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling signal request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.OtherSignalRequest", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) + } + // execute signal in child goroutine + doneCh := make(chan struct{}) + go func() { + err = a.client.OtherSignal(ctx, input.GetWorkflowId(), input.GetRunId(), &req) + close(doneCh) + }() + + heartbeatInterval := input.GetHeartbeatInterval().AsDuration() + if heartbeatInterval == 0 { + heartbeatInterval = time.Second * 10 + } + + // heartbeat activity while waiting for signal to complete + for { + select { + case <-time.After(heartbeatInterval): + activity.RecordHeartbeat(ctx) + case <-ctx.Done(): + return ctx.Err() + case <-doneCh: + return err + } } - return a.client.OtherSignal(ctx, input.GetWorkflowId(), input.GetRunId(), &req) } // OtherUpdate executes a(n) mycompany.simple.Other.OtherUpdate update via an activity @@ -2300,7 +2716,11 @@ func (a *otherActivities) OtherUpdate(ctx context.Context, input *v1.UpdateReque // unmarshal update request var req simple.OtherUpdateRequest if err := input.Request.UnmarshalTo(&req); err != nil { - return nil, err + return nil, temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling update request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.OtherUpdateRequest", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize update execution @@ -2352,6 +2772,35 @@ type WhatWorkflowOptions struct { StartWorkflowOptions *client.StartWorkflowOptions } +// NewWhatWorkflowOptions initializes a new WhatWorkflowOptions value +func NewWhatWorkflowOptions() *WhatWorkflowOptions { + return &WhatWorkflowOptions{} +} + +// WithActivityOptions can be used to customize the activity options +func (opts *WhatWorkflowOptions) WithActivityOptions(ao workflow.ActivityOptions) *WhatWorkflowOptions { + opts.ActivityOptions = &ao + return opts +} + +// WithDetached can be used to start a workflow execution and exit immediately +func (opts *WhatWorkflowOptions) WithDetached(d bool) *WhatWorkflowOptions { + opts.Detached = d + return opts +} + +// WithHeartbeatInterval can be used to customize the activity heartbeat interval +func (opts *WhatWorkflowOptions) WithHeartbeatInterval(d time.Duration) *WhatWorkflowOptions { + opts.HeartbeatInterval = d + return opts +} + +// WithStartWorkflowOptions can be used to customize the start workflow options +func (opts *WhatWorkflowOptions) WithStartWorkflow(swo client.StartWorkflowOptions) *WhatWorkflowOptions { + opts.StartWorkflowOptions = &swo + return opts +} + // WhatRun provides a handle to a What workflow execution type WhatRun interface { // Cancel cancels the workflow @@ -2412,6 +2861,7 @@ func What(ctx workflow.Context, req *simple.WhatRequest, opts ...*WhatWorkflowOp // WhatAsync executes a(n) mycompany.simple.Ignored.What workflow and blocks until error or response received func WhatAsync(ctx workflow.Context, req *simple.WhatRequest, opts ...*WhatWorkflowOptions) (WhatRun, error) { + // configure xns options opt := &WhatWorkflowOptions{} if len(opts) > 0 && opts[0] != nil { opt = opts[0] @@ -2420,6 +2870,7 @@ func WhatAsync(ctx workflow.Context, req *simple.WhatRequest, opts ...*WhatWorkf opt.HeartbeatInterval = time.Second * 30 } + // configure activity options ao := workflow.GetActivityOptions(ctx) if opt.ActivityOptions != nil { ao = *opt.ActivityOptions @@ -2428,10 +2879,11 @@ func WhatAsync(ctx workflow.Context, req *simple.WhatRequest, opts ...*WhatWorkf ao.HeartbeatTimeout = opt.HeartbeatInterval * 2 } if ao.StartToCloseTimeout == 0 && ao.ScheduleToCloseTimeout == 0 { - ao.StartToCloseTimeout = time.Hour * 24 + ao.ScheduleToCloseTimeout = 86400000000000 // 1 day } ctx = workflow.WithActivityOptions(ctx, ao) + // configure start workflow options wo := client.StartWorkflowOptions{} if opt.StartWorkflowOptions != nil { wo = *opt.StartWorkflowOptions @@ -2451,16 +2903,19 @@ func WhatAsync(ctx workflow.Context, req *simple.WhatRequest, opts ...*WhatWorkf wo.ID = id.String() } + // marshal start workflow options protobuf message swo, err := xns.MarshalStartWorkflowOptions(wo) if err != nil { return nil, fmt.Errorf("error marshalling start workflow options: %w", err) } + // marshal workflow request protobuf message wreq, err := anypb.New(req) if err != nil { return nil, fmt.Errorf("error marshalling workflow request: %w", err) } + // create cancellable context ctx, cancel := workflow.WithCancel(ctx) return &whatRun{ @@ -2512,7 +2967,11 @@ func (a *ignoredActivities) What(ctx context.Context, input *v1.WorkflowRequest) // unmarshal workflow request var req simple.WhatRequest if err := input.Request.UnmarshalTo(&req); err != nil { - return err + return temporal.NewNonRetryableApplicationError( + fmt.Sprintf("error unmarshalling workflow request of type %s as github.com/cludden/protoc-gen-go-temporal/gen/simple.WhatRequest", input.Request.GetTypeUrl()), + "InvalidArgument", + err, + ) } // initialize workflow execution diff --git a/gen/temporal/v1/temporal.pb.go b/gen/temporal/v1/temporal.pb.go index 0f2608b1..538be88b 100644 --- a/gen/temporal/v1/temporal.pb.go +++ b/gen/temporal/v1/temporal.pb.go @@ -452,6 +452,8 @@ type QueryOptions struct { // Fully-qualified query name Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // XNS can be used to configure default activity options for xns workflow executions + Xns *XNSActivityOptions `protobuf:"bytes,2,opt,name=xns,proto3" json:"xns,omitempty"` } func (x *QueryOptions) Reset() { @@ -493,6 +495,13 @@ func (x *QueryOptions) GetName() string { return "" } +func (x *QueryOptions) GetXns() *XNSActivityOptions { + if x != nil { + return x.Xns + } + return nil +} + // RetryPolicy describes configuration for activity or child workflow retries type RetryPolicy struct { state protoimpl.MessageState @@ -641,6 +650,8 @@ type SignalOptions struct { // Fully-qualified signal name Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // XNS can be used to configure default activity options for xns workflow executions + Xns *XNSActivityOptions `protobuf:"bytes,2,opt,name=xns,proto3" json:"xns,omitempty"` } func (x *SignalOptions) Reset() { @@ -682,6 +693,13 @@ func (x *SignalOptions) GetName() string { return "" } +func (x *SignalOptions) GetXns() *XNSActivityOptions { + if x != nil { + return x.Xns + } + return nil +} + // UpdateOptions identifies an rpc method as a Temporal update definition, and describes // available update configuration options type UpdateOptions struct { @@ -697,6 +715,8 @@ type UpdateOptions struct { Validate bool `protobuf:"varint,2,opt,name=validate,proto3" json:"validate,omitempty"` // Default wait policy if not specified WaitPolicy WaitPolicy `protobuf:"varint,3,opt,name=wait_policy,json=waitPolicy,proto3,enum=temporal.v1.WaitPolicy" json:"wait_policy,omitempty"` + // XNS can be used to configure default activity options for xns workflow executions + Xns *XNSActivityOptions `protobuf:"bytes,5,opt,name=xns,proto3" json:"xns,omitempty"` } func (x *UpdateOptions) Reset() { @@ -759,6 +779,13 @@ func (x *UpdateOptions) GetWaitPolicy() WaitPolicy { return WaitPolicy_WAIT_POLICY_UNSPECIFIED } +func (x *UpdateOptions) GetXns() *XNSActivityOptions { + if x != nil { + return x.Xns + } + return nil +} + // WorkflowOptions identifies an rpc method as a Temporal workflow definition, and describes // available workflow configuration options type WorkflowOptions struct { @@ -801,6 +828,8 @@ type WorkflowOptions struct { // WaitForCancellation specifies whether to wait for canceled child workflow to be ended // (child workflow can be ended as: completed/failed/timedout/terminated/canceled) WaitForCancellation bool `protobuf:"varint,13,opt,name=wait_for_cancellation,json=waitForCancellation,proto3" json:"wait_for_cancellation,omitempty"` + // XNS can be used to configure default activity options for xns workflow executions + Xns *XNSActivityOptions `protobuf:"bytes,16,opt,name=xns,proto3" json:"xns,omitempty"` } func (x *WorkflowOptions) Reset() { @@ -940,6 +969,125 @@ func (x *WorkflowOptions) GetWaitForCancellation() bool { return false } +func (x *WorkflowOptions) GetXns() *XNSActivityOptions { + if x != nil { + return x.Xns + } + return nil +} + +type XNSActivityOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Fully-qualified xns activity name + Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"` + // Override default task queue for activity + TaskQueue string `protobuf:"bytes,1,opt,name=task_queue,json=taskQueue,proto3" json:"task_queue,omitempty"` + // Total time that a workflow is willing to wait for Activity to complete + ScheduleToCloseTimeout *durationpb.Duration `protobuf:"bytes,2,opt,name=schedule_to_close_timeout,json=scheduleToCloseTimeout,proto3" json:"schedule_to_close_timeout,omitempty"` + // Time that the Activity Task can stay in the Task Queue before it is picked up by + // a Worker + ScheduleToStartTimeout *durationpb.Duration `protobuf:"bytes,3,opt,name=schedule_to_start_timeout,json=scheduleToStartTimeout,proto3" json:"schedule_to_start_timeout,omitempty"` + // Maximum time of a single Activity execution attempt + StartToCloseTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=start_to_close_timeout,json=startToCloseTimeout,proto3" json:"start_to_close_timeout,omitempty"` + // HeartbeatInterval configures the default heartbeat interval + HeartbeatInterval *durationpb.Duration `protobuf:"bytes,8,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` + // Heartbeat timeout. Activity must call Activity.RecordHeartbeat(ctx, "my-heartbeat") + HeartbeatTimeout *durationpb.Duration `protobuf:"bytes,5,opt,name=heartbeat_timeout,json=heartbeatTimeout,proto3" json:"heartbeat_timeout,omitempty"` + // Specifies how to retry an Activity if an error occurs + RetryPolicy *RetryPolicy `protobuf:"bytes,6,opt,name=retry_policy,json=retryPolicy,proto3" json:"retry_policy,omitempty"` +} + +func (x *XNSActivityOptions) Reset() { + *x = XNSActivityOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_temporal_v1_temporal_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *XNSActivityOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*XNSActivityOptions) ProtoMessage() {} + +func (x *XNSActivityOptions) ProtoReflect() protoreflect.Message { + mi := &file_temporal_v1_temporal_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use XNSActivityOptions.ProtoReflect.Descriptor instead. +func (*XNSActivityOptions) Descriptor() ([]byte, []int) { + return file_temporal_v1_temporal_proto_rawDescGZIP(), []int{9} +} + +func (x *XNSActivityOptions) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *XNSActivityOptions) GetTaskQueue() string { + if x != nil { + return x.TaskQueue + } + return "" +} + +func (x *XNSActivityOptions) GetScheduleToCloseTimeout() *durationpb.Duration { + if x != nil { + return x.ScheduleToCloseTimeout + } + return nil +} + +func (x *XNSActivityOptions) GetScheduleToStartTimeout() *durationpb.Duration { + if x != nil { + return x.ScheduleToStartTimeout + } + return nil +} + +func (x *XNSActivityOptions) GetStartToCloseTimeout() *durationpb.Duration { + if x != nil { + return x.StartToCloseTimeout + } + return nil +} + +func (x *XNSActivityOptions) GetHeartbeatInterval() *durationpb.Duration { + if x != nil { + return x.HeartbeatInterval + } + return nil +} + +func (x *XNSActivityOptions) GetHeartbeatTimeout() *durationpb.Duration { + if x != nil { + return x.HeartbeatTimeout + } + return nil +} + +func (x *XNSActivityOptions) GetRetryPolicy() *RetryPolicy { + if x != nil { + return x.RetryPolicy + } + return nil +} + // Query identifies a query supported by the worklow type WorkflowOptions_Query struct { state protoimpl.MessageState @@ -948,12 +1096,14 @@ type WorkflowOptions_Query struct { // Query name Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` + // XNS can be used to configure default activity options for xns workflow executions + Xns *XNSActivityOptions `protobuf:"bytes,2,opt,name=xns,proto3" json:"xns,omitempty"` } func (x *WorkflowOptions_Query) Reset() { *x = WorkflowOptions_Query{} if protoimpl.UnsafeEnabled { - mi := &file_temporal_v1_temporal_proto_msgTypes[9] + mi := &file_temporal_v1_temporal_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -966,7 +1116,7 @@ func (x *WorkflowOptions_Query) String() string { func (*WorkflowOptions_Query) ProtoMessage() {} func (x *WorkflowOptions_Query) ProtoReflect() protoreflect.Message { - mi := &file_temporal_v1_temporal_proto_msgTypes[9] + mi := &file_temporal_v1_temporal_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -989,6 +1139,13 @@ func (x *WorkflowOptions_Query) GetRef() string { return "" } +func (x *WorkflowOptions_Query) GetXns() *XNSActivityOptions { + if x != nil { + return x.Xns + } + return nil +} + // Signal identifies a signal supported by the workflow type WorkflowOptions_Signal struct { state protoimpl.MessageState @@ -999,12 +1156,14 @@ type WorkflowOptions_Signal struct { Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` // Include convenience method for signal with start Start bool `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` + // XNS can be used to configure default activity options for xns workflow executions + Xns *XNSActivityOptions `protobuf:"bytes,3,opt,name=xns,proto3" json:"xns,omitempty"` } func (x *WorkflowOptions_Signal) Reset() { *x = WorkflowOptions_Signal{} if protoimpl.UnsafeEnabled { - mi := &file_temporal_v1_temporal_proto_msgTypes[10] + mi := &file_temporal_v1_temporal_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1017,7 +1176,7 @@ func (x *WorkflowOptions_Signal) String() string { func (*WorkflowOptions_Signal) ProtoMessage() {} func (x *WorkflowOptions_Signal) ProtoReflect() protoreflect.Message { - mi := &file_temporal_v1_temporal_proto_msgTypes[10] + mi := &file_temporal_v1_temporal_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1047,6 +1206,13 @@ func (x *WorkflowOptions_Signal) GetStart() bool { return false } +func (x *WorkflowOptions_Signal) GetXns() *XNSActivityOptions { + if x != nil { + return x.Xns + } + return nil +} + // Update identifies an update supported by the workflow type WorkflowOptions_Update struct { state protoimpl.MessageState @@ -1055,12 +1221,14 @@ type WorkflowOptions_Update struct { // Update name Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` + // XNS can be used to configure default activity options for xns workflow executions + Xns *XNSActivityOptions `protobuf:"bytes,2,opt,name=xns,proto3" json:"xns,omitempty"` } func (x *WorkflowOptions_Update) Reset() { *x = WorkflowOptions_Update{} if protoimpl.UnsafeEnabled { - mi := &file_temporal_v1_temporal_proto_msgTypes[11] + mi := &file_temporal_v1_temporal_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1073,7 +1241,7 @@ func (x *WorkflowOptions_Update) String() string { func (*WorkflowOptions_Update) ProtoMessage() {} func (x *WorkflowOptions_Update) ProtoReflect() protoreflect.Message { - mi := &file_temporal_v1_temporal_proto_msgTypes[11] + mi := &file_temporal_v1_temporal_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1096,6 +1264,13 @@ func (x *WorkflowOptions_Update) GetRef() string { return "" } +func (x *WorkflowOptions_Update) GetXns() *XNSActivityOptions { + if x != nil { + return x.Xns + } + return nil +} + var file_temporal_v1_temporal_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.ServiceOptions)(nil), @@ -1230,194 +1405,250 @@ var file_temporal_v1_temporal_proto_rawDesc = []byte{ 0x08, 0x52, 0x06, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x67, 0x6e, - 0x6f, 0x72, 0x65, 0x22, 0x22, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x72, 0x65, 0x22, 0x55, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x52, 0x65, 0x74, 0x72, - 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x44, 0x0a, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2f, 0x0a, - 0x13, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x63, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, - 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x12, 0x62, 0x61, 0x63, 0x6b, - 0x6f, 0x66, 0x66, 0x43, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x3c, - 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x03, 0x78, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x58, 0x4e, 0x53, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x03, 0x78, 0x6e, 0x73, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x52, + 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x44, 0x0a, 0x10, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0b, 0x6d, 0x61, 0x78, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x21, 0x0a, 0x0c, - 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x12, - 0x39, 0x0a, 0x19, 0x6e, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x16, 0x6e, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x4d, 0x0a, 0x0e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, - 0x73, 0x6b, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x74, 0x61, 0x73, 0x6b, 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x23, 0x0a, 0x0d, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x89, - 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x12, 0x38, 0x0a, 0x0b, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, - 0x77, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x83, 0x07, 0x0a, 0x0f, 0x57, - 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3b, 0x0a, 0x06, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, - 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, - 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x06, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x6d, 0x70, - 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, - 0x0a, 0x0f, 0x69, 0x64, 0x5f, 0x72, 0x65, 0x75, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, - 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x44, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x52, 0x0d, 0x69, 0x64, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x4e, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, - 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, - 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x11, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x12, 0x3b, 0x0a, 0x0c, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x0b, 0x72, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3a, 0x0a, - 0x0b, 0x72, 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x72, - 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x71, - 0x75, 0x65, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, - 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x12, 0x2f, 0x0a, 0x13, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x63, 0x6f, 0x65, 0x66, + 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x12, 0x62, + 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x43, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, + 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, + 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x6e, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x6e, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x61, + 0x62, 0x6c, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x4d, 0x0a, + 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x56, 0x0a, 0x0d, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x31, 0x0a, 0x03, 0x78, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x58, 0x4e, 0x53, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x03, 0x78, 0x6e, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x74, 0x65, + 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, 0x77, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x31, 0x0a, 0x03, 0x78, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x58, 0x4e, 0x53, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x03, + 0x78, 0x6e, 0x73, 0x22, 0xcf, 0x08, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x6d, + 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3b, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x46, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x0f, 0x69, 0x64, 0x5f, 0x72, 0x65, + 0x75, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x49, + 0x44, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0d, 0x69, 0x64, + 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x13, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6c, + 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3b, 0x0a, 0x0c, 0x72, 0x65, 0x74, + 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0b, 0x72, 0x65, 0x74, 0x72, 0x79, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3a, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x5f, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x13, 0x77, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x3c, + 0x0a, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x32, 0x0a, 0x15, + 0x77, 0x61, 0x69, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x77, 0x61, 0x69, + 0x74, 0x46, 0x6f, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x31, 0x0a, 0x03, 0x78, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x58, 0x4e, 0x53, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x03, + 0x78, 0x6e, 0x73, 0x1a, 0x4c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x31, + 0x0a, 0x03, 0x78, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, + 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x58, 0x4e, 0x53, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x03, 0x78, 0x6e, + 0x73, 0x1a, 0x63, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x72, + 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x78, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x58, + 0x4e, 0x53, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x03, 0x78, 0x6e, 0x73, 0x1a, 0x4d, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, - 0x65, 0x66, 0x1a, 0x30, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, - 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x1a, 0x1a, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, - 0x2a, 0x3f, 0x0a, 0x0a, 0x43, 0x4c, 0x49, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, - 0x0a, 0x14, 0x43, 0x4c, 0x49, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x44, 0x49, - 0x53, 0x41, 0x4c, 0x42, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4c, 0x49, 0x5f, - 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, - 0x01, 0x2a, 0x83, 0x02, 0x0a, 0x0d, 0x49, 0x44, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x24, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, - 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2c, 0x0a, - 0x28, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, - 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, - 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x38, 0x0a, 0x34, 0x57, - 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, - 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x44, 0x55, - 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, - 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x2d, 0x0a, 0x29, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, + 0x65, 0x66, 0x12, 0x31, 0x0a, 0x03, 0x78, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x58, 0x4e, + 0x53, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x03, 0x78, 0x6e, 0x73, 0x22, 0x92, 0x04, 0x0a, 0x12, 0x58, 0x4e, 0x53, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, + 0x54, 0x0a, 0x19, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, + 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x6f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x54, 0x0a, 0x19, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x6f, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x4e, 0x0a, 0x16, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x6f, 0x43, + 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x48, 0x0a, 0x12, 0x68, + 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x46, 0x0a, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, + 0x61, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3b, 0x0a, + 0x0c, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0b, 0x72, + 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2a, 0x3f, 0x0a, 0x0a, 0x43, 0x4c, + 0x49, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4c, 0x49, 0x5f, + 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x42, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4c, 0x49, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, + 0x45, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x83, 0x02, 0x0a, 0x0d, + 0x49, 0x44, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x28, 0x0a, + 0x24, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, + 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2c, 0x0a, 0x28, 0x57, 0x4f, 0x52, 0x4b, 0x46, + 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, + 0x49, 0x43, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x38, 0x0a, 0x34, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, - 0x59, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, - 0x54, 0x45, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, - 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, - 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x46, 0x5f, 0x52, 0x55, - 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x2a, 0xa4, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x23, 0x0a, - 0x1f, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, - 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, - 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, - 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, - 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x42, 0x41, - 0x4e, 0x44, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, - 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x52, 0x45, - 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x10, 0x03, 0x2a, 0x78, - 0x0a, 0x0a, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1b, 0x0a, 0x17, - 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, - 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x54, 0x54, 0x45, - 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, - 0x43, 0x59, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x19, 0x0a, - 0x15, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x43, 0x4f, 0x4d, - 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x3a, 0x5a, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc1, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, - 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x88, 0x01, 0x01, 0x3a, 0x4e, 0x0a, 0x03, 0x63, 0x6c, 0x69, 0x12, 0x1f, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc2, 0x38, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x4c, 0x49, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x03, 0x63, 0x6c, - 0x69, 0x88, 0x01, 0x01, 0x3a, 0x5c, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, + 0x2d, 0x0a, 0x29, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, + 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x4a, 0x45, + 0x43, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x31, + 0x0a, 0x2d, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, + 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, + 0x4e, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x46, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, + 0x04, 0x2a, 0xa4, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, + 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x41, 0x52, 0x45, 0x4e, + 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, + 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, + 0x49, 0x43, 0x59, 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, + 0x1f, 0x0a, 0x1b, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, + 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x42, 0x41, 0x4e, 0x44, 0x4f, 0x4e, 0x10, 0x02, + 0x12, 0x26, 0x0a, 0x22, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, + 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, + 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x10, 0x03, 0x2a, 0x78, 0x0a, 0x0a, 0x57, 0x61, 0x69, 0x74, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1b, 0x0a, 0x17, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, + 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, + 0x43, 0x59, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, + 0x14, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x43, 0x43, + 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x57, 0x41, 0x49, 0x54, 0x5f, + 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, + 0x10, 0x03, 0x3a, 0x5a, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc1, + 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x88, 0x01, 0x01, 0x3a, 0x4e, + 0x0a, 0x03, 0x63, 0x6c, 0x69, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc2, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x4c, 0x49, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x03, 0x63, 0x6c, 0x69, 0x88, 0x01, 0x01, 0x3a, 0x5c, + 0x0a, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc2, 0x38, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x3a, 0x59, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc6, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x3a, 0x53, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xc2, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, - 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x88, - 0x01, 0x01, 0x3a, 0x59, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc6, 0x38, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x3a, 0x53, 0x0a, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x18, 0xc3, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x88, 0x01, 0x01, 0x3a, 0x56, 0x0a, 0x06, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc3, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x88, - 0x01, 0x01, 0x3a, 0x56, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x1e, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc4, 0x38, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x3a, 0x56, 0x0a, 0x06, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc5, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, - 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x88, - 0x01, 0x01, 0x3a, 0x5c, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x1e, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc4, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x88, 0x01, 0x01, 0x3a, 0x56, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc1, - 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x88, 0x01, 0x01, - 0x42, 0xb3, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, - 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6c, 0x75, 0x64, 0x64, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x76, 0x31, - 0x3b, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, - 0x58, 0xaa, 0x02, 0x0b, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x0b, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, - 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, - 0x61, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc5, + 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x88, 0x01, 0x01, 0x3a, 0x5c, 0x0a, 0x08, + 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc1, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x08, 0x77, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x88, 0x01, 0x01, 0x42, 0xb3, 0x01, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0d, + 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x75, 0x64, + 0x64, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, + 0x6f, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x74, + 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x65, 0x6d, 0x70, 0x6f, + 0x72, 0x61, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x54, 0x65, + 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x54, 0x65, 0x6d, 0x70, + 0x6f, 0x72, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, + 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0c, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1433,7 +1664,7 @@ func file_temporal_v1_temporal_proto_rawDescGZIP() []byte { } var file_temporal_v1_temporal_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_temporal_v1_temporal_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_temporal_v1_temporal_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_temporal_v1_temporal_proto_goTypes = []interface{}{ (CLIFeature)(0), // 0: temporal.v1.CLIFeature (IDReusePolicy)(0), // 1: temporal.v1.IDReusePolicy @@ -1448,52 +1679,66 @@ var file_temporal_v1_temporal_proto_goTypes = []interface{}{ (*SignalOptions)(nil), // 10: temporal.v1.SignalOptions (*UpdateOptions)(nil), // 11: temporal.v1.UpdateOptions (*WorkflowOptions)(nil), // 12: temporal.v1.WorkflowOptions - (*WorkflowOptions_Query)(nil), // 13: temporal.v1.WorkflowOptions.Query - (*WorkflowOptions_Signal)(nil), // 14: temporal.v1.WorkflowOptions.Signal - (*WorkflowOptions_Update)(nil), // 15: temporal.v1.WorkflowOptions.Update - (*durationpb.Duration)(nil), // 16: google.protobuf.Duration - (*descriptorpb.ServiceOptions)(nil), // 17: google.protobuf.ServiceOptions - (*descriptorpb.MethodOptions)(nil), // 18: google.protobuf.MethodOptions + (*XNSActivityOptions)(nil), // 13: temporal.v1.XNSActivityOptions + (*WorkflowOptions_Query)(nil), // 14: temporal.v1.WorkflowOptions.Query + (*WorkflowOptions_Signal)(nil), // 15: temporal.v1.WorkflowOptions.Signal + (*WorkflowOptions_Update)(nil), // 16: temporal.v1.WorkflowOptions.Update + (*durationpb.Duration)(nil), // 17: google.protobuf.Duration + (*descriptorpb.ServiceOptions)(nil), // 18: google.protobuf.ServiceOptions + (*descriptorpb.MethodOptions)(nil), // 19: google.protobuf.MethodOptions } var file_temporal_v1_temporal_proto_depIdxs = []int32{ - 16, // 0: temporal.v1.ActivityOptions.schedule_to_close_timeout:type_name -> google.protobuf.Duration - 16, // 1: temporal.v1.ActivityOptions.schedule_to_start_timeout:type_name -> google.protobuf.Duration - 16, // 2: temporal.v1.ActivityOptions.start_to_close_timeout:type_name -> google.protobuf.Duration - 16, // 3: temporal.v1.ActivityOptions.heartbeat_timeout:type_name -> google.protobuf.Duration + 17, // 0: temporal.v1.ActivityOptions.schedule_to_close_timeout:type_name -> google.protobuf.Duration + 17, // 1: temporal.v1.ActivityOptions.schedule_to_start_timeout:type_name -> google.protobuf.Duration + 17, // 2: temporal.v1.ActivityOptions.start_to_close_timeout:type_name -> google.protobuf.Duration + 17, // 3: temporal.v1.ActivityOptions.heartbeat_timeout:type_name -> google.protobuf.Duration 8, // 4: temporal.v1.ActivityOptions.retry_policy:type_name -> temporal.v1.RetryPolicy - 16, // 5: temporal.v1.RetryPolicy.initial_interval:type_name -> google.protobuf.Duration - 16, // 6: temporal.v1.RetryPolicy.max_interval:type_name -> google.protobuf.Duration - 3, // 7: temporal.v1.UpdateOptions.wait_policy:type_name -> temporal.v1.WaitPolicy - 13, // 8: temporal.v1.WorkflowOptions.query:type_name -> temporal.v1.WorkflowOptions.Query - 14, // 9: temporal.v1.WorkflowOptions.signal:type_name -> temporal.v1.WorkflowOptions.Signal - 15, // 10: temporal.v1.WorkflowOptions.update:type_name -> temporal.v1.WorkflowOptions.Update - 16, // 11: temporal.v1.WorkflowOptions.execution_timeout:type_name -> google.protobuf.Duration - 1, // 12: temporal.v1.WorkflowOptions.id_reuse_policy:type_name -> temporal.v1.IDReusePolicy - 2, // 13: temporal.v1.WorkflowOptions.parent_close_policy:type_name -> temporal.v1.ParentClosePolicy - 8, // 14: temporal.v1.WorkflowOptions.retry_policy:type_name -> temporal.v1.RetryPolicy - 16, // 15: temporal.v1.WorkflowOptions.run_timeout:type_name -> google.protobuf.Duration - 16, // 16: temporal.v1.WorkflowOptions.task_timeout:type_name -> google.protobuf.Duration - 17, // 17: temporal.v1.service:extendee -> google.protobuf.ServiceOptions - 17, // 18: temporal.v1.cli:extendee -> google.protobuf.ServiceOptions - 18, // 19: temporal.v1.activity:extendee -> google.protobuf.MethodOptions - 18, // 20: temporal.v1.command:extendee -> google.protobuf.MethodOptions - 18, // 21: temporal.v1.query:extendee -> google.protobuf.MethodOptions - 18, // 22: temporal.v1.signal:extendee -> google.protobuf.MethodOptions - 18, // 23: temporal.v1.update:extendee -> google.protobuf.MethodOptions - 18, // 24: temporal.v1.workflow:extendee -> google.protobuf.MethodOptions - 9, // 25: temporal.v1.service:type_name -> temporal.v1.ServiceOptions - 5, // 26: temporal.v1.cli:type_name -> temporal.v1.CLIOptions - 4, // 27: temporal.v1.activity:type_name -> temporal.v1.ActivityOptions - 6, // 28: temporal.v1.command:type_name -> temporal.v1.CommandOptions - 7, // 29: temporal.v1.query:type_name -> temporal.v1.QueryOptions - 10, // 30: temporal.v1.signal:type_name -> temporal.v1.SignalOptions - 11, // 31: temporal.v1.update:type_name -> temporal.v1.UpdateOptions - 12, // 32: temporal.v1.workflow:type_name -> temporal.v1.WorkflowOptions - 33, // [33:33] is the sub-list for method output_type - 33, // [33:33] is the sub-list for method input_type - 25, // [25:33] is the sub-list for extension type_name - 17, // [17:25] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 13, // 5: temporal.v1.QueryOptions.xns:type_name -> temporal.v1.XNSActivityOptions + 17, // 6: temporal.v1.RetryPolicy.initial_interval:type_name -> google.protobuf.Duration + 17, // 7: temporal.v1.RetryPolicy.max_interval:type_name -> google.protobuf.Duration + 13, // 8: temporal.v1.SignalOptions.xns:type_name -> temporal.v1.XNSActivityOptions + 3, // 9: temporal.v1.UpdateOptions.wait_policy:type_name -> temporal.v1.WaitPolicy + 13, // 10: temporal.v1.UpdateOptions.xns:type_name -> temporal.v1.XNSActivityOptions + 14, // 11: temporal.v1.WorkflowOptions.query:type_name -> temporal.v1.WorkflowOptions.Query + 15, // 12: temporal.v1.WorkflowOptions.signal:type_name -> temporal.v1.WorkflowOptions.Signal + 16, // 13: temporal.v1.WorkflowOptions.update:type_name -> temporal.v1.WorkflowOptions.Update + 17, // 14: temporal.v1.WorkflowOptions.execution_timeout:type_name -> google.protobuf.Duration + 1, // 15: temporal.v1.WorkflowOptions.id_reuse_policy:type_name -> temporal.v1.IDReusePolicy + 2, // 16: temporal.v1.WorkflowOptions.parent_close_policy:type_name -> temporal.v1.ParentClosePolicy + 8, // 17: temporal.v1.WorkflowOptions.retry_policy:type_name -> temporal.v1.RetryPolicy + 17, // 18: temporal.v1.WorkflowOptions.run_timeout:type_name -> google.protobuf.Duration + 17, // 19: temporal.v1.WorkflowOptions.task_timeout:type_name -> google.protobuf.Duration + 13, // 20: temporal.v1.WorkflowOptions.xns:type_name -> temporal.v1.XNSActivityOptions + 17, // 21: temporal.v1.XNSActivityOptions.schedule_to_close_timeout:type_name -> google.protobuf.Duration + 17, // 22: temporal.v1.XNSActivityOptions.schedule_to_start_timeout:type_name -> google.protobuf.Duration + 17, // 23: temporal.v1.XNSActivityOptions.start_to_close_timeout:type_name -> google.protobuf.Duration + 17, // 24: temporal.v1.XNSActivityOptions.heartbeat_interval:type_name -> google.protobuf.Duration + 17, // 25: temporal.v1.XNSActivityOptions.heartbeat_timeout:type_name -> google.protobuf.Duration + 8, // 26: temporal.v1.XNSActivityOptions.retry_policy:type_name -> temporal.v1.RetryPolicy + 13, // 27: temporal.v1.WorkflowOptions.Query.xns:type_name -> temporal.v1.XNSActivityOptions + 13, // 28: temporal.v1.WorkflowOptions.Signal.xns:type_name -> temporal.v1.XNSActivityOptions + 13, // 29: temporal.v1.WorkflowOptions.Update.xns:type_name -> temporal.v1.XNSActivityOptions + 18, // 30: temporal.v1.service:extendee -> google.protobuf.ServiceOptions + 18, // 31: temporal.v1.cli:extendee -> google.protobuf.ServiceOptions + 19, // 32: temporal.v1.activity:extendee -> google.protobuf.MethodOptions + 19, // 33: temporal.v1.command:extendee -> google.protobuf.MethodOptions + 19, // 34: temporal.v1.query:extendee -> google.protobuf.MethodOptions + 19, // 35: temporal.v1.signal:extendee -> google.protobuf.MethodOptions + 19, // 36: temporal.v1.update:extendee -> google.protobuf.MethodOptions + 19, // 37: temporal.v1.workflow:extendee -> google.protobuf.MethodOptions + 9, // 38: temporal.v1.service:type_name -> temporal.v1.ServiceOptions + 5, // 39: temporal.v1.cli:type_name -> temporal.v1.CLIOptions + 4, // 40: temporal.v1.activity:type_name -> temporal.v1.ActivityOptions + 6, // 41: temporal.v1.command:type_name -> temporal.v1.CommandOptions + 7, // 42: temporal.v1.query:type_name -> temporal.v1.QueryOptions + 10, // 43: temporal.v1.signal:type_name -> temporal.v1.SignalOptions + 11, // 44: temporal.v1.update:type_name -> temporal.v1.UpdateOptions + 12, // 45: temporal.v1.workflow:type_name -> temporal.v1.WorkflowOptions + 46, // [46:46] is the sub-list for method output_type + 46, // [46:46] is the sub-list for method input_type + 38, // [38:46] is the sub-list for extension type_name + 30, // [30:38] is the sub-list for extension extendee + 0, // [0:30] is the sub-list for field type_name } func init() { file_temporal_v1_temporal_proto_init() } @@ -1611,7 +1856,7 @@ func file_temporal_v1_temporal_proto_init() { } } file_temporal_v1_temporal_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkflowOptions_Query); i { + switch v := v.(*XNSActivityOptions); i { case 0: return &v.state case 1: @@ -1623,7 +1868,7 @@ func file_temporal_v1_temporal_proto_init() { } } file_temporal_v1_temporal_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkflowOptions_Signal); i { + switch v := v.(*WorkflowOptions_Query); i { case 0: return &v.state case 1: @@ -1635,6 +1880,18 @@ func file_temporal_v1_temporal_proto_init() { } } file_temporal_v1_temporal_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkflowOptions_Signal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_temporal_v1_temporal_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkflowOptions_Update); i { case 0: return &v.state @@ -1653,7 +1910,7 @@ func file_temporal_v1_temporal_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_temporal_v1_temporal_proto_rawDesc, NumEnums: 4, - NumMessages: 12, + NumMessages: 13, NumExtensions: 8, NumServices: 0, }, diff --git a/gen/temporal/xns/v1/xns.pb.go b/gen/temporal/xns/v1/xns.pb.go index b8aa97ab..8c7f1b27 100644 --- a/gen/temporal/xns/v1/xns.pb.go +++ b/gen/temporal/xns/v1/xns.pb.go @@ -202,9 +202,10 @@ type QueryRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` - WorkflowId string `protobuf:"bytes,2,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` - Request *anypb.Any `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"` + RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` + WorkflowId string `protobuf:"bytes,2,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` + Request *anypb.Any `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"` + HeartbeatInterval *durationpb.Duration `protobuf:"bytes,4,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` } func (x *QueryRequest) Reset() { @@ -260,6 +261,13 @@ func (x *QueryRequest) GetRequest() *anypb.Any { return nil } +func (x *QueryRequest) GetHeartbeatInterval() *durationpb.Duration { + if x != nil { + return x.HeartbeatInterval + } + return nil +} + // RetryPolicy describes configuration for activity or child workflow retries type RetryPolicy struct { state protoimpl.MessageState @@ -346,9 +354,10 @@ type SignalRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` - WorkflowId string `protobuf:"bytes,2,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` - Request *anypb.Any `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"` + RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` + WorkflowId string `protobuf:"bytes,2,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` + Request *anypb.Any `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"` + HeartbeatInterval *durationpb.Duration `protobuf:"bytes,4,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` } func (x *SignalRequest) Reset() { @@ -404,6 +413,13 @@ func (x *SignalRequest) GetRequest() *anypb.Any { return nil } +func (x *SignalRequest) GetHeartbeatInterval() *durationpb.Duration { + if x != nil { + return x.HeartbeatInterval + } + return nil +} + type StartWorkflowOptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -775,180 +791,189 @@ var file_temporal_xns_v1_xns_proto_rawDesc = []byte{ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x12, - 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0xa0, 0x02, 0x0a, 0x0b, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x44, 0x0a, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x13, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, - 0x5f, 0x63, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x12, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x43, 0x6f, 0x65, 0x66, 0x66, - 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, + 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x61, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x74, 0x74, 0x65, - 0x6d, 0x70, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x41, - 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x6e, 0x6f, 0x6e, 0x5f, 0x72, - 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x6e, 0x6f, 0x6e, 0x52, - 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x22, 0x77, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x6f, - 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xaa, 0x05, 0x0a, 0x14, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x71, 0x75, 0x65, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x51, 0x75, - 0x65, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x72, - 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x72, 0x75, 0x6e, - 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x46, 0x0a, 0x0f, 0x69, 0x64, 0x5f, 0x72, 0x65, 0x75, 0x73, - 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, - 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x44, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0d, - 0x69, 0x64, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3b, 0x0a, - 0x1a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x77, 0x68, 0x65, 0x6e, 0x5f, 0x61, 0x6c, 0x72, 0x65, - 0x61, 0x64, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x17, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x57, 0x68, 0x65, 0x6e, 0x41, 0x6c, 0x72, 0x65, - 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x3f, 0x0a, 0x0c, 0x72, 0x65, - 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0b, - 0x72, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2b, 0x0a, 0x04, 0x6d, - 0x65, 0x6d, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x44, 0x0a, 0x11, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x69, 0x72, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x10, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x41, 0x74, 0x74, 0x69, 0x72, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2c, - 0x0a, 0x12, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x45, 0x61, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x3a, 0x0a, 0x0b, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0xf4, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, - 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, + 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x52, + 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x44, 0x0a, 0x10, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x12, 0x2f, 0x0a, 0x13, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x63, 0x6f, 0x65, 0x66, + 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x12, 0x62, + 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x43, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, + 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, + 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x6e, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x6e, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x61, + 0x62, 0x6c, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0xc1, 0x01, + 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, 0x61, 0x72, 0x74, + 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, + 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x22, 0xaa, 0x05, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, + 0x73, 0x6b, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x74, 0x61, 0x73, 0x6b, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x61, 0x6c, 0x12, 0x69, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x77, - 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, - 0x2e, 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, - 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0xea, 0x01, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, - 0x6f, 0x77, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, - 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, - 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x16, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x66, 0x69, 0x72, 0x73, 0x74, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6e, 0x49, 0x64, 0x12, 0x3c, - 0x0a, 0x0b, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, - 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x0a, 0x77, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0xb2, 0x02, 0x0a, - 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x6e, 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, + 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, + 0x74, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x46, 0x0a, 0x0f, 0x69, + 0x64, 0x5f, 0x72, 0x65, 0x75, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, + 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x44, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0d, 0x69, 0x64, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x12, 0x3b, 0x0a, 0x1a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x77, 0x68, 0x65, + 0x6e, 0x5f, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, + 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x57, 0x68, + 0x65, 0x6e, 0x41, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, + 0x12, 0x3f, 0x0a, 0x0c, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, + 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0b, 0x72, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x12, 0x2b, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x44, + 0x0a, 0x11, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x69, 0x72, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x52, 0x10, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x74, 0x74, 0x69, 0x72, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, + 0x61, 0x67, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x10, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x61, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x61, + 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0xf4, + 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, - 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x5b, 0x0a, 0x16, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x65, 0x6d, - 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x74, 0x61, 0x63, - 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x65, 0x74, 0x61, 0x63, - 0x68, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x2a, 0x83, 0x02, 0x0a, 0x0d, 0x49, 0x44, 0x52, 0x65, 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x24, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, + 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x69, 0x0a, 0x17, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x65, + 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x57, 0x69, 0x74, 0x68, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x15, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xea, 0x01, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, + 0x33, 0x0a, 0x16, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x13, 0x66, 0x69, 0x72, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x75, 0x6e, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6d, 0x70, + 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, 0x77, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x22, 0xb2, 0x02, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x68, + 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x12, 0x5b, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x2a, 0x83, 0x02, 0x0a, 0x0d, 0x49, 0x44, 0x52, 0x65, + 0x75, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x24, 0x57, 0x4f, 0x52, + 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, + 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x2c, 0x0a, 0x28, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2c, 0x0a, - 0x28, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, - 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, - 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x38, 0x0a, 0x34, 0x57, + 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, + 0x01, 0x12, 0x38, 0x0a, 0x34, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, + 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, + 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x2d, 0x0a, 0x29, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, - 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x44, 0x55, - 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, - 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x2d, 0x0a, 0x29, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, - 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, - 0x59, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, - 0x54, 0x45, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, - 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, - 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x46, 0x5f, 0x52, 0x55, - 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x2a, 0xa4, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x23, 0x0a, - 0x1f, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, - 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, - 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, - 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, - 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x42, 0x41, - 0x4e, 0x44, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, - 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x52, 0x45, - 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x10, 0x03, 0x2a, 0x78, - 0x0a, 0x0a, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1b, 0x0a, 0x17, - 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, - 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x54, 0x54, 0x45, - 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, - 0x43, 0x59, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x19, 0x0a, - 0x15, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x43, 0x4f, 0x4d, - 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x42, 0xc2, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, - 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, - 0x42, 0x08, 0x58, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x75, 0x64, 0x64, 0x65, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x74, - 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x74, 0x65, 0x6d, 0x70, - 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x78, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x78, 0x6e, 0x73, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, - 0x61, 0x6c, 0x2e, 0x58, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x54, 0x65, 0x6d, 0x70, - 0x6f, 0x72, 0x61, 0x6c, 0x5c, 0x58, 0x6e, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x54, 0x65, - 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x5c, 0x58, 0x6e, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x54, 0x65, 0x6d, 0x70, - 0x6f, 0x72, 0x61, 0x6c, 0x3a, 0x3a, 0x58, 0x6e, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, + 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x57, 0x4f, + 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x55, 0x53, 0x45, 0x5f, + 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, + 0x5f, 0x49, 0x46, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x2a, 0xa4, 0x01, + 0x0a, 0x11, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, + 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x41, 0x52, 0x45, + 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, + 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x50, + 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, + 0x43, 0x59, 0x5f, 0x41, 0x42, 0x41, 0x4e, 0x44, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, + 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, + 0x49, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x41, 0x4e, 0x43, + 0x45, 0x4c, 0x10, 0x03, 0x2a, 0x78, 0x0a, 0x0a, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x1b, 0x0a, 0x17, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, + 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, + 0x44, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, + 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, + 0x44, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, + 0x43, 0x59, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x42, 0xc2, + 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, + 0x78, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x58, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6c, 0x75, 0x64, 0x64, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, + 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x78, 0x6e, 0x73, 0x2f, 0x76, + 0x31, 0x3b, 0x78, 0x6e, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x0f, + 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x58, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0f, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x5c, 0x58, 0x6e, 0x73, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1b, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x5c, 0x58, 0x6e, 0x73, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x11, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x3a, 0x3a, 0x58, 0x6e, 0x73, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -982,30 +1007,32 @@ var file_temporal_xns_v1_xns_proto_goTypes = []interface{}{ } var file_temporal_xns_v1_xns_proto_depIdxs = []int32{ 10, // 0: temporal.xns.v1.QueryRequest.request:type_name -> google.protobuf.Any - 11, // 1: temporal.xns.v1.RetryPolicy.initial_interval:type_name -> google.protobuf.Duration - 11, // 2: temporal.xns.v1.RetryPolicy.max_interval:type_name -> google.protobuf.Duration - 10, // 3: temporal.xns.v1.SignalRequest.request:type_name -> google.protobuf.Any - 11, // 4: temporal.xns.v1.StartWorkflowOptions.execution_timeout:type_name -> google.protobuf.Duration - 11, // 5: temporal.xns.v1.StartWorkflowOptions.run_timeout:type_name -> google.protobuf.Duration - 11, // 6: temporal.xns.v1.StartWorkflowOptions.task_timeout:type_name -> google.protobuf.Duration - 0, // 7: temporal.xns.v1.StartWorkflowOptions.id_reuse_policy:type_name -> temporal.xns.v1.IDReusePolicy - 4, // 8: temporal.xns.v1.StartWorkflowOptions.retry_policy:type_name -> temporal.xns.v1.RetryPolicy - 12, // 9: temporal.xns.v1.StartWorkflowOptions.memo:type_name -> google.protobuf.Struct - 12, // 10: temporal.xns.v1.StartWorkflowOptions.search_attirbutes:type_name -> google.protobuf.Struct - 11, // 11: temporal.xns.v1.StartWorkflowOptions.start_delay:type_name -> google.protobuf.Duration - 11, // 12: temporal.xns.v1.UpdateRequest.heartbeat_interval:type_name -> google.protobuf.Duration - 8, // 13: temporal.xns.v1.UpdateRequest.update_workflow_options:type_name -> temporal.xns.v1.UpdateWorkflowWithOptionsRequest - 10, // 14: temporal.xns.v1.UpdateRequest.request:type_name -> google.protobuf.Any - 2, // 15: temporal.xns.v1.UpdateWorkflowWithOptionsRequest.wait_policy:type_name -> temporal.xns.v1.WaitPolicy - 11, // 16: temporal.xns.v1.WorkflowRequest.heartbeat_interval:type_name -> google.protobuf.Duration - 6, // 17: temporal.xns.v1.WorkflowRequest.start_workflow_options:type_name -> temporal.xns.v1.StartWorkflowOptions - 10, // 18: temporal.xns.v1.WorkflowRequest.request:type_name -> google.protobuf.Any - 10, // 19: temporal.xns.v1.WorkflowRequest.signal:type_name -> google.protobuf.Any - 20, // [20:20] is the sub-list for method output_type - 20, // [20:20] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 11, // 1: temporal.xns.v1.QueryRequest.heartbeat_interval:type_name -> google.protobuf.Duration + 11, // 2: temporal.xns.v1.RetryPolicy.initial_interval:type_name -> google.protobuf.Duration + 11, // 3: temporal.xns.v1.RetryPolicy.max_interval:type_name -> google.protobuf.Duration + 10, // 4: temporal.xns.v1.SignalRequest.request:type_name -> google.protobuf.Any + 11, // 5: temporal.xns.v1.SignalRequest.heartbeat_interval:type_name -> google.protobuf.Duration + 11, // 6: temporal.xns.v1.StartWorkflowOptions.execution_timeout:type_name -> google.protobuf.Duration + 11, // 7: temporal.xns.v1.StartWorkflowOptions.run_timeout:type_name -> google.protobuf.Duration + 11, // 8: temporal.xns.v1.StartWorkflowOptions.task_timeout:type_name -> google.protobuf.Duration + 0, // 9: temporal.xns.v1.StartWorkflowOptions.id_reuse_policy:type_name -> temporal.xns.v1.IDReusePolicy + 4, // 10: temporal.xns.v1.StartWorkflowOptions.retry_policy:type_name -> temporal.xns.v1.RetryPolicy + 12, // 11: temporal.xns.v1.StartWorkflowOptions.memo:type_name -> google.protobuf.Struct + 12, // 12: temporal.xns.v1.StartWorkflowOptions.search_attirbutes:type_name -> google.protobuf.Struct + 11, // 13: temporal.xns.v1.StartWorkflowOptions.start_delay:type_name -> google.protobuf.Duration + 11, // 14: temporal.xns.v1.UpdateRequest.heartbeat_interval:type_name -> google.protobuf.Duration + 8, // 15: temporal.xns.v1.UpdateRequest.update_workflow_options:type_name -> temporal.xns.v1.UpdateWorkflowWithOptionsRequest + 10, // 16: temporal.xns.v1.UpdateRequest.request:type_name -> google.protobuf.Any + 2, // 17: temporal.xns.v1.UpdateWorkflowWithOptionsRequest.wait_policy:type_name -> temporal.xns.v1.WaitPolicy + 11, // 18: temporal.xns.v1.WorkflowRequest.heartbeat_interval:type_name -> google.protobuf.Duration + 6, // 19: temporal.xns.v1.WorkflowRequest.start_workflow_options:type_name -> temporal.xns.v1.StartWorkflowOptions + 10, // 20: temporal.xns.v1.WorkflowRequest.request:type_name -> google.protobuf.Any + 10, // 21: temporal.xns.v1.WorkflowRequest.signal:type_name -> google.protobuf.Any + 22, // [22:22] is the sub-list for method output_type + 22, // [22:22] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_temporal_xns_v1_xns_proto_init() } diff --git a/go.mod b/go.mod index 2e93a6a8..8b4f29a7 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/benthosdev/benthos/v4 v4.24.0 github.com/dave/jennifer v1.7.0 github.com/google/uuid v1.4.0 + github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b github.com/iancoleman/strcase v0.3.0 github.com/mitchellh/go-homedir v1.1.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index e12ba381..bed546e9 100644 --- a/go.sum +++ b/go.sum @@ -438,6 +438,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDa github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4= +github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b/go.mod h1:VzxiSdG6j1pi7rwGm/xYI5RbtpBgM8sARDXlvEvxlu0= github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok= github.com/hanwen/go-fuse/v2 v2.1.0/go.mod h1:oRyA5eK+pvJyv5otpO/DgccS8y/RvYMaO00GgRLGryc= github.com/hashicorp/go-uuid v0.0.0-20180228145832-27454136f036/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= diff --git a/internal/plugin/xns.go b/internal/plugin/xns.go index e34c82eb..53a212a4 100644 --- a/internal/plugin/xns.go +++ b/internal/plugin/xns.go @@ -6,7 +6,9 @@ import ( "strings" "time" + temporalv1 "github.com/cludden/protoc-gen-go-temporal/gen/temporal/v1" g "github.com/dave/jennifer/jen" + "github.com/hako/durafmt" ) const ( @@ -121,9 +123,9 @@ func (svc *Service) genXNSActivitiesQueryMethod(f *g.File, query string) { ). ParamsFunc(func(returnVals *g.Group) { if hasOutput { - returnVals.Op("*").Qual(string(svc.File.GoImportPath), svc.getMessageName(method.Output)) + returnVals.Id("resp").Op("*").Qual(string(svc.File.GoImportPath), svc.getMessageName(method.Output)) } - returnVals.Error() + returnVals.Err().Error() }). BlockFunc(func(fn *g.Group) { if hasInput { @@ -134,13 +136,28 @@ func (svc *Service) genXNSActivitiesQueryMethod(f *g.File, query string) { if hasOutput { returnVals.Nil() } - returnVals.Err() + returnVals.Qual(temporalPkg, "NewNonRetryableApplicationError").Custom( + multiLineArgs, + g.Qual("fmt", "Sprintf").Call( + g.Lit(fmt.Sprintf("error unmarshalling query request of type %%s as %s.%s", string(svc.File.GoImportPath), svc.getMessageName(method.Input))), + g.Id("input").Dot("Request").Dot("GetTypeUrl").Call(), + ), + g.Lit("InvalidArgument"), + g.Err(), + ) }), ) } - fn.Return( - g.Id("a").Dot("client").Dot(methodName).CallFunc(func(args *g.Group) { + fn.Comment("execute signal in child goroutine") + fn.Id("doneCh").Op(":=").Make(g.Chan().Struct()) + fn.Go().Func().Params().Block( + g.ListFunc(func(ls *g.Group) { + if hasOutput { + ls.Id("resp") + } + ls.Err() + }).Op("=").Id("a").Dot("client").Dot(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("input").Dot("GetWorkflowId").Call() args.Id("input").Dot("GetRunId").Call() @@ -148,6 +165,39 @@ func (svc *Service) genXNSActivitiesQueryMethod(f *g.File, query string) { args.Op("&").Id("req") } }), + g.Close(g.Id("doneCh")), + ).Call() + fn.Line() + + fn.Id("heartbeatInterval").Op(":=").Id("input").Dot("GetHeartbeatInterval").Call().Dot("AsDuration").Call() + fn.If(g.Id("heartbeatInterval").Op("==").Lit(0)).Block( + g.Id("heartbeatInterval").Op("=").Qual("time", "Second").Op("*").Lit(10), + ) + fn.Line() + + fn.Comment("heartbeat activity while waiting for signal to complete") + fn.For().Block( + g.Select().Block( + g.Case(g.Op("<-").Qual("time", "After").Call(g.Id("heartbeatInterval"))).Block( + g.Qual(activityPkg, "RecordHeartbeat").Call(g.Id("ctx")), + ), + g.Case(g.Op("<-").Id("ctx").Dot("Done").Call()).Block( + g.ReturnFunc(func(returnVals *g.Group) { + if hasOutput { + returnVals.Nil() + } + returnVals.Id("ctx").Dot("Err").Call() + }), + ), + g.Case(g.Op("<-").Id("doneCh")).Block( + g.ReturnFunc(func(returnVals *g.Group) { + if hasOutput { + returnVals.Id("resp") + } + returnVals.Err() + }), + ), + ), ) }) } @@ -167,18 +217,30 @@ func (svc *Service) genXNSActivitiesSignalMethod(f *g.File, signal string) { g.Id("ctx").Qual("context", "Context"), g.Id("input").Op("*").Qual(xnsv1Pkg, "SignalRequest"), ). - Error(). + Params(g.Err().Error()). BlockFunc(func(fn *g.Group) { if hasInput { fn.Comment("unmarshal signal request") fn.Var().Id("req").Qual(string(svc.File.GoImportPath), svc.getMessageName(method.Input)) fn.If(g.Err().Op(":=").Id("input").Dot("Request").Dot("UnmarshalTo").Call(g.Op("&").Id("req")), g.Err().Op("!=").Nil()).Block( - g.Return(g.Err()), + g.Return( + g.Qual(temporalPkg, "NewNonRetryableApplicationError").Custom( + multiLineArgs, + g.Qual("fmt", "Sprintf").Call( + g.Lit(fmt.Sprintf("error unmarshalling signal request of type %%s as %s.%s", string(svc.File.GoImportPath), svc.getMessageName(method.Input))), + g.Id("input").Dot("Request").Dot("GetTypeUrl").Call(), + ), + g.Lit("InvalidArgument"), + g.Err(), + ), + ), ) } - fn.Return( - g.Id("a").Dot("client").Dot(methodName).CallFunc(func(args *g.Group) { + fn.Comment("execute signal in child goroutine") + fn.Id("doneCh").Op(":=").Make(g.Chan().Struct()) + fn.Go().Func().Params().Block( + g.Err().Op("=").Id("a").Dot("client").Dot(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("input").Dot("GetWorkflowId").Call() args.Id("input").Dot("GetRunId").Call() @@ -186,6 +248,29 @@ func (svc *Service) genXNSActivitiesSignalMethod(f *g.File, signal string) { args.Op("&").Id("req") } }), + g.Close(g.Id("doneCh")), + ).Call() + fn.Line() + + fn.Id("heartbeatInterval").Op(":=").Id("input").Dot("GetHeartbeatInterval").Call().Dot("AsDuration").Call() + fn.If(g.Id("heartbeatInterval").Op("==").Lit(0)).Block( + g.Id("heartbeatInterval").Op("=").Qual("time", "Second").Op("*").Lit(10), + ) + fn.Line() + + fn.Comment("heartbeat activity while waiting for signal to complete") + fn.For().Block( + g.Select().Block( + g.Case(g.Op("<-").Qual("time", "After").Call(g.Id("heartbeatInterval"))).Block( + g.Qual(activityPkg, "RecordHeartbeat").Call(g.Id("ctx")), + ), + g.Case(g.Op("<-").Id("ctx").Dot("Done").Call()).Block( + g.Return(g.Id("ctx").Dot("Err").Call()), + ), + g.Case(g.Op("<-").Id("doneCh")).Block( + g.Return(g.Err()), + ), + ), ) }) } @@ -256,7 +341,15 @@ func (svc *Service) genXNSActivitiesUpdateMethod(f *g.File, update string) { if hasOutput { returnVals.Nil() } - returnVals.Err() + returnVals.Qual(temporalPkg, "NewNonRetryableApplicationError").Custom( + multiLineArgs, + g.Qual("fmt", "Sprintf").Call( + g.Lit(fmt.Sprintf("error unmarshalling update request of type %%s as %s.%s", string(svc.File.GoImportPath), svc.getMessageName(method.Input))), + g.Id("input").Dot("Request").Dot("GetTypeUrl").Call(), + ), + g.Lit("InvalidArgument"), + g.Err(), + ) }), ) bl.Line() @@ -366,7 +459,15 @@ func (svc *Service) genXNSActivitiesWorkflowMethod(f *g.File, workflow string) { if hasOutput { returnVals.Nil() } - returnVals.Err() + returnVals.Qual(temporalPkg, "NewNonRetryableApplicationError").Custom( + multiLineArgs, + g.Qual("fmt", "Sprintf").Call( + g.Lit(fmt.Sprintf("error unmarshalling workflow request of type %%s as %s.%s", string(svc.File.GoImportPath), svc.getMessageName(method.Input))), + g.Id("input").Dot("Request").Dot("GetTypeUrl").Call(), + ), + g.Lit("InvalidArgument"), + g.Err(), + ) }), ) fn.Line() @@ -495,7 +596,15 @@ func (svc *Service) genXNSActivitiesWorkflowWithStartMethod(f *g.File, workflow, if hasOutput { returnVals.Nil() } - returnVals.Err() + returnVals.Qual(temporalPkg, "NewNonRetryableApplicationError").Custom( + multiLineArgs, + g.Qual("fmt", "Sprintf").Call( + g.Lit(fmt.Sprintf("error unmarshalling workflow request of type %%s as %s.%s", string(svc.File.GoImportPath), svc.getMessageName(method.Input))), + g.Id("input").Dot("Request").Dot("GetTypeUrl").Call(), + ), + g.Lit("InvalidArgument"), + g.Err(), + ) }), ) fn.Line() @@ -508,7 +617,15 @@ func (svc *Service) genXNSActivitiesWorkflowWithStartMethod(f *g.File, workflow, if hasOutput { returnVals.Nil() } - returnVals.Err() + returnVals.Qual(temporalPkg, "NewNonRetryableApplicationError").Custom( + multiLineArgs, + g.Qual("fmt", "Sprintf").Call( + g.Lit(fmt.Sprintf("error unmarshalling signal request of type %%s as %s.%s", string(svc.File.GoImportPath), svc.getMessageName(handler.Input))), + g.Id("input").Dot("Signal").Dot("GetTypeUrl").Call(), + ), + g.Lit("InvalidArgument"), + g.Err(), + ) }), ) fn.Line() @@ -780,6 +897,7 @@ func (svc *Service) genXNSQueryFunction(f *g.File, query string) { func (svc *Service) genXNSQueryFunctionAsync(f *g.File, query string) { methodName := toCamel("%sAsync", query) method := svc.methods[query] + opts := svc.queries[query] hasInput := !isEmpty(method.Input) if method.Comments.Leading.String() != "" { @@ -809,24 +927,9 @@ func (svc *Service) genXNSQueryFunctionAsync(f *g.File, query string) { fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), ) - fn.If(g.Id("opt").Dot("HeartbeatInterval").Op("==").Lit(0)).Block( - g.Id("opt").Dot("HeartbeatInterval").Op("=").Qual("time", "Second").Op("*").Lit(30), - ) fn.Line() - fn.Comment("build and set activity options") - fn.Id("ao").Op(":=").Qual(workflowPkg, "GetActivityOptions").Call(g.Id("ctx")) - fn.If(g.Id("opt").Dot("ActivityOptions").Op("!=").Nil()).Block( - g.Id("ao").Op("=").Op("*").Id("opt").Dot("ActivityOptions"), - ) - fn.If(g.Id("ao").Dot("HeartbeatTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("HeartbeatTimeout").Op("=").Id("opt").Dot("HeartbeatInterval").Op("*").Lit(2), - ) - fn.If(g.Id("ao").Dot("StartToCloseTimeout").Op("==").Lit(0).Op("&&").Id("ao").Dot("ScheduleToCloseTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("StartToCloseTimeout").Op("=").Qual("time", "Minute").Op("*").Lit(2), - ) - fn.Id("ctx").Op("=").Qual(workflowPkg, "WithActivityOptions").Call(g.Id("ctx"), g.Id("ao")) - fn.Line() + initializeXNSOptions(fn, opts.GetXns(), time.Minute) if hasInput { fn.Comment("marshal workflow request") @@ -849,6 +952,7 @@ func (svc *Service) genXNSQueryFunctionAsync(f *g.File, query string) { g.Id("ctx"), g.Qual(string(svc.File.GoImportPath), toCamel("%sQueryName", query)), g.Op("&").Qual(xnsv1Pkg, "QueryRequest").CustomFunc(multiLineValues, func(fields *g.Group) { + fields.Id("HeartbeatInterval").Op(":").Qual(durationpbPkg, "New").Call(g.Id("opt").Dot("HeartbeatInterval")) fields.Id("WorkflowId").Op(":").Id("workflowID") fields.Id("RunId").Op(":").Id("runID") if hasInput { @@ -1070,6 +1174,7 @@ func (svc *Service) genXNSSignalFunction(f *g.File, signal string) { func (svc *Service) genXNSSignalFunctionAsync(f *g.File, signal string) { methodName := toCamel("%sAsync", signal) method := svc.methods[signal] + opts := svc.signals[signal] hasInput := !isEmpty(method.Input) if method.Comments.Leading.String() != "" { @@ -1099,24 +1204,9 @@ func (svc *Service) genXNSSignalFunctionAsync(f *g.File, signal string) { fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), ) - fn.If(g.Id("opt").Dot("HeartbeatInterval").Op("==").Lit(0)).Block( - g.Id("opt").Dot("HeartbeatInterval").Op("=").Qual("time", "Second").Op("*").Lit(30), - ) fn.Line() - fn.Comment("build and set activity options") - fn.Id("ao").Op(":=").Qual(workflowPkg, "GetActivityOptions").Call(g.Id("ctx")) - fn.If(g.Id("opt").Dot("ActivityOptions").Op("!=").Nil()).Block( - g.Id("ao").Op("=").Op("*").Id("opt").Dot("ActivityOptions"), - ) - fn.If(g.Id("ao").Dot("HeartbeatTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("HeartbeatTimeout").Op("=").Id("opt").Dot("HeartbeatInterval").Op("*").Lit(2), - ) - fn.If(g.Id("ao").Dot("StartToCloseTimeout").Op("==").Lit(0).Op("&&").Id("ao").Dot("ScheduleToCloseTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("StartToCloseTimeout").Op("=").Qual("time", "Minute").Op("*").Lit(2), - ) - fn.Id("ctx").Op("=").Qual(workflowPkg, "WithActivityOptions").Call(g.Id("ctx"), g.Id("ao")) - fn.Line() + initializeXNSOptions(fn, opts.GetXns(), time.Minute) if hasInput { fn.Comment("marshal workflow request") @@ -1139,6 +1229,7 @@ func (svc *Service) genXNSSignalFunctionAsync(f *g.File, signal string) { g.Id("ctx"), g.Qual(string(svc.File.GoImportPath), toCamel("%sSignalName", signal)), g.Op("&").Qual(xnsv1Pkg, "SignalRequest").CustomFunc(multiLineValues, func(fields *g.Group) { + fields.Id("HeartbeatInterval").Op(":").Qual(durationpbPkg, "New").Call(g.Id("opt").Dot("HeartbeatInterval")) fields.Id("WorkflowId").Op(":").Id("workflowID") fields.Id("RunId").Op(":").Id("runID") if hasInput { @@ -1358,19 +1449,7 @@ func (svc *Service) genXNSUpdateFunctionAsync(f *g.File, update string) { ) fn.Line() - // build and set activity options - fn.Id("ao").Op(":=").Qual(workflowPkg, "GetActivityOptions").Call(g.Id("ctx")) - fn.If(g.Id("opt").Dot("ActivityOptions").Op("!=").Nil()).Block( - g.Id("ao").Op("=").Op("*").Id("opt").Dot("ActivityOptions"), - ) - fn.If(g.Id("ao").Dot("HeartbeatTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("HeartbeatTimeout").Op("=").Id("opt").Dot("HeartbeatInterval").Op("*").Lit(2), - ) - fn.If(g.Id("ao").Dot("StartToCloseTimeout").Op("==").Lit(0).Op("&&").Id("ao").Dot("ScheduleToCloseTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("StartToCloseTimeout").Op("=").Qual("time", "Hour").Op("*").Lit(24), - ) - fn.Id("ctx").Op("=").Qual(workflowPkg, "WithActivityOptions").Call(g.Id("ctx"), g.Id("ao")) - fn.Line() + initializeXNSOptions(fn, opts.GetXns(), time.Minute*5) // build update options fn.Id("uo").Op(":=").Qual(clientPkg, "UpdateWorkflowWithOptionsRequest").Values() @@ -1456,6 +1535,62 @@ func (svc *Service) genXNSUpdateOptions(f *g.File, update string) { g.Id("HeartbeatInterval").Qual("time", "Duration"), g.Id("UpdateWorkflowOptions").Op("*").Qual(clientPkg, "UpdateWorkflowWithOptionsRequest"), ) + + f.Commentf("New%s initializes a new %s value", typeName, typeName) + f.Func(). + Id(toCamel("New%s", typeName)). + Params(). + Op("*").Id(typeName). + Block( + g.Return( + g.Op("&").Id(typeName).Values(), + ), + ) + + f.Comment("WithActivityOptions can be used to customize the activity options") + f.Func(). + Params( + g.Id("opts").Op("*").Id(typeName), + ). + Id("WithActivityOptions"). + Params( + g.Id("ao").Qual(workflowPkg, "ActivityOptions"), + ). + Op("*").Id(typeName). + Block( + g.Id("opts").Dot("ActivityOptions").Op("=").Op("&").Id("ao"), + g.Return(g.Id("opts")), + ) + + f.Comment("WithHeartbeatInterval can be used to customize the activity heartbeat interval") + f.Func(). + Params( + g.Id("opts").Op("*").Id(typeName), + ). + Id("WithHeartbeatInterval"). + Params( + g.Id("d").Qual("time", "Duration"), + ). + Op("*").Id(typeName). + Block( + g.Id("opts").Dot("HeartbeatInterval").Op("=").Id("d"), + g.Return(g.Id("opts")), + ) + + f.Comment("WithUpdateWorkflowOptions can be used to customize the update workflow options") + f.Func(). + Params( + g.Id("opts").Op("*").Id(typeName), + ). + Id("WithUpdateWorkflowOptions"). + Params( + g.Id("uwo").Qual(clientPkg, "UpdateWorkflowWithOptionsRequest"), + ). + Op("*").Id(typeName). + Block( + g.Id("opts").Dot("UpdateWorkflowOptions").Op("=").Op("&").Id("uwo"), + g.Return(g.Id("opts")), + ) } func (svc *Service) genXNSUpdateHandleImpl(f *g.File, update string) { @@ -1660,75 +1795,17 @@ func (svc *Service) genXNSWorkflowFunctionAsync(f *g.File, workflow string) { g.Error(), ). BlockFunc(func(fn *g.Group) { - // extract workflow options + fn.Comment("configure xns options") fn.Id("opt").Op(":=").Op("&").Id(toCamel("%sWorkflowOptions", workflow)).Values() fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), ) - fn.If(g.Id("opt").Dot("HeartbeatInterval").Op("==").Lit(0)).Block( - g.Id("opt").Dot("HeartbeatInterval").Op("=").Qual("time", "Second").Op("*").Lit(30), - ) - fn.Line() - // build and set activity options - fn.Id("ao").Op(":=").Qual(workflowPkg, "GetActivityOptions").Call(g.Id("ctx")) - fn.If(g.Id("opt").Dot("ActivityOptions").Op("!=").Nil()).Block( - g.Id("ao").Op("=").Op("*").Id("opt").Dot("ActivityOptions"), - ) - fn.If(g.Id("ao").Dot("HeartbeatTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("HeartbeatTimeout").Op("=").Id("opt").Dot("HeartbeatInterval").Op("*").Lit(2), - ) - fn.If(g.Id("ao").Dot("StartToCloseTimeout").Op("==").Lit(0).Op("&&").Id("ao").Dot("ScheduleToCloseTimeout").Op("==").Lit(0)).BlockFunc(func(bl *g.Group) { - if d := opts.GetExecutionTimeout(); d.IsValid() { - t := d.AsDuration() + (time.Minute * 5) - bl.Id("ao").Dot("ScheduleToCloseTimeout").Op("=").Id(strconv.FormatInt(t.Nanoseconds(), 10)).Comment(t.String()) - } else { - bl.Id("ao").Dot("StartToCloseTimeout").Op("=").Qual("time", "Hour").Op("*").Lit(24) - } - }) - fn.Id("ctx").Op("=").Qual(workflowPkg, "WithActivityOptions").Call(g.Id("ctx"), g.Id("ao")) - fn.Line() + initializeXNSOptions(fn, opts.GetXns(), opts.GetExecutionTimeout().AsDuration()) + svc.initializeXNSStartWorkflowOptions(fn, workflow) - // build start workflow options - fn.Id("wo").Op(":=").Qual(clientPkg, "StartWorkflowOptions").Values() - fn.If(g.Id("opt").Dot("StartWorkflowOptions").Op("!=").Nil()).Block( - g.Id("wo").Op("=").Op("*").Id("opt").Dot("StartWorkflowOptions"), - ) - // set workflow id if unset and id field and/or prefix defined - if idExpr := opts.GetId(); idExpr != "" { - fn.If(g.Id("wo").Dot("ID").Op("==").Lit("")).Block( - g.List(g.Id("id"), g.Err()).Op(":=").Qual(expressionPkg, "EvalExpression").CallFunc(func(args *g.Group) { - args.Qual(string(svc.File.GoImportPath), toCamel("%sIDExpression", workflow)) - if hasInput { - args.Id("req").Dot("ProtoReflect").Call() - } else { - args.Nil() - } - }), - g.If(g.Err().Op("!=").Nil()).Block( - g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit(fmt.Sprintf("error evaluating id expression for %q workflow: %%w", workflow)), g.Err())), - ), - g.Id("wo").Dot("ID").Op("=").Id("id"), - ) - } - fn.If(g.Id("wo").Dot("ID").Op("==").Lit("")).Block( - g.List(g.Id("id"), g.Err()).Op(":=").Qual(uuidPkg, "NewRandom").Call(), - g.If(g.Err().Op("!=").Nil()).Block( - g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit("error generating workflow id: %w"), g.Err())), - ), - g.Id("wo").Dot("ID").Op("=").Id("id").Dot("String").Call(), - ) - fn.Line() - - // marshal start workflow options - fn.List(g.Id("swo"), g.Err()).Op(":=").Qual(xnsPkg, "MarshalStartWorkflowOptions").Call(g.Id("wo")) - fn.If(g.Err().Op("!=").Nil()).Block( - g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit("error marshalling start workflow options: %w"), g.Err())), - ) - fn.Line() - - // marshal workflow request if hasInput { + fn.Comment("marshal workflow request protobuf message") fn.List(g.Id("wreq"), g.Err()).Op(":=").Qual(anypbPkg, "New").Call(g.Id("req")) fn.If(g.Err().Op("!=").Nil()).Block( g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit("error marshalling workflow request: %w"), g.Err())), @@ -1736,7 +1813,7 @@ func (svc *Service) genXNSWorkflowFunctionAsync(f *g.File, workflow string) { fn.Line() } - // create cancellable context + fn.Comment("create cancellable context") fn.List(g.Id("ctx"), g.Id("cancel")).Op(":=").Qual(workflowPkg, "WithCancel").Call(g.Id("ctx")) fn.Line() @@ -1773,6 +1850,77 @@ func (svc *Service) genXNSWorkflowOptions(f *g.File, workflow string) { g.Id("HeartbeatInterval").Qual("time", "Duration"), g.Id("StartWorkflowOptions").Op("*").Qual(clientPkg, "StartWorkflowOptions"), ) + + f.Commentf("New%s initializes a new %s value", typeName, typeName) + f.Func(). + Id(toCamel("New%s", typeName)). + Params(). + Op("*").Id(typeName). + Block( + g.Return( + g.Op("&").Id(typeName).Values(), + ), + ) + + f.Comment("WithActivityOptions can be used to customize the activity options") + f.Func(). + Params( + g.Id("opts").Op("*").Id(typeName), + ). + Id("WithActivityOptions"). + Params( + g.Id("ao").Qual(workflowPkg, "ActivityOptions"), + ). + Op("*").Id(typeName). + Block( + g.Id("opts").Dot("ActivityOptions").Op("=").Op("&").Id("ao"), + g.Return(g.Id("opts")), + ) + + f.Comment("WithDetached can be used to start a workflow execution and exit immediately") + f.Func(). + Params( + g.Id("opts").Op("*").Id(typeName), + ). + Id("WithDetached"). + Params( + g.Id("d").Bool(), + ). + Op("*").Id(typeName). + Block( + g.Id("opts").Dot("Detached").Op("=").Id("d"), + g.Return(g.Id("opts")), + ) + + f.Comment("WithHeartbeatInterval can be used to customize the activity heartbeat interval") + f.Func(). + Params( + g.Id("opts").Op("*").Id(typeName), + ). + Id("WithHeartbeatInterval"). + Params( + g.Id("d").Qual("time", "Duration"), + ). + Op("*").Id(typeName). + Block( + g.Id("opts").Dot("HeartbeatInterval").Op("=").Id("d"), + g.Return(g.Id("opts")), + ) + + f.Comment("WithStartWorkflowOptions can be used to customize the start workflow options") + f.Func(). + Params( + g.Id("opts").Op("*").Id(typeName), + ). + Id("WithStartWorkflow"). + Params( + g.Id("swo").Qual(clientPkg, "StartWorkflowOptions"), + ). + Op("*").Id(typeName). + Block( + g.Id("opts").Dot("StartWorkflowOptions").Op("=").Op("&").Id("swo"), + g.Return(g.Id("opts")), + ) } func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { @@ -1902,8 +2050,20 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { } returnVals.Error() }). - Block( - g.Return(g.Id(methodName).CallFunc(func(args *g.Group) { + BlockFunc(func(fn *g.Group) { + if xns := opts.GetQuery()[i].GetXns(); xns != nil { + fn.Comment("configure activity options if unset") + fn.Id("opt").Op(":=").Op("&").Id(toCamel("%sQueryOptions", query)).Values() + fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( + g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), + ) + fn.If(g.Id("opt").Dot("ActivityOptions").Op("==").Nil()).BlockFunc(func(bl *g.Group) { + initializeXNSOptions(bl, xns, opts.GetExecutionTimeout().AsDuration()) + bl.Id("opt").Dot("ActivityOptions").Op("=").Op("&").Id("ao") + bl.Id("opts").Index(g.Lit(0)).Op("=").Id("opt") + }) + } + fn.Return(g.Id(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("r").Dot("ID").Call() args.Lit("") @@ -1911,8 +2071,8 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { args.Id("req") } args.Id("opts").Op("...") - })), - ) + })) + }) methodName = toCamel("%sAsync", query) if handler.Comments.Leading.String() != "" { @@ -1934,8 +2094,20 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { g.Id(toCamel("%sQueryHandle", query)), g.Error(), ). - Block( - g.Return(g.Id(methodName).CallFunc(func(args *g.Group) { + BlockFunc(func(fn *g.Group) { + if xns := opts.GetQuery()[i].GetXns(); xns != nil { + fn.Comment("configure activity options if unset") + fn.Id("opt").Op(":=").Op("&").Id(toCamel("%sQueryOptions", query)).Values() + fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( + g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), + ) + fn.If(g.Id("opt").Dot("ActivityOptions").Op("==").Nil()).BlockFunc(func(bl *g.Group) { + initializeXNSOptions(bl, xns, opts.GetExecutionTimeout().AsDuration()) + bl.Id("opt").Dot("ActivityOptions").Op("=").Op("&").Id("ao") + bl.Id("opts").Index(g.Lit(0)).Op("=").Id("opt") + }) + } + fn.Return(g.Id(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("r").Dot("ID").Call() args.Lit("") @@ -1943,8 +2115,8 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { args.Id("req") } args.Id("opts").Op("...") - })), - ) + })) + }) } for i := range opts.GetSignal() { @@ -1969,8 +2141,20 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { args.Id("opts").Op("...").Op("*").Id(toCamel("%sSignalOptions", signal)) }). Error(). - Block( - g.Return(g.Id(methodName).CallFunc(func(args *g.Group) { + BlockFunc(func(fn *g.Group) { + if xns := opts.GetSignal()[i].GetXns(); xns != nil { + fn.Comment("configure activity options if unset") + fn.Id("opt").Op(":=").Op("&").Id(toCamel("%sSignalOptions", signal)).Values() + fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( + g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), + ) + fn.If(g.Id("opt").Dot("ActivityOptions").Op("==").Nil()).BlockFunc(func(bl *g.Group) { + initializeXNSOptions(bl, xns, opts.GetExecutionTimeout().AsDuration()) + bl.Id("opt").Dot("ActivityOptions").Op("=").Op("&").Id("ao") + bl.Id("opts").Index(g.Lit(0)).Op("=").Id("opt") + }) + } + fn.Return(g.Id(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("r").Dot("ID").Call() args.Lit("") @@ -1978,8 +2162,8 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { args.Id("req") } args.Id("opts").Op("...") - })), - ) + })) + }) methodName = toCamel("%sAsync", signal) if handler.Comments.Leading.String() != "" { @@ -2001,8 +2185,20 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { g.Id(toCamel("%sSignalHandle", signal)), g.Error(), ). - Block( - g.Return(g.Id(methodName).CallFunc(func(args *g.Group) { + BlockFunc(func(fn *g.Group) { + if xns := opts.GetSignal()[i].GetXns(); xns != nil { + fn.Comment("configure activity options if unset") + fn.Id("opt").Op(":=").Op("&").Id(toCamel("%sSignalOptions", signal)).Values() + fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( + g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), + ) + fn.If(g.Id("opt").Dot("ActivityOptions").Op("==").Nil()).BlockFunc(func(bl *g.Group) { + initializeXNSOptions(bl, xns, opts.GetExecutionTimeout().AsDuration()) + bl.Id("opt").Dot("ActivityOptions").Op("=").Op("&").Id("ao") + bl.Id("opts").Index(g.Lit(0)).Op("=").Id("opt") + }) + } + fn.Return(g.Id(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("r").Dot("ID").Call() args.Lit("") @@ -2010,8 +2206,8 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { args.Id("req") } args.Id("opts").Op("...") - })), - ) + })) + }) } for i := range opts.GetUpdate() { @@ -2042,8 +2238,20 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { } returnVals.Error() }). - Block( - g.Return(g.Id(methodName).CallFunc(func(args *g.Group) { + BlockFunc(func(fn *g.Group) { + if xns := opts.GetUpdate()[i].GetXns(); xns != nil { + fn.Comment("configure activity options if unset") + fn.Id("opt").Op(":=").Op("&").Id(toCamel("%sUpdateOptions", update)).Values() + fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( + g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), + ) + fn.If(g.Id("opt").Dot("ActivityOptions").Op("==").Nil()).BlockFunc(func(bl *g.Group) { + initializeXNSOptions(bl, xns, opts.GetExecutionTimeout().AsDuration()) + bl.Id("opt").Dot("ActivityOptions").Op("=").Op("&").Id("ao") + bl.Id("opts").Index(g.Lit(0)).Op("=").Id("opt") + }) + } + fn.Return(g.Id(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("r").Dot("ID").Call() args.Lit("") @@ -2051,8 +2259,8 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { args.Id("req") } args.Id("opts").Op("...") - })), - ) + })) + }) methodName = toCamel("%sAsync", update) if handler.Comments.Leading.String() != "" { @@ -2074,8 +2282,20 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { g.Id(toCamel("%sHandle", update)), g.Error(), ). - Block( - g.Return(g.Id(methodName).CallFunc(func(args *g.Group) { + BlockFunc(func(fn *g.Group) { + if xns := opts.GetUpdate()[i].GetXns(); xns != nil { + fn.Comment("configure activity options if unset") + fn.Id("opt").Op(":=").Op("&").Id(toCamel("%sUpdateOptions", update)).Values() + fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( + g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), + ) + fn.If(g.Id("opt").Dot("ActivityOptions").Op("==").Nil()).BlockFunc(func(bl *g.Group) { + initializeXNSOptions(bl, xns, opts.GetExecutionTimeout().AsDuration()) + bl.Id("opt").Dot("ActivityOptions").Op("=").Op("&").Id("ao") + bl.Id("opts").Index(g.Lit(0)).Op("=").Id("opt") + }) + } + fn.Return(g.Id(methodName).CallFunc(func(args *g.Group) { args.Id("ctx") args.Id("r").Dot("ID").Call() args.Lit("") @@ -2083,8 +2303,8 @@ func (svc *Service) genXNSWorkflowRunImpl(f *g.File, workflow string) { args.Id("req") } args.Id("opts").Op("...") - })), - ) + })) + }) } } @@ -2352,21 +2572,18 @@ func (svc *Service) genXNSWorkflowWithStartFunctionAsync(f *g.File, workflow, si fn.If(g.Len(g.Id("opts")).Op(">").Lit(0).Op("&&").Id("opts").Index(g.Lit(0)).Op("!=").Nil()).Block( g.Id("opt").Op("=").Id("opts").Index(g.Lit(0)), ) - fn.If(g.Id("opt").Dot("HeartbeatInterval").Op("==").Lit(0)).Block( - g.Id("opt").Dot("HeartbeatInterval").Op("=").Qual("time", "Second").Op("*").Lit(30), - ) - fn.Line() - // build and set activity options - fn.Id("ao").Op(":=").Qual(workflowPkg, "GetActivityOptions").Call(g.Id("ctx")) - fn.If(g.Id("opt").Dot("ActivityOptions").Op("!=").Nil()).Block( - g.Id("ao").Op("=").Op("*").Id("opt").Dot("ActivityOptions"), - ) - fn.If(g.Id("ao").Dot("HeartbeatTimeout").Op("==").Lit(0)).Block( - g.Id("ao").Dot("HeartbeatTimeout").Op("=").Id("opt").Dot("HeartbeatInterval").Op("*").Lit(2), - ) - fn.Id("ctx").Op("=").Qual(workflowPkg, "WithActivityOptions").Call(g.Id("ctx"), g.Id("ao")) - fn.Line() + xnsOpts := opts.GetXns() + for _, s := range opts.GetSignal() { + if s.GetRef() != signal { + continue + } + if s.GetXns() != nil { + xnsOpts = s.GetXns() + } + break + } + initializeXNSOptions(fn, xnsOpts, opts.GetExecutionTimeout().AsDuration()) // build start workflow options fn.Id("wo").Op(":=").Qual(clientPkg, "StartWorkflowOptions").Values() @@ -2406,8 +2623,8 @@ func (svc *Service) genXNSWorkflowWithStartFunctionAsync(f *g.File, workflow, si ) fn.Line() - // marshal workflow request if hasInput { + fn.Comment("marshal workflow request protobuf message") fn.List(g.Id("wreq"), g.Err()).Op(":=").Qual(anypbPkg, "New").Call(g.Id("req")) fn.If(g.Err().Op("!=").Nil()).Block( g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit("error marshalling workflow request: %w"), g.Err())), @@ -2415,8 +2632,8 @@ func (svc *Service) genXNSWorkflowWithStartFunctionAsync(f *g.File, workflow, si fn.Line() } - // marshal signal request if handlerInput { + fn.Comment("marshal signal request protobuf message") fn.List(g.Id("wsignal"), g.Err()).Op(":=").Qual(anypbPkg, "New").Call(g.Id("signal")) fn.If(g.Err().Op("!=").Nil()).Block( g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit("error marshalling signal request: %w"), g.Err())), @@ -2424,7 +2641,7 @@ func (svc *Service) genXNSWorkflowWithStartFunctionAsync(f *g.File, workflow, si fn.Line() } - // create cancellable context + fn.Comment("create cancellable context") fn.List(g.Id("ctx"), g.Id("cancel")).Op(":=").Qual(workflowPkg, "WithCancel").Call(g.Id("ctx")) fn.Line() @@ -2453,3 +2670,140 @@ func (svc *Service) genXNSWorkflowWithStartFunctionAsync(f *g.File, workflow, si ) }) } + +func initializeXNSOptions(fn *g.Group, opts *temporalv1.XNSActivityOptions, defaultTimeout time.Duration) { + if defaultTimeout == 0 { + defaultTimeout = time.Hour * 24 + } + + // set default heartbeat interval if unset + fn.If(g.Id("opt").Dot("HeartbeatInterval").Op("==").Lit(0)).BlockFunc(func(bl *g.Group) { + if d := opts.GetHeartbeatInterval(); d.IsValid() { + bl.Id("opt").Dot("HeartbeatInterval").Op("=").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(durafmt.Parse(d.AsDuration()).String()) + } else { + bl.Id("opt").Dot("HeartbeatInterval").Op("=").Qual("time", "Second").Op("*").Lit(30) + } + }) + fn.Line() + + fn.Comment("configure activity options") + fn.Id("ao").Op(":=").Qual(workflowPkg, "GetActivityOptions").Call(g.Id("ctx")) + // use user-specified activity options if non-nil + fn.If(g.Id("opt").Dot("ActivityOptions").Op("!=").Nil()).Block( + g.Id("ao").Op("=").Op("*").Id("opt").Dot("ActivityOptions"), + ) + // set heartbeat timeout if unset + fn.If(g.Id("ao").Dot("HeartbeatTimeout").Op("==").Lit(0)).BlockFunc(func(bl *g.Group) { + if d := opts.GetHeartbeatTimeout(); d.IsValid() { + bl.Id("ao").Dot("HeartbeatTimeout").Op("=").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(durafmt.Parse(d.AsDuration()).String()) + } else { + bl.Id("ao").Dot("HeartbeatTimeout").Op("=").Id("opt").Dot("HeartbeatInterval").Op("*").Lit(2) + } + + }) + // set retry policy if defined + if v := opts.GetRetryPolicy(); v != nil { + fn.If(g.Id("ao").Dot("RetryPolicy").Op("==").Nil()).Block( + g.Id("ao").Dot("RetryPolicy").Op("=").Op("&").Qual(temporalPkg, "RetryPolicy").CustomFunc(multiLineValues, func(fields *g.Group) { + if d := v.GetBackoffCoefficient(); d != 0 { + fields.Id("BackoffCoefficient").Op(":").Lit(d) + } + if d := v.GetInitialInterval(); d.IsValid() { + fields.Id("InitialInterval").Op(":").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(durafmt.Parse(d.AsDuration()).String()) + } + if d := v.GetMaxAttempts(); d != 0 { + fields.Id("MaximumAttempts").Op(":").Lit(d) + } + if d := v.GetMaxInterval(); d.IsValid() { + fields.Id("MaximumInterval").Op(":").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(durafmt.Parse(d.AsDuration()).String()) + } + if d := v.GetNonRetryableErrorTypes(); len(d) > 0 { + fields.Id("NonRetryableErrorTypes").Op(":").Index().String().CustomFunc(multiLineValues, func(vals *g.Group) { + for _, errT := range d { + vals.Lit(errT) + } + }) + } + }), + ) + } + var hasDefaultTimeout bool + // set schedule-to-close if schema defined and unset + if d := opts.GetScheduleToCloseTimeout(); d.IsValid() { + hasDefaultTimeout = true + fn.If(g.Id("ao").Dot("ScheduleToCloseTimeout").Op("==").Lit(0)).Block( + g.Id("ao").Dot("ScheduleToCloseTimeout").Op("=").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(durafmt.Parse(d.AsDuration()).String()), + ) + } + if d := opts.GetScheduleToStartTimeout(); d.IsValid() { + fn.If(g.Id("ao").Dot("ScheduleToStartTimeout").Op("==").Lit(0)).Block( + g.Id("ao").Dot("ScheduleToStartTimeout").Op("=").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(durafmt.Parse(d.AsDuration()).String()), + ) + } + // set start-to-close if schema defined and unset + if d := opts.GetStartToCloseTimeout(); d.IsValid() { + hasDefaultTimeout = true + fn.If(g.Id("ao").Dot("StartToCloseTimeout").Op("==").Lit(0)).Block( + g.Id("ao").Dot("StartToCloseTimeout").Op("=").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(durafmt.Parse(d.AsDuration()).String()), + ) + } + if !hasDefaultTimeout { + // ensure atleast one of start-to-close or schedule-to-close is set + fn.If(g.Id("ao").Dot("StartToCloseTimeout").Op("==").Lit(0).Op("&&").Id("ao").Dot("ScheduleToCloseTimeout").Op("==").Lit(0)).Block( + g.Id("ao").Dot("ScheduleToCloseTimeout").Op("=").Id(strconv.FormatInt(defaultTimeout.Nanoseconds(), 10)).Comment(durafmt.Parse(defaultTimeout).String()), + ) + } + // set task queue if unset + if v := opts.GetTaskQueue(); v != "" { + fn.If(g.Id("ao").Dot("TaskQueue").Op("==").Lit("")).Block( + g.Id("ao").Dot("TaskQueue").Op("=").Lit(v), + ) + } + fn.Id("ctx").Op("=").Qual(workflowPkg, "WithActivityOptions").Call(g.Id("ctx"), g.Id("ao")) + fn.Line() +} + +// initializes a `swo` variable that contains a non-nil *temporalv1.StartWorkflowOptions value +func (svc *Service) initializeXNSStartWorkflowOptions(fn *g.Group, workflow string) { + method := svc.methods[workflow] + opts := svc.workflows[workflow] + hasInput := !isEmpty(method.Input) + + fn.Comment("configure start workflow options") + fn.Id("wo").Op(":=").Qual(clientPkg, "StartWorkflowOptions").Values() + fn.If(g.Id("opt").Dot("StartWorkflowOptions").Op("!=").Nil()).Block( + g.Id("wo").Op("=").Op("*").Id("opt").Dot("StartWorkflowOptions"), + ) + // set workflow id if unset and id field and/or prefix defined + if idExpr := opts.GetId(); idExpr != "" { + fn.If(g.Id("wo").Dot("ID").Op("==").Lit("")).Block( + g.List(g.Id("id"), g.Err()).Op(":=").Qual(expressionPkg, "EvalExpression").CallFunc(func(args *g.Group) { + args.Qual(string(svc.File.GoImportPath), toCamel("%sIDExpression", workflow)) + if hasInput { + args.Id("req").Dot("ProtoReflect").Call() + } else { + args.Nil() + } + }), + g.If(g.Err().Op("!=").Nil()).Block( + g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit(fmt.Sprintf("error evaluating id expression for %q workflow: %%w", workflow)), g.Err())), + ), + g.Id("wo").Dot("ID").Op("=").Id("id"), + ) + } + fn.If(g.Id("wo").Dot("ID").Op("==").Lit("")).Block( + g.List(g.Id("id"), g.Err()).Op(":=").Qual(uuidPkg, "NewRandom").Call(), + g.If(g.Err().Op("!=").Nil()).Block( + g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit("error generating workflow id: %w"), g.Err())), + ), + g.Id("wo").Dot("ID").Op("=").Id("id").Dot("String").Call(), + ) + fn.Line() + + fn.Comment("marshal start workflow options protobuf message") + fn.List(g.Id("swo"), g.Err()).Op(":=").Qual(xnsPkg, "MarshalStartWorkflowOptions").Call(g.Id("wo")) + fn.If(g.Err().Op("!=").Nil()).Block( + g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit("error marshalling start workflow options: %w"), g.Err())), + ) + fn.Line() +} diff --git a/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_CreateFooRun.go b/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_CreateFooRun.go index 88f230b4..2c5bac7c 100644 --- a/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_CreateFooRun.go +++ b/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_CreateFooRun.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package examplev1 @@ -6,6 +6,8 @@ import ( context "context" examplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1" + internal "go.temporal.io/sdk/client" + mock "github.com/stretchr/testify/mock" ) @@ -229,6 +231,53 @@ func (_c *MockCreateFooRun_ID_Call) RunAndReturn(run func() string) *MockCreateF return _c } +// Run provides a mock function with given fields: +func (_m *MockCreateFooRun) Run() internal.WorkflowRun { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Run") + } + + var r0 internal.WorkflowRun + if rf, ok := ret.Get(0).(func() internal.WorkflowRun); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(internal.WorkflowRun) + } + } + + return r0 +} + +// MockCreateFooRun_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type MockCreateFooRun_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +func (_e *MockCreateFooRun_Expecter) Run() *MockCreateFooRun_Run_Call { + return &MockCreateFooRun_Run_Call{Call: _e.mock.On("Run")} +} + +func (_c *MockCreateFooRun_Run_Call) Run(run func()) *MockCreateFooRun_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockCreateFooRun_Run_Call) Return(_a0 internal.WorkflowRun) *MockCreateFooRun_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCreateFooRun_Run_Call) RunAndReturn(run func() internal.WorkflowRun) *MockCreateFooRun_Run_Call { + _c.Call.Return(run) + return _c +} + // RunID provides a mock function with given fields: func (_m *MockCreateFooRun) RunID() string { ret := _m.Called() diff --git a/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_ExampleClient.go b/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_ExampleClient.go index 0d4e82a9..53c261e6 100644 --- a/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_ExampleClient.go +++ b/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_ExampleClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package examplev1 diff --git a/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_UpdateFooProgressHandle.go b/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_UpdateFooProgressHandle.go index 401e375e..11421454 100644 --- a/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_UpdateFooProgressHandle.go +++ b/mocks/github.com/cludden/protoc-gen-go-temporal/gen/example/v1/mock_UpdateFooProgressHandle.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package examplev1 diff --git a/mocks/go.temporal.io/sdk/client/mock_Client.go b/mocks/go.temporal.io/sdk/client/mock_Client.go index fb6edfe0..8e37b2b9 100644 --- a/mocks/go.temporal.io/sdk/client/mock_Client.go +++ b/mocks/go.temporal.io/sdk/client/mock_Client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package client diff --git a/mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go b/mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go index 88c2252b..0393970d 100644 --- a/mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go +++ b/mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.39.1. DO NOT EDIT. package clientutils diff --git a/proto/temporal/v1/temporal.proto b/proto/temporal/v1/temporal.proto index 1f104429..18ec1571 100644 --- a/proto/temporal/v1/temporal.proto +++ b/proto/temporal/v1/temporal.proto @@ -95,6 +95,9 @@ enum ParentClosePolicy { message QueryOptions { // Fully-qualified query name string name = 1; + + // XNS can be used to configure default activity options for xns workflow executions + XNSActivityOptions xns = 2; } // RetryPolicy describes configuration for activity or child workflow retries @@ -120,6 +123,9 @@ message ServiceOptions { message SignalOptions { // Fully-qualified signal name string name = 1; + + // XNS can be used to configure default activity options for xns workflow executions + XNSActivityOptions xns = 2; } // UpdateOptions identifies an rpc method as a Temporal update definition, and describes @@ -136,6 +142,9 @@ message UpdateOptions { // Default wait policy if not specified WaitPolicy wait_policy = 3; + + // XNS can be used to configure default activity options for xns workflow executions + XNSActivityOptions xns = 5; } // WorkflowOptions identifies an rpc method as a Temporal workflow definition, and describes @@ -191,10 +200,16 @@ message WorkflowOptions { // (child workflow can be ended as: completed/failed/timedout/terminated/canceled) bool wait_for_cancellation = 13; + // XNS can be used to configure default activity options for xns workflow executions + XNSActivityOptions xns = 16; + // Query identifies a query supported by the worklow message Query { // Query name string ref = 1; + + // XNS can be used to configure default activity options for xns workflow executions + XNSActivityOptions xns = 2; } // Signal identifies a signal supported by the workflow @@ -204,12 +219,18 @@ message WorkflowOptions { // Include convenience method for signal with start bool start = 2; + + // XNS can be used to configure default activity options for xns workflow executions + XNSActivityOptions xns = 3; } // Update identifies an update supported by the workflow message Update { // Update name string ref = 1; + + // XNS can be used to configure default activity options for xns workflow executions + XNSActivityOptions xns = 2; } } @@ -220,4 +241,31 @@ enum WaitPolicy { WAIT_POLICY_ADMITTED = 1; WAIT_POLICY_ACCEPTED = 2; WAIT_POLICY_COMPLETED = 3; +} + +message XNSActivityOptions { + // Fully-qualified xns activity name + string name = 7; + + // Override default task queue for activity + string task_queue = 1; + + // Total time that a workflow is willing to wait for Activity to complete + google.protobuf.Duration schedule_to_close_timeout = 2; + + // Time that the Activity Task can stay in the Task Queue before it is picked up by + // a Worker + google.protobuf.Duration schedule_to_start_timeout = 3; + + // Maximum time of a single Activity execution attempt + google.protobuf.Duration start_to_close_timeout = 4; + + // HeartbeatInterval configures the default heartbeat interval + google.protobuf.Duration heartbeat_interval = 8; + + // Heartbeat timeout. Activity must call Activity.RecordHeartbeat(ctx, "my-heartbeat") + google.protobuf.Duration heartbeat_timeout = 5; + + // Specifies how to retry an Activity if an error occurs + RetryPolicy retry_policy = 6; } \ No newline at end of file diff --git a/proto/temporal/xns/v1/xns.proto b/proto/temporal/xns/v1/xns.proto index 2ee96ef7..22e6d333 100644 --- a/proto/temporal/xns/v1/xns.proto +++ b/proto/temporal/xns/v1/xns.proto @@ -40,6 +40,7 @@ message QueryRequest { string run_id = 1; string workflow_id = 2; google.protobuf.Any request = 3; + google.protobuf.Duration heartbeat_interval = 4; } // RetryPolicy describes configuration for activity or child workflow retries @@ -56,6 +57,7 @@ message SignalRequest { string run_id = 1; string workflow_id = 2; google.protobuf.Any request = 3; + google.protobuf.Duration heartbeat_interval = 4; } message StartWorkflowOptions {