From ba60038c496163528c99493a2b9fb86711c541f2 Mon Sep 17 00:00:00 2001 From: chris ludden Date: Sun, 22 Oct 2023 12:32:23 -0600 Subject: [PATCH] fix: fixes client StartWorkflowOptions timeouts --- .mockery.yaml | 16 + example/main_test.go | 56 + example/proto/buf.yaml | 3 +- example/proto/example/v1/example.proto | 3 + gen/example/v1/example.pb.go | 91 +- gen/example/v1/example_temporal.pb.go | 75 +- gen/simple/simple_temporal.pb.go | 10 +- internal/plugin/client.go | 4 +- mocks/Client.go | 741 ------- .../go.temporal.io/sdk/client/mock_Client.go | 1782 +++++++++++++++++ .../sdk/clientutils/mock_WorkflowRun.go | 206 ++ 11 files changed, 2188 insertions(+), 799 deletions(-) create mode 100644 .mockery.yaml create mode 100644 example/main_test.go delete mode 100644 mocks/Client.go create mode 100644 mocks/go.temporal.io/sdk/client/mock_Client.go create mode 100644 mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go diff --git a/.mockery.yaml b/.mockery.yaml new file mode 100644 index 00000000..9df3208a --- /dev/null +++ b/.mockery.yaml @@ -0,0 +1,16 @@ +with-expecter: true +packages: + go.temporal.io/sdk/internal: + config: + dir: mocks/go.temporal.io/sdk/clientutils + outpkg: clientutils + replace-type: + - go.temporal.io/sdk/internal=go.temporal.io/sdk/client + interfaces: + WorkflowRun: {} + go.temporal.io/sdk/client: + config: + replace-type: + - go.temporal.io/sdk/internal=go.temporal.io/sdk/client + interfaces: + Client: {} \ No newline at end of file diff --git a/example/main_test.go b/example/main_test.go new file mode 100644 index 00000000..f13eb8ea --- /dev/null +++ b/example/main_test.go @@ -0,0 +1,56 @@ +package main + +import ( + "context" + "errors" + "fmt" + "testing" + "time" + + examplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1" + clientMock "github.com/cludden/protoc-gen-go-temporal/mocks/go.temporal.io/sdk/client" + "github.com/cludden/protoc-gen-go-temporal/mocks/go.temporal.io/sdk/clientutils" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.temporal.io/sdk/client" +) + +func TestCreateFooStartWorkflowOptions(t *testing.T) { + ctx, require := context.Background(), require.New(t) + + c := clientMock.NewMockClient(t) + c.On("ExecuteWorkflow", mock.Anything, mock.Anything, examplev1.CreateFooWorkflowName, mock.Anything).Return( + func(ctx context.Context, opts client.StartWorkflowOptions, workflow any, params ...any) (run client.WorkflowRun, err error) { + if opts.ID != "create-foo/bar" { + err = errors.Join(err, fmt.Errorf("expected workflow id to equal 'create-foo/bar', got: %q", opts.ID)) + } + if opts.WorkflowExecutionTimeout != time.Hour { + err = errors.Join(err, fmt.Errorf("expected workflow execution timeout to equal 1h, got: %s", opts.WorkflowExecutionTimeout)) + } + if len(opts.SearchAttributes) != 2 { + err = errors.Join(err, fmt.Errorf("expected 2 search attributes, got: %d", len(opts.SearchAttributes))) + } + if raw, ok := opts.SearchAttributes["foo"]; !ok { + err = errors.Join(err, fmt.Errorf("expected search attributes to contain 'foo' attribute")) + } else if v, ok := raw.(string); !ok { + err = errors.Join(err, fmt.Errorf("expected 'foo' attribute to be string, got: %T", raw)) + } else if v != "bar" { + err = errors.Join(err, fmt.Errorf("expected 'foo' to equal 'bar', got: %q", v)) + } + if raw, ok := opts.SearchAttributes["created_at"]; !ok { + err = errors.Join(err, fmt.Errorf("expected search attributes to contain 'created_at' attribute")) + } else if v, ok := raw.(time.Time); !ok { + err = errors.Join(err, fmt.Errorf("expected 'created_at' attribute to be string, got: %T", raw)) + } else if time.Since(v) > time.Second { + err = errors.Join(err, fmt.Errorf("expected 'created_at' to be within 1s: %q", v)) + } + if err != nil { + return nil, err + } + return clientutils.NewMockWorkflowRun(t), nil + }, + ) + example := examplev1.NewExampleClient(c) + _, err := example.CreateFooAsync(ctx, &examplev1.CreateFooRequest{Name: "bar"}) + require.NoError(err) +} diff --git a/example/proto/buf.yaml b/example/proto/buf.yaml index 63a05c64..e0b1f01e 100644 --- a/example/proto/buf.yaml +++ b/example/proto/buf.yaml @@ -1,8 +1,7 @@ version: v1 name: buf.build/cludden/protoc-gen-go-temporal-example deps: - - buf.build/cludden/protoc-gen-go-temporal:v0.8.0 - - buf.build/googleapis/googleapis + - buf.build/cludden/protoc-gen-go-temporal breaking: use: - FILE diff --git a/example/proto/example/v1/example.proto b/example/proto/example/v1/example.proto index 420a242d..fbc2ed51 100644 --- a/example/proto/example/v1/example.proto +++ b/example/proto/example/v1/example.proto @@ -16,6 +16,9 @@ service Example { execution_timeout: { seconds: 3600 } id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE id: 'create-foo/${!name.slug()}' + search_attributes: + 'foo = name\n' + 'created_at = now().ts_tz("UTC")\n' query: { ref: 'GetFooProgress' } signal: { ref: 'SetFooProgress', start: true } update: { ref: 'UpdateFooProgress' } diff --git a/gen/example/v1/example.pb.go b/gen/example/v1/example.pb.go index 66646162..26ff6d1e 100644 --- a/gen/example/v1/example.pb.go +++ b/gen/example/v1/example.pb.go @@ -414,55 +414,58 @@ var file_example_v1_example_proto_rawDesc = []byte{ 0x65, 0x22, 0x33, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x32, 0xc8, 0x04, 0x0a, 0x07, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x12, 0xac, 0x01, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x32, 0xf7, 0x04, 0x0a, 0x07, 0x45, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x12, 0xdb, 0x01, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x62, 0x8a, - 0xc4, 0x03, 0x5e, 0x0a, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, - 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x1a, 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x03, - 0x08, 0x90, 0x1c, 0x2a, 0x1a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2d, 0x66, 0x6f, 0x6f, 0x2f, - 0x24, 0x7b, 0x21, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x75, 0x67, 0x28, 0x29, 0x7d, 0x30, - 0x01, 0x12, 0x52, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x90, 0x01, + 0x8a, 0xc4, 0x03, 0x8b, 0x01, 0x0a, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, + 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x46, 0x6f, + 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x1a, 0x13, 0x0a, 0x11, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x22, 0x03, 0x08, 0x90, 0x1c, 0x2a, 0x1a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2d, 0x66, 0x6f, + 0x6f, 0x2f, 0x24, 0x7b, 0x21, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x75, 0x67, 0x28, 0x29, + 0x7d, 0x30, 0x01, 0x7a, 0x2b, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x77, + 0x28, 0x29, 0x2e, 0x74, 0x73, 0x5f, 0x74, 0x7a, 0x28, 0x22, 0x55, 0x54, 0x43, 0x22, 0x29, 0x0a, + 0x12, 0x52, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x04, + 0x9a, 0xc4, 0x03, 0x00, 0x12, 0x49, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x19, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x0c, 0x92, 0xc4, 0x03, 0x08, 0x22, 0x02, 0x08, 0x1e, 0x32, 0x02, 0x20, 0x03, 0x12, + 0x51, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x04, 0xa2, 0xc4, + 0x03, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6f, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x04, 0x9a, 0xc4, 0x03, 0x00, 0x12, 0x49, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, - 0x19, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x74, - 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x0c, 0x92, 0xc4, 0x03, 0x08, 0x22, 0x02, 0x08, 0x1e, 0x32, 0x02, 0x20, 0x03, - 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x04, 0xa2, - 0xc4, 0x03, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, - 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, - 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2d, 0xaa, 0xc4, 0x03, 0x29, 0x0a, 0x27, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x70, - 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x24, 0x7b, 0x21, 0x20, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x20, 0x7d, 0x1a, - 0x10, 0x8a, 0xc4, 0x03, 0x0c, 0x0a, 0x0a, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x76, - 0x31, 0x42, 0xab, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6c, 0x75, 0x64, 0x64, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, - 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, - 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0xaa, 0xc4, 0x03, 0x29, 0x0a, 0x27, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x24, 0x7b, 0x21, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x20, 0x7d, 0x1a, 0x10, + 0x8a, 0xc4, 0x03, 0x0c, 0x0a, 0x0a, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x76, 0x31, + 0x42, 0xab, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6c, 0x75, 0x64, 0x64, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, + 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/gen/example/v1/example_temporal.pb.go b/gen/example/v1/example_temporal.pb.go index aaa06a0c..fba89328 100644 --- a/gen/example/v1/example_temporal.pb.go +++ b/gen/example/v1/example_temporal.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go_temporal. DO NOT EDIT. // versions: // -// protoc-gen-go_temporal 1.0.2-next (3da86b13f3ebce6521323d62538511f2b615ab7c) +// protoc-gen-go_temporal 1.0.2-next (51b472a3466a4b3530a59c6d6486448ffb49a42f) // go go1.21.3 // protoc (unknown) // @@ -42,6 +42,11 @@ var ( CreateFooIDExpression = expression.MustParseExpression("create-foo/${!name.slug()}") ) +// example.v1.Example workflow search attribute mappings +var ( + CreateFooSearchAttributesMapping = expression.MustParseMapping("foo = name\ncreated_at = now().ts_tz(\"UTC\")\n") +) + // example.v1.Example activity names const ( NotifyActivityName = "example.v1.Example.Notify" @@ -154,7 +159,22 @@ func (c *exampleClient) CreateFooAsync(ctx context.Context, req *CreateFooReques opts.WorkflowIDReusePolicy = v1.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s + } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes } run, err := c.client.ExecuteWorkflow(ctx, *opts, CreateFooWorkflowName, req) if err != nil { @@ -206,7 +226,22 @@ func (c *exampleClient) CreateFooWithSetFooProgressAsync(ctx context.Context, re opts.WorkflowIDReusePolicy = v1.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s + } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes } run, err := c.client.SignalWithStartWorkflow(ctx, opts.ID, SetFooProgressSignalName, signal, *opts, CreateFooWorkflowName, req) if run == nil || err != nil { @@ -536,7 +571,22 @@ func CreateFooChildAsync(ctx workflow.Context, req *CreateFooRequest, options .. opts.WorkflowIDReusePolicy = v1.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s + } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes } ctx = workflow.WithChildOptions(ctx, *opts) return &CreateFooChildRun{Future: workflow.ExecuteChildWorkflow(ctx, CreateFooWorkflowName, req)}, nil @@ -880,7 +930,22 @@ func (c *TestExampleClient) CreateFooAsync(ctx context.Context, req *CreateFooRe opts.WorkflowIDReusePolicy = v1.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s + } + if opts.SearchAttributes == nil { + structured, err := expression.ToStructured(req.ProtoReflect()) + if err != nil { + return nil, fmt.Errorf("error serializing input for \"CreateFoo\" search attribute mapping: %v", err) + } + result, err := CreateFooSearchAttributesMapping.Query(structured) + if err != nil { + return nil, fmt.Errorf("error executing \"CreateFoo\" search attribute mapping: %v", err) + } + searchAttributes, ok := result.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("expected \"CreateFoo\" search attribute mapping to return map[string]any, got: %T", result) + } + opts.SearchAttributes = searchAttributes } return &testCreateFooRun{client: c, env: c.env, opts: opts, req: req, workflows: c.workflows}, nil } diff --git a/gen/simple/simple_temporal.pb.go b/gen/simple/simple_temporal.pb.go index 8b67682b..d65a7eac 100644 --- a/gen/simple/simple_temporal.pb.go +++ b/gen/simple/simple_temporal.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go_temporal. DO NOT EDIT. // versions: // -// protoc-gen-go_temporal 1.0.2-next (3da86b13f3ebce6521323d62538511f2b615ab7c) +// protoc-gen-go_temporal 1.0.2-next (51b472a3466a4b3530a59c6d6486448ffb49a42f) // go go1.21.3 // protoc (unknown) // @@ -305,7 +305,7 @@ func (c *simpleClient) SomeWorkflow3Async(ctx context.Context, req *SomeWorkflow opts.RetryPolicy = &temporal.RetryPolicy{MaximumAttempts: int32(2)} } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } run, err := c.client.ExecuteWorkflow(ctx, *opts, SomeWorkflow3WorkflowName, req) if err != nil { @@ -360,7 +360,7 @@ func (c *simpleClient) SomeWorkflow3WithSomeSignal2Async(ctx context.Context, re opts.RetryPolicy = &temporal.RetryPolicy{MaximumAttempts: int32(2)} } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } run, err := c.client.SignalWithStartWorkflow(ctx, opts.ID, SomeSignal2SignalName, signal, *opts, SomeWorkflow3WorkflowName, req) if run == nil || err != nil { @@ -1159,7 +1159,7 @@ func SomeWorkflow3ChildAsync(ctx workflow.Context, req *SomeWorkflow3Request, op opts.RetryPolicy = &temporal.RetryPolicy{MaximumAttempts: int32(2)} } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } ctx = workflow.WithChildOptions(ctx, *opts) return &SomeWorkflow3ChildRun{Future: workflow.ExecuteChildWorkflow(ctx, SomeWorkflow3WorkflowName, req)}, nil @@ -1948,7 +1948,7 @@ func (c *TestSimpleClient) SomeWorkflow3Async(ctx context.Context, req *SomeWork opts.RetryPolicy = &temporal.RetryPolicy{MaximumAttempts: int32(2)} } if opts.WorkflowExecutionTimeout == 0 { - opts.WorkflowRunTimeout = 3600000000000 // 1h0m0s + opts.WorkflowExecutionTimeout = 3600000000000 // 1h0m0s } return &testSomeWorkflow3Run{client: c, env: c.env, opts: opts, req: req, workflows: c.workflows}, nil } diff --git a/internal/plugin/client.go b/internal/plugin/client.go index e16b6d79..27297e30 100644 --- a/internal/plugin/client.go +++ b/internal/plugin/client.go @@ -932,7 +932,7 @@ func (svc *Service) genClientStartWorkflowOptions(fn *g.Group, workflow string, if timeout := opts.GetExecutionTimeout(); timeout.IsValid() { fn.If(g.Id("opts").Dot("WorkflowExecutionTimeout").Op("==").Lit(0)). Block( - g.Id("opts").Dot("WorkflowRunTimeout").Op("=").Id(strconv.FormatInt(timeout.AsDuration().Nanoseconds(), 10)).Comment(timeout.AsDuration().String()), + g.Id("opts").Dot("WorkflowExecutionTimeout").Op("=").Id(strconv.FormatInt(timeout.AsDuration().Nanoseconds(), 10)).Comment(timeout.AsDuration().String()), ) } @@ -946,7 +946,7 @@ func (svc *Service) genClientStartWorkflowOptions(fn *g.Group, workflow string, if timeout := opts.GetTaskTimeout(); timeout.IsValid() { fn.If(g.Id("opts").Dot("WorkflowTaskTimeout").Op("==").Lit(0)). Block( - g.Id("opts").Dot("WorkflowRunTimeout").Op("=").Id(strconv.FormatInt(timeout.AsDuration().Nanoseconds(), 10)).Comment(timeout.AsDuration().String()), + g.Id("opts").Dot("WorkflowTaskTimeout").Op("=").Id(strconv.FormatInt(timeout.AsDuration().Nanoseconds(), 10)).Comment(timeout.AsDuration().String()), ) } diff --git a/mocks/Client.go b/mocks/Client.go deleted file mode 100644 index 4c3ce1e6..00000000 --- a/mocks/Client.go +++ /dev/null @@ -1,741 +0,0 @@ -// Code generated by mockery v2.28.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - client "go.temporal.io/sdk/client" - - converter "go.temporal.io/sdk/converter" - - enums "go.temporal.io/api/enums/v1" - - mock "github.com/stretchr/testify/mock" - - operatorservice "go.temporal.io/api/operatorservice/v1" - - workflowservice "go.temporal.io/api/workflowservice/v1" -) - -// Client is an autogenerated mock type for the Client type -type Client struct { - mock.Mock -} - -// CancelWorkflow provides a mock function with given fields: ctx, workflowID, runID -func (_m *Client) CancelWorkflow(ctx context.Context, workflowID string, runID string) error { - ret := _m.Called(ctx, workflowID, runID) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, workflowID, runID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CheckHealth provides a mock function with given fields: ctx, request -func (_m *Client) CheckHealth(ctx context.Context, request *client.CheckHealthRequest) (*client.CheckHealthResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *client.CheckHealthResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *client.CheckHealthRequest) (*client.CheckHealthResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *client.CheckHealthRequest) *client.CheckHealthResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*client.CheckHealthResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *client.CheckHealthRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Close provides a mock function with given fields: -func (_m *Client) Close() { - _m.Called() -} - -// CompleteActivity provides a mock function with given fields: ctx, taskToken, result, err -func (_m *Client) CompleteActivity(ctx context.Context, taskToken []byte, result interface{}, err error) error { - ret := _m.Called(ctx, taskToken, result, err) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []byte, interface{}, error) error); ok { - r0 = rf(ctx, taskToken, result, err) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CompleteActivityByID provides a mock function with given fields: ctx, namespace, workflowID, runID, activityID, result, err -func (_m *Client) CompleteActivityByID(ctx context.Context, namespace string, workflowID string, runID string, activityID string, result interface{}, err error) error { - ret := _m.Called(ctx, namespace, workflowID, runID, activityID, result, err) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, interface{}, error) error); ok { - r0 = rf(ctx, namespace, workflowID, runID, activityID, result, err) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CountWorkflow provides a mock function with given fields: ctx, request -func (_m *Client) CountWorkflow(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *workflowservice.CountWorkflowExecutionsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.CountWorkflowExecutionsRequest) *workflowservice.CountWorkflowExecutionsResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.CountWorkflowExecutionsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.CountWorkflowExecutionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DescribeTaskQueue provides a mock function with given fields: ctx, taskqueue, taskqueueType -func (_m *Client) DescribeTaskQueue(ctx context.Context, taskqueue string, taskqueueType enums.TaskQueueType) (*workflowservice.DescribeTaskQueueResponse, error) { - ret := _m.Called(ctx, taskqueue, taskqueueType) - - var r0 *workflowservice.DescribeTaskQueueResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, enums.TaskQueueType) (*workflowservice.DescribeTaskQueueResponse, error)); ok { - return rf(ctx, taskqueue, taskqueueType) - } - if rf, ok := ret.Get(0).(func(context.Context, string, enums.TaskQueueType) *workflowservice.DescribeTaskQueueResponse); ok { - r0 = rf(ctx, taskqueue, taskqueueType) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.DescribeTaskQueueResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, enums.TaskQueueType) error); ok { - r1 = rf(ctx, taskqueue, taskqueueType) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DescribeWorkflowExecution provides a mock function with given fields: ctx, workflowID, runID -func (_m *Client) DescribeWorkflowExecution(ctx context.Context, workflowID string, runID string) (*workflowservice.DescribeWorkflowExecutionResponse, error) { - ret := _m.Called(ctx, workflowID, runID) - - var r0 *workflowservice.DescribeWorkflowExecutionResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*workflowservice.DescribeWorkflowExecutionResponse, error)); ok { - return rf(ctx, workflowID, runID) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *workflowservice.DescribeWorkflowExecutionResponse); ok { - r0 = rf(ctx, workflowID, runID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.DescribeWorkflowExecutionResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, workflowID, runID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ExecuteWorkflow provides a mock function with given fields: ctx, options, workflow, args -func (_m *Client) ExecuteWorkflow(ctx context.Context, options client.StartWorkflowOptions, workflow interface{}, args ...interface{}) (client.WorkflowRun, error) { - var _ca []interface{} - _ca = append(_ca, ctx, options, workflow) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - var r0 client.WorkflowRun - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, client.StartWorkflowOptions, interface{}, ...interface{}) (client.WorkflowRun, error)); ok { - return rf(ctx, options, workflow, args...) - } - if rf, ok := ret.Get(0).(func(context.Context, client.StartWorkflowOptions, interface{}, ...interface{}) client.WorkflowRun); ok { - r0 = rf(ctx, options, workflow, args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.WorkflowRun) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, client.StartWorkflowOptions, interface{}, ...interface{}) error); ok { - r1 = rf(ctx, options, workflow, args...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetSearchAttributes provides a mock function with given fields: ctx -func (_m *Client) GetSearchAttributes(ctx context.Context) (*workflowservice.GetSearchAttributesResponse, error) { - ret := _m.Called(ctx) - - var r0 *workflowservice.GetSearchAttributesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*workflowservice.GetSearchAttributesResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *workflowservice.GetSearchAttributesResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.GetSearchAttributesResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetWorkerBuildIdCompatibility provides a mock function with given fields: ctx, options -func (_m *Client) GetWorkerBuildIdCompatibility(ctx context.Context, options *client.GetWorkerBuildIdCompatibilityOptions) (*client.WorkerBuildIDVersionSets, error) { - ret := _m.Called(ctx, options) - - var r0 *client.WorkerBuildIDVersionSets - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *client.GetWorkerBuildIdCompatibilityOptions) (*client.WorkerBuildIDVersionSets, error)); ok { - return rf(ctx, options) - } - if rf, ok := ret.Get(0).(func(context.Context, *client.GetWorkerBuildIdCompatibilityOptions) *client.WorkerBuildIDVersionSets); ok { - r0 = rf(ctx, options) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*client.WorkerBuildIDVersionSets) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *client.GetWorkerBuildIdCompatibilityOptions) error); ok { - r1 = rf(ctx, options) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetWorkflow provides a mock function with given fields: ctx, workflowID, runID -func (_m *Client) GetWorkflow(ctx context.Context, workflowID string, runID string) client.WorkflowRun { - ret := _m.Called(ctx, workflowID, runID) - - var r0 client.WorkflowRun - if rf, ok := ret.Get(0).(func(context.Context, string, string) client.WorkflowRun); ok { - r0 = rf(ctx, workflowID, runID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.WorkflowRun) - } - } - - return r0 -} - -// GetWorkflowHistory provides a mock function with given fields: ctx, workflowID, runID, isLongPoll, filterType -func (_m *Client) GetWorkflowHistory(ctx context.Context, workflowID string, runID string, isLongPoll bool, filterType enums.HistoryEventFilterType) client.HistoryEventIterator { - ret := _m.Called(ctx, workflowID, runID, isLongPoll, filterType) - - var r0 client.HistoryEventIterator - if rf, ok := ret.Get(0).(func(context.Context, string, string, bool, enums.HistoryEventFilterType) client.HistoryEventIterator); ok { - r0 = rf(ctx, workflowID, runID, isLongPoll, filterType) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.HistoryEventIterator) - } - } - - return r0 -} - -// GetWorkflowUpdateHandle provides a mock function with given fields: ref -func (_m *Client) GetWorkflowUpdateHandle(ref client.GetWorkflowUpdateHandleOptions) client.WorkflowUpdateHandle { - ret := _m.Called(ref) - - var r0 client.WorkflowUpdateHandle - if rf, ok := ret.Get(0).(func(client.GetWorkflowUpdateHandleOptions) client.WorkflowUpdateHandle); ok { - r0 = rf(ref) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.WorkflowUpdateHandle) - } - } - - return r0 -} - -// ListArchivedWorkflow provides a mock function with given fields: ctx, request -func (_m *Client) ListArchivedWorkflow(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *workflowservice.ListArchivedWorkflowExecutionsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListArchivedWorkflowExecutionsRequest) *workflowservice.ListArchivedWorkflowExecutionsResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.ListArchivedWorkflowExecutionsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListArchivedWorkflowExecutionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListClosedWorkflow provides a mock function with given fields: ctx, request -func (_m *Client) ListClosedWorkflow(ctx context.Context, request *workflowservice.ListClosedWorkflowExecutionsRequest) (*workflowservice.ListClosedWorkflowExecutionsResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *workflowservice.ListClosedWorkflowExecutionsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListClosedWorkflowExecutionsRequest) (*workflowservice.ListClosedWorkflowExecutionsResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListClosedWorkflowExecutionsRequest) *workflowservice.ListClosedWorkflowExecutionsResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.ListClosedWorkflowExecutionsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListClosedWorkflowExecutionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListOpenWorkflow provides a mock function with given fields: ctx, request -func (_m *Client) ListOpenWorkflow(ctx context.Context, request *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *workflowservice.ListOpenWorkflowExecutionsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListOpenWorkflowExecutionsRequest) *workflowservice.ListOpenWorkflowExecutionsResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.ListOpenWorkflowExecutionsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListOpenWorkflowExecutionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListWorkflow provides a mock function with given fields: ctx, request -func (_m *Client) ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *workflowservice.ListWorkflowExecutionsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListWorkflowExecutionsRequest) *workflowservice.ListWorkflowExecutionsResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.ListWorkflowExecutionsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListWorkflowExecutionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OperatorService provides a mock function with given fields: -func (_m *Client) OperatorService() operatorservice.OperatorServiceClient { - ret := _m.Called() - - var r0 operatorservice.OperatorServiceClient - if rf, ok := ret.Get(0).(func() operatorservice.OperatorServiceClient); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(operatorservice.OperatorServiceClient) - } - } - - return r0 -} - -// QueryWorkflow provides a mock function with given fields: ctx, workflowID, runID, queryType, args -func (_m *Client) QueryWorkflow(ctx context.Context, workflowID string, runID string, queryType string, args ...interface{}) (converter.EncodedValue, error) { - var _ca []interface{} - _ca = append(_ca, ctx, workflowID, runID, queryType) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - var r0 converter.EncodedValue - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) (converter.EncodedValue, error)); ok { - return rf(ctx, workflowID, runID, queryType, args...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) converter.EncodedValue); ok { - r0 = rf(ctx, workflowID, runID, queryType, args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(converter.EncodedValue) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...interface{}) error); ok { - r1 = rf(ctx, workflowID, runID, queryType, args...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// QueryWorkflowWithOptions provides a mock function with given fields: ctx, request -func (_m *Client) QueryWorkflowWithOptions(ctx context.Context, request *client.QueryWorkflowWithOptionsRequest) (*client.QueryWorkflowWithOptionsResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *client.QueryWorkflowWithOptionsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *client.QueryWorkflowWithOptionsRequest) (*client.QueryWorkflowWithOptionsResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *client.QueryWorkflowWithOptionsRequest) *client.QueryWorkflowWithOptionsResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*client.QueryWorkflowWithOptionsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *client.QueryWorkflowWithOptionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RecordActivityHeartbeat provides a mock function with given fields: ctx, taskToken, details -func (_m *Client) RecordActivityHeartbeat(ctx context.Context, taskToken []byte, details ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, ctx, taskToken) - _ca = append(_ca, details...) - ret := _m.Called(_ca...) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []byte, ...interface{}) error); ok { - r0 = rf(ctx, taskToken, details...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RecordActivityHeartbeatByID provides a mock function with given fields: ctx, namespace, workflowID, runID, activityID, details -func (_m *Client) RecordActivityHeartbeatByID(ctx context.Context, namespace string, workflowID string, runID string, activityID string, details ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, ctx, namespace, workflowID, runID, activityID) - _ca = append(_ca, details...) - ret := _m.Called(_ca...) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...interface{}) error); ok { - r0 = rf(ctx, namespace, workflowID, runID, activityID, details...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ResetWorkflowExecution provides a mock function with given fields: ctx, request -func (_m *Client) ResetWorkflowExecution(ctx context.Context, request *workflowservice.ResetWorkflowExecutionRequest) (*workflowservice.ResetWorkflowExecutionResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *workflowservice.ResetWorkflowExecutionResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ResetWorkflowExecutionRequest) (*workflowservice.ResetWorkflowExecutionResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ResetWorkflowExecutionRequest) *workflowservice.ResetWorkflowExecutionResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.ResetWorkflowExecutionResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ResetWorkflowExecutionRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ScanWorkflow provides a mock function with given fields: ctx, request -func (_m *Client) ScanWorkflow(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error) { - ret := _m.Called(ctx, request) - - var r0 *workflowservice.ScanWorkflowExecutionsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ScanWorkflowExecutionsRequest) *workflowservice.ScanWorkflowExecutionsResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*workflowservice.ScanWorkflowExecutionsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ScanWorkflowExecutionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ScheduleClient provides a mock function with given fields: -func (_m *Client) ScheduleClient() client.ScheduleClient { - ret := _m.Called() - - var r0 client.ScheduleClient - if rf, ok := ret.Get(0).(func() client.ScheduleClient); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.ScheduleClient) - } - } - - return r0 -} - -// SignalWithStartWorkflow provides a mock function with given fields: ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs -func (_m *Client) SignalWithStartWorkflow(ctx context.Context, workflowID string, signalName string, signalArg interface{}, options client.StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (client.WorkflowRun, error) { - var _ca []interface{} - _ca = append(_ca, ctx, workflowID, signalName, signalArg, options, workflow) - _ca = append(_ca, workflowArgs...) - ret := _m.Called(_ca...) - - var r0 client.WorkflowRun - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, client.StartWorkflowOptions, interface{}, ...interface{}) (client.WorkflowRun, error)); ok { - return rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, client.StartWorkflowOptions, interface{}, ...interface{}) client.WorkflowRun); ok { - r0 = rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.WorkflowRun) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, interface{}, client.StartWorkflowOptions, interface{}, ...interface{}) error); ok { - r1 = rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SignalWorkflow provides a mock function with given fields: ctx, workflowID, runID, signalName, arg -func (_m *Client) SignalWorkflow(ctx context.Context, workflowID string, runID string, signalName string, arg interface{}) error { - ret := _m.Called(ctx, workflowID, runID, signalName, arg) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, interface{}) error); ok { - r0 = rf(ctx, workflowID, runID, signalName, arg) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TerminateWorkflow provides a mock function with given fields: ctx, workflowID, runID, reason, details -func (_m *Client) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, ctx, workflowID, runID, reason) - _ca = append(_ca, details...) - ret := _m.Called(_ca...) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) error); ok { - r0 = rf(ctx, workflowID, runID, reason, details...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UpdateWorkerBuildIdCompatibility provides a mock function with given fields: ctx, options -func (_m *Client) UpdateWorkerBuildIdCompatibility(ctx context.Context, options *client.UpdateWorkerBuildIdCompatibilityOptions) error { - ret := _m.Called(ctx, options) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *client.UpdateWorkerBuildIdCompatibilityOptions) error); ok { - r0 = rf(ctx, options) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UpdateWorkflow provides a mock function with given fields: ctx, workflowID, workflowRunID, updateName, args -func (_m *Client) UpdateWorkflow(ctx context.Context, workflowID string, workflowRunID string, updateName string, args ...interface{}) (client.WorkflowUpdateHandle, error) { - var _ca []interface{} - _ca = append(_ca, ctx, workflowID, workflowRunID, updateName) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - var r0 client.WorkflowUpdateHandle - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) (client.WorkflowUpdateHandle, error)); ok { - return rf(ctx, workflowID, workflowRunID, updateName, args...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) client.WorkflowUpdateHandle); ok { - r0 = rf(ctx, workflowID, workflowRunID, updateName, args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.WorkflowUpdateHandle) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...interface{}) error); ok { - r1 = rf(ctx, workflowID, workflowRunID, updateName, args...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UpdateWorkflowWithOptions provides a mock function with given fields: ctx, request -func (_m *Client) UpdateWorkflowWithOptions(ctx context.Context, request *client.UpdateWorkflowWithOptionsRequest) (client.WorkflowUpdateHandle, error) { - ret := _m.Called(ctx, request) - - var r0 client.WorkflowUpdateHandle - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *client.UpdateWorkflowWithOptionsRequest) (client.WorkflowUpdateHandle, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, *client.UpdateWorkflowWithOptionsRequest) client.WorkflowUpdateHandle); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.WorkflowUpdateHandle) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *client.UpdateWorkflowWithOptionsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WorkflowService provides a mock function with given fields: -func (_m *Client) WorkflowService() workflowservice.WorkflowServiceClient { - ret := _m.Called() - - var r0 workflowservice.WorkflowServiceClient - if rf, ok := ret.Get(0).(func() workflowservice.WorkflowServiceClient); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(workflowservice.WorkflowServiceClient) - } - } - - return r0 -} - -type mockConstructorTestingTNewClient interface { - mock.TestingT - Cleanup(func()) -} - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewClient(t mockConstructorTestingTNewClient) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/go.temporal.io/sdk/client/mock_Client.go b/mocks/go.temporal.io/sdk/client/mock_Client.go new file mode 100644 index 00000000..b7f5405d --- /dev/null +++ b/mocks/go.temporal.io/sdk/client/mock_Client.go @@ -0,0 +1,1782 @@ +// Code generated by mockery v2.36.0. DO NOT EDIT. + +package client + +import ( + context "context" + + client "go.temporal.io/sdk/client" + + converter "go.temporal.io/sdk/converter" + + enums "go.temporal.io/api/enums/v1" + + mock "github.com/stretchr/testify/mock" + + operatorservice "go.temporal.io/api/operatorservice/v1" + + workflowservice "go.temporal.io/api/workflowservice/v1" +) + +// MockClient is an autogenerated mock type for the Client type +type MockClient struct { + mock.Mock +} + +type MockClient_Expecter struct { + mock *mock.Mock +} + +func (_m *MockClient) EXPECT() *MockClient_Expecter { + return &MockClient_Expecter{mock: &_m.Mock} +} + +// CancelWorkflow provides a mock function with given fields: ctx, workflowID, runID +func (_m *MockClient) CancelWorkflow(ctx context.Context, workflowID string, runID string) error { + ret := _m.Called(ctx, workflowID, runID) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, workflowID, runID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_CancelWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelWorkflow' +type MockClient_CancelWorkflow_Call struct { + *mock.Call +} + +// CancelWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - runID string +func (_e *MockClient_Expecter) CancelWorkflow(ctx interface{}, workflowID interface{}, runID interface{}) *MockClient_CancelWorkflow_Call { + return &MockClient_CancelWorkflow_Call{Call: _e.mock.On("CancelWorkflow", ctx, workflowID, runID)} +} + +func (_c *MockClient_CancelWorkflow_Call) Run(run func(ctx context.Context, workflowID string, runID string)) *MockClient_CancelWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockClient_CancelWorkflow_Call) Return(_a0 error) *MockClient_CancelWorkflow_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_CancelWorkflow_Call) RunAndReturn(run func(context.Context, string, string) error) *MockClient_CancelWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// CheckHealth provides a mock function with given fields: ctx, request +func (_m *MockClient) CheckHealth(ctx context.Context, request *client.CheckHealthRequest) (*client.CheckHealthResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *client.CheckHealthResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *client.CheckHealthRequest) (*client.CheckHealthResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *client.CheckHealthRequest) *client.CheckHealthResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*client.CheckHealthResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *client.CheckHealthRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_CheckHealth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckHealth' +type MockClient_CheckHealth_Call struct { + *mock.Call +} + +// CheckHealth is a helper method to define mock.On call +// - ctx context.Context +// - request *client.CheckHealthRequest +func (_e *MockClient_Expecter) CheckHealth(ctx interface{}, request interface{}) *MockClient_CheckHealth_Call { + return &MockClient_CheckHealth_Call{Call: _e.mock.On("CheckHealth", ctx, request)} +} + +func (_c *MockClient_CheckHealth_Call) Run(run func(ctx context.Context, request *client.CheckHealthRequest)) *MockClient_CheckHealth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*client.CheckHealthRequest)) + }) + return _c +} + +func (_c *MockClient_CheckHealth_Call) Return(_a0 *client.CheckHealthResponse, _a1 error) *MockClient_CheckHealth_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_CheckHealth_Call) RunAndReturn(run func(context.Context, *client.CheckHealthRequest) (*client.CheckHealthResponse, error)) *MockClient_CheckHealth_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *MockClient) Close() { + _m.Called() +} + +// MockClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockClient_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockClient_Expecter) Close() *MockClient_Close_Call { + return &MockClient_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockClient_Close_Call) Run(run func()) *MockClient_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_Close_Call) Return() *MockClient_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *MockClient_Close_Call) RunAndReturn(run func()) *MockClient_Close_Call { + _c.Call.Return(run) + return _c +} + +// CompleteActivity provides a mock function with given fields: ctx, taskToken, result, err +func (_m *MockClient) CompleteActivity(ctx context.Context, taskToken []byte, result interface{}, err error) error { + ret := _m.Called(ctx, taskToken, result, err) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, interface{}, error) error); ok { + r0 = rf(ctx, taskToken, result, err) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_CompleteActivity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteActivity' +type MockClient_CompleteActivity_Call struct { + *mock.Call +} + +// CompleteActivity is a helper method to define mock.On call +// - ctx context.Context +// - taskToken []byte +// - result interface{} +// - err error +func (_e *MockClient_Expecter) CompleteActivity(ctx interface{}, taskToken interface{}, result interface{}, err interface{}) *MockClient_CompleteActivity_Call { + return &MockClient_CompleteActivity_Call{Call: _e.mock.On("CompleteActivity", ctx, taskToken, result, err)} +} + +func (_c *MockClient_CompleteActivity_Call) Run(run func(ctx context.Context, taskToken []byte, result interface{}, err error)) *MockClient_CompleteActivity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(interface{}), args[3].(error)) + }) + return _c +} + +func (_c *MockClient_CompleteActivity_Call) Return(_a0 error) *MockClient_CompleteActivity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_CompleteActivity_Call) RunAndReturn(run func(context.Context, []byte, interface{}, error) error) *MockClient_CompleteActivity_Call { + _c.Call.Return(run) + return _c +} + +// CompleteActivityByID provides a mock function with given fields: ctx, namespace, workflowID, runID, activityID, result, err +func (_m *MockClient) CompleteActivityByID(ctx context.Context, namespace string, workflowID string, runID string, activityID string, result interface{}, err error) error { + ret := _m.Called(ctx, namespace, workflowID, runID, activityID, result, err) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, interface{}, error) error); ok { + r0 = rf(ctx, namespace, workflowID, runID, activityID, result, err) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_CompleteActivityByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteActivityByID' +type MockClient_CompleteActivityByID_Call struct { + *mock.Call +} + +// CompleteActivityByID is a helper method to define mock.On call +// - ctx context.Context +// - namespace string +// - workflowID string +// - runID string +// - activityID string +// - result interface{} +// - err error +func (_e *MockClient_Expecter) CompleteActivityByID(ctx interface{}, namespace interface{}, workflowID interface{}, runID interface{}, activityID interface{}, result interface{}, err interface{}) *MockClient_CompleteActivityByID_Call { + return &MockClient_CompleteActivityByID_Call{Call: _e.mock.On("CompleteActivityByID", ctx, namespace, workflowID, runID, activityID, result, err)} +} + +func (_c *MockClient_CompleteActivityByID_Call) Run(run func(ctx context.Context, namespace string, workflowID string, runID string, activityID string, result interface{}, err error)) *MockClient_CompleteActivityByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(string), args[5].(interface{}), args[6].(error)) + }) + return _c +} + +func (_c *MockClient_CompleteActivityByID_Call) Return(_a0 error) *MockClient_CompleteActivityByID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_CompleteActivityByID_Call) RunAndReturn(run func(context.Context, string, string, string, string, interface{}, error) error) *MockClient_CompleteActivityByID_Call { + _c.Call.Return(run) + return _c +} + +// CountWorkflow provides a mock function with given fields: ctx, request +func (_m *MockClient) CountWorkflow(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *workflowservice.CountWorkflowExecutionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.CountWorkflowExecutionsRequest) *workflowservice.CountWorkflowExecutionsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.CountWorkflowExecutionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.CountWorkflowExecutionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_CountWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountWorkflow' +type MockClient_CountWorkflow_Call struct { + *mock.Call +} + +// CountWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - request *workflowservice.CountWorkflowExecutionsRequest +func (_e *MockClient_Expecter) CountWorkflow(ctx interface{}, request interface{}) *MockClient_CountWorkflow_Call { + return &MockClient_CountWorkflow_Call{Call: _e.mock.On("CountWorkflow", ctx, request)} +} + +func (_c *MockClient_CountWorkflow_Call) Run(run func(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest)) *MockClient_CountWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*workflowservice.CountWorkflowExecutionsRequest)) + }) + return _c +} + +func (_c *MockClient_CountWorkflow_Call) Return(_a0 *workflowservice.CountWorkflowExecutionsResponse, _a1 error) *MockClient_CountWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_CountWorkflow_Call) RunAndReturn(run func(context.Context, *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error)) *MockClient_CountWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// DescribeTaskQueue provides a mock function with given fields: ctx, taskqueue, taskqueueType +func (_m *MockClient) DescribeTaskQueue(ctx context.Context, taskqueue string, taskqueueType enums.TaskQueueType) (*workflowservice.DescribeTaskQueueResponse, error) { + ret := _m.Called(ctx, taskqueue, taskqueueType) + + var r0 *workflowservice.DescribeTaskQueueResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, enums.TaskQueueType) (*workflowservice.DescribeTaskQueueResponse, error)); ok { + return rf(ctx, taskqueue, taskqueueType) + } + if rf, ok := ret.Get(0).(func(context.Context, string, enums.TaskQueueType) *workflowservice.DescribeTaskQueueResponse); ok { + r0 = rf(ctx, taskqueue, taskqueueType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.DescribeTaskQueueResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, enums.TaskQueueType) error); ok { + r1 = rf(ctx, taskqueue, taskqueueType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_DescribeTaskQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeTaskQueue' +type MockClient_DescribeTaskQueue_Call struct { + *mock.Call +} + +// DescribeTaskQueue is a helper method to define mock.On call +// - ctx context.Context +// - taskqueue string +// - taskqueueType enums.TaskQueueType +func (_e *MockClient_Expecter) DescribeTaskQueue(ctx interface{}, taskqueue interface{}, taskqueueType interface{}) *MockClient_DescribeTaskQueue_Call { + return &MockClient_DescribeTaskQueue_Call{Call: _e.mock.On("DescribeTaskQueue", ctx, taskqueue, taskqueueType)} +} + +func (_c *MockClient_DescribeTaskQueue_Call) Run(run func(ctx context.Context, taskqueue string, taskqueueType enums.TaskQueueType)) *MockClient_DescribeTaskQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(enums.TaskQueueType)) + }) + return _c +} + +func (_c *MockClient_DescribeTaskQueue_Call) Return(_a0 *workflowservice.DescribeTaskQueueResponse, _a1 error) *MockClient_DescribeTaskQueue_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_DescribeTaskQueue_Call) RunAndReturn(run func(context.Context, string, enums.TaskQueueType) (*workflowservice.DescribeTaskQueueResponse, error)) *MockClient_DescribeTaskQueue_Call { + _c.Call.Return(run) + return _c +} + +// DescribeWorkflowExecution provides a mock function with given fields: ctx, workflowID, runID +func (_m *MockClient) DescribeWorkflowExecution(ctx context.Context, workflowID string, runID string) (*workflowservice.DescribeWorkflowExecutionResponse, error) { + ret := _m.Called(ctx, workflowID, runID) + + var r0 *workflowservice.DescribeWorkflowExecutionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*workflowservice.DescribeWorkflowExecutionResponse, error)); ok { + return rf(ctx, workflowID, runID) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *workflowservice.DescribeWorkflowExecutionResponse); ok { + r0 = rf(ctx, workflowID, runID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.DescribeWorkflowExecutionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, workflowID, runID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_DescribeWorkflowExecution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeWorkflowExecution' +type MockClient_DescribeWorkflowExecution_Call struct { + *mock.Call +} + +// DescribeWorkflowExecution is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - runID string +func (_e *MockClient_Expecter) DescribeWorkflowExecution(ctx interface{}, workflowID interface{}, runID interface{}) *MockClient_DescribeWorkflowExecution_Call { + return &MockClient_DescribeWorkflowExecution_Call{Call: _e.mock.On("DescribeWorkflowExecution", ctx, workflowID, runID)} +} + +func (_c *MockClient_DescribeWorkflowExecution_Call) Run(run func(ctx context.Context, workflowID string, runID string)) *MockClient_DescribeWorkflowExecution_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockClient_DescribeWorkflowExecution_Call) Return(_a0 *workflowservice.DescribeWorkflowExecutionResponse, _a1 error) *MockClient_DescribeWorkflowExecution_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_DescribeWorkflowExecution_Call) RunAndReturn(run func(context.Context, string, string) (*workflowservice.DescribeWorkflowExecutionResponse, error)) *MockClient_DescribeWorkflowExecution_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteWorkflow provides a mock function with given fields: ctx, options, workflow, args +func (_m *MockClient) ExecuteWorkflow(ctx context.Context, options client.StartWorkflowOptions, workflow interface{}, args ...interface{}) (client.WorkflowRun, error) { + var _ca []interface{} + _ca = append(_ca, ctx, options, workflow) + _ca = append(_ca, args...) + ret := _m.Called(_ca...) + + var r0 client.WorkflowRun + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, client.StartWorkflowOptions, interface{}, ...interface{}) (client.WorkflowRun, error)); ok { + return rf(ctx, options, workflow, args...) + } + if rf, ok := ret.Get(0).(func(context.Context, client.StartWorkflowOptions, interface{}, ...interface{}) client.WorkflowRun); ok { + r0 = rf(ctx, options, workflow, args...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.WorkflowRun) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, client.StartWorkflowOptions, interface{}, ...interface{}) error); ok { + r1 = rf(ctx, options, workflow, args...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_ExecuteWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteWorkflow' +type MockClient_ExecuteWorkflow_Call struct { + *mock.Call +} + +// ExecuteWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - options client.StartWorkflowOptions +// - workflow interface{} +// - args ...interface{} +func (_e *MockClient_Expecter) ExecuteWorkflow(ctx interface{}, options interface{}, workflow interface{}, args ...interface{}) *MockClient_ExecuteWorkflow_Call { + return &MockClient_ExecuteWorkflow_Call{Call: _e.mock.On("ExecuteWorkflow", + append([]interface{}{ctx, options, workflow}, args...)...)} +} + +func (_c *MockClient_ExecuteWorkflow_Call) Run(run func(ctx context.Context, options client.StartWorkflowOptions, workflow interface{}, args ...interface{})) *MockClient_ExecuteWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(client.StartWorkflowOptions), args[2].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *MockClient_ExecuteWorkflow_Call) Return(_a0 client.WorkflowRun, _a1 error) *MockClient_ExecuteWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_ExecuteWorkflow_Call) RunAndReturn(run func(context.Context, client.StartWorkflowOptions, interface{}, ...interface{}) (client.WorkflowRun, error)) *MockClient_ExecuteWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// GetSearchAttributes provides a mock function with given fields: ctx +func (_m *MockClient) GetSearchAttributes(ctx context.Context) (*workflowservice.GetSearchAttributesResponse, error) { + ret := _m.Called(ctx) + + var r0 *workflowservice.GetSearchAttributesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*workflowservice.GetSearchAttributesResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *workflowservice.GetSearchAttributesResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.GetSearchAttributesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_GetSearchAttributes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSearchAttributes' +type MockClient_GetSearchAttributes_Call struct { + *mock.Call +} + +// GetSearchAttributes is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockClient_Expecter) GetSearchAttributes(ctx interface{}) *MockClient_GetSearchAttributes_Call { + return &MockClient_GetSearchAttributes_Call{Call: _e.mock.On("GetSearchAttributes", ctx)} +} + +func (_c *MockClient_GetSearchAttributes_Call) Run(run func(ctx context.Context)) *MockClient_GetSearchAttributes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockClient_GetSearchAttributes_Call) Return(_a0 *workflowservice.GetSearchAttributesResponse, _a1 error) *MockClient_GetSearchAttributes_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_GetSearchAttributes_Call) RunAndReturn(run func(context.Context) (*workflowservice.GetSearchAttributesResponse, error)) *MockClient_GetSearchAttributes_Call { + _c.Call.Return(run) + return _c +} + +// GetWorkerBuildIdCompatibility provides a mock function with given fields: ctx, options +func (_m *MockClient) GetWorkerBuildIdCompatibility(ctx context.Context, options *client.GetWorkerBuildIdCompatibilityOptions) (*client.WorkerBuildIDVersionSets, error) { + ret := _m.Called(ctx, options) + + var r0 *client.WorkerBuildIDVersionSets + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *client.GetWorkerBuildIdCompatibilityOptions) (*client.WorkerBuildIDVersionSets, error)); ok { + return rf(ctx, options) + } + if rf, ok := ret.Get(0).(func(context.Context, *client.GetWorkerBuildIdCompatibilityOptions) *client.WorkerBuildIDVersionSets); ok { + r0 = rf(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*client.WorkerBuildIDVersionSets) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *client.GetWorkerBuildIdCompatibilityOptions) error); ok { + r1 = rf(ctx, options) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_GetWorkerBuildIdCompatibility_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkerBuildIdCompatibility' +type MockClient_GetWorkerBuildIdCompatibility_Call struct { + *mock.Call +} + +// GetWorkerBuildIdCompatibility is a helper method to define mock.On call +// - ctx context.Context +// - options *client.GetWorkerBuildIdCompatibilityOptions +func (_e *MockClient_Expecter) GetWorkerBuildIdCompatibility(ctx interface{}, options interface{}) *MockClient_GetWorkerBuildIdCompatibility_Call { + return &MockClient_GetWorkerBuildIdCompatibility_Call{Call: _e.mock.On("GetWorkerBuildIdCompatibility", ctx, options)} +} + +func (_c *MockClient_GetWorkerBuildIdCompatibility_Call) Run(run func(ctx context.Context, options *client.GetWorkerBuildIdCompatibilityOptions)) *MockClient_GetWorkerBuildIdCompatibility_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*client.GetWorkerBuildIdCompatibilityOptions)) + }) + return _c +} + +func (_c *MockClient_GetWorkerBuildIdCompatibility_Call) Return(_a0 *client.WorkerBuildIDVersionSets, _a1 error) *MockClient_GetWorkerBuildIdCompatibility_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_GetWorkerBuildIdCompatibility_Call) RunAndReturn(run func(context.Context, *client.GetWorkerBuildIdCompatibilityOptions) (*client.WorkerBuildIDVersionSets, error)) *MockClient_GetWorkerBuildIdCompatibility_Call { + _c.Call.Return(run) + return _c +} + +// GetWorkflow provides a mock function with given fields: ctx, workflowID, runID +func (_m *MockClient) GetWorkflow(ctx context.Context, workflowID string, runID string) client.WorkflowRun { + ret := _m.Called(ctx, workflowID, runID) + + var r0 client.WorkflowRun + if rf, ok := ret.Get(0).(func(context.Context, string, string) client.WorkflowRun); ok { + r0 = rf(ctx, workflowID, runID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.WorkflowRun) + } + } + + return r0 +} + +// MockClient_GetWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkflow' +type MockClient_GetWorkflow_Call struct { + *mock.Call +} + +// GetWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - runID string +func (_e *MockClient_Expecter) GetWorkflow(ctx interface{}, workflowID interface{}, runID interface{}) *MockClient_GetWorkflow_Call { + return &MockClient_GetWorkflow_Call{Call: _e.mock.On("GetWorkflow", ctx, workflowID, runID)} +} + +func (_c *MockClient_GetWorkflow_Call) Run(run func(ctx context.Context, workflowID string, runID string)) *MockClient_GetWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockClient_GetWorkflow_Call) Return(_a0 client.WorkflowRun) *MockClient_GetWorkflow_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_GetWorkflow_Call) RunAndReturn(run func(context.Context, string, string) client.WorkflowRun) *MockClient_GetWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// GetWorkflowHistory provides a mock function with given fields: ctx, workflowID, runID, isLongPoll, filterType +func (_m *MockClient) GetWorkflowHistory(ctx context.Context, workflowID string, runID string, isLongPoll bool, filterType enums.HistoryEventFilterType) client.HistoryEventIterator { + ret := _m.Called(ctx, workflowID, runID, isLongPoll, filterType) + + var r0 client.HistoryEventIterator + if rf, ok := ret.Get(0).(func(context.Context, string, string, bool, enums.HistoryEventFilterType) client.HistoryEventIterator); ok { + r0 = rf(ctx, workflowID, runID, isLongPoll, filterType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.HistoryEventIterator) + } + } + + return r0 +} + +// MockClient_GetWorkflowHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkflowHistory' +type MockClient_GetWorkflowHistory_Call struct { + *mock.Call +} + +// GetWorkflowHistory is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - runID string +// - isLongPoll bool +// - filterType enums.HistoryEventFilterType +func (_e *MockClient_Expecter) GetWorkflowHistory(ctx interface{}, workflowID interface{}, runID interface{}, isLongPoll interface{}, filterType interface{}) *MockClient_GetWorkflowHistory_Call { + return &MockClient_GetWorkflowHistory_Call{Call: _e.mock.On("GetWorkflowHistory", ctx, workflowID, runID, isLongPoll, filterType)} +} + +func (_c *MockClient_GetWorkflowHistory_Call) Run(run func(ctx context.Context, workflowID string, runID string, isLongPoll bool, filterType enums.HistoryEventFilterType)) *MockClient_GetWorkflowHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(bool), args[4].(enums.HistoryEventFilterType)) + }) + return _c +} + +func (_c *MockClient_GetWorkflowHistory_Call) Return(_a0 client.HistoryEventIterator) *MockClient_GetWorkflowHistory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_GetWorkflowHistory_Call) RunAndReturn(run func(context.Context, string, string, bool, enums.HistoryEventFilterType) client.HistoryEventIterator) *MockClient_GetWorkflowHistory_Call { + _c.Call.Return(run) + return _c +} + +// GetWorkflowUpdateHandle provides a mock function with given fields: ref +func (_m *MockClient) GetWorkflowUpdateHandle(ref client.GetWorkflowUpdateHandleOptions) client.WorkflowUpdateHandle { + ret := _m.Called(ref) + + var r0 client.WorkflowUpdateHandle + if rf, ok := ret.Get(0).(func(client.GetWorkflowUpdateHandleOptions) client.WorkflowUpdateHandle); ok { + r0 = rf(ref) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.WorkflowUpdateHandle) + } + } + + return r0 +} + +// MockClient_GetWorkflowUpdateHandle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkflowUpdateHandle' +type MockClient_GetWorkflowUpdateHandle_Call struct { + *mock.Call +} + +// GetWorkflowUpdateHandle is a helper method to define mock.On call +// - ref client.GetWorkflowUpdateHandleOptions +func (_e *MockClient_Expecter) GetWorkflowUpdateHandle(ref interface{}) *MockClient_GetWorkflowUpdateHandle_Call { + return &MockClient_GetWorkflowUpdateHandle_Call{Call: _e.mock.On("GetWorkflowUpdateHandle", ref)} +} + +func (_c *MockClient_GetWorkflowUpdateHandle_Call) Run(run func(ref client.GetWorkflowUpdateHandleOptions)) *MockClient_GetWorkflowUpdateHandle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(client.GetWorkflowUpdateHandleOptions)) + }) + return _c +} + +func (_c *MockClient_GetWorkflowUpdateHandle_Call) Return(_a0 client.WorkflowUpdateHandle) *MockClient_GetWorkflowUpdateHandle_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_GetWorkflowUpdateHandle_Call) RunAndReturn(run func(client.GetWorkflowUpdateHandleOptions) client.WorkflowUpdateHandle) *MockClient_GetWorkflowUpdateHandle_Call { + _c.Call.Return(run) + return _c +} + +// ListArchivedWorkflow provides a mock function with given fields: ctx, request +func (_m *MockClient) ListArchivedWorkflow(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *workflowservice.ListArchivedWorkflowExecutionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListArchivedWorkflowExecutionsRequest) *workflowservice.ListArchivedWorkflowExecutionsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.ListArchivedWorkflowExecutionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListArchivedWorkflowExecutionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_ListArchivedWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListArchivedWorkflow' +type MockClient_ListArchivedWorkflow_Call struct { + *mock.Call +} + +// ListArchivedWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - request *workflowservice.ListArchivedWorkflowExecutionsRequest +func (_e *MockClient_Expecter) ListArchivedWorkflow(ctx interface{}, request interface{}) *MockClient_ListArchivedWorkflow_Call { + return &MockClient_ListArchivedWorkflow_Call{Call: _e.mock.On("ListArchivedWorkflow", ctx, request)} +} + +func (_c *MockClient_ListArchivedWorkflow_Call) Run(run func(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest)) *MockClient_ListArchivedWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*workflowservice.ListArchivedWorkflowExecutionsRequest)) + }) + return _c +} + +func (_c *MockClient_ListArchivedWorkflow_Call) Return(_a0 *workflowservice.ListArchivedWorkflowExecutionsResponse, _a1 error) *MockClient_ListArchivedWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_ListArchivedWorkflow_Call) RunAndReturn(run func(context.Context, *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error)) *MockClient_ListArchivedWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// ListClosedWorkflow provides a mock function with given fields: ctx, request +func (_m *MockClient) ListClosedWorkflow(ctx context.Context, request *workflowservice.ListClosedWorkflowExecutionsRequest) (*workflowservice.ListClosedWorkflowExecutionsResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *workflowservice.ListClosedWorkflowExecutionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListClosedWorkflowExecutionsRequest) (*workflowservice.ListClosedWorkflowExecutionsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListClosedWorkflowExecutionsRequest) *workflowservice.ListClosedWorkflowExecutionsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.ListClosedWorkflowExecutionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListClosedWorkflowExecutionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_ListClosedWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListClosedWorkflow' +type MockClient_ListClosedWorkflow_Call struct { + *mock.Call +} + +// ListClosedWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - request *workflowservice.ListClosedWorkflowExecutionsRequest +func (_e *MockClient_Expecter) ListClosedWorkflow(ctx interface{}, request interface{}) *MockClient_ListClosedWorkflow_Call { + return &MockClient_ListClosedWorkflow_Call{Call: _e.mock.On("ListClosedWorkflow", ctx, request)} +} + +func (_c *MockClient_ListClosedWorkflow_Call) Run(run func(ctx context.Context, request *workflowservice.ListClosedWorkflowExecutionsRequest)) *MockClient_ListClosedWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*workflowservice.ListClosedWorkflowExecutionsRequest)) + }) + return _c +} + +func (_c *MockClient_ListClosedWorkflow_Call) Return(_a0 *workflowservice.ListClosedWorkflowExecutionsResponse, _a1 error) *MockClient_ListClosedWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_ListClosedWorkflow_Call) RunAndReturn(run func(context.Context, *workflowservice.ListClosedWorkflowExecutionsRequest) (*workflowservice.ListClosedWorkflowExecutionsResponse, error)) *MockClient_ListClosedWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// ListOpenWorkflow provides a mock function with given fields: ctx, request +func (_m *MockClient) ListOpenWorkflow(ctx context.Context, request *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *workflowservice.ListOpenWorkflowExecutionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListOpenWorkflowExecutionsRequest) *workflowservice.ListOpenWorkflowExecutionsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.ListOpenWorkflowExecutionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListOpenWorkflowExecutionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_ListOpenWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListOpenWorkflow' +type MockClient_ListOpenWorkflow_Call struct { + *mock.Call +} + +// ListOpenWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - request *workflowservice.ListOpenWorkflowExecutionsRequest +func (_e *MockClient_Expecter) ListOpenWorkflow(ctx interface{}, request interface{}) *MockClient_ListOpenWorkflow_Call { + return &MockClient_ListOpenWorkflow_Call{Call: _e.mock.On("ListOpenWorkflow", ctx, request)} +} + +func (_c *MockClient_ListOpenWorkflow_Call) Run(run func(ctx context.Context, request *workflowservice.ListOpenWorkflowExecutionsRequest)) *MockClient_ListOpenWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*workflowservice.ListOpenWorkflowExecutionsRequest)) + }) + return _c +} + +func (_c *MockClient_ListOpenWorkflow_Call) Return(_a0 *workflowservice.ListOpenWorkflowExecutionsResponse, _a1 error) *MockClient_ListOpenWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_ListOpenWorkflow_Call) RunAndReturn(run func(context.Context, *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error)) *MockClient_ListOpenWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// ListWorkflow provides a mock function with given fields: ctx, request +func (_m *MockClient) ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *workflowservice.ListWorkflowExecutionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ListWorkflowExecutionsRequest) *workflowservice.ListWorkflowExecutionsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.ListWorkflowExecutionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ListWorkflowExecutionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_ListWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListWorkflow' +type MockClient_ListWorkflow_Call struct { + *mock.Call +} + +// ListWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - request *workflowservice.ListWorkflowExecutionsRequest +func (_e *MockClient_Expecter) ListWorkflow(ctx interface{}, request interface{}) *MockClient_ListWorkflow_Call { + return &MockClient_ListWorkflow_Call{Call: _e.mock.On("ListWorkflow", ctx, request)} +} + +func (_c *MockClient_ListWorkflow_Call) Run(run func(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest)) *MockClient_ListWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*workflowservice.ListWorkflowExecutionsRequest)) + }) + return _c +} + +func (_c *MockClient_ListWorkflow_Call) Return(_a0 *workflowservice.ListWorkflowExecutionsResponse, _a1 error) *MockClient_ListWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_ListWorkflow_Call) RunAndReturn(run func(context.Context, *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error)) *MockClient_ListWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// OperatorService provides a mock function with given fields: +func (_m *MockClient) OperatorService() operatorservice.OperatorServiceClient { + ret := _m.Called() + + var r0 operatorservice.OperatorServiceClient + if rf, ok := ret.Get(0).(func() operatorservice.OperatorServiceClient); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(operatorservice.OperatorServiceClient) + } + } + + return r0 +} + +// MockClient_OperatorService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OperatorService' +type MockClient_OperatorService_Call struct { + *mock.Call +} + +// OperatorService is a helper method to define mock.On call +func (_e *MockClient_Expecter) OperatorService() *MockClient_OperatorService_Call { + return &MockClient_OperatorService_Call{Call: _e.mock.On("OperatorService")} +} + +func (_c *MockClient_OperatorService_Call) Run(run func()) *MockClient_OperatorService_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_OperatorService_Call) Return(_a0 operatorservice.OperatorServiceClient) *MockClient_OperatorService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_OperatorService_Call) RunAndReturn(run func() operatorservice.OperatorServiceClient) *MockClient_OperatorService_Call { + _c.Call.Return(run) + return _c +} + +// QueryWorkflow provides a mock function with given fields: ctx, workflowID, runID, queryType, args +func (_m *MockClient) QueryWorkflow(ctx context.Context, workflowID string, runID string, queryType string, args ...interface{}) (converter.EncodedValue, error) { + var _ca []interface{} + _ca = append(_ca, ctx, workflowID, runID, queryType) + _ca = append(_ca, args...) + ret := _m.Called(_ca...) + + var r0 converter.EncodedValue + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) (converter.EncodedValue, error)); ok { + return rf(ctx, workflowID, runID, queryType, args...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) converter.EncodedValue); ok { + r0 = rf(ctx, workflowID, runID, queryType, args...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(converter.EncodedValue) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...interface{}) error); ok { + r1 = rf(ctx, workflowID, runID, queryType, args...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_QueryWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryWorkflow' +type MockClient_QueryWorkflow_Call struct { + *mock.Call +} + +// QueryWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - runID string +// - queryType string +// - args ...interface{} +func (_e *MockClient_Expecter) QueryWorkflow(ctx interface{}, workflowID interface{}, runID interface{}, queryType interface{}, args ...interface{}) *MockClient_QueryWorkflow_Call { + return &MockClient_QueryWorkflow_Call{Call: _e.mock.On("QueryWorkflow", + append([]interface{}{ctx, workflowID, runID, queryType}, args...)...)} +} + +func (_c *MockClient_QueryWorkflow_Call) Run(run func(ctx context.Context, workflowID string, runID string, queryType string, args ...interface{})) *MockClient_QueryWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-4) + for i, a := range args[4:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockClient_QueryWorkflow_Call) Return(_a0 converter.EncodedValue, _a1 error) *MockClient_QueryWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_QueryWorkflow_Call) RunAndReturn(run func(context.Context, string, string, string, ...interface{}) (converter.EncodedValue, error)) *MockClient_QueryWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// QueryWorkflowWithOptions provides a mock function with given fields: ctx, request +func (_m *MockClient) QueryWorkflowWithOptions(ctx context.Context, request *client.QueryWorkflowWithOptionsRequest) (*client.QueryWorkflowWithOptionsResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *client.QueryWorkflowWithOptionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *client.QueryWorkflowWithOptionsRequest) (*client.QueryWorkflowWithOptionsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *client.QueryWorkflowWithOptionsRequest) *client.QueryWorkflowWithOptionsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*client.QueryWorkflowWithOptionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *client.QueryWorkflowWithOptionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_QueryWorkflowWithOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryWorkflowWithOptions' +type MockClient_QueryWorkflowWithOptions_Call struct { + *mock.Call +} + +// QueryWorkflowWithOptions is a helper method to define mock.On call +// - ctx context.Context +// - request *client.QueryWorkflowWithOptionsRequest +func (_e *MockClient_Expecter) QueryWorkflowWithOptions(ctx interface{}, request interface{}) *MockClient_QueryWorkflowWithOptions_Call { + return &MockClient_QueryWorkflowWithOptions_Call{Call: _e.mock.On("QueryWorkflowWithOptions", ctx, request)} +} + +func (_c *MockClient_QueryWorkflowWithOptions_Call) Run(run func(ctx context.Context, request *client.QueryWorkflowWithOptionsRequest)) *MockClient_QueryWorkflowWithOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*client.QueryWorkflowWithOptionsRequest)) + }) + return _c +} + +func (_c *MockClient_QueryWorkflowWithOptions_Call) Return(_a0 *client.QueryWorkflowWithOptionsResponse, _a1 error) *MockClient_QueryWorkflowWithOptions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_QueryWorkflowWithOptions_Call) RunAndReturn(run func(context.Context, *client.QueryWorkflowWithOptionsRequest) (*client.QueryWorkflowWithOptionsResponse, error)) *MockClient_QueryWorkflowWithOptions_Call { + _c.Call.Return(run) + return _c +} + +// RecordActivityHeartbeat provides a mock function with given fields: ctx, taskToken, details +func (_m *MockClient) RecordActivityHeartbeat(ctx context.Context, taskToken []byte, details ...interface{}) error { + var _ca []interface{} + _ca = append(_ca, ctx, taskToken) + _ca = append(_ca, details...) + ret := _m.Called(_ca...) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, ...interface{}) error); ok { + r0 = rf(ctx, taskToken, details...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_RecordActivityHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RecordActivityHeartbeat' +type MockClient_RecordActivityHeartbeat_Call struct { + *mock.Call +} + +// RecordActivityHeartbeat is a helper method to define mock.On call +// - ctx context.Context +// - taskToken []byte +// - details ...interface{} +func (_e *MockClient_Expecter) RecordActivityHeartbeat(ctx interface{}, taskToken interface{}, details ...interface{}) *MockClient_RecordActivityHeartbeat_Call { + return &MockClient_RecordActivityHeartbeat_Call{Call: _e.mock.On("RecordActivityHeartbeat", + append([]interface{}{ctx, taskToken}, details...)...)} +} + +func (_c *MockClient_RecordActivityHeartbeat_Call) Run(run func(ctx context.Context, taskToken []byte, details ...interface{})) *MockClient_RecordActivityHeartbeat_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].([]byte), variadicArgs...) + }) + return _c +} + +func (_c *MockClient_RecordActivityHeartbeat_Call) Return(_a0 error) *MockClient_RecordActivityHeartbeat_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_RecordActivityHeartbeat_Call) RunAndReturn(run func(context.Context, []byte, ...interface{}) error) *MockClient_RecordActivityHeartbeat_Call { + _c.Call.Return(run) + return _c +} + +// RecordActivityHeartbeatByID provides a mock function with given fields: ctx, namespace, workflowID, runID, activityID, details +func (_m *MockClient) RecordActivityHeartbeatByID(ctx context.Context, namespace string, workflowID string, runID string, activityID string, details ...interface{}) error { + var _ca []interface{} + _ca = append(_ca, ctx, namespace, workflowID, runID, activityID) + _ca = append(_ca, details...) + ret := _m.Called(_ca...) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...interface{}) error); ok { + r0 = rf(ctx, namespace, workflowID, runID, activityID, details...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_RecordActivityHeartbeatByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RecordActivityHeartbeatByID' +type MockClient_RecordActivityHeartbeatByID_Call struct { + *mock.Call +} + +// RecordActivityHeartbeatByID is a helper method to define mock.On call +// - ctx context.Context +// - namespace string +// - workflowID string +// - runID string +// - activityID string +// - details ...interface{} +func (_e *MockClient_Expecter) RecordActivityHeartbeatByID(ctx interface{}, namespace interface{}, workflowID interface{}, runID interface{}, activityID interface{}, details ...interface{}) *MockClient_RecordActivityHeartbeatByID_Call { + return &MockClient_RecordActivityHeartbeatByID_Call{Call: _e.mock.On("RecordActivityHeartbeatByID", + append([]interface{}{ctx, namespace, workflowID, runID, activityID}, details...)...)} +} + +func (_c *MockClient_RecordActivityHeartbeatByID_Call) Run(run func(ctx context.Context, namespace string, workflowID string, runID string, activityID string, details ...interface{})) *MockClient_RecordActivityHeartbeatByID_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-5) + for i, a := range args[5:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockClient_RecordActivityHeartbeatByID_Call) Return(_a0 error) *MockClient_RecordActivityHeartbeatByID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_RecordActivityHeartbeatByID_Call) RunAndReturn(run func(context.Context, string, string, string, string, ...interface{}) error) *MockClient_RecordActivityHeartbeatByID_Call { + _c.Call.Return(run) + return _c +} + +// ResetWorkflowExecution provides a mock function with given fields: ctx, request +func (_m *MockClient) ResetWorkflowExecution(ctx context.Context, request *workflowservice.ResetWorkflowExecutionRequest) (*workflowservice.ResetWorkflowExecutionResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *workflowservice.ResetWorkflowExecutionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ResetWorkflowExecutionRequest) (*workflowservice.ResetWorkflowExecutionResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ResetWorkflowExecutionRequest) *workflowservice.ResetWorkflowExecutionResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.ResetWorkflowExecutionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ResetWorkflowExecutionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_ResetWorkflowExecution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetWorkflowExecution' +type MockClient_ResetWorkflowExecution_Call struct { + *mock.Call +} + +// ResetWorkflowExecution is a helper method to define mock.On call +// - ctx context.Context +// - request *workflowservice.ResetWorkflowExecutionRequest +func (_e *MockClient_Expecter) ResetWorkflowExecution(ctx interface{}, request interface{}) *MockClient_ResetWorkflowExecution_Call { + return &MockClient_ResetWorkflowExecution_Call{Call: _e.mock.On("ResetWorkflowExecution", ctx, request)} +} + +func (_c *MockClient_ResetWorkflowExecution_Call) Run(run func(ctx context.Context, request *workflowservice.ResetWorkflowExecutionRequest)) *MockClient_ResetWorkflowExecution_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*workflowservice.ResetWorkflowExecutionRequest)) + }) + return _c +} + +func (_c *MockClient_ResetWorkflowExecution_Call) Return(_a0 *workflowservice.ResetWorkflowExecutionResponse, _a1 error) *MockClient_ResetWorkflowExecution_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_ResetWorkflowExecution_Call) RunAndReturn(run func(context.Context, *workflowservice.ResetWorkflowExecutionRequest) (*workflowservice.ResetWorkflowExecutionResponse, error)) *MockClient_ResetWorkflowExecution_Call { + _c.Call.Return(run) + return _c +} + +// ScanWorkflow provides a mock function with given fields: ctx, request +func (_m *MockClient) ScanWorkflow(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error) { + ret := _m.Called(ctx, request) + + var r0 *workflowservice.ScanWorkflowExecutionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *workflowservice.ScanWorkflowExecutionsRequest) *workflowservice.ScanWorkflowExecutionsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*workflowservice.ScanWorkflowExecutionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *workflowservice.ScanWorkflowExecutionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_ScanWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScanWorkflow' +type MockClient_ScanWorkflow_Call struct { + *mock.Call +} + +// ScanWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - request *workflowservice.ScanWorkflowExecutionsRequest +func (_e *MockClient_Expecter) ScanWorkflow(ctx interface{}, request interface{}) *MockClient_ScanWorkflow_Call { + return &MockClient_ScanWorkflow_Call{Call: _e.mock.On("ScanWorkflow", ctx, request)} +} + +func (_c *MockClient_ScanWorkflow_Call) Run(run func(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest)) *MockClient_ScanWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*workflowservice.ScanWorkflowExecutionsRequest)) + }) + return _c +} + +func (_c *MockClient_ScanWorkflow_Call) Return(_a0 *workflowservice.ScanWorkflowExecutionsResponse, _a1 error) *MockClient_ScanWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_ScanWorkflow_Call) RunAndReturn(run func(context.Context, *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error)) *MockClient_ScanWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// ScheduleClient provides a mock function with given fields: +func (_m *MockClient) ScheduleClient() client.ScheduleClient { + ret := _m.Called() + + var r0 client.ScheduleClient + if rf, ok := ret.Get(0).(func() client.ScheduleClient); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.ScheduleClient) + } + } + + return r0 +} + +// MockClient_ScheduleClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScheduleClient' +type MockClient_ScheduleClient_Call struct { + *mock.Call +} + +// ScheduleClient is a helper method to define mock.On call +func (_e *MockClient_Expecter) ScheduleClient() *MockClient_ScheduleClient_Call { + return &MockClient_ScheduleClient_Call{Call: _e.mock.On("ScheduleClient")} +} + +func (_c *MockClient_ScheduleClient_Call) Run(run func()) *MockClient_ScheduleClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_ScheduleClient_Call) Return(_a0 client.ScheduleClient) *MockClient_ScheduleClient_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_ScheduleClient_Call) RunAndReturn(run func() client.ScheduleClient) *MockClient_ScheduleClient_Call { + _c.Call.Return(run) + return _c +} + +// SignalWithStartWorkflow provides a mock function with given fields: ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs +func (_m *MockClient) SignalWithStartWorkflow(ctx context.Context, workflowID string, signalName string, signalArg interface{}, options client.StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (client.WorkflowRun, error) { + var _ca []interface{} + _ca = append(_ca, ctx, workflowID, signalName, signalArg, options, workflow) + _ca = append(_ca, workflowArgs...) + ret := _m.Called(_ca...) + + var r0 client.WorkflowRun + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, client.StartWorkflowOptions, interface{}, ...interface{}) (client.WorkflowRun, error)); ok { + return rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, client.StartWorkflowOptions, interface{}, ...interface{}) client.WorkflowRun); ok { + r0 = rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.WorkflowRun) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, interface{}, client.StartWorkflowOptions, interface{}, ...interface{}) error); ok { + r1 = rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_SignalWithStartWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignalWithStartWorkflow' +type MockClient_SignalWithStartWorkflow_Call struct { + *mock.Call +} + +// SignalWithStartWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - signalName string +// - signalArg interface{} +// - options client.StartWorkflowOptions +// - workflow interface{} +// - workflowArgs ...interface{} +func (_e *MockClient_Expecter) SignalWithStartWorkflow(ctx interface{}, workflowID interface{}, signalName interface{}, signalArg interface{}, options interface{}, workflow interface{}, workflowArgs ...interface{}) *MockClient_SignalWithStartWorkflow_Call { + return &MockClient_SignalWithStartWorkflow_Call{Call: _e.mock.On("SignalWithStartWorkflow", + append([]interface{}{ctx, workflowID, signalName, signalArg, options, workflow}, workflowArgs...)...)} +} + +func (_c *MockClient_SignalWithStartWorkflow_Call) Run(run func(ctx context.Context, workflowID string, signalName string, signalArg interface{}, options client.StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{})) *MockClient_SignalWithStartWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-6) + for i, a := range args[6:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(interface{}), args[4].(client.StartWorkflowOptions), args[5].(interface{}), variadicArgs...) + }) + return _c +} + +func (_c *MockClient_SignalWithStartWorkflow_Call) Return(_a0 client.WorkflowRun, _a1 error) *MockClient_SignalWithStartWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_SignalWithStartWorkflow_Call) RunAndReturn(run func(context.Context, string, string, interface{}, client.StartWorkflowOptions, interface{}, ...interface{}) (client.WorkflowRun, error)) *MockClient_SignalWithStartWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// SignalWorkflow provides a mock function with given fields: ctx, workflowID, runID, signalName, arg +func (_m *MockClient) SignalWorkflow(ctx context.Context, workflowID string, runID string, signalName string, arg interface{}) error { + ret := _m.Called(ctx, workflowID, runID, signalName, arg) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, interface{}) error); ok { + r0 = rf(ctx, workflowID, runID, signalName, arg) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_SignalWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignalWorkflow' +type MockClient_SignalWorkflow_Call struct { + *mock.Call +} + +// SignalWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - runID string +// - signalName string +// - arg interface{} +func (_e *MockClient_Expecter) SignalWorkflow(ctx interface{}, workflowID interface{}, runID interface{}, signalName interface{}, arg interface{}) *MockClient_SignalWorkflow_Call { + return &MockClient_SignalWorkflow_Call{Call: _e.mock.On("SignalWorkflow", ctx, workflowID, runID, signalName, arg)} +} + +func (_c *MockClient_SignalWorkflow_Call) Run(run func(ctx context.Context, workflowID string, runID string, signalName string, arg interface{})) *MockClient_SignalWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(interface{})) + }) + return _c +} + +func (_c *MockClient_SignalWorkflow_Call) Return(_a0 error) *MockClient_SignalWorkflow_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_SignalWorkflow_Call) RunAndReturn(run func(context.Context, string, string, string, interface{}) error) *MockClient_SignalWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// TerminateWorkflow provides a mock function with given fields: ctx, workflowID, runID, reason, details +func (_m *MockClient) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error { + var _ca []interface{} + _ca = append(_ca, ctx, workflowID, runID, reason) + _ca = append(_ca, details...) + ret := _m.Called(_ca...) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) error); ok { + r0 = rf(ctx, workflowID, runID, reason, details...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_TerminateWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TerminateWorkflow' +type MockClient_TerminateWorkflow_Call struct { + *mock.Call +} + +// TerminateWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - runID string +// - reason string +// - details ...interface{} +func (_e *MockClient_Expecter) TerminateWorkflow(ctx interface{}, workflowID interface{}, runID interface{}, reason interface{}, details ...interface{}) *MockClient_TerminateWorkflow_Call { + return &MockClient_TerminateWorkflow_Call{Call: _e.mock.On("TerminateWorkflow", + append([]interface{}{ctx, workflowID, runID, reason}, details...)...)} +} + +func (_c *MockClient_TerminateWorkflow_Call) Run(run func(ctx context.Context, workflowID string, runID string, reason string, details ...interface{})) *MockClient_TerminateWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-4) + for i, a := range args[4:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockClient_TerminateWorkflow_Call) Return(_a0 error) *MockClient_TerminateWorkflow_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_TerminateWorkflow_Call) RunAndReturn(run func(context.Context, string, string, string, ...interface{}) error) *MockClient_TerminateWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// UpdateWorkerBuildIdCompatibility provides a mock function with given fields: ctx, options +func (_m *MockClient) UpdateWorkerBuildIdCompatibility(ctx context.Context, options *client.UpdateWorkerBuildIdCompatibilityOptions) error { + ret := _m.Called(ctx, options) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *client.UpdateWorkerBuildIdCompatibilityOptions) error); ok { + r0 = rf(ctx, options) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClient_UpdateWorkerBuildIdCompatibility_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateWorkerBuildIdCompatibility' +type MockClient_UpdateWorkerBuildIdCompatibility_Call struct { + *mock.Call +} + +// UpdateWorkerBuildIdCompatibility is a helper method to define mock.On call +// - ctx context.Context +// - options *client.UpdateWorkerBuildIdCompatibilityOptions +func (_e *MockClient_Expecter) UpdateWorkerBuildIdCompatibility(ctx interface{}, options interface{}) *MockClient_UpdateWorkerBuildIdCompatibility_Call { + return &MockClient_UpdateWorkerBuildIdCompatibility_Call{Call: _e.mock.On("UpdateWorkerBuildIdCompatibility", ctx, options)} +} + +func (_c *MockClient_UpdateWorkerBuildIdCompatibility_Call) Run(run func(ctx context.Context, options *client.UpdateWorkerBuildIdCompatibilityOptions)) *MockClient_UpdateWorkerBuildIdCompatibility_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*client.UpdateWorkerBuildIdCompatibilityOptions)) + }) + return _c +} + +func (_c *MockClient_UpdateWorkerBuildIdCompatibility_Call) Return(_a0 error) *MockClient_UpdateWorkerBuildIdCompatibility_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_UpdateWorkerBuildIdCompatibility_Call) RunAndReturn(run func(context.Context, *client.UpdateWorkerBuildIdCompatibilityOptions) error) *MockClient_UpdateWorkerBuildIdCompatibility_Call { + _c.Call.Return(run) + return _c +} + +// UpdateWorkflow provides a mock function with given fields: ctx, workflowID, workflowRunID, updateName, args +func (_m *MockClient) UpdateWorkflow(ctx context.Context, workflowID string, workflowRunID string, updateName string, args ...interface{}) (client.WorkflowUpdateHandle, error) { + var _ca []interface{} + _ca = append(_ca, ctx, workflowID, workflowRunID, updateName) + _ca = append(_ca, args...) + ret := _m.Called(_ca...) + + var r0 client.WorkflowUpdateHandle + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) (client.WorkflowUpdateHandle, error)); ok { + return rf(ctx, workflowID, workflowRunID, updateName, args...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) client.WorkflowUpdateHandle); ok { + r0 = rf(ctx, workflowID, workflowRunID, updateName, args...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.WorkflowUpdateHandle) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...interface{}) error); ok { + r1 = rf(ctx, workflowID, workflowRunID, updateName, args...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_UpdateWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateWorkflow' +type MockClient_UpdateWorkflow_Call struct { + *mock.Call +} + +// UpdateWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - workflowID string +// - workflowRunID string +// - updateName string +// - args ...interface{} +func (_e *MockClient_Expecter) UpdateWorkflow(ctx interface{}, workflowID interface{}, workflowRunID interface{}, updateName interface{}, args ...interface{}) *MockClient_UpdateWorkflow_Call { + return &MockClient_UpdateWorkflow_Call{Call: _e.mock.On("UpdateWorkflow", + append([]interface{}{ctx, workflowID, workflowRunID, updateName}, args...)...)} +} + +func (_c *MockClient_UpdateWorkflow_Call) Run(run func(ctx context.Context, workflowID string, workflowRunID string, updateName string, args ...interface{})) *MockClient_UpdateWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-4) + for i, a := range args[4:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockClient_UpdateWorkflow_Call) Return(_a0 client.WorkflowUpdateHandle, _a1 error) *MockClient_UpdateWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_UpdateWorkflow_Call) RunAndReturn(run func(context.Context, string, string, string, ...interface{}) (client.WorkflowUpdateHandle, error)) *MockClient_UpdateWorkflow_Call { + _c.Call.Return(run) + return _c +} + +// UpdateWorkflowWithOptions provides a mock function with given fields: ctx, request +func (_m *MockClient) UpdateWorkflowWithOptions(ctx context.Context, request *client.UpdateWorkflowWithOptionsRequest) (client.WorkflowUpdateHandle, error) { + ret := _m.Called(ctx, request) + + var r0 client.WorkflowUpdateHandle + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *client.UpdateWorkflowWithOptionsRequest) (client.WorkflowUpdateHandle, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, *client.UpdateWorkflowWithOptionsRequest) client.WorkflowUpdateHandle); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(client.WorkflowUpdateHandle) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *client.UpdateWorkflowWithOptionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClient_UpdateWorkflowWithOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateWorkflowWithOptions' +type MockClient_UpdateWorkflowWithOptions_Call struct { + *mock.Call +} + +// UpdateWorkflowWithOptions is a helper method to define mock.On call +// - ctx context.Context +// - request *client.UpdateWorkflowWithOptionsRequest +func (_e *MockClient_Expecter) UpdateWorkflowWithOptions(ctx interface{}, request interface{}) *MockClient_UpdateWorkflowWithOptions_Call { + return &MockClient_UpdateWorkflowWithOptions_Call{Call: _e.mock.On("UpdateWorkflowWithOptions", ctx, request)} +} + +func (_c *MockClient_UpdateWorkflowWithOptions_Call) Run(run func(ctx context.Context, request *client.UpdateWorkflowWithOptionsRequest)) *MockClient_UpdateWorkflowWithOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*client.UpdateWorkflowWithOptionsRequest)) + }) + return _c +} + +func (_c *MockClient_UpdateWorkflowWithOptions_Call) Return(_a0 client.WorkflowUpdateHandle, _a1 error) *MockClient_UpdateWorkflowWithOptions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClient_UpdateWorkflowWithOptions_Call) RunAndReturn(run func(context.Context, *client.UpdateWorkflowWithOptionsRequest) (client.WorkflowUpdateHandle, error)) *MockClient_UpdateWorkflowWithOptions_Call { + _c.Call.Return(run) + return _c +} + +// WorkflowService provides a mock function with given fields: +func (_m *MockClient) WorkflowService() workflowservice.WorkflowServiceClient { + ret := _m.Called() + + var r0 workflowservice.WorkflowServiceClient + if rf, ok := ret.Get(0).(func() workflowservice.WorkflowServiceClient); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(workflowservice.WorkflowServiceClient) + } + } + + return r0 +} + +// MockClient_WorkflowService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorkflowService' +type MockClient_WorkflowService_Call struct { + *mock.Call +} + +// WorkflowService is a helper method to define mock.On call +func (_e *MockClient_Expecter) WorkflowService() *MockClient_WorkflowService_Call { + return &MockClient_WorkflowService_Call{Call: _e.mock.On("WorkflowService")} +} + +func (_c *MockClient_WorkflowService_Call) Run(run func()) *MockClient_WorkflowService_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_WorkflowService_Call) Return(_a0 workflowservice.WorkflowServiceClient) *MockClient_WorkflowService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClient_WorkflowService_Call) RunAndReturn(run func() workflowservice.WorkflowServiceClient) *MockClient_WorkflowService_Call { + _c.Call.Return(run) + return _c +} + +// NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MockClient { + mock := &MockClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go b/mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go new file mode 100644 index 00000000..52f37b80 --- /dev/null +++ b/mocks/go.temporal.io/sdk/clientutils/mock_WorkflowRun.go @@ -0,0 +1,206 @@ +// Code generated by mockery v2.36.0. DO NOT EDIT. + +package clientutils + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + internal "go.temporal.io/sdk/client" +) + +// MockWorkflowRun is an autogenerated mock type for the WorkflowRun type +type MockWorkflowRun struct { + mock.Mock +} + +type MockWorkflowRun_Expecter struct { + mock *mock.Mock +} + +func (_m *MockWorkflowRun) EXPECT() *MockWorkflowRun_Expecter { + return &MockWorkflowRun_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: ctx, valuePtr +func (_m *MockWorkflowRun) Get(ctx context.Context, valuePtr interface{}) error { + ret := _m.Called(ctx, valuePtr) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, interface{}) error); ok { + r0 = rf(ctx, valuePtr) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockWorkflowRun_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockWorkflowRun_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - valuePtr interface{} +func (_e *MockWorkflowRun_Expecter) Get(ctx interface{}, valuePtr interface{}) *MockWorkflowRun_Get_Call { + return &MockWorkflowRun_Get_Call{Call: _e.mock.On("Get", ctx, valuePtr)} +} + +func (_c *MockWorkflowRun_Get_Call) Run(run func(ctx context.Context, valuePtr interface{})) *MockWorkflowRun_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{})) + }) + return _c +} + +func (_c *MockWorkflowRun_Get_Call) Return(_a0 error) *MockWorkflowRun_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockWorkflowRun_Get_Call) RunAndReturn(run func(context.Context, interface{}) error) *MockWorkflowRun_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetID provides a mock function with given fields: +func (_m *MockWorkflowRun) GetID() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockWorkflowRun_GetID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetID' +type MockWorkflowRun_GetID_Call struct { + *mock.Call +} + +// GetID is a helper method to define mock.On call +func (_e *MockWorkflowRun_Expecter) GetID() *MockWorkflowRun_GetID_Call { + return &MockWorkflowRun_GetID_Call{Call: _e.mock.On("GetID")} +} + +func (_c *MockWorkflowRun_GetID_Call) Run(run func()) *MockWorkflowRun_GetID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockWorkflowRun_GetID_Call) Return(_a0 string) *MockWorkflowRun_GetID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockWorkflowRun_GetID_Call) RunAndReturn(run func() string) *MockWorkflowRun_GetID_Call { + _c.Call.Return(run) + return _c +} + +// GetRunID provides a mock function with given fields: +func (_m *MockWorkflowRun) GetRunID() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockWorkflowRun_GetRunID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRunID' +type MockWorkflowRun_GetRunID_Call struct { + *mock.Call +} + +// GetRunID is a helper method to define mock.On call +func (_e *MockWorkflowRun_Expecter) GetRunID() *MockWorkflowRun_GetRunID_Call { + return &MockWorkflowRun_GetRunID_Call{Call: _e.mock.On("GetRunID")} +} + +func (_c *MockWorkflowRun_GetRunID_Call) Run(run func()) *MockWorkflowRun_GetRunID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockWorkflowRun_GetRunID_Call) Return(_a0 string) *MockWorkflowRun_GetRunID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockWorkflowRun_GetRunID_Call) RunAndReturn(run func() string) *MockWorkflowRun_GetRunID_Call { + _c.Call.Return(run) + return _c +} + +// GetWithOptions provides a mock function with given fields: ctx, valuePtr, options +func (_m *MockWorkflowRun) GetWithOptions(ctx context.Context, valuePtr interface{}, options internal.WorkflowRunGetOptions) error { + ret := _m.Called(ctx, valuePtr, options) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, interface{}, internal.WorkflowRunGetOptions) error); ok { + r0 = rf(ctx, valuePtr, options) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockWorkflowRun_GetWithOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithOptions' +type MockWorkflowRun_GetWithOptions_Call struct { + *mock.Call +} + +// GetWithOptions is a helper method to define mock.On call +// - ctx context.Context +// - valuePtr interface{} +// - options internal.WorkflowRunGetOptions +func (_e *MockWorkflowRun_Expecter) GetWithOptions(ctx interface{}, valuePtr interface{}, options interface{}) *MockWorkflowRun_GetWithOptions_Call { + return &MockWorkflowRun_GetWithOptions_Call{Call: _e.mock.On("GetWithOptions", ctx, valuePtr, options)} +} + +func (_c *MockWorkflowRun_GetWithOptions_Call) Run(run func(ctx context.Context, valuePtr interface{}, options internal.WorkflowRunGetOptions)) *MockWorkflowRun_GetWithOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{}), args[2].(internal.WorkflowRunGetOptions)) + }) + return _c +} + +func (_c *MockWorkflowRun_GetWithOptions_Call) Return(_a0 error) *MockWorkflowRun_GetWithOptions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockWorkflowRun_GetWithOptions_Call) RunAndReturn(run func(context.Context, interface{}, internal.WorkflowRunGetOptions) error) *MockWorkflowRun_GetWithOptions_Call { + _c.Call.Return(run) + return _c +} + +// NewMockWorkflowRun creates a new instance of MockWorkflowRun. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockWorkflowRun(t interface { + mock.TestingT + Cleanup(func()) +}) *MockWorkflowRun { + mock := &MockWorkflowRun{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}