diff --git a/.gen/go/shared/idl.go b/.gen/go/shared/idl.go index 4962fa4e1..aa74ed5a5 100644 --- a/.gen/go/shared/idl.go +++ b/.gen/go/shared/idl.go @@ -30,8 +30,8 @@ var ThriftModule = &thriftreflect.ThriftModule{ Name: "shared", Package: "go.uber.org/cadence/.gen/go/shared", FilePath: "shared.thrift", - SHA1: "061e5d77656c005af99aa473b47809cc1c0247ab", + SHA1: "91e7408db253e27fe9652f7c6fb5948ae5a6240e", Raw: rawIDL, } -const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.cadence\n\nexception BadRequestError {\n 1: required string message\n}\n\nexception InternalServiceError {\n 1: required string message\n}\n\nexception DomainAlreadyExistsError {\n 1: required string message\n}\n\nexception WorkflowExecutionAlreadyStartedError {\n 10: optional string message\n 20: optional string startRequestId\n 30: optional string runId\n}\n\nexception EntityNotExistsError {\n 1: required string message\n}\n\nexception ServiceBusyError {\n 1: required string message\n}\n\nexception CancellationAlreadyRequestedError {\n 1: required string message\n}\n\nexception QueryFailedError {\n 1: required string message\n}\n\nenum DomainStatus {\n REGISTERED,\n DEPRECATED,\n DELETED,\n}\n\nenum TimeoutType {\n START_TO_CLOSE,\n SCHEDULE_TO_START,\n SCHEDULE_TO_CLOSE,\n HEARTBEAT,\n}\n\nenum DecisionType {\n ScheduleActivityTask,\n RequestCancelActivityTask,\n StartTimer,\n CompleteWorkflowExecution,\n FailWorkflowExecution,\n CancelTimer,\n CancelWorkflowExecution,\n RequestCancelExternalWorkflowExecution,\n RecordMarker,\n ContinueAsNewWorkflowExecution,\n StartChildWorkflowExecution,\n}\n\nenum EventType {\n WorkflowExecutionStarted,\n WorkflowExecutionCompleted,\n WorkflowExecutionFailed,\n WorkflowExecutionTimedOut,\n DecisionTaskScheduled,\n DecisionTaskStarted,\n DecisionTaskCompleted,\n DecisionTaskTimedOut\n DecisionTaskFailed,\n ActivityTaskScheduled,\n ActivityTaskStarted,\n ActivityTaskCompleted,\n ActivityTaskFailed,\n ActivityTaskTimedOut,\n ActivityTaskCancelRequested,\n RequestCancelActivityTaskFailed,\n ActivityTaskCanceled,\n TimerStarted,\n TimerFired,\n CancelTimerFailed,\n TimerCanceled,\n WorkflowExecutionCancelRequested,\n WorkflowExecutionCanceled,\n RequestCancelExternalWorkflowExecutionInitiated,\n RequestCancelExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionCancelRequested,\n MarkerRecorded,\n WorkflowExecutionSignaled,\n WorkflowExecutionTerminated,\n WorkflowExecutionContinuedAsNew,\n StartChildWorkflowExecutionInitiated,\n StartChildWorkflowExecutionFailed,\n ChildWorkflowExecutionStarted,\n ChildWorkflowExecutionCompleted,\n ChildWorkflowExecutionFailed,\n ChildWorkflowExecutionCanceled,\n ChildWorkflowExecutionTimedOut,\n ChildWorkflowExecutionTerminated,\n}\n\nenum DecisionTaskFailedCause {\n UNHANDLED_DECISION,\n BAD_SCHEDULE_ACTIVITY_ATTRIBUTES,\n BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES,\n BAD_START_TIMER_ATTRIBUTES,\n BAD_CANCEL_TIMER_ATTRIBUTES,\n BAD_RECORD_MARKER_ATTRIBUTES,\n BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CONTINUE_AS_NEW_ATTRIBUTES,\n START_TIMER_DUPLICATE_ID,\n RESET_STICKY_TASKLIST,\n WORKFLOW_WORKER_UNHANDLED_FAILURE\n}\n\nenum CancelExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n}\n\nenum ChildWorkflowExecutionFailedCause {\n WORKFLOW_ALREADY_RUNNING,\n}\n\nenum WorkflowExecutionCloseStatus {\n COMPLETED,\n FAILED,\n CANCELED,\n TERMINATED,\n CONTINUED_AS_NEW,\n TIMED_OUT,\n}\n\nenum ChildPolicy {\n TERMINATE,\n REQUEST_CANCEL,\n ABANDON,\n}\n\nenum QueryTaskCompletedType {\n COMPLETED,\n FAILED,\n}\n\nstruct WorkflowType {\n 10: optional string name\n}\n\nstruct ActivityType {\n 10: optional string name\n}\n\nstruct TaskList {\n 10: optional string name\n}\n\nstruct TaskListMetadata {\n 10: optional double maxTasksPerSecond\n}\n\nstruct WorkflowExecution {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct WorkflowExecutionInfo {\n 10: optional WorkflowExecution execution\n 20: optional WorkflowType type\n 30: optional i64 (js.type = \"Long\") startTime\n 40: optional i64 (js.type = \"Long\") closeTime\n 50: optional WorkflowExecutionCloseStatus closeStatus\n 60: optional i64 (js.type = \"Long\") historyLength\n}\n\nstruct WorkflowExecutionConfiguration {\n 10: optional TaskList taskList\n 20: optional i32 executionStartToCloseTimeoutSeconds\n 30: optional i32 taskStartToCloseTimeoutSeconds\n 40: optional ChildPolicy childPolicy\n}\n\nstruct TransientDecisionInfo {\n 10: optional HistoryEvent scheduledEvent\n 20: optional HistoryEvent startedEvent\n}\n\nstruct ScheduleActivityTaskDecisionAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RequestCancelActivityTaskDecisionAttributes {\n 10: optional string activityId\n}\n\nstruct StartTimerDecisionAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n}\n\nstruct CompleteWorkflowExecutionDecisionAttributes {\n 10: optional binary result\n}\n\nstruct FailWorkflowExecutionDecisionAttributes {\n 10: optional string reason\n 20: optional binary details\n}\n\nstruct CancelTimerDecisionAttributes {\n 10: optional string timerId\n}\n\nstruct CancelWorkflowExecutionDecisionAttributes {\n 10: optional binary details\n}\n\nstruct RequestCancelExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional string runId\n 40: optional binary control\n}\n\nstruct RecordMarkerDecisionAttributes {\n 10: optional string markerName\n 20: optional binary details\n}\n\nstruct ContinueAsNewWorkflowExecutionDecisionAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n}\n\nstruct StartChildWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n}\n\nstruct Decision {\n 10: optional DecisionType decisionType\n 20: optional ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes\n 25: optional StartTimerDecisionAttributes startTimerDecisionAttributes\n 30: optional CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes\n 35: optional FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes\n 40: optional RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes\n 50: optional CancelTimerDecisionAttributes cancelTimerDecisionAttributes\n 60: optional CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes\n 70: optional RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes\n 80: optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes\n 90: optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes\n 100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes\n}\n\nstruct WorkflowExecutionStartedEventAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n 60: optional string identity\n}\n\nstruct WorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n}\n\nstruct WorkflowExecutionContinuedAsNewEventAttributes {\n 10: optional string newExecutionRunId\n 20: optional WorkflowType workflowType\n 30: optional TaskList taskList\n 40: optional binary input\n 50: optional i32 executionStartToCloseTimeoutSeconds\n 60: optional i32 taskStartToCloseTimeoutSeconds\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct DecisionTaskScheduledEventAttributes {\n 10: optional TaskList taskList\n 20: optional i32 startToCloseTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") attempt\n}\n\nstruct DecisionTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct DecisionTaskCompletedEventAttributes {\n 10: optional binary executionContext\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct DecisionTaskTimedOutEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct DecisionTaskFailedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional DecisionTaskFailedCause cause\n 35: optional binary details\n 40: optional string identity\n}\n\nstruct ActivityTaskScheduledEventAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct ActivityTaskCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct ActivityTaskFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct ActivityTaskTimedOutEventAttributes {\n 05: optional binary details\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct ActivityTaskCancelRequestedEventAttributes {\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct RequestCancelActivityTaskFailedEventAttributes{\n 10: optional string activityId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskCanceledEventAttributes {\n 10: optional binary details\n 20: optional i64 (js.type = \"Long\") latestCancelRequestedEventId\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct TimerStartedEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct TimerFiredEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct TimerCanceledEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct CancelTimerFailedEventAttributes {\n 10: optional string timerId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCancelRequestedEventAttributes {\n 10: optional string cause\n 20: optional i64 (js.type = \"Long\") externalInitiatedEventId\n 30: optional WorkflowExecution externalWorkflowExecution\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCanceledEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional binary details\n}\n\nstruct MarkerRecordedEventAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionSignaledEventAttributes {\n 10: optional string signalName\n 20: optional binary input\n 30: optional string identity\n}\n\nstruct WorkflowExecutionTerminatedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n}\n\nstruct RequestCancelExternalWorkflowExecutionFailedEventAttributes {\n 10: optional CancelExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionCancelRequestedEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n}\n\nstruct StartChildWorkflowExecutionInitiatedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n 100: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct StartChildWorkflowExecutionFailedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional ChildWorkflowExecutionFailedCause cause\n 50: optional binary control\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ChildWorkflowExecutionStartedEventAttributes {\n 10: optional string domain\n 20: optional i64 (js.type = \"Long\") initiatedEventId\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n}\n\nstruct ChildWorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional WorkflowType workflowType\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionCanceledEventAttributes {\n 10: optional binary details\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTerminatedEventAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") initiatedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct HistoryEvent {\n 10: optional i64 (js.type = \"Long\") eventId\n 20: optional i64 (js.type = \"Long\") timestamp\n 30: optional EventType eventType\n 40: optional WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes\n 50: optional WorkflowExecutionCompletedEventAttributes workflowExecutionCompletedEventAttributes\n 60: optional WorkflowExecutionFailedEventAttributes workflowExecutionFailedEventAttributes\n 70: optional WorkflowExecutionTimedOutEventAttributes workflowExecutionTimedOutEventAttributes\n 80: optional DecisionTaskScheduledEventAttributes decisionTaskScheduledEventAttributes\n 90: optional DecisionTaskStartedEventAttributes decisionTaskStartedEventAttributes\n 100: optional DecisionTaskCompletedEventAttributes decisionTaskCompletedEventAttributes\n 110: optional DecisionTaskTimedOutEventAttributes decisionTaskTimedOutEventAttributes\n 120: optional DecisionTaskFailedEventAttributes decisionTaskFailedEventAttributes\n 130: optional ActivityTaskScheduledEventAttributes activityTaskScheduledEventAttributes\n 140: optional ActivityTaskStartedEventAttributes activityTaskStartedEventAttributes\n 150: optional ActivityTaskCompletedEventAttributes activityTaskCompletedEventAttributes\n 160: optional ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes\n 170: optional ActivityTaskTimedOutEventAttributes activityTaskTimedOutEventAttributes\n 180: optional TimerStartedEventAttributes timerStartedEventAttributes\n 190: optional TimerFiredEventAttributes timerFiredEventAttributes\n 200: optional ActivityTaskCancelRequestedEventAttributes activityTaskCancelRequestedEventAttributes\n 210: optional RequestCancelActivityTaskFailedEventAttributes requestCancelActivityTaskFailedEventAttributes\n 220: optional ActivityTaskCanceledEventAttributes activityTaskCanceledEventAttributes\n 230: optional TimerCanceledEventAttributes timerCanceledEventAttributes\n 240: optional CancelTimerFailedEventAttributes cancelTimerFailedEventAttributes\n 250: optional MarkerRecordedEventAttributes markerRecordedEventAttributes\n 260: optional WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes\n 270: optional WorkflowExecutionTerminatedEventAttributes workflowExecutionTerminatedEventAttributes\n 280: optional WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes\n 290: optional WorkflowExecutionCanceledEventAttributes workflowExecutionCanceledEventAttributes\n 300: optional RequestCancelExternalWorkflowExecutionInitiatedEventAttributes requestCancelExternalWorkflowExecutionInitiatedEventAttributes\n 310: optional RequestCancelExternalWorkflowExecutionFailedEventAttributes requestCancelExternalWorkflowExecutionFailedEventAttributes\n 320: optional ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes\n 330: optional WorkflowExecutionContinuedAsNewEventAttributes workflowExecutionContinuedAsNewEventAttributes\n 340: optional StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes\n 350: optional StartChildWorkflowExecutionFailedEventAttributes startChildWorkflowExecutionFailedEventAttributes\n 360: optional ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes\n 370: optional ChildWorkflowExecutionCompletedEventAttributes childWorkflowExecutionCompletedEventAttributes\n 380: optional ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes\n 390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes\n 400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes\n 410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes\n}\n\nstruct History {\n 10: optional list events\n}\n\nstruct WorkflowExecutionFilter {\n 10: optional string workflowId\n}\n\nstruct WorkflowTypeFilter {\n 10: optional string name\n}\n\nstruct StartTimeFilter {\n 10: optional i64 (js.type = \"Long\") earliestTime\n 20: optional i64 (js.type = \"Long\") latestTime\n}\n\nstruct DomainInfo {\n 10: optional string name\n 20: optional DomainStatus status\n 30: optional string description\n 40: optional string ownerEmail\n}\n\nstruct DomainConfiguration {\n 10: optional i32 workflowExecutionRetentionPeriodInDays\n 20: optional bool emitMetric\n}\n\nstruct UpdateDomainInfo {\n 10: optional string description\n 20: optional string ownerEmail\n}\n\nstruct RegisterDomainRequest {\n 10: optional string name\n 20: optional string description\n 30: optional string ownerEmail\n 40: optional i32 workflowExecutionRetentionPeriodInDays\n 50: optional bool emitMetric\n}\n\nstruct DescribeDomainRequest {\n 10: optional string name\n}\n\nstruct DescribeDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainRequest {\n 10: optional string name\n 20: optional UpdateDomainInfo updatedInfo\n 30: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct DeprecateDomainRequest {\n 10: optional string name\n}\n\nstruct StartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n}\n\nstruct StartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct PollForDecisionTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n}\n\nstruct PollForDecisionTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") previousStartedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n 54: optional i64 (js.type = \"Long\") backlogCountHint\n 60: optional History history\n 70: optional binary nextPageToken\n 80: optional WorkflowQuery query\n}\n\nstruct StickyExecutionAttributes {\n 10: optional TaskList workerTaskList\n 20: optional i32 scheduleToStartTimeoutSeconds\n}\n\nstruct RespondDecisionTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional list decisions\n 30: optional binary executionContext\n 40: optional string identity\n 50: optional StickyExecutionAttributes stickyAttributes\n}\n\nstruct RespondDecisionTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional DecisionTaskFailedCause cause\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct PollForActivityTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional TaskListMetadata taskListMetadata\n}\n\nstruct PollForActivityTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional string activityId\n 40: optional ActivityType activityType\n 50: optional binary input\n 70: optional i64 (js.type = \"Long\") scheduledTimestamp\n 80: optional i32 scheduleToCloseTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") startedTimestamp\n 100: optional i32 startToCloseTimeoutSeconds\n 110: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RecordActivityTaskHeartbeatRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatResponse {\n 10: optional bool cancelRequested\n}\n\nstruct RespondActivityTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional binary result\n 30: optional string identity\n}\n\nstruct RespondActivityTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional string reason\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct RespondActivityTaskCanceledRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RespondActivityTaskCompletedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary result\n 60: optional string identity\n}\n\nstruct RespondActivityTaskFailedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional string reason\n 60: optional binary details\n 70: optional string identity\n}\n\nstruct RespondActivityTaskCanceledByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RequestCancelWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n 40: optional string requestId\n}\n\nstruct GetWorkflowExecutionHistoryRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional i32 maximumPageSize\n 40: optional binary nextPageToken\n 50: optional bool waitForNewEvent\n}\n\nstruct GetWorkflowExecutionHistoryResponse {\n 10: optional History history\n 20: optional binary nextPageToken\n}\n\nstruct SignalWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string signalName\n 40: optional binary input\n 50: optional string identity\n}\n\nstruct TerminateWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional binary details\n 50: optional string identity\n}\n\nstruct ListOpenWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n}\n\nstruct ListOpenWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListClosedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n 70: optional WorkflowExecutionCloseStatus statusFilter\n}\n\nstruct ListClosedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct QueryWorkflowRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional WorkflowQuery query\n}\n\nstruct QueryWorkflowResponse {\n 10: optional binary queryResult\n}\n\nstruct WorkflowQuery {\n 10: optional string queryType\n 20: optional binary queryArgs\n}\n\nstruct RespondQueryTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional QueryTaskCompletedType completedType\n 30: optional binary queryResult\n 40: optional string errorMessage\n}\n\nstruct DescribeWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct DescribeWorkflowExecutionResponse {\n 10: optional WorkflowExecutionConfiguration executionConfiguration\n 20: optional WorkflowExecutionInfo workflowExecutionInfo\n}\n" +const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.cadence\n\nexception BadRequestError {\n 1: required string message\n}\n\nexception InternalServiceError {\n 1: required string message\n}\n\nexception DomainAlreadyExistsError {\n 1: required string message\n}\n\nexception WorkflowExecutionAlreadyStartedError {\n 10: optional string message\n 20: optional string startRequestId\n 30: optional string runId\n}\n\nexception EntityNotExistsError {\n 1: required string message\n}\n\nexception ServiceBusyError {\n 1: required string message\n}\n\nexception CancellationAlreadyRequestedError {\n 1: required string message\n}\n\nexception QueryFailedError {\n 1: required string message\n}\n\nenum DomainStatus {\n REGISTERED,\n DEPRECATED,\n DELETED,\n}\n\nenum TimeoutType {\n START_TO_CLOSE,\n SCHEDULE_TO_START,\n SCHEDULE_TO_CLOSE,\n HEARTBEAT,\n}\n\nenum DecisionType {\n ScheduleActivityTask,\n RequestCancelActivityTask,\n StartTimer,\n CompleteWorkflowExecution,\n FailWorkflowExecution,\n CancelTimer,\n CancelWorkflowExecution,\n RequestCancelExternalWorkflowExecution,\n RecordMarker,\n ContinueAsNewWorkflowExecution,\n StartChildWorkflowExecution,\n SignalExternalWorkflowExecution,\n}\n\nenum EventType {\n WorkflowExecutionStarted,\n WorkflowExecutionCompleted,\n WorkflowExecutionFailed,\n WorkflowExecutionTimedOut,\n DecisionTaskScheduled,\n DecisionTaskStarted,\n DecisionTaskCompleted,\n DecisionTaskTimedOut\n DecisionTaskFailed,\n ActivityTaskScheduled,\n ActivityTaskStarted,\n ActivityTaskCompleted,\n ActivityTaskFailed,\n ActivityTaskTimedOut,\n ActivityTaskCancelRequested,\n RequestCancelActivityTaskFailed,\n ActivityTaskCanceled,\n TimerStarted,\n TimerFired,\n CancelTimerFailed,\n TimerCanceled,\n WorkflowExecutionCancelRequested,\n WorkflowExecutionCanceled,\n RequestCancelExternalWorkflowExecutionInitiated,\n RequestCancelExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionCancelRequested,\n MarkerRecorded,\n SignalExternalWorkflowExecutionInitiated,\n SignalExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionSignalRequested,\n WorkflowExecutionSignaled,\n WorkflowExecutionTerminated,\n WorkflowExecutionContinuedAsNew,\n StartChildWorkflowExecutionInitiated,\n StartChildWorkflowExecutionFailed,\n ChildWorkflowExecutionStarted,\n ChildWorkflowExecutionCompleted,\n ChildWorkflowExecutionFailed,\n ChildWorkflowExecutionCanceled,\n ChildWorkflowExecutionTimedOut,\n ChildWorkflowExecutionTerminated,\n}\n\nenum DecisionTaskFailedCause {\n UNHANDLED_DECISION,\n BAD_SCHEDULE_ACTIVITY_ATTRIBUTES,\n BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES,\n BAD_START_TIMER_ATTRIBUTES,\n BAD_CANCEL_TIMER_ATTRIBUTES,\n BAD_RECORD_MARKER_ATTRIBUTES,\n BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CONTINUE_AS_NEW_ATTRIBUTES,\n START_TIMER_DUPLICATE_ID,\n RESET_STICKY_TASKLIST,\n WORKFLOW_WORKER_UNHANDLED_FAILURE\n}\n\nenum CancelExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n}\n\nenum SignalExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n}\n\nenum ChildWorkflowExecutionFailedCause {\n WORKFLOW_ALREADY_RUNNING,\n}\n\nenum WorkflowExecutionCloseStatus {\n COMPLETED,\n FAILED,\n CANCELED,\n TERMINATED,\n CONTINUED_AS_NEW,\n TIMED_OUT,\n}\n\nenum ChildPolicy {\n TERMINATE,\n REQUEST_CANCEL,\n ABANDON,\n}\n\nenum QueryTaskCompletedType {\n COMPLETED,\n FAILED,\n}\n\nstruct WorkflowType {\n 10: optional string name\n}\n\nstruct ActivityType {\n 10: optional string name\n}\n\nstruct TaskList {\n 10: optional string name\n}\n\nstruct TaskListMetadata {\n 10: optional double maxTasksPerSecond\n}\n\nstruct WorkflowExecution {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct WorkflowExecutionInfo {\n 10: optional WorkflowExecution execution\n 20: optional WorkflowType type\n 30: optional i64 (js.type = \"Long\") startTime\n 40: optional i64 (js.type = \"Long\") closeTime\n 50: optional WorkflowExecutionCloseStatus closeStatus\n 60: optional i64 (js.type = \"Long\") historyLength\n}\n\nstruct WorkflowExecutionConfiguration {\n 10: optional TaskList taskList\n 20: optional i32 executionStartToCloseTimeoutSeconds\n 30: optional i32 taskStartToCloseTimeoutSeconds\n 40: optional ChildPolicy childPolicy\n}\n\nstruct TransientDecisionInfo {\n 10: optional HistoryEvent scheduledEvent\n 20: optional HistoryEvent startedEvent\n}\n\nstruct ScheduleActivityTaskDecisionAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RequestCancelActivityTaskDecisionAttributes {\n 10: optional string activityId\n}\n\nstruct StartTimerDecisionAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n}\n\nstruct CompleteWorkflowExecutionDecisionAttributes {\n 10: optional binary result\n}\n\nstruct FailWorkflowExecutionDecisionAttributes {\n 10: optional string reason\n 20: optional binary details\n}\n\nstruct CancelTimerDecisionAttributes {\n 10: optional string timerId\n}\n\nstruct CancelWorkflowExecutionDecisionAttributes {\n 10: optional binary details\n}\n\nstruct RequestCancelExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional string runId\n 40: optional binary control\n}\n\nstruct SignalExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional string runId\n 40: optional string signalName\n 50: optional binary input\n 60: optional binary control\n}\n\nstruct RecordMarkerDecisionAttributes {\n 10: optional string markerName\n 20: optional binary details\n}\n\nstruct ContinueAsNewWorkflowExecutionDecisionAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n}\n\nstruct StartChildWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n}\n\nstruct Decision {\n 10: optional DecisionType decisionType\n 20: optional ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes\n 25: optional StartTimerDecisionAttributes startTimerDecisionAttributes\n 30: optional CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes\n 35: optional FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes\n 40: optional RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes\n 50: optional CancelTimerDecisionAttributes cancelTimerDecisionAttributes\n 60: optional CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes\n 70: optional RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes\n 80: optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes\n 90: optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes\n 100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes\n 110: optional SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes\n}\n\nstruct WorkflowExecutionStartedEventAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n 60: optional string identity\n}\n\nstruct WorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n}\n\nstruct WorkflowExecutionContinuedAsNewEventAttributes {\n 10: optional string newExecutionRunId\n 20: optional WorkflowType workflowType\n 30: optional TaskList taskList\n 40: optional binary input\n 50: optional i32 executionStartToCloseTimeoutSeconds\n 60: optional i32 taskStartToCloseTimeoutSeconds\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct DecisionTaskScheduledEventAttributes {\n 10: optional TaskList taskList\n 20: optional i32 startToCloseTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") attempt\n}\n\nstruct DecisionTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct DecisionTaskCompletedEventAttributes {\n 10: optional binary executionContext\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct DecisionTaskTimedOutEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct DecisionTaskFailedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional DecisionTaskFailedCause cause\n 35: optional binary details\n 40: optional string identity\n}\n\nstruct ActivityTaskScheduledEventAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct ActivityTaskCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct ActivityTaskFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct ActivityTaskTimedOutEventAttributes {\n 05: optional binary details\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct ActivityTaskCancelRequestedEventAttributes {\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct RequestCancelActivityTaskFailedEventAttributes{\n 10: optional string activityId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskCanceledEventAttributes {\n 10: optional binary details\n 20: optional i64 (js.type = \"Long\") latestCancelRequestedEventId\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct TimerStartedEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct TimerFiredEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct TimerCanceledEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct CancelTimerFailedEventAttributes {\n 10: optional string timerId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCancelRequestedEventAttributes {\n 10: optional string cause\n 20: optional i64 (js.type = \"Long\") externalInitiatedEventId\n 30: optional WorkflowExecution externalWorkflowExecution\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCanceledEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional binary details\n}\n\nstruct MarkerRecordedEventAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionSignaledEventAttributes {\n 10: optional string signalName\n 20: optional binary input\n 30: optional string identity\n}\n\nstruct WorkflowExecutionTerminatedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n}\n\nstruct RequestCancelExternalWorkflowExecutionFailedEventAttributes {\n 10: optional CancelExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionCancelRequestedEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n}\n\nstruct SignalExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional string signalName\n 50: optional binary input\n 60: optional binary control\n}\n\nstruct SignalExternalWorkflowExecutionFailedEventAttributes {\n 10: optional SignalExternalWorkflowExecutionFailedCause cause,\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionSignalRequestedEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n}\n\nstruct StartChildWorkflowExecutionInitiatedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n 100: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct StartChildWorkflowExecutionFailedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional ChildWorkflowExecutionFailedCause cause\n 50: optional binary control\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ChildWorkflowExecutionStartedEventAttributes {\n 10: optional string domain\n 20: optional i64 (js.type = \"Long\") initiatedEventId\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n}\n\nstruct ChildWorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional WorkflowType workflowType\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionCanceledEventAttributes {\n 10: optional binary details\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTerminatedEventAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") initiatedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct HistoryEvent {\n 10: optional i64 (js.type = \"Long\") eventId\n 20: optional i64 (js.type = \"Long\") timestamp\n 30: optional EventType eventType\n 40: optional WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes\n 50: optional WorkflowExecutionCompletedEventAttributes workflowExecutionCompletedEventAttributes\n 60: optional WorkflowExecutionFailedEventAttributes workflowExecutionFailedEventAttributes\n 70: optional WorkflowExecutionTimedOutEventAttributes workflowExecutionTimedOutEventAttributes\n 80: optional DecisionTaskScheduledEventAttributes decisionTaskScheduledEventAttributes\n 90: optional DecisionTaskStartedEventAttributes decisionTaskStartedEventAttributes\n 100: optional DecisionTaskCompletedEventAttributes decisionTaskCompletedEventAttributes\n 110: optional DecisionTaskTimedOutEventAttributes decisionTaskTimedOutEventAttributes\n 120: optional DecisionTaskFailedEventAttributes decisionTaskFailedEventAttributes\n 130: optional ActivityTaskScheduledEventAttributes activityTaskScheduledEventAttributes\n 140: optional ActivityTaskStartedEventAttributes activityTaskStartedEventAttributes\n 150: optional ActivityTaskCompletedEventAttributes activityTaskCompletedEventAttributes\n 160: optional ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes\n 170: optional ActivityTaskTimedOutEventAttributes activityTaskTimedOutEventAttributes\n 180: optional TimerStartedEventAttributes timerStartedEventAttributes\n 190: optional TimerFiredEventAttributes timerFiredEventAttributes\n 200: optional ActivityTaskCancelRequestedEventAttributes activityTaskCancelRequestedEventAttributes\n 210: optional RequestCancelActivityTaskFailedEventAttributes requestCancelActivityTaskFailedEventAttributes\n 220: optional ActivityTaskCanceledEventAttributes activityTaskCanceledEventAttributes\n 230: optional TimerCanceledEventAttributes timerCanceledEventAttributes\n 240: optional CancelTimerFailedEventAttributes cancelTimerFailedEventAttributes\n 250: optional MarkerRecordedEventAttributes markerRecordedEventAttributes\n 260: optional WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes\n 270: optional WorkflowExecutionTerminatedEventAttributes workflowExecutionTerminatedEventAttributes\n 280: optional WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes\n 290: optional WorkflowExecutionCanceledEventAttributes workflowExecutionCanceledEventAttributes\n 300: optional RequestCancelExternalWorkflowExecutionInitiatedEventAttributes requestCancelExternalWorkflowExecutionInitiatedEventAttributes\n 310: optional RequestCancelExternalWorkflowExecutionFailedEventAttributes requestCancelExternalWorkflowExecutionFailedEventAttributes\n 320: optional ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes\n 330: optional WorkflowExecutionContinuedAsNewEventAttributes workflowExecutionContinuedAsNewEventAttributes\n 340: optional StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes\n 350: optional StartChildWorkflowExecutionFailedEventAttributes startChildWorkflowExecutionFailedEventAttributes\n 360: optional ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes\n 370: optional ChildWorkflowExecutionCompletedEventAttributes childWorkflowExecutionCompletedEventAttributes\n 380: optional ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes\n 390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes\n 400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes\n 410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes\n 420: optional SignalExternalWorkflowExecutionInitiatedEventAttributes signalExternalWorkflowExecutionInitiatedEventAttributes\n 430: optional SignalExternalWorkflowExecutionFailedEventAttributes signalExternalWorkflowExecutionFailedEventAttributes\n 440: optional ExternalWorkflowExecutionSignalRequestedEventAttributes externalWorkflowExecutionSignalRequestedEventAttributes\n}\n\nstruct History {\n 10: optional list events\n}\n\nstruct WorkflowExecutionFilter {\n 10: optional string workflowId\n}\n\nstruct WorkflowTypeFilter {\n 10: optional string name\n}\n\nstruct StartTimeFilter {\n 10: optional i64 (js.type = \"Long\") earliestTime\n 20: optional i64 (js.type = \"Long\") latestTime\n}\n\nstruct DomainInfo {\n 10: optional string name\n 20: optional DomainStatus status\n 30: optional string description\n 40: optional string ownerEmail\n}\n\nstruct DomainConfiguration {\n 10: optional i32 workflowExecutionRetentionPeriodInDays\n 20: optional bool emitMetric\n}\n\nstruct UpdateDomainInfo {\n 10: optional string description\n 20: optional string ownerEmail\n}\n\nstruct RegisterDomainRequest {\n 10: optional string name\n 20: optional string description\n 30: optional string ownerEmail\n 40: optional i32 workflowExecutionRetentionPeriodInDays\n 50: optional bool emitMetric\n}\n\nstruct DescribeDomainRequest {\n 10: optional string name\n}\n\nstruct DescribeDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainRequest {\n 10: optional string name\n 20: optional UpdateDomainInfo updatedInfo\n 30: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct DeprecateDomainRequest {\n 10: optional string name\n}\n\nstruct StartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n}\n\nstruct StartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct PollForDecisionTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n}\n\nstruct PollForDecisionTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") previousStartedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n 54: optional i64 (js.type = \"Long\") backlogCountHint\n 60: optional History history\n 70: optional binary nextPageToken\n 80: optional WorkflowQuery query\n}\n\nstruct StickyExecutionAttributes {\n 10: optional TaskList workerTaskList\n 20: optional i32 scheduleToStartTimeoutSeconds\n}\n\nstruct RespondDecisionTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional list decisions\n 30: optional binary executionContext\n 40: optional string identity\n 50: optional StickyExecutionAttributes stickyAttributes\n}\n\nstruct RespondDecisionTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional DecisionTaskFailedCause cause\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct PollForActivityTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional TaskListMetadata taskListMetadata\n}\n\nstruct PollForActivityTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional string activityId\n 40: optional ActivityType activityType\n 50: optional binary input\n 70: optional i64 (js.type = \"Long\") scheduledTimestamp\n 80: optional i32 scheduleToCloseTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") startedTimestamp\n 100: optional i32 startToCloseTimeoutSeconds\n 110: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RecordActivityTaskHeartbeatRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatResponse {\n 10: optional bool cancelRequested\n}\n\nstruct RespondActivityTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional binary result\n 30: optional string identity\n}\n\nstruct RespondActivityTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional string reason\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct RespondActivityTaskCanceledRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RespondActivityTaskCompletedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary result\n 60: optional string identity\n}\n\nstruct RespondActivityTaskFailedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional string reason\n 60: optional binary details\n 70: optional string identity\n}\n\nstruct RespondActivityTaskCanceledByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RequestCancelWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n 40: optional string requestId\n}\n\nstruct GetWorkflowExecutionHistoryRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional i32 maximumPageSize\n 40: optional binary nextPageToken\n 50: optional bool waitForNewEvent\n}\n\nstruct GetWorkflowExecutionHistoryResponse {\n 10: optional History history\n 20: optional binary nextPageToken\n}\n\nstruct SignalWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string signalName\n 40: optional binary input\n 50: optional string identity\n 60: optional string requestId\n}\n\nstruct DeleteWorkflowExecutionSignalRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n 40: optional string requestId\n}\n\nstruct TerminateWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional binary details\n 50: optional string identity\n}\n\nstruct ListOpenWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n}\n\nstruct ListOpenWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListClosedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n 70: optional WorkflowExecutionCloseStatus statusFilter\n}\n\nstruct ListClosedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct QueryWorkflowRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional WorkflowQuery query\n}\n\nstruct QueryWorkflowResponse {\n 10: optional binary queryResult\n}\n\nstruct WorkflowQuery {\n 10: optional string queryType\n 20: optional binary queryArgs\n}\n\nstruct RespondQueryTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional QueryTaskCompletedType completedType\n 30: optional binary queryResult\n 40: optional string errorMessage\n}\n\nstruct DescribeWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct DescribeWorkflowExecutionResponse {\n 10: optional WorkflowExecutionConfiguration executionConfiguration\n 20: optional WorkflowExecutionInfo workflowExecutionInfo\n}\n" diff --git a/.gen/go/shared/types.go b/.gen/go/shared/types.go index 51b3444e5..8ed4a95ba 100644 --- a/.gen/go/shared/types.go +++ b/.gen/go/shared/types.go @@ -4794,6 +4794,7 @@ type Decision struct { RecordMarkerDecisionAttributes *RecordMarkerDecisionAttributes `json:"recordMarkerDecisionAttributes,omitempty"` ContinueAsNewWorkflowExecutionDecisionAttributes *ContinueAsNewWorkflowExecutionDecisionAttributes `json:"continueAsNewWorkflowExecutionDecisionAttributes,omitempty"` StartChildWorkflowExecutionDecisionAttributes *StartChildWorkflowExecutionDecisionAttributes `json:"startChildWorkflowExecutionDecisionAttributes,omitempty"` + SignalExternalWorkflowExecutionDecisionAttributes *SignalExternalWorkflowExecutionDecisionAttributes `json:"signalExternalWorkflowExecutionDecisionAttributes,omitempty"` } // ToWire translates a Decision struct into a Thrift-level intermediate @@ -4813,7 +4814,7 @@ type Decision struct { // } func (v *Decision) ToWire() (wire.Value, error) { var ( - fields [12]wire.Field + fields [13]wire.Field i int = 0 w wire.Value err error @@ -4915,6 +4916,14 @@ func (v *Decision) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 100, Value: w} i++ } + if v.SignalExternalWorkflowExecutionDecisionAttributes != nil { + w, err = v.SignalExternalWorkflowExecutionDecisionAttributes.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 110, Value: w} + i++ + } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } @@ -4991,6 +5000,12 @@ func _StartChildWorkflowExecutionDecisionAttributes_Read(w wire.Value) (*StartCh return &v, err } +func _SignalExternalWorkflowExecutionDecisionAttributes_Read(w wire.Value) (*SignalExternalWorkflowExecutionDecisionAttributes, error) { + var v SignalExternalWorkflowExecutionDecisionAttributes + err := v.FromWire(w) + return &v, err +} + // FromWire deserializes a Decision struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. @@ -5110,6 +5125,14 @@ func (v *Decision) FromWire(w wire.Value) error { return err } + } + case 110: + if field.Value.Type() == wire.TStruct { + v.SignalExternalWorkflowExecutionDecisionAttributes, err = _SignalExternalWorkflowExecutionDecisionAttributes_Read(field.Value) + if err != nil { + return err + } + } } } @@ -5124,7 +5147,7 @@ func (v *Decision) String() string { return "" } - var fields [12]string + var fields [13]string i := 0 if v.DecisionType != nil { fields[i] = fmt.Sprintf("DecisionType: %v", *(v.DecisionType)) @@ -5174,6 +5197,10 @@ func (v *Decision) String() string { fields[i] = fmt.Sprintf("StartChildWorkflowExecutionDecisionAttributes: %v", v.StartChildWorkflowExecutionDecisionAttributes) i++ } + if v.SignalExternalWorkflowExecutionDecisionAttributes != nil { + fields[i] = fmt.Sprintf("SignalExternalWorkflowExecutionDecisionAttributes: %v", v.SignalExternalWorkflowExecutionDecisionAttributes) + i++ + } return fmt.Sprintf("Decision{%v}", strings.Join(fields[:i], ", ")) } @@ -5229,6 +5256,9 @@ func (v *Decision) Equals(rhs *Decision) bool { if !((v.StartChildWorkflowExecutionDecisionAttributes == nil && rhs.StartChildWorkflowExecutionDecisionAttributes == nil) || (v.StartChildWorkflowExecutionDecisionAttributes != nil && rhs.StartChildWorkflowExecutionDecisionAttributes != nil && v.StartChildWorkflowExecutionDecisionAttributes.Equals(rhs.StartChildWorkflowExecutionDecisionAttributes))) { return false } + if !((v.SignalExternalWorkflowExecutionDecisionAttributes == nil && rhs.SignalExternalWorkflowExecutionDecisionAttributes == nil) || (v.SignalExternalWorkflowExecutionDecisionAttributes != nil && rhs.SignalExternalWorkflowExecutionDecisionAttributes != nil && v.SignalExternalWorkflowExecutionDecisionAttributes.Equals(rhs.SignalExternalWorkflowExecutionDecisionAttributes))) { + return false + } return true } @@ -5467,11 +5497,12 @@ const ( DecisionTaskFailedCauseBadCompleteWorkflowExecutionAttributes DecisionTaskFailedCause = 6 DecisionTaskFailedCauseBadFailWorkflowExecutionAttributes DecisionTaskFailedCause = 7 DecisionTaskFailedCauseBadCancelWorkflowExecutionAttributes DecisionTaskFailedCause = 8 - DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes DecisionTaskFailedCause = 9 - DecisionTaskFailedCauseBadContinueAsNewAttributes DecisionTaskFailedCause = 10 - DecisionTaskFailedCauseStartTimerDuplicateID DecisionTaskFailedCause = 11 - DecisionTaskFailedCauseResetStickyTasklist DecisionTaskFailedCause = 12 - DecisionTaskFailedCauseWorkflowWorkerUnhandledFailure DecisionTaskFailedCause = 13 + DecisionTaskFailedCauseBadSignalWorkflowExecutionAttributes DecisionTaskFailedCause = 9 + DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes DecisionTaskFailedCause = 10 + DecisionTaskFailedCauseBadContinueAsNewAttributes DecisionTaskFailedCause = 11 + DecisionTaskFailedCauseStartTimerDuplicateID DecisionTaskFailedCause = 12 + DecisionTaskFailedCauseResetStickyTasklist DecisionTaskFailedCause = 13 + DecisionTaskFailedCauseWorkflowWorkerUnhandledFailure DecisionTaskFailedCause = 14 ) // DecisionTaskFailedCause_Values returns all recognized values of DecisionTaskFailedCause. @@ -5486,6 +5517,7 @@ func DecisionTaskFailedCause_Values() []DecisionTaskFailedCause { DecisionTaskFailedCauseBadCompleteWorkflowExecutionAttributes, DecisionTaskFailedCauseBadFailWorkflowExecutionAttributes, DecisionTaskFailedCauseBadCancelWorkflowExecutionAttributes, + DecisionTaskFailedCauseBadSignalWorkflowExecutionAttributes, DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes, DecisionTaskFailedCauseBadContinueAsNewAttributes, DecisionTaskFailedCauseStartTimerDuplicateID, @@ -5528,6 +5560,9 @@ func (v *DecisionTaskFailedCause) UnmarshalText(value []byte) error { case "BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES": *v = DecisionTaskFailedCauseBadCancelWorkflowExecutionAttributes return nil + case "BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES": + *v = DecisionTaskFailedCauseBadSignalWorkflowExecutionAttributes + return nil case "BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES": *v = DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes return nil @@ -5598,14 +5633,16 @@ func (v DecisionTaskFailedCause) String() string { case 8: return "BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES" case 9: - return "BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES" + return "BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES" case 10: - return "BAD_CONTINUE_AS_NEW_ATTRIBUTES" + return "BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES" case 11: - return "START_TIMER_DUPLICATE_ID" + return "BAD_CONTINUE_AS_NEW_ATTRIBUTES" case 12: - return "RESET_STICKY_TASKLIST" + return "START_TIMER_DUPLICATE_ID" case 13: + return "RESET_STICKY_TASKLIST" + case 14: return "WORKFLOW_WORKER_UNHANDLED_FAILURE" } return fmt.Sprintf("DecisionTaskFailedCause(%d)", w) @@ -5644,14 +5681,16 @@ func (v DecisionTaskFailedCause) MarshalJSON() ([]byte, error) { case 8: return ([]byte)("\"BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil case 9: - return ([]byte)("\"BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil + return ([]byte)("\"BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil case 10: - return ([]byte)("\"BAD_CONTINUE_AS_NEW_ATTRIBUTES\""), nil + return ([]byte)("\"BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil case 11: - return ([]byte)("\"START_TIMER_DUPLICATE_ID\""), nil + return ([]byte)("\"BAD_CONTINUE_AS_NEW_ATTRIBUTES\""), nil case 12: - return ([]byte)("\"RESET_STICKY_TASKLIST\""), nil + return ([]byte)("\"START_TIMER_DUPLICATE_ID\""), nil case 13: + return ([]byte)("\"RESET_STICKY_TASKLIST\""), nil + case 14: return ([]byte)("\"WORKFLOW_WORKER_UNHANDLED_FAILURE\""), nil } return ([]byte)(strconv.FormatInt(int64(v), 10)), nil @@ -6523,6 +6562,7 @@ const ( DecisionTypeRecordMarker DecisionType = 8 DecisionTypeContinueAsNewWorkflowExecution DecisionType = 9 DecisionTypeStartChildWorkflowExecution DecisionType = 10 + DecisionTypeSignalExternalWorkflowExecution DecisionType = 11 ) // DecisionType_Values returns all recognized values of DecisionType. @@ -6539,6 +6579,7 @@ func DecisionType_Values() []DecisionType { DecisionTypeRecordMarker, DecisionTypeContinueAsNewWorkflowExecution, DecisionTypeStartChildWorkflowExecution, + DecisionTypeSignalExternalWorkflowExecution, } } @@ -6582,6 +6623,9 @@ func (v *DecisionType) UnmarshalText(value []byte) error { case "StartChildWorkflowExecution": *v = DecisionTypeStartChildWorkflowExecution return nil + case "SignalExternalWorkflowExecution": + *v = DecisionTypeSignalExternalWorkflowExecution + return nil default: return fmt.Errorf("unknown enum value %q for %q", value, "DecisionType") } @@ -6640,6 +6684,8 @@ func (v DecisionType) String() string { return "ContinueAsNewWorkflowExecution" case 10: return "StartChildWorkflowExecution" + case 11: + return "SignalExternalWorkflowExecution" } return fmt.Sprintf("DecisionType(%d)", w) } @@ -6680,6 +6726,8 @@ func (v DecisionType) MarshalJSON() ([]byte, error) { return ([]byte)("\"ContinueAsNewWorkflowExecution\""), nil case 10: return ([]byte)("\"StartChildWorkflowExecution\""), nil + case 11: + return ([]byte)("\"SignalExternalWorkflowExecution\""), nil } return ([]byte)(strconv.FormatInt(int64(v), 10)), nil } @@ -6720,6 +6768,218 @@ func (v *DecisionType) UnmarshalJSON(text []byte) error { } } +type DeleteWorkflowExecutionSignalRequest struct { + Domain *string `json:"domain,omitempty"` + WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"` + Identity *string `json:"identity,omitempty"` + RequestId *string `json:"requestId,omitempty"` +} + +// ToWire translates a DeleteWorkflowExecutionSignalRequest struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *DeleteWorkflowExecutionSignalRequest) ToWire() (wire.Value, error) { + var ( + fields [4]wire.Field + i int = 0 + w wire.Value + err error + ) + + if v.Domain != nil { + w, err = wire.NewValueString(*(v.Domain)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 10, Value: w} + i++ + } + if v.WorkflowExecution != nil { + w, err = v.WorkflowExecution.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } + if v.Identity != nil { + w, err = wire.NewValueString(*(v.Identity)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 30, Value: w} + i++ + } + if v.RequestId != nil { + w, err = wire.NewValueString(*(v.RequestId)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 40, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a DeleteWorkflowExecutionSignalRequest struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a DeleteWorkflowExecutionSignalRequest struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v DeleteWorkflowExecutionSignalRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *DeleteWorkflowExecutionSignalRequest) FromWire(w wire.Value) error { + var err error + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 10: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Domain = &x + if err != nil { + return err + } + + } + case 20: + if field.Value.Type() == wire.TStruct { + v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value) + if err != nil { + return err + } + + } + case 30: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Identity = &x + if err != nil { + return err + } + + } + case 40: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.RequestId = &x + if err != nil { + return err + } + + } + } + } + + return nil +} + +// String returns a readable string representation of a DeleteWorkflowExecutionSignalRequest +// struct. +func (v *DeleteWorkflowExecutionSignalRequest) String() string { + if v == nil { + return "" + } + + var fields [4]string + i := 0 + if v.Domain != nil { + fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain)) + i++ + } + if v.WorkflowExecution != nil { + fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution) + i++ + } + if v.Identity != nil { + fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity)) + i++ + } + if v.RequestId != nil { + fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId)) + i++ + } + + return fmt.Sprintf("DeleteWorkflowExecutionSignalRequest{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this DeleteWorkflowExecutionSignalRequest match the +// provided DeleteWorkflowExecutionSignalRequest. +// +// This function performs a deep comparison. +func (v *DeleteWorkflowExecutionSignalRequest) Equals(rhs *DeleteWorkflowExecutionSignalRequest) bool { + if !_String_EqualsPtr(v.Domain, rhs.Domain) { + return false + } + if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) { + return false + } + if !_String_EqualsPtr(v.Identity, rhs.Identity) { + return false + } + if !_String_EqualsPtr(v.RequestId, rhs.RequestId) { + return false + } + + return true +} + +// GetDomain returns the value of Domain if it is set or its +// zero value if it is unset. +func (v *DeleteWorkflowExecutionSignalRequest) GetDomain() (o string) { + if v.Domain != nil { + return *v.Domain + } + + return +} + +// GetIdentity returns the value of Identity if it is set or its +// zero value if it is unset. +func (v *DeleteWorkflowExecutionSignalRequest) GetIdentity() (o string) { + if v.Identity != nil { + return *v.Identity + } + + return +} + +// GetRequestId returns the value of RequestId if it is set or its +// zero value if it is unset. +func (v *DeleteWorkflowExecutionSignalRequest) GetRequestId() (o string) { + if v.RequestId != nil { + return *v.RequestId + } + + return +} + type DeprecateDomainRequest struct { Name *string `json:"name,omitempty"` } @@ -8163,17 +8423,20 @@ const ( EventTypeRequestCancelExternalWorkflowExecutionFailed EventType = 24 EventTypeExternalWorkflowExecutionCancelRequested EventType = 25 EventTypeMarkerRecorded EventType = 26 - EventTypeWorkflowExecutionSignaled EventType = 27 - EventTypeWorkflowExecutionTerminated EventType = 28 - EventTypeWorkflowExecutionContinuedAsNew EventType = 29 - EventTypeStartChildWorkflowExecutionInitiated EventType = 30 - EventTypeStartChildWorkflowExecutionFailed EventType = 31 - EventTypeChildWorkflowExecutionStarted EventType = 32 - EventTypeChildWorkflowExecutionCompleted EventType = 33 - EventTypeChildWorkflowExecutionFailed EventType = 34 - EventTypeChildWorkflowExecutionCanceled EventType = 35 - EventTypeChildWorkflowExecutionTimedOut EventType = 36 - EventTypeChildWorkflowExecutionTerminated EventType = 37 + EventTypeSignalExternalWorkflowExecutionInitiated EventType = 27 + EventTypeSignalExternalWorkflowExecutionFailed EventType = 28 + EventTypeExternalWorkflowExecutionSignalRequested EventType = 29 + EventTypeWorkflowExecutionSignaled EventType = 30 + EventTypeWorkflowExecutionTerminated EventType = 31 + EventTypeWorkflowExecutionContinuedAsNew EventType = 32 + EventTypeStartChildWorkflowExecutionInitiated EventType = 33 + EventTypeStartChildWorkflowExecutionFailed EventType = 34 + EventTypeChildWorkflowExecutionStarted EventType = 35 + EventTypeChildWorkflowExecutionCompleted EventType = 36 + EventTypeChildWorkflowExecutionFailed EventType = 37 + EventTypeChildWorkflowExecutionCanceled EventType = 38 + EventTypeChildWorkflowExecutionTimedOut EventType = 39 + EventTypeChildWorkflowExecutionTerminated EventType = 40 ) // EventType_Values returns all recognized values of EventType. @@ -8206,6 +8469,9 @@ func EventType_Values() []EventType { EventTypeRequestCancelExternalWorkflowExecutionFailed, EventTypeExternalWorkflowExecutionCancelRequested, EventTypeMarkerRecorded, + EventTypeSignalExternalWorkflowExecutionInitiated, + EventTypeSignalExternalWorkflowExecutionFailed, + EventTypeExternalWorkflowExecutionSignalRequested, EventTypeWorkflowExecutionSignaled, EventTypeWorkflowExecutionTerminated, EventTypeWorkflowExecutionContinuedAsNew, @@ -8308,6 +8574,15 @@ func (v *EventType) UnmarshalText(value []byte) error { case "MarkerRecorded": *v = EventTypeMarkerRecorded return nil + case "SignalExternalWorkflowExecutionInitiated": + *v = EventTypeSignalExternalWorkflowExecutionInitiated + return nil + case "SignalExternalWorkflowExecutionFailed": + *v = EventTypeSignalExternalWorkflowExecutionFailed + return nil + case "ExternalWorkflowExecutionSignalRequested": + *v = EventTypeExternalWorkflowExecutionSignalRequested + return nil case "WorkflowExecutionSignaled": *v = EventTypeWorkflowExecutionSignaled return nil @@ -8432,26 +8707,32 @@ func (v EventType) String() string { case 26: return "MarkerRecorded" case 27: - return "WorkflowExecutionSignaled" + return "SignalExternalWorkflowExecutionInitiated" case 28: - return "WorkflowExecutionTerminated" + return "SignalExternalWorkflowExecutionFailed" case 29: - return "WorkflowExecutionContinuedAsNew" + return "ExternalWorkflowExecutionSignalRequested" case 30: - return "StartChildWorkflowExecutionInitiated" + return "WorkflowExecutionSignaled" case 31: - return "StartChildWorkflowExecutionFailed" + return "WorkflowExecutionTerminated" case 32: - return "ChildWorkflowExecutionStarted" + return "WorkflowExecutionContinuedAsNew" case 33: - return "ChildWorkflowExecutionCompleted" + return "StartChildWorkflowExecutionInitiated" case 34: - return "ChildWorkflowExecutionFailed" + return "StartChildWorkflowExecutionFailed" case 35: - return "ChildWorkflowExecutionCanceled" + return "ChildWorkflowExecutionStarted" case 36: - return "ChildWorkflowExecutionTimedOut" + return "ChildWorkflowExecutionCompleted" case 37: + return "ChildWorkflowExecutionFailed" + case 38: + return "ChildWorkflowExecutionCanceled" + case 39: + return "ChildWorkflowExecutionTimedOut" + case 40: return "ChildWorkflowExecutionTerminated" } return fmt.Sprintf("EventType(%d)", w) @@ -8526,26 +8807,32 @@ func (v EventType) MarshalJSON() ([]byte, error) { case 26: return ([]byte)("\"MarkerRecorded\""), nil case 27: - return ([]byte)("\"WorkflowExecutionSignaled\""), nil + return ([]byte)("\"SignalExternalWorkflowExecutionInitiated\""), nil case 28: - return ([]byte)("\"WorkflowExecutionTerminated\""), nil + return ([]byte)("\"SignalExternalWorkflowExecutionFailed\""), nil case 29: - return ([]byte)("\"WorkflowExecutionContinuedAsNew\""), nil + return ([]byte)("\"ExternalWorkflowExecutionSignalRequested\""), nil case 30: - return ([]byte)("\"StartChildWorkflowExecutionInitiated\""), nil + return ([]byte)("\"WorkflowExecutionSignaled\""), nil case 31: - return ([]byte)("\"StartChildWorkflowExecutionFailed\""), nil + return ([]byte)("\"WorkflowExecutionTerminated\""), nil case 32: - return ([]byte)("\"ChildWorkflowExecutionStarted\""), nil + return ([]byte)("\"WorkflowExecutionContinuedAsNew\""), nil case 33: - return ([]byte)("\"ChildWorkflowExecutionCompleted\""), nil + return ([]byte)("\"StartChildWorkflowExecutionInitiated\""), nil case 34: - return ([]byte)("\"ChildWorkflowExecutionFailed\""), nil + return ([]byte)("\"StartChildWorkflowExecutionFailed\""), nil case 35: - return ([]byte)("\"ChildWorkflowExecutionCanceled\""), nil + return ([]byte)("\"ChildWorkflowExecutionStarted\""), nil case 36: - return ([]byte)("\"ChildWorkflowExecutionTimedOut\""), nil + return ([]byte)("\"ChildWorkflowExecutionCompleted\""), nil case 37: + return ([]byte)("\"ChildWorkflowExecutionFailed\""), nil + case 38: + return ([]byte)("\"ChildWorkflowExecutionCanceled\""), nil + case 39: + return ([]byte)("\"ChildWorkflowExecutionTimedOut\""), nil + case 40: return ([]byte)("\"ChildWorkflowExecutionTerminated\""), nil } return ([]byte)(strconv.FormatInt(int64(v), 10)), nil @@ -8763,6 +9050,206 @@ func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) GetDomain() (o return } +type ExternalWorkflowExecutionSignalRequestedEventAttributes struct { + InitiatedEventId *int64 `json:"initiatedEventId,omitempty"` + Domain *string `json:"domain,omitempty"` + WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"` + Control []byte `json:"control,omitempty"` +} + +// ToWire translates a ExternalWorkflowExecutionSignalRequestedEventAttributes struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *ExternalWorkflowExecutionSignalRequestedEventAttributes) ToWire() (wire.Value, error) { + var ( + fields [4]wire.Field + i int = 0 + w wire.Value + err error + ) + + if v.InitiatedEventId != nil { + w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 10, Value: w} + i++ + } + if v.Domain != nil { + w, err = wire.NewValueString(*(v.Domain)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } + if v.WorkflowExecution != nil { + w, err = v.WorkflowExecution.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 30, Value: w} + i++ + } + if v.Control != nil { + w, err = wire.NewValueBinary(v.Control), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 40, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a ExternalWorkflowExecutionSignalRequestedEventAttributes struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a ExternalWorkflowExecutionSignalRequestedEventAttributes struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v ExternalWorkflowExecutionSignalRequestedEventAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *ExternalWorkflowExecutionSignalRequestedEventAttributes) FromWire(w wire.Value) error { + var err error + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 10: + if field.Value.Type() == wire.TI64 { + var x int64 + x, err = field.Value.GetI64(), error(nil) + v.InitiatedEventId = &x + if err != nil { + return err + } + + } + case 20: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Domain = &x + if err != nil { + return err + } + + } + case 30: + if field.Value.Type() == wire.TStruct { + v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value) + if err != nil { + return err + } + + } + case 40: + if field.Value.Type() == wire.TBinary { + v.Control, err = field.Value.GetBinary(), error(nil) + if err != nil { + return err + } + + } + } + } + + return nil +} + +// String returns a readable string representation of a ExternalWorkflowExecutionSignalRequestedEventAttributes +// struct. +func (v *ExternalWorkflowExecutionSignalRequestedEventAttributes) String() string { + if v == nil { + return "" + } + + var fields [4]string + i := 0 + if v.InitiatedEventId != nil { + fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId)) + i++ + } + if v.Domain != nil { + fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain)) + i++ + } + if v.WorkflowExecution != nil { + fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution) + i++ + } + if v.Control != nil { + fields[i] = fmt.Sprintf("Control: %v", v.Control) + i++ + } + + return fmt.Sprintf("ExternalWorkflowExecutionSignalRequestedEventAttributes{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this ExternalWorkflowExecutionSignalRequestedEventAttributes match the +// provided ExternalWorkflowExecutionSignalRequestedEventAttributes. +// +// This function performs a deep comparison. +func (v *ExternalWorkflowExecutionSignalRequestedEventAttributes) Equals(rhs *ExternalWorkflowExecutionSignalRequestedEventAttributes) bool { + if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) { + return false + } + if !_String_EqualsPtr(v.Domain, rhs.Domain) { + return false + } + if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) { + return false + } + if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) { + return false + } + + return true +} + +// GetInitiatedEventId returns the value of InitiatedEventId if it is set or its +// zero value if it is unset. +func (v *ExternalWorkflowExecutionSignalRequestedEventAttributes) GetInitiatedEventId() (o int64) { + if v.InitiatedEventId != nil { + return *v.InitiatedEventId + } + + return +} + +// GetDomain returns the value of Domain if it is set or its +// zero value if it is unset. +func (v *ExternalWorkflowExecutionSignalRequestedEventAttributes) GetDomain() (o string) { + if v.Domain != nil { + return *v.Domain + } + + return +} + type FailWorkflowExecutionDecisionAttributes struct { Reason *string `json:"reason,omitempty"` Details []byte `json:"details,omitempty"` @@ -9487,6 +9974,9 @@ type HistoryEvent struct { ChildWorkflowExecutionCanceledEventAttributes *ChildWorkflowExecutionCanceledEventAttributes `json:"childWorkflowExecutionCanceledEventAttributes,omitempty"` ChildWorkflowExecutionTimedOutEventAttributes *ChildWorkflowExecutionTimedOutEventAttributes `json:"childWorkflowExecutionTimedOutEventAttributes,omitempty"` ChildWorkflowExecutionTerminatedEventAttributes *ChildWorkflowExecutionTerminatedEventAttributes `json:"childWorkflowExecutionTerminatedEventAttributes,omitempty"` + SignalExternalWorkflowExecutionInitiatedEventAttributes *SignalExternalWorkflowExecutionInitiatedEventAttributes `json:"signalExternalWorkflowExecutionInitiatedEventAttributes,omitempty"` + SignalExternalWorkflowExecutionFailedEventAttributes *SignalExternalWorkflowExecutionFailedEventAttributes `json:"signalExternalWorkflowExecutionFailedEventAttributes,omitempty"` + ExternalWorkflowExecutionSignalRequestedEventAttributes *ExternalWorkflowExecutionSignalRequestedEventAttributes `json:"externalWorkflowExecutionSignalRequestedEventAttributes,omitempty"` } // ToWire translates a HistoryEvent struct into a Thrift-level intermediate @@ -9506,7 +9996,7 @@ type HistoryEvent struct { // } func (v *HistoryEvent) ToWire() (wire.Value, error) { var ( - fields [41]wire.Field + fields [44]wire.Field i int = 0 w wire.Value err error @@ -9840,6 +10330,30 @@ func (v *HistoryEvent) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 410, Value: w} i++ } + if v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil { + w, err = v.SignalExternalWorkflowExecutionInitiatedEventAttributes.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 420, Value: w} + i++ + } + if v.SignalExternalWorkflowExecutionFailedEventAttributes != nil { + w, err = v.SignalExternalWorkflowExecutionFailedEventAttributes.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 430, Value: w} + i++ + } + if v.ExternalWorkflowExecutionSignalRequestedEventAttributes != nil { + w, err = v.ExternalWorkflowExecutionSignalRequestedEventAttributes.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 440, Value: w} + i++ + } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } @@ -10078,6 +10592,24 @@ func _ChildWorkflowExecutionTerminatedEventAttributes_Read(w wire.Value) (*Child return &v, err } +func _SignalExternalWorkflowExecutionInitiatedEventAttributes_Read(w wire.Value) (*SignalExternalWorkflowExecutionInitiatedEventAttributes, error) { + var v SignalExternalWorkflowExecutionInitiatedEventAttributes + err := v.FromWire(w) + return &v, err +} + +func _SignalExternalWorkflowExecutionFailedEventAttributes_Read(w wire.Value) (*SignalExternalWorkflowExecutionFailedEventAttributes, error) { + var v SignalExternalWorkflowExecutionFailedEventAttributes + err := v.FromWire(w) + return &v, err +} + +func _ExternalWorkflowExecutionSignalRequestedEventAttributes_Read(w wire.Value) (*ExternalWorkflowExecutionSignalRequestedEventAttributes, error) { + var v ExternalWorkflowExecutionSignalRequestedEventAttributes + err := v.FromWire(w) + return &v, err +} + // FromWire deserializes a HistoryEvent struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. @@ -10433,6 +10965,30 @@ func (v *HistoryEvent) FromWire(w wire.Value) error { return err } + } + case 420: + if field.Value.Type() == wire.TStruct { + v.SignalExternalWorkflowExecutionInitiatedEventAttributes, err = _SignalExternalWorkflowExecutionInitiatedEventAttributes_Read(field.Value) + if err != nil { + return err + } + + } + case 430: + if field.Value.Type() == wire.TStruct { + v.SignalExternalWorkflowExecutionFailedEventAttributes, err = _SignalExternalWorkflowExecutionFailedEventAttributes_Read(field.Value) + if err != nil { + return err + } + + } + case 440: + if field.Value.Type() == wire.TStruct { + v.ExternalWorkflowExecutionSignalRequestedEventAttributes, err = _ExternalWorkflowExecutionSignalRequestedEventAttributes_Read(field.Value) + if err != nil { + return err + } + } } } @@ -10447,7 +11003,7 @@ func (v *HistoryEvent) String() string { return "" } - var fields [41]string + var fields [44]string i := 0 if v.EventId != nil { fields[i] = fmt.Sprintf("EventId: %v", *(v.EventId)) @@ -10613,7 +11169,19 @@ func (v *HistoryEvent) String() string { fields[i] = fmt.Sprintf("ChildWorkflowExecutionTerminatedEventAttributes: %v", v.ChildWorkflowExecutionTerminatedEventAttributes) i++ } - + if v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil { + fields[i] = fmt.Sprintf("SignalExternalWorkflowExecutionInitiatedEventAttributes: %v", v.SignalExternalWorkflowExecutionInitiatedEventAttributes) + i++ + } + if v.SignalExternalWorkflowExecutionFailedEventAttributes != nil { + fields[i] = fmt.Sprintf("SignalExternalWorkflowExecutionFailedEventAttributes: %v", v.SignalExternalWorkflowExecutionFailedEventAttributes) + i++ + } + if v.ExternalWorkflowExecutionSignalRequestedEventAttributes != nil { + fields[i] = fmt.Sprintf("ExternalWorkflowExecutionSignalRequestedEventAttributes: %v", v.ExternalWorkflowExecutionSignalRequestedEventAttributes) + i++ + } + return fmt.Sprintf("HistoryEvent{%v}", strings.Join(fields[:i], ", ")) } @@ -10755,6 +11323,15 @@ func (v *HistoryEvent) Equals(rhs *HistoryEvent) bool { if !((v.ChildWorkflowExecutionTerminatedEventAttributes == nil && rhs.ChildWorkflowExecutionTerminatedEventAttributes == nil) || (v.ChildWorkflowExecutionTerminatedEventAttributes != nil && rhs.ChildWorkflowExecutionTerminatedEventAttributes != nil && v.ChildWorkflowExecutionTerminatedEventAttributes.Equals(rhs.ChildWorkflowExecutionTerminatedEventAttributes))) { return false } + if !((v.SignalExternalWorkflowExecutionInitiatedEventAttributes == nil && rhs.SignalExternalWorkflowExecutionInitiatedEventAttributes == nil) || (v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil && rhs.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil && v.SignalExternalWorkflowExecutionInitiatedEventAttributes.Equals(rhs.SignalExternalWorkflowExecutionInitiatedEventAttributes))) { + return false + } + if !((v.SignalExternalWorkflowExecutionFailedEventAttributes == nil && rhs.SignalExternalWorkflowExecutionFailedEventAttributes == nil) || (v.SignalExternalWorkflowExecutionFailedEventAttributes != nil && rhs.SignalExternalWorkflowExecutionFailedEventAttributes != nil && v.SignalExternalWorkflowExecutionFailedEventAttributes.Equals(rhs.SignalExternalWorkflowExecutionFailedEventAttributes))) { + return false + } + if !((v.ExternalWorkflowExecutionSignalRequestedEventAttributes == nil && rhs.ExternalWorkflowExecutionSignalRequestedEventAttributes == nil) || (v.ExternalWorkflowExecutionSignalRequestedEventAttributes != nil && rhs.ExternalWorkflowExecutionSignalRequestedEventAttributes != nil && v.ExternalWorkflowExecutionSignalRequestedEventAttributes.Equals(rhs.ExternalWorkflowExecutionSignalRequestedEventAttributes))) { + return false + } return true } @@ -18071,15 +18648,16 @@ func (v *ServiceBusyError) Error() string { return v.String() } -type SignalWorkflowExecutionRequest struct { - Domain *string `json:"domain,omitempty"` - WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"` - SignalName *string `json:"signalName,omitempty"` - Input []byte `json:"input,omitempty"` - Identity *string `json:"identity,omitempty"` +type SignalExternalWorkflowExecutionDecisionAttributes struct { + Domain *string `json:"domain,omitempty"` + WorkflowId *string `json:"workflowId,omitempty"` + RunId *string `json:"runId,omitempty"` + SignalName *string `json:"signalName,omitempty"` + Input []byte `json:"input,omitempty"` + Control []byte `json:"control,omitempty"` } -// ToWire translates a SignalWorkflowExecutionRequest struct into a Thrift-level intermediate +// ToWire translates a SignalExternalWorkflowExecutionDecisionAttributes struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -18094,9 +18672,9 @@ type SignalWorkflowExecutionRequest struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *SignalWorkflowExecutionRequest) ToWire() (wire.Value, error) { +func (v *SignalExternalWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) { var ( - fields [5]wire.Field + fields [6]wire.Field i int = 0 w wire.Value err error @@ -18110,20 +18688,28 @@ func (v *SignalWorkflowExecutionRequest) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 10, Value: w} i++ } - if v.WorkflowExecution != nil { - w, err = v.WorkflowExecution.ToWire() + if v.WorkflowId != nil { + w, err = wire.NewValueString(*(v.WorkflowId)), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 20, Value: w} i++ } + if v.RunId != nil { + w, err = wire.NewValueString(*(v.RunId)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 30, Value: w} + i++ + } if v.SignalName != nil { w, err = wire.NewValueString(*(v.SignalName)), error(nil) if err != nil { return w, err } - fields[i] = wire.Field{ID: 30, Value: w} + fields[i] = wire.Field{ID: 40, Value: w} i++ } if v.Input != nil { @@ -18131,26 +18717,26 @@ func (v *SignalWorkflowExecutionRequest) ToWire() (wire.Value, error) { if err != nil { return w, err } - fields[i] = wire.Field{ID: 40, Value: w} + fields[i] = wire.Field{ID: 50, Value: w} i++ } - if v.Identity != nil { - w, err = wire.NewValueString(*(v.Identity)), error(nil) + if v.Control != nil { + w, err = wire.NewValueBinary(v.Control), error(nil) if err != nil { return w, err } - fields[i] = wire.Field{ID: 50, Value: w} + fields[i] = wire.Field{ID: 60, Value: w} i++ } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a SignalWorkflowExecutionRequest struct from its Thrift-level +// FromWire deserializes a SignalExternalWorkflowExecutionDecisionAttributes struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a SignalWorkflowExecutionRequest struct +// An error is returned if we were unable to build a SignalExternalWorkflowExecutionDecisionAttributes struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -18158,12 +18744,12 @@ func (v *SignalWorkflowExecutionRequest) ToWire() (wire.Value, error) { // return nil, err // } // -// var v SignalWorkflowExecutionRequest +// var v SignalExternalWorkflowExecutionDecisionAttributes // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *SignalWorkflowExecutionRequest) FromWire(w wire.Value) error { +func (v *SignalExternalWorkflowExecutionDecisionAttributes) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -18179,8 +18765,10 @@ func (v *SignalWorkflowExecutionRequest) FromWire(w wire.Value) error { } case 20: - if field.Value.Type() == wire.TStruct { - v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value) + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.WorkflowId = &x if err != nil { return err } @@ -18190,7 +18778,7 @@ func (v *SignalWorkflowExecutionRequest) FromWire(w wire.Value) error { if field.Value.Type() == wire.TBinary { var x string x, err = field.Value.GetString(), error(nil) - v.SignalName = &x + v.RunId = &x if err != nil { return err } @@ -18198,7 +18786,9 @@ func (v *SignalWorkflowExecutionRequest) FromWire(w wire.Value) error { } case 40: if field.Value.Type() == wire.TBinary { - v.Input, err = field.Value.GetBinary(), error(nil) + var x string + x, err = field.Value.GetString(), error(nil) + v.SignalName = &x if err != nil { return err } @@ -18206,9 +18796,15 @@ func (v *SignalWorkflowExecutionRequest) FromWire(w wire.Value) error { } case 50: if field.Value.Type() == wire.TBinary { - var x string - x, err = field.Value.GetString(), error(nil) - v.Identity = &x + v.Input, err = field.Value.GetBinary(), error(nil) + if err != nil { + return err + } + + } + case 60: + if field.Value.Type() == wire.TBinary { + v.Control, err = field.Value.GetBinary(), error(nil) if err != nil { return err } @@ -18220,21 +18816,25 @@ func (v *SignalWorkflowExecutionRequest) FromWire(w wire.Value) error { return nil } -// String returns a readable string representation of a SignalWorkflowExecutionRequest +// String returns a readable string representation of a SignalExternalWorkflowExecutionDecisionAttributes // struct. -func (v *SignalWorkflowExecutionRequest) String() string { +func (v *SignalExternalWorkflowExecutionDecisionAttributes) String() string { if v == nil { return "" } - var fields [5]string + var fields [6]string i := 0 if v.Domain != nil { fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain)) i++ } - if v.WorkflowExecution != nil { - fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution) + if v.WorkflowId != nil { + fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId)) + i++ + } + if v.RunId != nil { + fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId)) i++ } if v.SignalName != nil { @@ -18245,23 +18845,26 @@ func (v *SignalWorkflowExecutionRequest) String() string { fields[i] = fmt.Sprintf("Input: %v", v.Input) i++ } - if v.Identity != nil { - fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity)) + if v.Control != nil { + fields[i] = fmt.Sprintf("Control: %v", v.Control) i++ } - return fmt.Sprintf("SignalWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("SignalExternalWorkflowExecutionDecisionAttributes{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this SignalWorkflowExecutionRequest match the -// provided SignalWorkflowExecutionRequest. +// Equals returns true if all the fields of this SignalExternalWorkflowExecutionDecisionAttributes match the +// provided SignalExternalWorkflowExecutionDecisionAttributes. // // This function performs a deep comparison. -func (v *SignalWorkflowExecutionRequest) Equals(rhs *SignalWorkflowExecutionRequest) bool { +func (v *SignalExternalWorkflowExecutionDecisionAttributes) Equals(rhs *SignalExternalWorkflowExecutionDecisionAttributes) bool { if !_String_EqualsPtr(v.Domain, rhs.Domain) { return false } - if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) { + if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) { + return false + } + if !_String_EqualsPtr(v.RunId, rhs.RunId) { return false } if !_String_EqualsPtr(v.SignalName, rhs.SignalName) { @@ -18270,7 +18873,7 @@ func (v *SignalWorkflowExecutionRequest) Equals(rhs *SignalWorkflowExecutionRequ if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) { return false } - if !_String_EqualsPtr(v.Identity, rhs.Identity) { + if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) { return false } @@ -18279,7 +18882,7 @@ func (v *SignalWorkflowExecutionRequest) Equals(rhs *SignalWorkflowExecutionRequ // GetDomain returns the value of Domain if it is set or its // zero value if it is unset. -func (v *SignalWorkflowExecutionRequest) GetDomain() (o string) { +func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetDomain() (o string) { if v.Domain != nil { return *v.Domain } @@ -18287,9 +18890,29 @@ func (v *SignalWorkflowExecutionRequest) GetDomain() (o string) { return } +// GetWorkflowId returns the value of WorkflowId if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetWorkflowId() (o string) { + if v.WorkflowId != nil { + return *v.WorkflowId + } + + return +} + +// GetRunId returns the value of RunId if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetRunId() (o string) { + if v.RunId != nil { + return *v.RunId + } + + return +} + // GetSignalName returns the value of SignalName if it is set or its // zero value if it is unset. -func (v *SignalWorkflowExecutionRequest) GetSignalName() (o string) { +func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetSignalName() (o string) { if v.SignalName != nil { return *v.SignalName } @@ -18297,11 +18920,942 @@ func (v *SignalWorkflowExecutionRequest) GetSignalName() (o string) { return } -// GetIdentity returns the value of Identity if it is set or its -// zero value if it is unset. -func (v *SignalWorkflowExecutionRequest) GetIdentity() (o string) { - if v.Identity != nil { - return *v.Identity +type SignalExternalWorkflowExecutionFailedCause int32 + +const ( + SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution SignalExternalWorkflowExecutionFailedCause = 0 +) + +// SignalExternalWorkflowExecutionFailedCause_Values returns all recognized values of SignalExternalWorkflowExecutionFailedCause. +func SignalExternalWorkflowExecutionFailedCause_Values() []SignalExternalWorkflowExecutionFailedCause { + return []SignalExternalWorkflowExecutionFailedCause{ + SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution, + } +} + +// UnmarshalText tries to decode SignalExternalWorkflowExecutionFailedCause from a byte slice +// containing its name. +// +// var v SignalExternalWorkflowExecutionFailedCause +// err := v.UnmarshalText([]byte("UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION")) +func (v *SignalExternalWorkflowExecutionFailedCause) UnmarshalText(value []byte) error { + switch string(value) { + case "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION": + *v = SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution + return nil + default: + return fmt.Errorf("unknown enum value %q for %q", value, "SignalExternalWorkflowExecutionFailedCause") + } +} + +// ToWire translates SignalExternalWorkflowExecutionFailedCause into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// Enums are represented as 32-bit integers over the wire. +func (v SignalExternalWorkflowExecutionFailedCause) ToWire() (wire.Value, error) { + return wire.NewValueI32(int32(v)), nil +} + +// FromWire deserializes SignalExternalWorkflowExecutionFailedCause from its Thrift-level +// representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return SignalExternalWorkflowExecutionFailedCause(0), err +// } +// +// var v SignalExternalWorkflowExecutionFailedCause +// if err := v.FromWire(x); err != nil { +// return SignalExternalWorkflowExecutionFailedCause(0), err +// } +// return v, nil +func (v *SignalExternalWorkflowExecutionFailedCause) FromWire(w wire.Value) error { + *v = (SignalExternalWorkflowExecutionFailedCause)(w.GetI32()) + return nil +} + +// String returns a readable string representation of SignalExternalWorkflowExecutionFailedCause. +func (v SignalExternalWorkflowExecutionFailedCause) String() string { + w := int32(v) + switch w { + case 0: + return "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION" + } + return fmt.Sprintf("SignalExternalWorkflowExecutionFailedCause(%d)", w) +} + +// Equals returns true if this SignalExternalWorkflowExecutionFailedCause value matches the provided +// value. +func (v SignalExternalWorkflowExecutionFailedCause) Equals(rhs SignalExternalWorkflowExecutionFailedCause) bool { + return v == rhs +} + +// MarshalJSON serializes SignalExternalWorkflowExecutionFailedCause into JSON. +// +// If the enum value is recognized, its name is returned. Otherwise, +// its integer value is returned. +// +// This implements json.Marshaler. +func (v SignalExternalWorkflowExecutionFailedCause) MarshalJSON() ([]byte, error) { + switch int32(v) { + case 0: + return ([]byte)("\"UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION\""), nil + } + return ([]byte)(strconv.FormatInt(int64(v), 10)), nil +} + +// UnmarshalJSON attempts to decode SignalExternalWorkflowExecutionFailedCause from its JSON +// representation. +// +// This implementation supports both, numeric and string inputs. If a +// string is provided, it must be a known enum name. +// +// This implements json.Unmarshaler. +func (v *SignalExternalWorkflowExecutionFailedCause) UnmarshalJSON(text []byte) error { + d := json.NewDecoder(bytes.NewReader(text)) + d.UseNumber() + t, err := d.Token() + if err != nil { + return err + } + + switch w := t.(type) { + case json.Number: + x, err := w.Int64() + if err != nil { + return err + } + if x > math.MaxInt32 { + return fmt.Errorf("enum overflow from JSON %q for %q", text, "SignalExternalWorkflowExecutionFailedCause") + } + if x < math.MinInt32 { + return fmt.Errorf("enum underflow from JSON %q for %q", text, "SignalExternalWorkflowExecutionFailedCause") + } + *v = (SignalExternalWorkflowExecutionFailedCause)(x) + return nil + case string: + return v.UnmarshalText([]byte(w)) + default: + return fmt.Errorf("invalid JSON value %q (%T) to unmarshal into %q", t, t, "SignalExternalWorkflowExecutionFailedCause") + } +} + +type SignalExternalWorkflowExecutionFailedEventAttributes struct { + Cause *SignalExternalWorkflowExecutionFailedCause `json:"cause,omitempty"` + DecisionTaskCompletedEventId *int64 `json:"decisionTaskCompletedEventId,omitempty"` + Domain *string `json:"domain,omitempty"` + WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"` + InitiatedEventId *int64 `json:"initiatedEventId,omitempty"` + Control []byte `json:"control,omitempty"` +} + +// ToWire translates a SignalExternalWorkflowExecutionFailedEventAttributes struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) ToWire() (wire.Value, error) { + var ( + fields [6]wire.Field + i int = 0 + w wire.Value + err error + ) + + if v.Cause != nil { + w, err = v.Cause.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 10, Value: w} + i++ + } + if v.DecisionTaskCompletedEventId != nil { + w, err = wire.NewValueI64(*(v.DecisionTaskCompletedEventId)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } + if v.Domain != nil { + w, err = wire.NewValueString(*(v.Domain)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 30, Value: w} + i++ + } + if v.WorkflowExecution != nil { + w, err = v.WorkflowExecution.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 40, Value: w} + i++ + } + if v.InitiatedEventId != nil { + w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 50, Value: w} + i++ + } + if v.Control != nil { + w, err = wire.NewValueBinary(v.Control), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 60, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +func _SignalExternalWorkflowExecutionFailedCause_Read(w wire.Value) (SignalExternalWorkflowExecutionFailedCause, error) { + var v SignalExternalWorkflowExecutionFailedCause + err := v.FromWire(w) + return v, err +} + +// FromWire deserializes a SignalExternalWorkflowExecutionFailedEventAttributes struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a SignalExternalWorkflowExecutionFailedEventAttributes struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v SignalExternalWorkflowExecutionFailedEventAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) FromWire(w wire.Value) error { + var err error + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 10: + if field.Value.Type() == wire.TI32 { + var x SignalExternalWorkflowExecutionFailedCause + x, err = _SignalExternalWorkflowExecutionFailedCause_Read(field.Value) + v.Cause = &x + if err != nil { + return err + } + + } + case 20: + if field.Value.Type() == wire.TI64 { + var x int64 + x, err = field.Value.GetI64(), error(nil) + v.DecisionTaskCompletedEventId = &x + if err != nil { + return err + } + + } + case 30: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Domain = &x + if err != nil { + return err + } + + } + case 40: + if field.Value.Type() == wire.TStruct { + v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value) + if err != nil { + return err + } + + } + case 50: + if field.Value.Type() == wire.TI64 { + var x int64 + x, err = field.Value.GetI64(), error(nil) + v.InitiatedEventId = &x + if err != nil { + return err + } + + } + case 60: + if field.Value.Type() == wire.TBinary { + v.Control, err = field.Value.GetBinary(), error(nil) + if err != nil { + return err + } + + } + } + } + + return nil +} + +// String returns a readable string representation of a SignalExternalWorkflowExecutionFailedEventAttributes +// struct. +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) String() string { + if v == nil { + return "" + } + + var fields [6]string + i := 0 + if v.Cause != nil { + fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause)) + i++ + } + if v.DecisionTaskCompletedEventId != nil { + fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId)) + i++ + } + if v.Domain != nil { + fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain)) + i++ + } + if v.WorkflowExecution != nil { + fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution) + i++ + } + if v.InitiatedEventId != nil { + fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId)) + i++ + } + if v.Control != nil { + fields[i] = fmt.Sprintf("Control: %v", v.Control) + i++ + } + + return fmt.Sprintf("SignalExternalWorkflowExecutionFailedEventAttributes{%v}", strings.Join(fields[:i], ", ")) +} + +func _SignalExternalWorkflowExecutionFailedCause_EqualsPtr(lhs, rhs *SignalExternalWorkflowExecutionFailedCause) bool { + if lhs != nil && rhs != nil { + + x := *lhs + y := *rhs + return x.Equals(y) + } + return lhs == nil && rhs == nil +} + +// Equals returns true if all the fields of this SignalExternalWorkflowExecutionFailedEventAttributes match the +// provided SignalExternalWorkflowExecutionFailedEventAttributes. +// +// This function performs a deep comparison. +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) Equals(rhs *SignalExternalWorkflowExecutionFailedEventAttributes) bool { + if !_SignalExternalWorkflowExecutionFailedCause_EqualsPtr(v.Cause, rhs.Cause) { + return false + } + if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) { + return false + } + if !_String_EqualsPtr(v.Domain, rhs.Domain) { + return false + } + if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) { + return false + } + if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) { + return false + } + if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) { + return false + } + + return true +} + +// GetCause returns the value of Cause if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetCause() (o SignalExternalWorkflowExecutionFailedCause) { + if v.Cause != nil { + return *v.Cause + } + + return +} + +// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) { + if v.DecisionTaskCompletedEventId != nil { + return *v.DecisionTaskCompletedEventId + } + + return +} + +// GetDomain returns the value of Domain if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetDomain() (o string) { + if v.Domain != nil { + return *v.Domain + } + + return +} + +// GetInitiatedEventId returns the value of InitiatedEventId if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetInitiatedEventId() (o int64) { + if v.InitiatedEventId != nil { + return *v.InitiatedEventId + } + + return +} + +type SignalExternalWorkflowExecutionInitiatedEventAttributes struct { + DecisionTaskCompletedEventId *int64 `json:"decisionTaskCompletedEventId,omitempty"` + Domain *string `json:"domain,omitempty"` + WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"` + SignalName *string `json:"signalName,omitempty"` + Input []byte `json:"input,omitempty"` + Control []byte `json:"control,omitempty"` +} + +// ToWire translates a SignalExternalWorkflowExecutionInitiatedEventAttributes struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) ToWire() (wire.Value, error) { + var ( + fields [6]wire.Field + i int = 0 + w wire.Value + err error + ) + + if v.DecisionTaskCompletedEventId != nil { + w, err = wire.NewValueI64(*(v.DecisionTaskCompletedEventId)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 10, Value: w} + i++ + } + if v.Domain != nil { + w, err = wire.NewValueString(*(v.Domain)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } + if v.WorkflowExecution != nil { + w, err = v.WorkflowExecution.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 30, Value: w} + i++ + } + if v.SignalName != nil { + w, err = wire.NewValueString(*(v.SignalName)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 40, Value: w} + i++ + } + if v.Input != nil { + w, err = wire.NewValueBinary(v.Input), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 50, Value: w} + i++ + } + if v.Control != nil { + w, err = wire.NewValueBinary(v.Control), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 60, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a SignalExternalWorkflowExecutionInitiatedEventAttributes struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a SignalExternalWorkflowExecutionInitiatedEventAttributes struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v SignalExternalWorkflowExecutionInitiatedEventAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) FromWire(w wire.Value) error { + var err error + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 10: + if field.Value.Type() == wire.TI64 { + var x int64 + x, err = field.Value.GetI64(), error(nil) + v.DecisionTaskCompletedEventId = &x + if err != nil { + return err + } + + } + case 20: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Domain = &x + if err != nil { + return err + } + + } + case 30: + if field.Value.Type() == wire.TStruct { + v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value) + if err != nil { + return err + } + + } + case 40: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.SignalName = &x + if err != nil { + return err + } + + } + case 50: + if field.Value.Type() == wire.TBinary { + v.Input, err = field.Value.GetBinary(), error(nil) + if err != nil { + return err + } + + } + case 60: + if field.Value.Type() == wire.TBinary { + v.Control, err = field.Value.GetBinary(), error(nil) + if err != nil { + return err + } + + } + } + } + + return nil +} + +// String returns a readable string representation of a SignalExternalWorkflowExecutionInitiatedEventAttributes +// struct. +func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) String() string { + if v == nil { + return "" + } + + var fields [6]string + i := 0 + if v.DecisionTaskCompletedEventId != nil { + fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId)) + i++ + } + if v.Domain != nil { + fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain)) + i++ + } + if v.WorkflowExecution != nil { + fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution) + i++ + } + if v.SignalName != nil { + fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName)) + i++ + } + if v.Input != nil { + fields[i] = fmt.Sprintf("Input: %v", v.Input) + i++ + } + if v.Control != nil { + fields[i] = fmt.Sprintf("Control: %v", v.Control) + i++ + } + + return fmt.Sprintf("SignalExternalWorkflowExecutionInitiatedEventAttributes{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this SignalExternalWorkflowExecutionInitiatedEventAttributes match the +// provided SignalExternalWorkflowExecutionInitiatedEventAttributes. +// +// This function performs a deep comparison. +func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) Equals(rhs *SignalExternalWorkflowExecutionInitiatedEventAttributes) bool { + if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) { + return false + } + if !_String_EqualsPtr(v.Domain, rhs.Domain) { + return false + } + if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) { + return false + } + if !_String_EqualsPtr(v.SignalName, rhs.SignalName) { + return false + } + if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) { + return false + } + if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) { + return false + } + + return true +} + +// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) { + if v.DecisionTaskCompletedEventId != nil { + return *v.DecisionTaskCompletedEventId + } + + return +} + +// GetDomain returns the value of Domain if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetDomain() (o string) { + if v.Domain != nil { + return *v.Domain + } + + return +} + +// GetSignalName returns the value of SignalName if it is set or its +// zero value if it is unset. +func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetSignalName() (o string) { + if v.SignalName != nil { + return *v.SignalName + } + + return +} + +type SignalWorkflowExecutionRequest struct { + Domain *string `json:"domain,omitempty"` + WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"` + SignalName *string `json:"signalName,omitempty"` + Input []byte `json:"input,omitempty"` + Identity *string `json:"identity,omitempty"` + RequestId *string `json:"requestId,omitempty"` +} + +// ToWire translates a SignalWorkflowExecutionRequest struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *SignalWorkflowExecutionRequest) ToWire() (wire.Value, error) { + var ( + fields [6]wire.Field + i int = 0 + w wire.Value + err error + ) + + if v.Domain != nil { + w, err = wire.NewValueString(*(v.Domain)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 10, Value: w} + i++ + } + if v.WorkflowExecution != nil { + w, err = v.WorkflowExecution.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } + if v.SignalName != nil { + w, err = wire.NewValueString(*(v.SignalName)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 30, Value: w} + i++ + } + if v.Input != nil { + w, err = wire.NewValueBinary(v.Input), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 40, Value: w} + i++ + } + if v.Identity != nil { + w, err = wire.NewValueString(*(v.Identity)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 50, Value: w} + i++ + } + if v.RequestId != nil { + w, err = wire.NewValueString(*(v.RequestId)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 60, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a SignalWorkflowExecutionRequest struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a SignalWorkflowExecutionRequest struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v SignalWorkflowExecutionRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *SignalWorkflowExecutionRequest) FromWire(w wire.Value) error { + var err error + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 10: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Domain = &x + if err != nil { + return err + } + + } + case 20: + if field.Value.Type() == wire.TStruct { + v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value) + if err != nil { + return err + } + + } + case 30: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.SignalName = &x + if err != nil { + return err + } + + } + case 40: + if field.Value.Type() == wire.TBinary { + v.Input, err = field.Value.GetBinary(), error(nil) + if err != nil { + return err + } + + } + case 50: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Identity = &x + if err != nil { + return err + } + + } + case 60: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.RequestId = &x + if err != nil { + return err + } + + } + } + } + + return nil +} + +// String returns a readable string representation of a SignalWorkflowExecutionRequest +// struct. +func (v *SignalWorkflowExecutionRequest) String() string { + if v == nil { + return "" + } + + var fields [6]string + i := 0 + if v.Domain != nil { + fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain)) + i++ + } + if v.WorkflowExecution != nil { + fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution) + i++ + } + if v.SignalName != nil { + fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName)) + i++ + } + if v.Input != nil { + fields[i] = fmt.Sprintf("Input: %v", v.Input) + i++ + } + if v.Identity != nil { + fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity)) + i++ + } + if v.RequestId != nil { + fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId)) + i++ + } + + return fmt.Sprintf("SignalWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this SignalWorkflowExecutionRequest match the +// provided SignalWorkflowExecutionRequest. +// +// This function performs a deep comparison. +func (v *SignalWorkflowExecutionRequest) Equals(rhs *SignalWorkflowExecutionRequest) bool { + if !_String_EqualsPtr(v.Domain, rhs.Domain) { + return false + } + if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) { + return false + } + if !_String_EqualsPtr(v.SignalName, rhs.SignalName) { + return false + } + if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) { + return false + } + if !_String_EqualsPtr(v.Identity, rhs.Identity) { + return false + } + if !_String_EqualsPtr(v.RequestId, rhs.RequestId) { + return false + } + + return true +} + +// GetDomain returns the value of Domain if it is set or its +// zero value if it is unset. +func (v *SignalWorkflowExecutionRequest) GetDomain() (o string) { + if v.Domain != nil { + return *v.Domain + } + + return +} + +// GetSignalName returns the value of SignalName if it is set or its +// zero value if it is unset. +func (v *SignalWorkflowExecutionRequest) GetSignalName() (o string) { + if v.SignalName != nil { + return *v.SignalName + } + + return +} + +// GetIdentity returns the value of Identity if it is set or its +// zero value if it is unset. +func (v *SignalWorkflowExecutionRequest) GetIdentity() (o string) { + if v.Identity != nil { + return *v.Identity + } + + return +} + +// GetRequestId returns the value of RequestId if it is set or its +// zero value if it is unset. +func (v *SignalWorkflowExecutionRequest) GetRequestId() (o string) { + if v.RequestId != nil { + return *v.RequestId } return diff --git a/idl/github.com/uber/cadence/shared.thrift b/idl/github.com/uber/cadence/shared.thrift index 1ad164284..d9816b07a 100644 --- a/idl/github.com/uber/cadence/shared.thrift +++ b/idl/github.com/uber/cadence/shared.thrift @@ -79,6 +79,7 @@ enum DecisionType { RecordMarker, ContinueAsNewWorkflowExecution, StartChildWorkflowExecution, + SignalExternalWorkflowExecution, } enum EventType { @@ -109,6 +110,9 @@ enum EventType { RequestCancelExternalWorkflowExecutionFailed, ExternalWorkflowExecutionCancelRequested, MarkerRecorded, + SignalExternalWorkflowExecutionInitiated, + SignalExternalWorkflowExecutionFailed, + ExternalWorkflowExecutionSignalRequested, WorkflowExecutionSignaled, WorkflowExecutionTerminated, WorkflowExecutionContinuedAsNew, @@ -132,6 +136,7 @@ enum DecisionTaskFailedCause { BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES, BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES, BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES, + BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES, BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES, BAD_CONTINUE_AS_NEW_ATTRIBUTES, START_TIMER_DUPLICATE_ID, @@ -143,6 +148,10 @@ enum CancelExternalWorkflowExecutionFailedCause { UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION, } +enum SignalExternalWorkflowExecutionFailedCause { + UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION, +} + enum ChildWorkflowExecutionFailedCause { WORKFLOW_ALREADY_RUNNING, } @@ -254,6 +263,15 @@ struct RequestCancelExternalWorkflowExecutionDecisionAttributes { 40: optional binary control } +struct SignalExternalWorkflowExecutionDecisionAttributes { + 10: optional string domain + 20: optional string workflowId + 30: optional string runId + 40: optional string signalName + 50: optional binary input + 60: optional binary control +} + struct RecordMarkerDecisionAttributes { 10: optional string markerName 20: optional binary details @@ -292,6 +310,7 @@ struct Decision { 80: optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes 90: optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes 100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes + 110: optional SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes } struct WorkflowExecutionStartedEventAttributes { @@ -498,6 +517,31 @@ struct ExternalWorkflowExecutionCancelRequestedEventAttributes { 30: optional WorkflowExecution workflowExecution } +struct SignalExternalWorkflowExecutionInitiatedEventAttributes { + 10: optional i64 (js.type = "Long") decisionTaskCompletedEventId + 20: optional string domain + 30: optional WorkflowExecution workflowExecution + 40: optional string signalName + 50: optional binary input + 60: optional binary control +} + +struct SignalExternalWorkflowExecutionFailedEventAttributes { + 10: optional SignalExternalWorkflowExecutionFailedCause cause, + 20: optional i64 (js.type = "Long") decisionTaskCompletedEventId + 30: optional string domain + 40: optional WorkflowExecution workflowExecution + 50: optional i64 (js.type = "Long") initiatedEventId + 60: optional binary control +} + +struct ExternalWorkflowExecutionSignalRequestedEventAttributes { + 10: optional i64 (js.type = "Long") initiatedEventId + 20: optional string domain + 30: optional WorkflowExecution workflowExecution + 40: optional binary control +} + struct StartChildWorkflowExecutionInitiatedEventAttributes { 10: optional string domain 20: optional string workflowId @@ -615,6 +659,9 @@ struct HistoryEvent { 390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes 400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes 410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes + 420: optional SignalExternalWorkflowExecutionInitiatedEventAttributes signalExternalWorkflowExecutionInitiatedEventAttributes + 430: optional SignalExternalWorkflowExecutionFailedEventAttributes signalExternalWorkflowExecutionFailedEventAttributes + 440: optional ExternalWorkflowExecutionSignalRequestedEventAttributes externalWorkflowExecutionSignalRequestedEventAttributes } struct History { @@ -840,6 +887,14 @@ struct SignalWorkflowExecutionRequest { 30: optional string signalName 40: optional binary input 50: optional string identity + 60: optional string requestId +} + +struct DeleteWorkflowExecutionSignalRequest { + 10: optional string domain + 20: optional WorkflowExecution workflowExecution + 30: optional string identity + 40: optional string requestId } struct TerminateWorkflowExecutionRequest { diff --git a/internal/internal_decision_state_machine.go b/internal/internal_decision_state_machine.go index f9791c2af..bfca60b13 100644 --- a/internal/internal_decision_state_machine.go +++ b/internal/internal_decision_state_machine.go @@ -23,6 +23,7 @@ package internal import ( "fmt" + "github.com/pborman/uuid" s "go.uber.org/cadence/.gen/go/shared" "go.uber.org/cadence/internal/common" "go.uber.org/cadence/internal/common/util" @@ -92,6 +93,10 @@ type ( *naiveDecisionStateMachine } + signalExternalWorkflowDecisionStateMachine struct { + *naiveDecisionStateMachine + } + // only possible state transition is: CREATED->SENT->COMPLETED markerDecisionStateMachine struct { *naiveDecisionStateMachine @@ -124,6 +129,7 @@ const ( decisionTypeExternalWorkflow decisionType = 2 decisionTypeMarker decisionType = 3 decisionTypeTimer decisionType = 4 + decisionTypeSignal decisionType = 5 ) const ( @@ -251,6 +257,14 @@ func newCancelExternalWorkflowStateMachine(attributes *s.RequestCancelExternalWo } } +func newSignalExternalWorkflowStateMachine(attributes *s.SignalExternalWorkflowExecutionDecisionAttributes, signalID string) *signalExternalWorkflowDecisionStateMachine { + d := createNewDecision(s.DecisionTypeSignalExternalWorkflowExecution) + d.SignalExternalWorkflowExecutionDecisionAttributes = attributes + return &signalExternalWorkflowDecisionStateMachine{ + naiveDecisionStateMachine: newNaiveDecisionStateMachine(decisionTypeSignal, signalID, d), + } +} + func (d *decisionStateMachineBase) getState() decisionState { return d.state } @@ -585,6 +599,24 @@ func (d *cancelExternalWorkflowDecisionStateMachine) handleCompletionEvent() { } } +func (d *signalExternalWorkflowDecisionStateMachine) handleInitiatedEvent() { + switch d.state { + case decisionStateDecisionSent: + d.moveState(decisionStateInitiated, eventInitiated) + default: + d.failStateTransition(eventInitiated) + } +} + +func (d *signalExternalWorkflowDecisionStateMachine) handleCompletionEvent() { + switch d.state { + case decisionStateInitiated: + d.moveState(decisionStateCompleted, eventCompletion) + default: + d.failStateTransition(eventCompletion) + } +} + func (d *markerDecisionStateMachine) handleCompletionEvent() { // Marker decision transit from SENT to COMPLETED on EventType_MarkerRecorded event switch d.state { @@ -788,6 +820,38 @@ func (h *decisionsHelper) handleRequestCancelExternalWorkflowExecutionFailed(wor } } +func (h *decisionsHelper) signalExternalWorkflowExecution(domain, workflowID, runID, signalName string, input []byte) decisionStateMachine { + signalID := uuid.New() + attributes := &s.SignalExternalWorkflowExecutionDecisionAttributes{ + Domain: common.StringPtr(domain), + WorkflowId: common.StringPtr(workflowID), + RunId: common.StringPtr(runID), + SignalName: common.StringPtr(signalName), + Input: input, + Control: []byte(signalID), + } + decision := newSignalExternalWorkflowStateMachine(attributes, signalID) + h.addDecision(decision) + return decision +} + +func (h *decisionsHelper) handleSignalExternalWorkflowExecutionInitiated(signalID string) { + decision := h.getDecision(makeDecisionID(decisionTypeSignal, signalID)) + decision.handleInitiatedEvent() +} + +func (h *decisionsHelper) handleSignalExternalWorkflowExecutionRequested(signalID string) decisionStateMachine { + decision := h.getDecision(makeDecisionID(decisionTypeSignal, signalID)) + decision.handleCompletionEvent() + return decision +} + +func (h *decisionsHelper) handleSignalExternalWorkflowExecutionFailed(signalID string) decisionStateMachine { + decision := h.getDecision(makeDecisionID(decisionTypeSignal, signalID)) + decision.handleCompletionEvent() + return decision +} + func (h *decisionsHelper) startTimer(attributes *s.StartTimerDecisionAttributes) decisionStateMachine { decision := newTimerDecisionStateMachine(attributes) h.addDecision(decision) diff --git a/internal/internal_event_handlers.go b/internal/internal_event_handlers.go index 8d9cc86c6..3a58359c2 100644 --- a/internal/internal_event_handlers.go +++ b/internal/internal_event_handlers.go @@ -68,6 +68,11 @@ type ( handled bool } + scheduledSignal struct { + callback resultHandler + handled bool + } + // workflowEnvironmentImpl an implementation of workflowEnvironment represents a environment for workflow execution. workflowEnvironmentImpl struct { workflowInfo *WorkflowInfo @@ -172,6 +177,14 @@ func (s *scheduledChildWorkflow) handle(result []byte, err error) { s.resultCallback(result, err) } +func (s *scheduledSignal) handle(result []byte, err error) { + if s.handled { + panic(fmt.Sprintf("signal already handled %v", s)) + } + s.handled = true + s.callback(result, err) +} + func (wc *workflowEnvironmentImpl) WorkflowInfo() *WorkflowInfo { return wc.workflowInfo } @@ -203,6 +216,22 @@ func (wc *workflowEnvironmentImpl) RequestCancelWorkflow(domainName, workflowID, return nil } +func (wc *workflowEnvironmentImpl) SignalExternalWorkflow(domainName, workflowID, runID, signalName string, + input []byte, callback resultHandler) { + + if domainName == "" { + callback(nil, errors.New("domain is empty")) + return + } + if workflowID == "" { + callback(nil, errors.New("workflow ID is empty")) + return + } + + decision := wc.decisionsHelper.signalExternalWorkflowExecution(domainName, workflowID, runID, signalName, input) + decision.setData(&scheduledSignal{callback: callback}) +} + func (wc *workflowEnvironmentImpl) RegisterCancelHandler(handler func()) { wc.cancelHandler = handler } @@ -405,7 +434,7 @@ func (wc *workflowEnvironmentImpl) SideEffect(f func() ([]byte, error), callback panic(fmt.Sprintf("No cached result found for side effectID=%v. KnownSideEffects=%v", sideEffectID, keys)) } - wc.logger.Debug("SideEffect returning already caclulated result.", + wc.logger.Debug("SideEffect returning already calculated result.", zap.Int32(tagSideEffectID, sideEffectID)) details = result } else { @@ -528,6 +557,16 @@ func (weh *workflowExecutionEventHandlerImpl) ProcessEvent( case m.EventTypeWorkflowExecutionSignaled: weh.handleWorkflowExecutionSignaled(event.WorkflowExecutionSignaledEventAttributes) + case m.EventTypeSignalExternalWorkflowExecutionInitiated: + weh.decisionsHelper.handleSignalExternalWorkflowExecutionInitiated( + event.SignalExternalWorkflowExecutionInitiatedEventAttributes.WorkflowExecution.GetWorkflowId()) + + case m.EventTypeSignalExternalWorkflowExecutionFailed: + weh.handleSignalExternalWorkflowExecutionFailed(event) + + case m.EventTypeExternalWorkflowExecutionSignalRequested: + weh.handleSignalExternalWorkflowExecutionRequested(event) + case m.EventTypeMarkerRecorded: err = weh.handleMarkerRecorded(event.GetEventId(), event.MarkerRecordedEventAttributes) @@ -818,3 +857,30 @@ func (weh *workflowExecutionEventHandlerImpl) handleChildWorkflowExecutionTermin return nil } + +func (weh *workflowExecutionEventHandlerImpl) handleSignalExternalWorkflowExecutionRequested(event *m.HistoryEvent) error { + attributes := event.ExternalWorkflowExecutionSignalRequestedEventAttributes + signalID := string(attributes.Control) + decision := weh.decisionsHelper.handleSignalExternalWorkflowExecutionRequested(signalID) + signal := decision.getData().(*scheduledSignal) + if signal.handled { + return nil + } + signal.handle(nil, nil) + + return nil +} + +func (weh *workflowExecutionEventHandlerImpl) handleSignalExternalWorkflowExecutionFailed(event *m.HistoryEvent) error { + attributes := event.SignalExternalWorkflowExecutionFailedEventAttributes + signalID := string(attributes.Control) + decision := weh.decisionsHelper.handleSignalExternalWorkflowExecutionFailed(signalID) + signal := decision.getData().(*scheduledSignal) + if signal.handled { + return nil + } + err := fmt.Errorf("signal external workflow failed, %v", attributes.GetCause()) + signal.handle(nil, err) + + return nil +} diff --git a/internal/internal_task_handlers.go b/internal/internal_task_handlers.go index b1af0bfc8..c2606aef5 100644 --- a/internal/internal_task_handlers.go +++ b/internal/internal_task_handlers.go @@ -535,7 +535,7 @@ func (wth *workflowTaskHandlerImpl) getOrCreateWorkflowContext(task *s.PollForDe return } -// ProcessWorkflowTask processes each all the events of the workflow task. +// ProcessWorkflowTask processes all the events of the workflow task. func (wth *workflowTaskHandlerImpl) ProcessWorkflowTask( task *s.PollForDecisionTaskResponse, historyIterator HistoryIterator, @@ -572,7 +572,7 @@ func (wth *workflowTaskHandlerImpl) ProcessWorkflowTask( defer func() { if err != nil || workflowClosed { // TODO: in case of error, ideally, we should notify server to clear the stickiness. - // TODO: in case of closed, it asumes the close decision always succeed. need server side change to return + // TODO: in case of closed, it assumes the close decision always succeed. need server side change to return // error to indicate the close failure case. This should be rear case. For now, always remove the cache, and // if the close decision failed, the next decision will have to rebuild the state. workflowContext.destroyCachedState() diff --git a/internal/internal_worker.go b/internal/internal_worker.go index b5c71a95c..753ce36de 100644 --- a/internal/internal_worker.go +++ b/internal/internal_worker.go @@ -691,7 +691,7 @@ func (th *hostEnvImpl) getWorkflowDefinition(wt WorkflowType) (workflowDefinitio wf, ok := th.getWorkflowFn(lookup) if !ok { supported := strings.Join(th.getRegisteredWorkflowTypes(), ", ") - return nil, fmt.Errorf("Unable to find workflow type: %v. Supported types: [%v]", lookup, supported) + return nil, fmt.Errorf("unable to find workflow type: %v. Supported types: [%v]", lookup, supported) } wd := &workflowExecutor{name: lookup, fn: wf} return newWorkflowDefinition(wd), nil @@ -888,7 +888,7 @@ func (we *workflowExecutor) Execute(ctx Context, input []byte) ([]byte, error) { decoded, err := getHostEnvironment().decodeArgs(fnType, input) if err != nil { return nil, fmt.Errorf( - "Unable to decode the workflow function input bytes with error: %v, function name: %v", + "unable to decode the workflow function input bytes with error: %v, function name: %v", err, we.name) } args = append(args, decoded...) @@ -929,7 +929,7 @@ func (ae *activityExecutor) Execute(ctx context.Context, input []byte) ([]byte, decoded, err := getHostEnvironment().decodeArgs(fnType, input) if err != nil { return nil, fmt.Errorf( - "Unable to decode the activity function input bytes with error: %v for function name: %v", + "unable to decode the activity function input bytes with error: %v for function name: %v", err, ae.name) } args = append(args, decoded...) diff --git a/internal/internal_worker_base.go b/internal/internal_worker_base.go index 02b281ef7..e468850b4 100644 --- a/internal/internal_worker_base.go +++ b/internal/internal_worker_base.go @@ -63,6 +63,7 @@ type ( GetLogger() *zap.Logger GetMetricsScope() tally.Scope RegisterSignalHandler(handler func(name string, input []byte)) + SignalExternalWorkflow(domainName, workflowID, runID, signalName string, input []byte, callback resultHandler) RegisterQueryHandler(handler func(queryType string, queryArgs []byte) ([]byte, error)) } diff --git a/internal/internal_workflow.go b/internal/internal_workflow.go index 82d861e15..6700a3f88 100644 --- a/internal/internal_workflow.go +++ b/internal/internal_workflow.go @@ -936,7 +936,7 @@ func (s *selectorImpl) Select(ctx Context) { } } -// NewWorkflowDefinition creates a WorkflowDefinition from a Workflow +// NewWorkflowDefinition creates a WorkflowDefinition from a Workflow func newWorkflowDefinition(workflow workflow) workflowDefinition { return &syncWorkflowDefinition{workflow: workflow} } diff --git a/internal/internal_workflow_client.go b/internal/internal_workflow_client.go index 66f847a2a..69d1194a6 100644 --- a/internal/internal_workflow_client.go +++ b/internal/internal_workflow_client.go @@ -139,12 +139,9 @@ func (wc *workflowClient) StartWorkflow( // SignalWorkflow signals a workflow in execution. func (wc *workflowClient) SignalWorkflow(ctx context.Context, workflowID string, runID string, signalName string, arg interface{}) error { - var input []byte - if arg != nil { - var err error - if input, err = getHostEnvironment().encodeArg(arg); err != nil { - return err - } + input, err := getEncodedArg(arg) + if err != nil { + return err } request := &s.SignalWorkflowExecutionRequest{ @@ -166,7 +163,9 @@ func (wc *workflowClient) SignalWorkflow(ctx context.Context, workflowID string, }, serviceOperationRetryPolicy, isServiceTransientError) } -// CancelWorkflow cancels a workflow in execution. +// CancelWorkflow cancels a workflow in execution. It allows workflow to properly clean up and gracefully close. +// workflowID is required, other parameters are optional. +// If runID is omit, it will terminate currently running workflow (if there is one) based on the workflowID. func (wc *workflowClient) CancelWorkflow(ctx context.Context, workflowID string, runID string) error { request := &s.RequestCancelWorkflowExecutionRequest{ Domain: common.StringPtr(wc.domain), @@ -494,3 +493,14 @@ func getRunID(runID string) *string { } return common.StringPtr(runID) } + +func getEncodedArg(arg interface{}) ([]byte, error) { + var input []byte + if arg != nil { + var err error + if input, err = getHostEnvironment().encodeArg(arg); err != nil { + return nil, err + } + } + return input, nil +} diff --git a/internal/internal_workflow_test.go b/internal/internal_workflow_test.go index 3a5c3ded8..7f026c759 100644 --- a/internal/internal_workflow_test.go +++ b/internal/internal_workflow_test.go @@ -74,6 +74,7 @@ func (s *WorkflowUnitTest) Test_WorldWorkflow() { env := s.NewTestWorkflowEnvironment() env.ExecuteWorkflow(worldWorkflow, "Hello") s.True(env.IsWorkflowCompleted()) + s.NoError(env.GetWorkflowError()) } func helloWorldActivityWorkflow(ctx Context, input string) (result string, err error) { @@ -523,3 +524,7 @@ func (s *WorkflowUnitTest) Test_SignalWorkflow() { env.GetWorkflowResult(&result) s.EqualValues(strings.Join(expected, ""), string(result)) } + +func (s *WorkflowUnitTest) Test_SignalDecision() { + // TODO Bowei +} diff --git a/internal/internal_workflow_testsuite.go b/internal/internal_workflow_testsuite.go index 8d52e257b..1ced2e948 100644 --- a/internal/internal_workflow_testsuite.go +++ b/internal/internal_workflow_testsuite.go @@ -1039,6 +1039,10 @@ func (env *testWorkflowEnvironmentImpl) RequestCancelWorkflow(domainName, workfl return nil } +func (env *testWorkflowEnvironmentImpl) SignalExternalWorkflow(domainName, workflowID, runID, signalName string, input []byte, callback resultHandler) { + // TODO Bowei +} + func (env *testWorkflowEnvironmentImpl) ExecuteChildWorkflow(options workflowOptions, callback resultHandler, startedHandler func(r WorkflowExecution, e error)) error { childEnv := env.newTestWorkflowEnvironmentForChild(&options, callback) env.logger.Sugar().Infof("ExecuteChildWorkflow: %v", options.workflowType.Name) diff --git a/internal/workflow.go b/internal/workflow.go index 2f66804b2..e138decac 100644 --- a/internal/workflow.go +++ b/internal/workflow.go @@ -483,6 +483,38 @@ func RequestCancelWorkflow(ctx Context, workflowID, runID string) error { return getWorkflowEnvironment(ctx).RequestCancelWorkflow(*options.domain, workflowID, runID) } +// SignalExternalWorkflow can be used to send signal info to an external workflow. +// Input workflowID is the workflow ID of target workflow. +// Input runID indicates the instance of a workflow. Input runID is optional (default is ""). When runID is not specified, +// then the currently running instance of that workflowID will be used. +// By default, the current workflow's domain will be used as target domain. However, you can specify a different domain +// of the target workflow using the context like: +// ctx := WithWorkflowDomain(ctx, "domain-name") +// SignalExternalWorkflow return Future with failure or empty success result. +func SignalExternalWorkflow(ctx Context, workflowID, runID, signalName string, arg interface{}) Future { + ctx1 := setWorkflowEnvOptionsIfNotExist(ctx) + options := getWorkflowEnvOptions(ctx1) + future, settable := NewFuture(ctx1) + + if options.domain == nil { + settable.Set(nil, errors.New("domain is nil")) + return future + } + + input, err := getEncodedArg(arg) + if err != nil { + settable.Set(nil, fmt.Errorf("error when encode nternal_workflow_testsuite.goargument: %v", err)) + return future + } + + resultCallback := func(result []byte, err error) { + settable.Set(result, err) + } + getWorkflowEnvironment(ctx).SignalExternalWorkflow(*options.domain, workflowID, runID, signalName, input, resultCallback) + + return future +} + // WithChildWorkflowOptions adds all workflow options to the context. func WithChildWorkflowOptions(ctx Context, cwo ChildWorkflowOptions) Context { ctx1 := setWorkflowEnvOptionsIfNotExist(ctx) diff --git a/workflow/workflow.go b/workflow/workflow.go index e0ad486bc..5bd969be8 100644 --- a/workflow/workflow.go +++ b/workflow/workflow.go @@ -169,6 +169,18 @@ func RequestCancelWorkflow(ctx Context, workflowID, runID string) error { return internal.RequestCancelWorkflow(ctx, workflowID, runID) } +// SignalExternalWorkflow can be used to send signal info to an external workflow. +// Input workflowID is the workflow ID of target workflow. +// Input runID indicates the instance of a workflow. Input runID is optional (default is ""). When runID is not specified, +// then the currently running instance of that workflowID will be used. +// By default, the current workflow's domain will be used as target domain. However, you can specify a different domain +// of the target workflow using the context like: +// ctx := WithWorkflowDomain(ctx, "domain-name") +// SignalExternalWorkflow return Future with failure or empty success result. +func SignalExternalWorkflow(ctx Context, workflowID, runID, signalName string, arg interface{}) Future { + return internal.SignalExternalWorkflow(ctx, workflowID, runID, signalName, arg) +} + // GetSignalChannel returns channel corresponding to the signal name. func GetSignalChannel(ctx Context, signalName string) Channel { return internal.GetSignalChannel(ctx, signalName)