go.uber.org/cadence@v1.2.9/internal/compatibility/thrift/enum.go (about)

     1  // Copyright (c) 2021 Uber Technologies, Inc.
     2  //
     3  // Permission is hereby granted, free of charge, to any person obtaining a copy
     4  // of this software and associated documentation files (the "Software"), to deal
     5  // in the Software without restriction, including without limitation the rights
     6  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     7  // copies of the Software, and to permit persons to whom the Software is
     8  // furnished to do so, subject to the following conditions:
     9  //
    10  // The above copyright notice and this permission notice shall be included in
    11  // all copies or substantial portions of the Software.
    12  //
    13  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    14  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    15  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    16  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    17  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    18  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    19  // THE SOFTWARE.
    20  
    21  package thrift
    22  
    23  import (
    24  	"go.uber.org/cadence/.gen/go/shared"
    25  
    26  	apiv1 "github.com/uber/cadence-idl/go/proto/api/v1"
    27  )
    28  
    29  func TaskListKind(t apiv1.TaskListKind) *shared.TaskListKind {
    30  	switch t {
    31  	case apiv1.TaskListKind_TASK_LIST_KIND_INVALID:
    32  		return nil
    33  	case apiv1.TaskListKind_TASK_LIST_KIND_NORMAL:
    34  		return shared.TaskListKindNormal.Ptr()
    35  	case apiv1.TaskListKind_TASK_LIST_KIND_STICKY:
    36  		return shared.TaskListKindSticky.Ptr()
    37  	}
    38  	panic("unexpected enum value")
    39  }
    40  
    41  func TaskListType(t apiv1.TaskListType) *shared.TaskListType {
    42  	if t == apiv1.TaskListType_TASK_LIST_TYPE_INVALID {
    43  		return nil
    44  	}
    45  	switch t {
    46  	case apiv1.TaskListType_TASK_LIST_TYPE_DECISION:
    47  		return shared.TaskListTypeDecision.Ptr()
    48  	case apiv1.TaskListType_TASK_LIST_TYPE_ACTIVITY:
    49  		return shared.TaskListTypeActivity.Ptr()
    50  	}
    51  	panic("unexpected enum value")
    52  }
    53  
    54  func EventFilterType(t apiv1.EventFilterType) *shared.HistoryEventFilterType {
    55  	if t == apiv1.EventFilterType_EVENT_FILTER_TYPE_INVALID {
    56  		return nil
    57  	}
    58  	switch t {
    59  	case apiv1.EventFilterType_EVENT_FILTER_TYPE_ALL_EVENT:
    60  		return shared.HistoryEventFilterTypeAllEvent.Ptr()
    61  	case apiv1.EventFilterType_EVENT_FILTER_TYPE_CLOSE_EVENT:
    62  		return shared.HistoryEventFilterTypeCloseEvent.Ptr()
    63  	}
    64  	panic("unexpected enum value")
    65  }
    66  
    67  func QueryRejectCondition(t apiv1.QueryRejectCondition) *shared.QueryRejectCondition {
    68  	if t == apiv1.QueryRejectCondition_QUERY_REJECT_CONDITION_INVALID {
    69  		return nil
    70  	}
    71  	switch t {
    72  	case apiv1.QueryRejectCondition_QUERY_REJECT_CONDITION_NOT_OPEN:
    73  		return shared.QueryRejectConditionNotOpen.Ptr()
    74  	case apiv1.QueryRejectCondition_QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY:
    75  		return shared.QueryRejectConditionNotCompletedCleanly.Ptr()
    76  	}
    77  	panic("unexpected enum value")
    78  }
    79  
    80  func QueryConsistencyLevel(t apiv1.QueryConsistencyLevel) *shared.QueryConsistencyLevel {
    81  	if t == apiv1.QueryConsistencyLevel_QUERY_CONSISTENCY_LEVEL_INVALID {
    82  		return nil
    83  	}
    84  	switch t {
    85  	case apiv1.QueryConsistencyLevel_QUERY_CONSISTENCY_LEVEL_EVENTUAL:
    86  		return shared.QueryConsistencyLevelEventual.Ptr()
    87  	case apiv1.QueryConsistencyLevel_QUERY_CONSISTENCY_LEVEL_STRONG:
    88  		return shared.QueryConsistencyLevelStrong.Ptr()
    89  	}
    90  	panic("unexpected enum value")
    91  }
    92  
    93  func ContinueAsNewInitiator(t apiv1.ContinueAsNewInitiator) *shared.ContinueAsNewInitiator {
    94  	switch t {
    95  	case apiv1.ContinueAsNewInitiator_CONTINUE_AS_NEW_INITIATOR_INVALID:
    96  		return nil
    97  	case apiv1.ContinueAsNewInitiator_CONTINUE_AS_NEW_INITIATOR_DECIDER:
    98  		return shared.ContinueAsNewInitiatorDecider.Ptr()
    99  	case apiv1.ContinueAsNewInitiator_CONTINUE_AS_NEW_INITIATOR_RETRY_POLICY:
   100  		return shared.ContinueAsNewInitiatorRetryPolicy.Ptr()
   101  	case apiv1.ContinueAsNewInitiator_CONTINUE_AS_NEW_INITIATOR_CRON_SCHEDULE:
   102  		return shared.ContinueAsNewInitiatorCronSchedule.Ptr()
   103  	}
   104  	panic("unexpected enum value")
   105  }
   106  
   107  func WorkflowIdReusePolicy(t apiv1.WorkflowIdReusePolicy) *shared.WorkflowIdReusePolicy {
   108  	switch t {
   109  	case apiv1.WorkflowIdReusePolicy_WORKFLOW_ID_REUSE_POLICY_INVALID:
   110  		return nil
   111  	case apiv1.WorkflowIdReusePolicy_WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY:
   112  		return shared.WorkflowIdReusePolicyAllowDuplicateFailedOnly.Ptr()
   113  	case apiv1.WorkflowIdReusePolicy_WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE:
   114  		return shared.WorkflowIdReusePolicyAllowDuplicate.Ptr()
   115  	case apiv1.WorkflowIdReusePolicy_WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE:
   116  		return shared.WorkflowIdReusePolicyRejectDuplicate.Ptr()
   117  	case apiv1.WorkflowIdReusePolicy_WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING:
   118  		return shared.WorkflowIdReusePolicyTerminateIfRunning.Ptr()
   119  	}
   120  	panic("unexpected enum value")
   121  }
   122  
   123  func QueryResultType(t apiv1.QueryResultType) *shared.QueryResultType {
   124  	if t == apiv1.QueryResultType_QUERY_RESULT_TYPE_INVALID {
   125  		return nil
   126  	}
   127  	switch t {
   128  	case apiv1.QueryResultType_QUERY_RESULT_TYPE_ANSWERED:
   129  		return shared.QueryResultTypeAnswered.Ptr()
   130  	case apiv1.QueryResultType_QUERY_RESULT_TYPE_FAILED:
   131  		return shared.QueryResultTypeFailed.Ptr()
   132  	}
   133  	panic("unexpected enum value")
   134  }
   135  
   136  func ArchivalStatus(t apiv1.ArchivalStatus) *shared.ArchivalStatus {
   137  	switch t {
   138  	case apiv1.ArchivalStatus_ARCHIVAL_STATUS_INVALID:
   139  		return nil
   140  	case apiv1.ArchivalStatus_ARCHIVAL_STATUS_DISABLED:
   141  		return shared.ArchivalStatusDisabled.Ptr()
   142  	case apiv1.ArchivalStatus_ARCHIVAL_STATUS_ENABLED:
   143  		return shared.ArchivalStatusEnabled.Ptr()
   144  	}
   145  	panic("unexpected enum value")
   146  }
   147  
   148  func ParentClosePolicy(t apiv1.ParentClosePolicy) *shared.ParentClosePolicy {
   149  	switch t {
   150  	case apiv1.ParentClosePolicy_PARENT_CLOSE_POLICY_INVALID:
   151  		return nil
   152  	case apiv1.ParentClosePolicy_PARENT_CLOSE_POLICY_ABANDON:
   153  		return shared.ParentClosePolicyAbandon.Ptr()
   154  	case apiv1.ParentClosePolicy_PARENT_CLOSE_POLICY_REQUEST_CANCEL:
   155  		return shared.ParentClosePolicyRequestCancel.Ptr()
   156  	case apiv1.ParentClosePolicy_PARENT_CLOSE_POLICY_TERMINATE:
   157  		return shared.ParentClosePolicyTerminate.Ptr()
   158  	}
   159  	panic("unexpected enum value")
   160  }
   161  
   162  func DecisionTaskFailedCause(t apiv1.DecisionTaskFailedCause) *shared.DecisionTaskFailedCause {
   163  	switch t {
   164  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_INVALID:
   165  		return nil
   166  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_UNHANDLED_DECISION:
   167  		return shared.DecisionTaskFailedCauseUnhandledDecision.Ptr()
   168  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES:
   169  		return shared.DecisionTaskFailedCauseBadScheduleActivityAttributes.Ptr()
   170  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES:
   171  		return shared.DecisionTaskFailedCauseBadRequestCancelActivityAttributes.Ptr()
   172  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_START_TIMER_ATTRIBUTES:
   173  		return shared.DecisionTaskFailedCauseBadStartTimerAttributes.Ptr()
   174  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_CANCEL_TIMER_ATTRIBUTES:
   175  		return shared.DecisionTaskFailedCauseBadCancelTimerAttributes.Ptr()
   176  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES:
   177  		return shared.DecisionTaskFailedCauseBadRecordMarkerAttributes.Ptr()
   178  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES:
   179  		return shared.DecisionTaskFailedCauseBadCompleteWorkflowExecutionAttributes.Ptr()
   180  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES:
   181  		return shared.DecisionTaskFailedCauseBadFailWorkflowExecutionAttributes.Ptr()
   182  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES:
   183  		return shared.DecisionTaskFailedCauseBadCancelWorkflowExecutionAttributes.Ptr()
   184  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES:
   185  		return shared.DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes.Ptr()
   186  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_CONTINUE_AS_NEW_ATTRIBUTES:
   187  		return shared.DecisionTaskFailedCauseBadContinueAsNewAttributes.Ptr()
   188  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_START_TIMER_DUPLICATE_ID:
   189  		return shared.DecisionTaskFailedCauseStartTimerDuplicateID.Ptr()
   190  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_RESET_STICKY_TASK_LIST:
   191  		return shared.DecisionTaskFailedCauseResetStickyTasklist.Ptr()
   192  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE:
   193  		return shared.DecisionTaskFailedCauseWorkflowWorkerUnhandledFailure.Ptr()
   194  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES:
   195  		return shared.DecisionTaskFailedCauseBadSignalWorkflowExecutionAttributes.Ptr()
   196  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_START_CHILD_EXECUTION_ATTRIBUTES:
   197  		return shared.DecisionTaskFailedCauseBadStartChildExecutionAttributes.Ptr()
   198  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_FORCE_CLOSE_DECISION:
   199  		return shared.DecisionTaskFailedCauseForceCloseDecision.Ptr()
   200  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_FAILOVER_CLOSE_DECISION:
   201  		return shared.DecisionTaskFailedCauseFailoverCloseDecision.Ptr()
   202  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_SIGNAL_INPUT_SIZE:
   203  		return shared.DecisionTaskFailedCauseBadSignalInputSize.Ptr()
   204  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_RESET_WORKFLOW:
   205  		return shared.DecisionTaskFailedCauseResetWorkflow.Ptr()
   206  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_BINARY:
   207  		return shared.DecisionTaskFailedCauseBadBinary.Ptr()
   208  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID:
   209  		return shared.DecisionTaskFailedCauseScheduleActivityDuplicateID.Ptr()
   210  	case apiv1.DecisionTaskFailedCause_DECISION_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES:
   211  		return shared.DecisionTaskFailedCauseBadSearchAttributes.Ptr()
   212  	}
   213  	panic("unexpected enum value")
   214  }
   215  
   216  func WorkflowExecutionCloseStatus(t apiv1.WorkflowExecutionCloseStatus) *shared.WorkflowExecutionCloseStatus {
   217  	switch t {
   218  	case apiv1.WorkflowExecutionCloseStatus_WORKFLOW_EXECUTION_CLOSE_STATUS_INVALID:
   219  		return nil
   220  	case apiv1.WorkflowExecutionCloseStatus_WORKFLOW_EXECUTION_CLOSE_STATUS_COMPLETED:
   221  		return shared.WorkflowExecutionCloseStatusCompleted.Ptr()
   222  	case apiv1.WorkflowExecutionCloseStatus_WORKFLOW_EXECUTION_CLOSE_STATUS_FAILED:
   223  		return shared.WorkflowExecutionCloseStatusFailed.Ptr()
   224  	case apiv1.WorkflowExecutionCloseStatus_WORKFLOW_EXECUTION_CLOSE_STATUS_CANCELED:
   225  		return shared.WorkflowExecutionCloseStatusCanceled.Ptr()
   226  	case apiv1.WorkflowExecutionCloseStatus_WORKFLOW_EXECUTION_CLOSE_STATUS_TERMINATED:
   227  		return shared.WorkflowExecutionCloseStatusTerminated.Ptr()
   228  	case apiv1.WorkflowExecutionCloseStatus_WORKFLOW_EXECUTION_CLOSE_STATUS_CONTINUED_AS_NEW:
   229  		return shared.WorkflowExecutionCloseStatusContinuedAsNew.Ptr()
   230  	case apiv1.WorkflowExecutionCloseStatus_WORKFLOW_EXECUTION_CLOSE_STATUS_TIMED_OUT:
   231  		return shared.WorkflowExecutionCloseStatusTimedOut.Ptr()
   232  	}
   233  	panic("unexpected enum value")
   234  }
   235  
   236  func QueryTaskCompletedType(t apiv1.QueryResultType) *shared.QueryTaskCompletedType {
   237  	if t == apiv1.QueryResultType_QUERY_RESULT_TYPE_INVALID {
   238  		return nil
   239  	}
   240  	switch t {
   241  	case apiv1.QueryResultType_QUERY_RESULT_TYPE_ANSWERED:
   242  		return shared.QueryTaskCompletedTypeCompleted.Ptr()
   243  	case apiv1.QueryResultType_QUERY_RESULT_TYPE_FAILED:
   244  		return shared.QueryTaskCompletedTypeFailed.Ptr()
   245  	}
   246  	panic("unexpected enum value")
   247  }
   248  
   249  func DomainStatus(t apiv1.DomainStatus) *shared.DomainStatus {
   250  	switch t {
   251  	case apiv1.DomainStatus_DOMAIN_STATUS_INVALID:
   252  		return nil
   253  	case apiv1.DomainStatus_DOMAIN_STATUS_REGISTERED:
   254  		return shared.DomainStatusRegistered.Ptr()
   255  	case apiv1.DomainStatus_DOMAIN_STATUS_DEPRECATED:
   256  		return shared.DomainStatusDeprecated.Ptr()
   257  	case apiv1.DomainStatus_DOMAIN_STATUS_DELETED:
   258  		return shared.DomainStatusDeleted.Ptr()
   259  	}
   260  	panic("unexpected enum value")
   261  }
   262  
   263  func PendingActivityState(t apiv1.PendingActivityState) *shared.PendingActivityState {
   264  	switch t {
   265  	case apiv1.PendingActivityState_PENDING_ACTIVITY_STATE_INVALID:
   266  		return nil
   267  	case apiv1.PendingActivityState_PENDING_ACTIVITY_STATE_SCHEDULED:
   268  		return shared.PendingActivityStateScheduled.Ptr()
   269  	case apiv1.PendingActivityState_PENDING_ACTIVITY_STATE_STARTED:
   270  		return shared.PendingActivityStateStarted.Ptr()
   271  	case apiv1.PendingActivityState_PENDING_ACTIVITY_STATE_CANCEL_REQUESTED:
   272  		return shared.PendingActivityStateCancelRequested.Ptr()
   273  	}
   274  	panic("unexpected enum value")
   275  }
   276  
   277  func PendingDecisionState(t apiv1.PendingDecisionState) *shared.PendingDecisionState {
   278  	switch t {
   279  	case apiv1.PendingDecisionState_PENDING_DECISION_STATE_INVALID:
   280  		return nil
   281  	case apiv1.PendingDecisionState_PENDING_DECISION_STATE_SCHEDULED:
   282  		return shared.PendingDecisionStateScheduled.Ptr()
   283  	case apiv1.PendingDecisionState_PENDING_DECISION_STATE_STARTED:
   284  		return shared.PendingDecisionStateStarted.Ptr()
   285  	}
   286  	panic("unexpected enum value")
   287  }
   288  
   289  func IndexedValueType(t apiv1.IndexedValueType) shared.IndexedValueType {
   290  	switch t {
   291  	case apiv1.IndexedValueType_INDEXED_VALUE_TYPE_INVALID:
   292  		panic("received IndexedValueType_INDEXED_VALUE_TYPE_INVALID")
   293  	case apiv1.IndexedValueType_INDEXED_VALUE_TYPE_STRING:
   294  		return shared.IndexedValueTypeString
   295  	case apiv1.IndexedValueType_INDEXED_VALUE_TYPE_KEYWORD:
   296  		return shared.IndexedValueTypeKeyword
   297  	case apiv1.IndexedValueType_INDEXED_VALUE_TYPE_INT:
   298  		return shared.IndexedValueTypeInt
   299  	case apiv1.IndexedValueType_INDEXED_VALUE_TYPE_DOUBLE:
   300  		return shared.IndexedValueTypeDouble
   301  	case apiv1.IndexedValueType_INDEXED_VALUE_TYPE_BOOL:
   302  		return shared.IndexedValueTypeBool
   303  	case apiv1.IndexedValueType_INDEXED_VALUE_TYPE_DATETIME:
   304  		return shared.IndexedValueTypeDatetime
   305  	}
   306  	panic("unexpected enum value")
   307  }
   308  
   309  func EncodingType(t apiv1.EncodingType) *shared.EncodingType {
   310  	switch t {
   311  	case apiv1.EncodingType_ENCODING_TYPE_INVALID:
   312  		return nil
   313  	case apiv1.EncodingType_ENCODING_TYPE_THRIFTRW:
   314  		return shared.EncodingTypeThriftRW.Ptr()
   315  	case apiv1.EncodingType_ENCODING_TYPE_JSON:
   316  		return shared.EncodingTypeJSON.Ptr()
   317  	case apiv1.EncodingType_ENCODING_TYPE_PROTO3:
   318  		panic("not supported yet")
   319  	}
   320  	panic("unexpected enum value")
   321  }
   322  
   323  func TimeoutType(t apiv1.TimeoutType) *shared.TimeoutType {
   324  	switch t {
   325  	case apiv1.TimeoutType_TIMEOUT_TYPE_INVALID:
   326  		return nil
   327  	case apiv1.TimeoutType_TIMEOUT_TYPE_START_TO_CLOSE:
   328  		return shared.TimeoutTypeStartToClose.Ptr()
   329  	case apiv1.TimeoutType_TIMEOUT_TYPE_SCHEDULE_TO_START:
   330  		return shared.TimeoutTypeScheduleToStart.Ptr()
   331  	case apiv1.TimeoutType_TIMEOUT_TYPE_SCHEDULE_TO_CLOSE:
   332  		return shared.TimeoutTypeScheduleToClose.Ptr()
   333  	case apiv1.TimeoutType_TIMEOUT_TYPE_HEARTBEAT:
   334  		return shared.TimeoutTypeHeartbeat.Ptr()
   335  	}
   336  	panic("unexpected enum value")
   337  }
   338  
   339  func DecisionTaskTimedOutCause(t apiv1.DecisionTaskTimedOutCause) *shared.DecisionTaskTimedOutCause {
   340  	switch t {
   341  	case apiv1.DecisionTaskTimedOutCause_DECISION_TASK_TIMED_OUT_CAUSE_INVALID:
   342  		return nil
   343  	case apiv1.DecisionTaskTimedOutCause_DECISION_TASK_TIMED_OUT_CAUSE_TIMEOUT:
   344  		return shared.DecisionTaskTimedOutCauseTimeout.Ptr()
   345  	case apiv1.DecisionTaskTimedOutCause_DECISION_TASK_TIMED_OUT_CAUSE_RESET:
   346  		return shared.DecisionTaskTimedOutCauseReset.Ptr()
   347  	}
   348  	panic("unexpected enum value")
   349  }
   350  
   351  func CancelExternalWorkflowExecutionFailedCause(t apiv1.CancelExternalWorkflowExecutionFailedCause) *shared.CancelExternalWorkflowExecutionFailedCause {
   352  	switch t {
   353  	case apiv1.CancelExternalWorkflowExecutionFailedCause_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_INVALID:
   354  		return nil
   355  	case apiv1.CancelExternalWorkflowExecutionFailedCause_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION:
   356  		return shared.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr()
   357  	}
   358  	panic("unexpected enum value")
   359  }
   360  
   361  func SignalExternalWorkflowExecutionFailedCause(t apiv1.SignalExternalWorkflowExecutionFailedCause) *shared.SignalExternalWorkflowExecutionFailedCause {
   362  	switch t {
   363  	case apiv1.SignalExternalWorkflowExecutionFailedCause_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_INVALID:
   364  		return nil
   365  	case apiv1.SignalExternalWorkflowExecutionFailedCause_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION:
   366  		return shared.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr()
   367  	}
   368  	panic("unexpected enum value")
   369  }
   370  
   371  func ChildWorkflowExecutionFailedCause(t apiv1.ChildWorkflowExecutionFailedCause) *shared.ChildWorkflowExecutionFailedCause {
   372  	switch t {
   373  	case apiv1.ChildWorkflowExecutionFailedCause_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_INVALID:
   374  		return nil
   375  	case apiv1.ChildWorkflowExecutionFailedCause_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_RUNNING:
   376  		return shared.ChildWorkflowExecutionFailedCauseWorkflowAlreadyRunning.Ptr()
   377  	}
   378  	panic("unexpected enum value")
   379  }