go.uber.org/cadence@v1.2.9/internal/compatibility/testdata/history.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 all
    11  // 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 THE
    19  // SOFTWARE.
    20  
    21  package testdata
    22  
    23  import (
    24  	apiv1 "github.com/uber/cadence-idl/go/proto/api/v1"
    25  )
    26  
    27  var (
    28  	History = apiv1.History{
    29  		Events: HistoryEventArray,
    30  	}
    31  	HistoryEventArray = []*apiv1.HistoryEvent{
    32  		&HistoryEvent_WorkflowExecutionStarted,
    33  		&HistoryEvent_WorkflowExecutionStarted,
    34  		&HistoryEvent_WorkflowExecutionCompleted,
    35  		&HistoryEvent_WorkflowExecutionFailed,
    36  		&HistoryEvent_WorkflowExecutionTimedOut,
    37  		&HistoryEvent_DecisionTaskScheduled,
    38  		&HistoryEvent_DecisionTaskStarted,
    39  		&HistoryEvent_DecisionTaskCompleted,
    40  		&HistoryEvent_DecisionTaskTimedOut,
    41  		&HistoryEvent_DecisionTaskFailed,
    42  		&HistoryEvent_ActivityTaskScheduled,
    43  		&HistoryEvent_ActivityTaskStarted,
    44  		&HistoryEvent_ActivityTaskCompleted,
    45  		&HistoryEvent_ActivityTaskFailed,
    46  		&HistoryEvent_ActivityTaskTimedOut,
    47  		&HistoryEvent_ActivityTaskCancelRequested,
    48  		&HistoryEvent_RequestCancelActivityTaskFailed,
    49  		&HistoryEvent_ActivityTaskCanceled,
    50  		&HistoryEvent_TimerStarted,
    51  		&HistoryEvent_TimerFired,
    52  		&HistoryEvent_CancelTimerFailed,
    53  		&HistoryEvent_TimerCanceled,
    54  		&HistoryEvent_WorkflowExecutionCancelRequested,
    55  		&HistoryEvent_WorkflowExecutionCanceled,
    56  		&HistoryEvent_RequestCancelExternalWorkflowExecutionInitiated,
    57  		&HistoryEvent_RequestCancelExternalWorkflowExecutionFailed,
    58  		&HistoryEvent_ExternalWorkflowExecutionCancelRequested,
    59  		&HistoryEvent_MarkerRecorded,
    60  		&HistoryEvent_WorkflowExecutionSignaled,
    61  		&HistoryEvent_WorkflowExecutionTerminated,
    62  		&HistoryEvent_WorkflowExecutionContinuedAsNew,
    63  		&HistoryEvent_StartChildWorkflowExecutionInitiated,
    64  		&HistoryEvent_StartChildWorkflowExecutionFailed,
    65  		&HistoryEvent_ChildWorkflowExecutionStarted,
    66  		&HistoryEvent_ChildWorkflowExecutionCompleted,
    67  		&HistoryEvent_ChildWorkflowExecutionFailed,
    68  		&HistoryEvent_ChildWorkflowExecutionCanceled,
    69  		&HistoryEvent_ChildWorkflowExecutionTimedOut,
    70  		&HistoryEvent_ChildWorkflowExecutionTerminated,
    71  		&HistoryEvent_SignalExternalWorkflowExecutionInitiated,
    72  		&HistoryEvent_SignalExternalWorkflowExecutionFailed,
    73  		&HistoryEvent_ExternalWorkflowExecutionSignaled,
    74  		&HistoryEvent_UpsertWorkflowSearchAttributes,
    75  	}
    76  
    77  	HistoryEvent_WorkflowExecutionStarted = generateEvent(func(e *apiv1.HistoryEvent) {
    78  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionStartedEventAttributes{WorkflowExecutionStartedEventAttributes: &WorkflowExecutionStartedEventAttributes}
    79  	})
    80  	HistoryEvent_WorkflowExecutionCompleted = generateEvent(func(e *apiv1.HistoryEvent) {
    81  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionCompletedEventAttributes{WorkflowExecutionCompletedEventAttributes: &WorkflowExecutionCompletedEventAttributes}
    82  	})
    83  	HistoryEvent_WorkflowExecutionFailed = generateEvent(func(e *apiv1.HistoryEvent) {
    84  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionFailedEventAttributes{WorkflowExecutionFailedEventAttributes: &WorkflowExecutionFailedEventAttributes}
    85  	})
    86  	HistoryEvent_WorkflowExecutionTimedOut = generateEvent(func(e *apiv1.HistoryEvent) {
    87  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionTimedOutEventAttributes{WorkflowExecutionTimedOutEventAttributes: &WorkflowExecutionTimedOutEventAttributes}
    88  	})
    89  	HistoryEvent_DecisionTaskScheduled = generateEvent(func(e *apiv1.HistoryEvent) {
    90  		e.Attributes = &apiv1.HistoryEvent_DecisionTaskScheduledEventAttributes{DecisionTaskScheduledEventAttributes: &DecisionTaskScheduledEventAttributes}
    91  	})
    92  	HistoryEvent_DecisionTaskStarted = generateEvent(func(e *apiv1.HistoryEvent) {
    93  		e.Attributes = &apiv1.HistoryEvent_DecisionTaskStartedEventAttributes{DecisionTaskStartedEventAttributes: &DecisionTaskStartedEventAttributes}
    94  	})
    95  	HistoryEvent_DecisionTaskCompleted = generateEvent(func(e *apiv1.HistoryEvent) {
    96  		e.Attributes = &apiv1.HistoryEvent_DecisionTaskCompletedEventAttributes{DecisionTaskCompletedEventAttributes: &DecisionTaskCompletedEventAttributes}
    97  	})
    98  	HistoryEvent_DecisionTaskTimedOut = generateEvent(func(e *apiv1.HistoryEvent) {
    99  		e.Attributes = &apiv1.HistoryEvent_DecisionTaskTimedOutEventAttributes{DecisionTaskTimedOutEventAttributes: &DecisionTaskTimedOutEventAttributes}
   100  	})
   101  	HistoryEvent_DecisionTaskFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   102  		e.Attributes = &apiv1.HistoryEvent_DecisionTaskFailedEventAttributes{DecisionTaskFailedEventAttributes: &DecisionTaskFailedEventAttributes}
   103  	})
   104  	HistoryEvent_ActivityTaskScheduled = generateEvent(func(e *apiv1.HistoryEvent) {
   105  		e.Attributes = &apiv1.HistoryEvent_ActivityTaskScheduledEventAttributes{ActivityTaskScheduledEventAttributes: &ActivityTaskScheduledEventAttributes}
   106  	})
   107  	HistoryEvent_ActivityTaskStarted = generateEvent(func(e *apiv1.HistoryEvent) {
   108  		e.Attributes = &apiv1.HistoryEvent_ActivityTaskStartedEventAttributes{ActivityTaskStartedEventAttributes: &ActivityTaskStartedEventAttributes}
   109  	})
   110  	HistoryEvent_ActivityTaskCompleted = generateEvent(func(e *apiv1.HistoryEvent) {
   111  		e.Attributes = &apiv1.HistoryEvent_ActivityTaskCompletedEventAttributes{ActivityTaskCompletedEventAttributes: &ActivityTaskCompletedEventAttributes}
   112  	})
   113  	HistoryEvent_ActivityTaskFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   114  		e.Attributes = &apiv1.HistoryEvent_ActivityTaskFailedEventAttributes{ActivityTaskFailedEventAttributes: &ActivityTaskFailedEventAttributes}
   115  	})
   116  	HistoryEvent_ActivityTaskTimedOut = generateEvent(func(e *apiv1.HistoryEvent) {
   117  		e.Attributes = &apiv1.HistoryEvent_ActivityTaskTimedOutEventAttributes{ActivityTaskTimedOutEventAttributes: &ActivityTaskTimedOutEventAttributes}
   118  	})
   119  	HistoryEvent_ActivityTaskCancelRequested = generateEvent(func(e *apiv1.HistoryEvent) {
   120  		e.Attributes = &apiv1.HistoryEvent_ActivityTaskCancelRequestedEventAttributes{ActivityTaskCancelRequestedEventAttributes: &ActivityTaskCancelRequestedEventAttributes}
   121  	})
   122  	HistoryEvent_RequestCancelActivityTaskFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   123  		e.Attributes = &apiv1.HistoryEvent_RequestCancelActivityTaskFailedEventAttributes{RequestCancelActivityTaskFailedEventAttributes: &RequestCancelActivityTaskFailedEventAttributes}
   124  	})
   125  	HistoryEvent_ActivityTaskCanceled = generateEvent(func(e *apiv1.HistoryEvent) {
   126  		e.Attributes = &apiv1.HistoryEvent_ActivityTaskCanceledEventAttributes{ActivityTaskCanceledEventAttributes: &ActivityTaskCanceledEventAttributes}
   127  	})
   128  	HistoryEvent_TimerStarted = generateEvent(func(e *apiv1.HistoryEvent) {
   129  		e.Attributes = &apiv1.HistoryEvent_TimerStartedEventAttributes{TimerStartedEventAttributes: &TimerStartedEventAttributes}
   130  	})
   131  	HistoryEvent_TimerFired = generateEvent(func(e *apiv1.HistoryEvent) {
   132  		e.Attributes = &apiv1.HistoryEvent_TimerFiredEventAttributes{TimerFiredEventAttributes: &TimerFiredEventAttributes}
   133  	})
   134  	HistoryEvent_CancelTimerFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   135  		e.Attributes = &apiv1.HistoryEvent_CancelTimerFailedEventAttributes{CancelTimerFailedEventAttributes: &CancelTimerFailedEventAttributes}
   136  	})
   137  	HistoryEvent_TimerCanceled = generateEvent(func(e *apiv1.HistoryEvent) {
   138  		e.Attributes = &apiv1.HistoryEvent_TimerCanceledEventAttributes{TimerCanceledEventAttributes: &TimerCanceledEventAttributes}
   139  	})
   140  	HistoryEvent_WorkflowExecutionCancelRequested = generateEvent(func(e *apiv1.HistoryEvent) {
   141  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionCancelRequestedEventAttributes{WorkflowExecutionCancelRequestedEventAttributes: &WorkflowExecutionCancelRequestedEventAttributes}
   142  	})
   143  	HistoryEvent_WorkflowExecutionCanceled = generateEvent(func(e *apiv1.HistoryEvent) {
   144  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionCanceledEventAttributes{WorkflowExecutionCanceledEventAttributes: &WorkflowExecutionCanceledEventAttributes}
   145  	})
   146  	HistoryEvent_RequestCancelExternalWorkflowExecutionInitiated = generateEvent(func(e *apiv1.HistoryEvent) {
   147  		e.Attributes = &apiv1.HistoryEvent_RequestCancelExternalWorkflowExecutionInitiatedEventAttributes{RequestCancelExternalWorkflowExecutionInitiatedEventAttributes: &RequestCancelExternalWorkflowExecutionInitiatedEventAttributes}
   148  	})
   149  	HistoryEvent_RequestCancelExternalWorkflowExecutionFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   150  		e.Attributes = &apiv1.HistoryEvent_RequestCancelExternalWorkflowExecutionFailedEventAttributes{RequestCancelExternalWorkflowExecutionFailedEventAttributes: &RequestCancelExternalWorkflowExecutionFailedEventAttributes}
   151  	})
   152  	HistoryEvent_ExternalWorkflowExecutionCancelRequested = generateEvent(func(e *apiv1.HistoryEvent) {
   153  		e.Attributes = &apiv1.HistoryEvent_ExternalWorkflowExecutionCancelRequestedEventAttributes{ExternalWorkflowExecutionCancelRequestedEventAttributes: &ExternalWorkflowExecutionCancelRequestedEventAttributes}
   154  	})
   155  	HistoryEvent_MarkerRecorded = generateEvent(func(e *apiv1.HistoryEvent) {
   156  		e.Attributes = &apiv1.HistoryEvent_MarkerRecordedEventAttributes{MarkerRecordedEventAttributes: &MarkerRecordedEventAttributes}
   157  	})
   158  	HistoryEvent_WorkflowExecutionSignaled = generateEvent(func(e *apiv1.HistoryEvent) {
   159  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionSignaledEventAttributes{WorkflowExecutionSignaledEventAttributes: &WorkflowExecutionSignaledEventAttributes}
   160  	})
   161  	HistoryEvent_WorkflowExecutionTerminated = generateEvent(func(e *apiv1.HistoryEvent) {
   162  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionTerminatedEventAttributes{WorkflowExecutionTerminatedEventAttributes: &WorkflowExecutionTerminatedEventAttributes}
   163  	})
   164  	HistoryEvent_WorkflowExecutionContinuedAsNew = generateEvent(func(e *apiv1.HistoryEvent) {
   165  		e.Attributes = &apiv1.HistoryEvent_WorkflowExecutionContinuedAsNewEventAttributes{WorkflowExecutionContinuedAsNewEventAttributes: &WorkflowExecutionContinuedAsNewEventAttributes}
   166  	})
   167  	HistoryEvent_StartChildWorkflowExecutionInitiated = generateEvent(func(e *apiv1.HistoryEvent) {
   168  		e.Attributes = &apiv1.HistoryEvent_StartChildWorkflowExecutionInitiatedEventAttributes{StartChildWorkflowExecutionInitiatedEventAttributes: &StartChildWorkflowExecutionInitiatedEventAttributes}
   169  	})
   170  	HistoryEvent_StartChildWorkflowExecutionFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   171  		e.Attributes = &apiv1.HistoryEvent_StartChildWorkflowExecutionFailedEventAttributes{StartChildWorkflowExecutionFailedEventAttributes: &StartChildWorkflowExecutionFailedEventAttributes}
   172  	})
   173  	HistoryEvent_ChildWorkflowExecutionStarted = generateEvent(func(e *apiv1.HistoryEvent) {
   174  		e.Attributes = &apiv1.HistoryEvent_ChildWorkflowExecutionStartedEventAttributes{ChildWorkflowExecutionStartedEventAttributes: &ChildWorkflowExecutionStartedEventAttributes}
   175  	})
   176  	HistoryEvent_ChildWorkflowExecutionCompleted = generateEvent(func(e *apiv1.HistoryEvent) {
   177  		e.Attributes = &apiv1.HistoryEvent_ChildWorkflowExecutionCompletedEventAttributes{ChildWorkflowExecutionCompletedEventAttributes: &ChildWorkflowExecutionCompletedEventAttributes}
   178  	})
   179  	HistoryEvent_ChildWorkflowExecutionFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   180  		e.Attributes = &apiv1.HistoryEvent_ChildWorkflowExecutionFailedEventAttributes{ChildWorkflowExecutionFailedEventAttributes: &ChildWorkflowExecutionFailedEventAttributes}
   181  	})
   182  	HistoryEvent_ChildWorkflowExecutionCanceled = generateEvent(func(e *apiv1.HistoryEvent) {
   183  		e.Attributes = &apiv1.HistoryEvent_ChildWorkflowExecutionCanceledEventAttributes{ChildWorkflowExecutionCanceledEventAttributes: &ChildWorkflowExecutionCanceledEventAttributes}
   184  	})
   185  	HistoryEvent_ChildWorkflowExecutionTimedOut = generateEvent(func(e *apiv1.HistoryEvent) {
   186  		e.Attributes = &apiv1.HistoryEvent_ChildWorkflowExecutionTimedOutEventAttributes{ChildWorkflowExecutionTimedOutEventAttributes: &ChildWorkflowExecutionTimedOutEventAttributes}
   187  	})
   188  	HistoryEvent_ChildWorkflowExecutionTerminated = generateEvent(func(e *apiv1.HistoryEvent) {
   189  		e.Attributes = &apiv1.HistoryEvent_ChildWorkflowExecutionTerminatedEventAttributes{ChildWorkflowExecutionTerminatedEventAttributes: &ChildWorkflowExecutionTerminatedEventAttributes}
   190  	})
   191  	HistoryEvent_SignalExternalWorkflowExecutionInitiated = generateEvent(func(e *apiv1.HistoryEvent) {
   192  		e.Attributes = &apiv1.HistoryEvent_SignalExternalWorkflowExecutionInitiatedEventAttributes{SignalExternalWorkflowExecutionInitiatedEventAttributes: &SignalExternalWorkflowExecutionInitiatedEventAttributes}
   193  	})
   194  	HistoryEvent_SignalExternalWorkflowExecutionFailed = generateEvent(func(e *apiv1.HistoryEvent) {
   195  		e.Attributes = &apiv1.HistoryEvent_SignalExternalWorkflowExecutionFailedEventAttributes{SignalExternalWorkflowExecutionFailedEventAttributes: &SignalExternalWorkflowExecutionFailedEventAttributes}
   196  	})
   197  	HistoryEvent_ExternalWorkflowExecutionSignaled = generateEvent(func(e *apiv1.HistoryEvent) {
   198  		e.Attributes = &apiv1.HistoryEvent_ExternalWorkflowExecutionSignaledEventAttributes{ExternalWorkflowExecutionSignaledEventAttributes: &ExternalWorkflowExecutionSignaledEventAttributes}
   199  	})
   200  	HistoryEvent_UpsertWorkflowSearchAttributes = generateEvent(func(e *apiv1.HistoryEvent) {
   201  		e.Attributes = &apiv1.HistoryEvent_UpsertWorkflowSearchAttributesEventAttributes{UpsertWorkflowSearchAttributesEventAttributes: &UpsertWorkflowSearchAttributesEventAttributes}
   202  	})
   203  
   204  	WorkflowExecutionStartedEventAttributes = apiv1.WorkflowExecutionStartedEventAttributes{
   205  		WorkflowType: &WorkflowType,
   206  		ParentExecutionInfo: &apiv1.ParentExecutionInfo{
   207  			DomainName:        DomainName,
   208  			WorkflowExecution: &WorkflowExecution,
   209  			InitiatedId:       EventID1,
   210  		},
   211  		TaskList:                     &TaskList,
   212  		Input:                        &Payload1,
   213  		ExecutionStartToCloseTimeout: Duration1,
   214  		TaskStartToCloseTimeout:      Duration2,
   215  		ContinuedExecutionRunId:      RunID1,
   216  		Initiator:                    ContinueAsNewInitiator,
   217  		ContinuedFailure:             &Failure,
   218  		LastCompletionResult:         &Payload2,
   219  		OriginalExecutionRunId:       RunID2,
   220  		Identity:                     Identity,
   221  		FirstExecutionRunId:          RunID3,
   222  		RetryPolicy:                  &RetryPolicy,
   223  		Attempt:                      Attempt,
   224  		ExpirationTime:               Timestamp1,
   225  		CronSchedule:                 CronSchedule,
   226  		FirstDecisionTaskBackoff:     Duration3,
   227  		Memo:                         &Memo,
   228  		SearchAttributes:             &SearchAttributes,
   229  		PrevAutoResetPoints:          &ResetPoints,
   230  		Header:                       &Header,
   231  	}
   232  	WorkflowExecutionCompletedEventAttributes = apiv1.WorkflowExecutionCompletedEventAttributes{
   233  		Result:                       &Payload1,
   234  		DecisionTaskCompletedEventId: EventID1,
   235  	}
   236  	WorkflowExecutionFailedEventAttributes = apiv1.WorkflowExecutionFailedEventAttributes{
   237  		Failure:                      &Failure,
   238  		DecisionTaskCompletedEventId: EventID1,
   239  	}
   240  	WorkflowExecutionTimedOutEventAttributes = apiv1.WorkflowExecutionTimedOutEventAttributes{
   241  		TimeoutType: TimeoutType,
   242  	}
   243  	DecisionTaskScheduledEventAttributes = apiv1.DecisionTaskScheduledEventAttributes{
   244  		TaskList:            &TaskList,
   245  		StartToCloseTimeout: Duration1,
   246  		Attempt:             Attempt,
   247  	}
   248  	DecisionTaskStartedEventAttributes = apiv1.DecisionTaskStartedEventAttributes{
   249  		ScheduledEventId: EventID1,
   250  		Identity:         Identity,
   251  		RequestId:        RequestID,
   252  	}
   253  	DecisionTaskCompletedEventAttributes = apiv1.DecisionTaskCompletedEventAttributes{
   254  		ExecutionContext: ExecutionContext,
   255  		ScheduledEventId: EventID1,
   256  		StartedEventId:   EventID2,
   257  		Identity:         Identity,
   258  		BinaryChecksum:   Checksum,
   259  	}
   260  	DecisionTaskTimedOutEventAttributes = apiv1.DecisionTaskTimedOutEventAttributes{
   261  		ScheduledEventId: EventID1,
   262  		StartedEventId:   EventID2,
   263  		TimeoutType:      TimeoutType,
   264  		BaseRunId:        RunID1,
   265  		NewRunId:         RunID2,
   266  		ForkEventVersion: Version1,
   267  		Reason:           Reason,
   268  		Cause:            DecisionTaskTimedOutCause,
   269  	}
   270  	DecisionTaskFailedEventAttributes = apiv1.DecisionTaskFailedEventAttributes{
   271  		ScheduledEventId: EventID1,
   272  		StartedEventId:   EventID2,
   273  		Cause:            DecisionTaskFailedCause,
   274  		Failure:          &Failure,
   275  		Identity:         Identity,
   276  		BaseRunId:        RunID1,
   277  		NewRunId:         RunID2,
   278  		ForkEventVersion: Version1,
   279  		BinaryChecksum:   Checksum,
   280  	}
   281  	ActivityTaskScheduledEventAttributes = apiv1.ActivityTaskScheduledEventAttributes{
   282  		ActivityId:                   ActivityID,
   283  		ActivityType:                 &ActivityType,
   284  		Domain:                       DomainName,
   285  		TaskList:                     &TaskList,
   286  		Input:                        &Payload1,
   287  		ScheduleToCloseTimeout:       Duration1,
   288  		ScheduleToStartTimeout:       Duration2,
   289  		StartToCloseTimeout:          Duration3,
   290  		HeartbeatTimeout:             Duration4,
   291  		DecisionTaskCompletedEventId: EventID1,
   292  		RetryPolicy:                  &RetryPolicy,
   293  		Header:                       &Header,
   294  	}
   295  	ActivityTaskStartedEventAttributes = apiv1.ActivityTaskStartedEventAttributes{
   296  		ScheduledEventId: EventID1,
   297  		Identity:         Identity,
   298  		RequestId:        RequestID,
   299  		Attempt:          Attempt,
   300  		LastFailure:      &Failure,
   301  	}
   302  	ActivityTaskCompletedEventAttributes = apiv1.ActivityTaskCompletedEventAttributes{
   303  		Result:           &Payload1,
   304  		ScheduledEventId: EventID1,
   305  		StartedEventId:   EventID2,
   306  		Identity:         Identity,
   307  	}
   308  	ActivityTaskFailedEventAttributes = apiv1.ActivityTaskFailedEventAttributes{
   309  		Failure:          &Failure,
   310  		ScheduledEventId: EventID1,
   311  		StartedEventId:   EventID2,
   312  		Identity:         Identity,
   313  	}
   314  	ActivityTaskTimedOutEventAttributes = apiv1.ActivityTaskTimedOutEventAttributes{
   315  		Details:          &Payload1,
   316  		ScheduledEventId: EventID1,
   317  		StartedEventId:   EventID2,
   318  		TimeoutType:      TimeoutType,
   319  		LastFailure:      &Failure,
   320  	}
   321  	TimerStartedEventAttributes = apiv1.TimerStartedEventAttributes{
   322  		TimerId:                      TimerID,
   323  		StartToFireTimeout:           Duration1,
   324  		DecisionTaskCompletedEventId: EventID1,
   325  	}
   326  	TimerFiredEventAttributes = apiv1.TimerFiredEventAttributes{
   327  		TimerId:        TimerID,
   328  		StartedEventId: EventID1,
   329  	}
   330  	ActivityTaskCancelRequestedEventAttributes = apiv1.ActivityTaskCancelRequestedEventAttributes{
   331  		ActivityId:                   ActivityID,
   332  		DecisionTaskCompletedEventId: EventID1,
   333  	}
   334  	RequestCancelActivityTaskFailedEventAttributes = apiv1.RequestCancelActivityTaskFailedEventAttributes{
   335  		ActivityId:                   ActivityID,
   336  		Cause:                        Cause,
   337  		DecisionTaskCompletedEventId: EventID1,
   338  	}
   339  	ActivityTaskCanceledEventAttributes = apiv1.ActivityTaskCanceledEventAttributes{
   340  		Details:                      &Payload1,
   341  		LatestCancelRequestedEventId: EventID1,
   342  		ScheduledEventId:             EventID2,
   343  		StartedEventId:               EventID3,
   344  		Identity:                     Identity,
   345  	}
   346  	TimerCanceledEventAttributes = apiv1.TimerCanceledEventAttributes{
   347  		TimerId:                      TimerID,
   348  		StartedEventId:               EventID1,
   349  		DecisionTaskCompletedEventId: EventID2,
   350  		Identity:                     Identity,
   351  	}
   352  	CancelTimerFailedEventAttributes = apiv1.CancelTimerFailedEventAttributes{
   353  		TimerId:                      TimerID,
   354  		Cause:                        Cause,
   355  		DecisionTaskCompletedEventId: EventID1,
   356  		Identity:                     Identity,
   357  	}
   358  	MarkerRecordedEventAttributes = apiv1.MarkerRecordedEventAttributes{
   359  		MarkerName:                   MarkerName,
   360  		Details:                      &Payload1,
   361  		DecisionTaskCompletedEventId: EventID1,
   362  		Header:                       &Header,
   363  	}
   364  	WorkflowExecutionSignaledEventAttributes = apiv1.WorkflowExecutionSignaledEventAttributes{
   365  		SignalName: SignalName,
   366  		Input:      &Payload1,
   367  		Identity:   Identity,
   368  	}
   369  	WorkflowExecutionTerminatedEventAttributes = apiv1.WorkflowExecutionTerminatedEventAttributes{
   370  		Reason:   Reason,
   371  		Details:  &Payload1,
   372  		Identity: Identity,
   373  	}
   374  	WorkflowExecutionCancelRequestedEventAttributes = apiv1.WorkflowExecutionCancelRequestedEventAttributes{
   375  		Cause: Cause,
   376  		ExternalExecutionInfo: &apiv1.ExternalExecutionInfo{
   377  			WorkflowExecution: &WorkflowExecution,
   378  			InitiatedId:       EventID1,
   379  		},
   380  		Identity: Identity,
   381  	}
   382  	WorkflowExecutionCanceledEventAttributes = apiv1.WorkflowExecutionCanceledEventAttributes{
   383  		DecisionTaskCompletedEventId: EventID1,
   384  		Details:                      &Payload1,
   385  	}
   386  	RequestCancelExternalWorkflowExecutionInitiatedEventAttributes = apiv1.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes{
   387  		DecisionTaskCompletedEventId: EventID1,
   388  		Domain:                       DomainName,
   389  		WorkflowExecution:            &WorkflowExecution,
   390  		Control:                      Control,
   391  		ChildWorkflowOnly:            true,
   392  	}
   393  	RequestCancelExternalWorkflowExecutionFailedEventAttributes = apiv1.RequestCancelExternalWorkflowExecutionFailedEventAttributes{
   394  		Cause:                        CancelExternalWorkflowExecutionFailedCause,
   395  		DecisionTaskCompletedEventId: EventID1,
   396  		Domain:                       DomainName,
   397  		WorkflowExecution:            &WorkflowExecution,
   398  		InitiatedEventId:             EventID2,
   399  		Control:                      Control,
   400  	}
   401  	ExternalWorkflowExecutionCancelRequestedEventAttributes = apiv1.ExternalWorkflowExecutionCancelRequestedEventAttributes{
   402  		InitiatedEventId:  EventID1,
   403  		Domain:            DomainName,
   404  		WorkflowExecution: &WorkflowExecution,
   405  	}
   406  	WorkflowExecutionContinuedAsNewEventAttributes = apiv1.WorkflowExecutionContinuedAsNewEventAttributes{
   407  		NewExecutionRunId:            RunID1,
   408  		WorkflowType:                 &WorkflowType,
   409  		TaskList:                     &TaskList,
   410  		Input:                        &Payload1,
   411  		ExecutionStartToCloseTimeout: Duration1,
   412  		TaskStartToCloseTimeout:      Duration2,
   413  		DecisionTaskCompletedEventId: EventID1,
   414  		BackoffStartInterval:         Duration3,
   415  		Initiator:                    ContinueAsNewInitiator,
   416  		Failure:                      &Failure,
   417  		LastCompletionResult:         &Payload2,
   418  		Header:                       &Header,
   419  		Memo:                         &Memo,
   420  		SearchAttributes:             &SearchAttributes,
   421  	}
   422  	StartChildWorkflowExecutionInitiatedEventAttributes = apiv1.StartChildWorkflowExecutionInitiatedEventAttributes{
   423  		Domain:                       DomainName,
   424  		WorkflowId:                   WorkflowID,
   425  		WorkflowType:                 &WorkflowType,
   426  		TaskList:                     &TaskList,
   427  		Input:                        &Payload1,
   428  		ExecutionStartToCloseTimeout: Duration1,
   429  		TaskStartToCloseTimeout:      Duration2,
   430  		ParentClosePolicy:            ParentClosePolicy,
   431  		Control:                      Control,
   432  		DecisionTaskCompletedEventId: EventID1,
   433  		WorkflowIdReusePolicy:        WorkflowIDReusePolicy,
   434  		RetryPolicy:                  &RetryPolicy,
   435  		CronSchedule:                 CronSchedule,
   436  		Header:                       &Header,
   437  		Memo:                         &Memo,
   438  		SearchAttributes:             &SearchAttributes,
   439  	}
   440  	StartChildWorkflowExecutionFailedEventAttributes = apiv1.StartChildWorkflowExecutionFailedEventAttributes{
   441  		Domain:                       DomainName,
   442  		WorkflowId:                   WorkflowID,
   443  		WorkflowType:                 &WorkflowType,
   444  		Cause:                        ChildWorkflowExecutionFailedCause,
   445  		Control:                      Control,
   446  		InitiatedEventId:             EventID1,
   447  		DecisionTaskCompletedEventId: EventID2,
   448  	}
   449  	ChildWorkflowExecutionStartedEventAttributes = apiv1.ChildWorkflowExecutionStartedEventAttributes{
   450  		Domain:            DomainName,
   451  		InitiatedEventId:  EventID1,
   452  		WorkflowExecution: &WorkflowExecution,
   453  		WorkflowType:      &WorkflowType,
   454  		Header:            &Header,
   455  	}
   456  	ChildWorkflowExecutionCompletedEventAttributes = apiv1.ChildWorkflowExecutionCompletedEventAttributes{
   457  		Result:            &Payload1,
   458  		Domain:            DomainName,
   459  		WorkflowExecution: &WorkflowExecution,
   460  		WorkflowType:      &WorkflowType,
   461  		InitiatedEventId:  EventID1,
   462  		StartedEventId:    EventID2,
   463  	}
   464  	ChildWorkflowExecutionFailedEventAttributes = apiv1.ChildWorkflowExecutionFailedEventAttributes{
   465  		Failure:           &Failure,
   466  		Domain:            DomainName,
   467  		WorkflowExecution: &WorkflowExecution,
   468  		WorkflowType:      &WorkflowType,
   469  		InitiatedEventId:  EventID1,
   470  		StartedEventId:    EventID2,
   471  	}
   472  	ChildWorkflowExecutionCanceledEventAttributes = apiv1.ChildWorkflowExecutionCanceledEventAttributes{
   473  		Details:           &Payload1,
   474  		Domain:            DomainName,
   475  		WorkflowExecution: &WorkflowExecution,
   476  		WorkflowType:      &WorkflowType,
   477  		InitiatedEventId:  EventID1,
   478  		StartedEventId:    EventID2,
   479  	}
   480  	ChildWorkflowExecutionTimedOutEventAttributes = apiv1.ChildWorkflowExecutionTimedOutEventAttributes{
   481  		TimeoutType:       TimeoutType,
   482  		Domain:            DomainName,
   483  		WorkflowExecution: &WorkflowExecution,
   484  		WorkflowType:      &WorkflowType,
   485  		InitiatedEventId:  EventID1,
   486  		StartedEventId:    EventID2,
   487  	}
   488  	ChildWorkflowExecutionTerminatedEventAttributes = apiv1.ChildWorkflowExecutionTerminatedEventAttributes{
   489  		Domain:            DomainName,
   490  		WorkflowExecution: &WorkflowExecution,
   491  		WorkflowType:      &WorkflowType,
   492  		InitiatedEventId:  EventID1,
   493  		StartedEventId:    EventID2,
   494  	}
   495  	SignalExternalWorkflowExecutionInitiatedEventAttributes = apiv1.SignalExternalWorkflowExecutionInitiatedEventAttributes{
   496  		DecisionTaskCompletedEventId: EventID1,
   497  		Domain:                       DomainName,
   498  		WorkflowExecution:            &WorkflowExecution,
   499  		SignalName:                   SignalName,
   500  		Input:                        &Payload1,
   501  		Control:                      Control,
   502  		ChildWorkflowOnly:            true,
   503  	}
   504  	SignalExternalWorkflowExecutionFailedEventAttributes = apiv1.SignalExternalWorkflowExecutionFailedEventAttributes{
   505  		Cause:                        SignalExternalWorkflowExecutionFailedCause,
   506  		DecisionTaskCompletedEventId: EventID1,
   507  		Domain:                       DomainName,
   508  		WorkflowExecution:            &WorkflowExecution,
   509  		InitiatedEventId:             EventID2,
   510  		Control:                      Control,
   511  	}
   512  	ExternalWorkflowExecutionSignaledEventAttributes = apiv1.ExternalWorkflowExecutionSignaledEventAttributes{
   513  		InitiatedEventId:  EventID1,
   514  		Domain:            DomainName,
   515  		WorkflowExecution: &WorkflowExecution,
   516  		Control:           Control,
   517  	}
   518  	UpsertWorkflowSearchAttributesEventAttributes = apiv1.UpsertWorkflowSearchAttributesEventAttributes{
   519  		DecisionTaskCompletedEventId: EventID1,
   520  		SearchAttributes:             &SearchAttributes,
   521  	}
   522  )
   523  
   524  func generateEvent(modifier func(e *apiv1.HistoryEvent)) apiv1.HistoryEvent {
   525  	e := apiv1.HistoryEvent{
   526  		EventId:   EventID1,
   527  		EventTime: Timestamp1,
   528  		Version:   Version1,
   529  		TaskId:    TaskID,
   530  	}
   531  	modifier(&e)
   532  	return e
   533  }