// Code generated by protoc-gen-go_temporal. DO NOT EDIT.
// versions:
//
//	protoc-gen-go_temporal dev (latest)
//	protoc (unknown)
//
// source: test/opaque/hybrid.proto
package opaque

import (
	"bytes"
	"context"
	"encoding/base64"
	"encoding/json"
	"errors"
	"fmt"
	convert "github.com/cludden/protoc-gen-go-temporal/pkg/convert"
	helpers "github.com/cludden/protoc-gen-go-temporal/pkg/helpers"
	scheme "github.com/cludden/protoc-gen-go-temporal/pkg/scheme"
	gohomedir "github.com/mitchellh/go-homedir"
	v2 "github.com/urfave/cli/v2"
	enumsv1 "go.temporal.io/api/enums/v1"
	client "go.temporal.io/sdk/client"
	converter "go.temporal.io/sdk/converter"
	temporal "go.temporal.io/sdk/temporal"
	testsuite "go.temporal.io/sdk/testsuite"
	worker "go.temporal.io/sdk/worker"
	workflow "go.temporal.io/sdk/workflow"
	protojson "google.golang.org/protobuf/encoding/protojson"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	"log/slog"
	"os"
	"sort"
	"strconv"
	"sync"
	"sync/atomic"
	"time"
)

// HybridTaskQueue is the default task-queue for a test.opaque.Hybrid worker
var HybridTaskQueue = "opaque-hybrid"

// test.opaque.Hybrid workflow names
const (
	PutHybridExampleWorkflowName = "test.opaque.Hybrid.PutHybridExample"
)

// test.opaque.Hybrid signal names
const (
	SignalHybridSignalName = "test.opaque.Hybrid.SignalHybrid"
)

// HybridClient describes a client for a(n) test.opaque.Hybrid worker
type HybridClient interface {
	// PutHybridExample executes a(n) test.opaque.Hybrid.PutHybridExample workflow and blocks until error or response received
	PutHybridExample(ctx context.Context, req *HybridExample, opts ...*PutHybridExampleOptions) (*HybridExample, error)

	// PutHybridExampleAsync starts a(n) test.opaque.Hybrid.PutHybridExample workflow and returns a handle to the workflow run
	PutHybridExampleAsync(ctx context.Context, req *HybridExample, opts ...*PutHybridExampleOptions) (PutHybridExampleRun, error)

	// GetPutHybridExample retrieves a handle to an existing test.opaque.Hybrid.PutHybridExample workflow execution
	GetPutHybridExample(ctx context.Context, workflowID string, runID string) PutHybridExampleRun

	// PutHybridExampleWithSignalHybrid sends a(n) test.opaque.Hybrid.SignalHybrid signal to a(n) test.opaque.Hybrid.PutHybridExample workflow, starting it if necessary, and blocks until workflow completion
	PutHybridExampleWithSignalHybrid(ctx context.Context, req *HybridExample, signal *HybridExample, opts ...*PutHybridExampleOptions) (*HybridExample, error)

	// PutHybridExampleWithSignalHybridAsync sends a(n) test.opaque.Hybrid.SignalHybrid signal to a(n) test.opaque.Hybrid.PutHybridExample workflow, starting it if necessary, and returns a handle to the workflow execution
	PutHybridExampleWithSignalHybridAsync(ctx context.Context, req *HybridExample, signal *HybridExample, opts ...*PutHybridExampleOptions) (PutHybridExampleRun, error)

	// CancelWorkflow requests cancellation of an existing workflow execution
	CancelWorkflow(ctx context.Context, workflowID string, runID string) error

	// TerminateWorkflow an existing workflow execution
	TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error

	// test.opaque.Hybrid.SignalHybrid sends a(n) test.opaque.Hybrid.SignalHybrid signal
	SignalHybrid(ctx context.Context, workflowID string, runID string, signal *HybridExample) error
}

// hybridClient implements a temporal client for a test.opaque.Hybrid service
type hybridClient struct {
	client client.Client
	log    *slog.Logger
}

// NewHybridClient initializes a new test.opaque.Hybrid client
func NewHybridClient(c client.Client, options ...*hybridClientOptions) HybridClient {
	var cfg *hybridClientOptions
	if len(options) > 0 {
		cfg = options[0]
	} else {
		cfg = NewHybridClientOptions()
	}
	return &hybridClient{
		client: c,
		log:    cfg.getLogger(),
	}
}

// NewHybridClientWithOptions initializes a new Hybrid client with the given options
func NewHybridClientWithOptions(c client.Client, opts client.Options, options ...*hybridClientOptions) (HybridClient, error) {
	var err error
	c, err = client.NewClientFromExisting(c, opts)
	if err != nil {
		return nil, fmt.Errorf("error initializing client with options: %w", err)
	}
	var cfg *hybridClientOptions
	if len(options) > 0 {
		cfg = options[0]
	} else {
		cfg = NewHybridClientOptions()
	}
	return &hybridClient{
		client: c,
		log:    cfg.getLogger(),
	}, nil
}

// hybridClientOptions describes optional runtime configuration for a HybridClient
type hybridClientOptions struct {
	log *slog.Logger
}

// NewHybridClientOptions initializes a new hybridClientOptions value
func NewHybridClientOptions() *hybridClientOptions {
	return &hybridClientOptions{}
}

// WithLogger can be used to override the default logger
func (opts *hybridClientOptions) WithLogger(l *slog.Logger) *hybridClientOptions {
	if l != nil {
		opts.log = l
	}
	return opts
}

// getLogger returns the configured logger, or the default logger
func (opts *hybridClientOptions) getLogger() *slog.Logger {
	if opts != nil && opts.log != nil {
		return opts.log
	}
	return slog.Default()
}

// test.opaque.Hybrid.PutHybridExample executes a test.opaque.Hybrid.PutHybridExample workflow and blocks until error or response received
func (c *hybridClient) PutHybridExample(ctx context.Context, req *HybridExample, options ...*PutHybridExampleOptions) (*HybridExample, error) {
	run, err := c.PutHybridExampleAsync(ctx, req, options...)
	if err != nil {
		return nil, err
	}
	return run.Get(ctx)
}

// PutHybridExampleAsync starts a(n) test.opaque.Hybrid.PutHybridExample workflow and returns a handle to the workflow run
func (c *hybridClient) PutHybridExampleAsync(ctx context.Context, req *HybridExample, options ...*PutHybridExampleOptions) (PutHybridExampleRun, error) {
	var o *PutHybridExampleOptions
	if len(options) > 0 && options[0] != nil {
		o = options[0]
	} else {
		o = NewPutHybridExampleOptions()
	}
	opts, err := o.Build(req.ProtoReflect())
	if err != nil {
		return nil, fmt.Errorf("error initializing client.StartWorkflowOptions: %w", err)
	}
	run, err := c.client.ExecuteWorkflow(ctx, opts, PutHybridExampleWorkflowName, req)
	if err != nil {
		return nil, err
	}
	if run == nil {
		return nil, errors.New("execute workflow returned nil run")
	}
	return &putHybridExampleRun{
		client: c,
		run:    run,
	}, nil
}

// GetPutHybridExample fetches an existing test.opaque.Hybrid.PutHybridExample execution
func (c *hybridClient) GetPutHybridExample(ctx context.Context, workflowID string, runID string) PutHybridExampleRun {
	return &putHybridExampleRun{
		client: c,
		run:    c.client.GetWorkflow(ctx, workflowID, runID),
	}
}

// PutHybridExampleWithSignalHybrid starts a(n) test.opaque.Hybrid.PutHybridExample workflow and sends a(n) test.opaque.Hybrid.SignalHybrid signal in a transaction
func (c *hybridClient) PutHybridExampleWithSignalHybrid(ctx context.Context, req *HybridExample, signal *HybridExample, options ...*PutHybridExampleOptions) (*HybridExample, error) {
	run, err := c.PutHybridExampleWithSignalHybridAsync(ctx, req, signal, options...)
	if err != nil {
		return nil, err
	}
	return run.Get(ctx)
}

// PutHybridExampleWithSignalHybridAsync starts a(n) test.opaque.Hybrid.PutHybridExample workflow and sends a(n) test.opaque.Hybrid.SignalHybrid signal in a transaction
func (c *hybridClient) PutHybridExampleWithSignalHybridAsync(ctx context.Context, req *HybridExample, signal *HybridExample, options ...*PutHybridExampleOptions) (PutHybridExampleRun, error) {
	var o *PutHybridExampleOptions
	if len(options) > 0 && options[0] != nil {
		o = options[0]
	} else {
		o = NewPutHybridExampleOptions()
	}
	opts, err := o.Build(req.ProtoReflect())
	if err != nil {
		return nil, fmt.Errorf("error initializing client.StartWorkflowOptions: %w", err)
	}
	run, err := c.client.SignalWithStartWorkflow(ctx, opts.ID, SignalHybridSignalName, signal, opts, PutHybridExampleWorkflowName, req)
	if run == nil || err != nil {
		return nil, err
	}
	return &putHybridExampleRun{
		client: c,
		run:    run,
	}, nil
}

// CancelWorkflow requests cancellation of an existing workflow execution
func (c *hybridClient) CancelWorkflow(ctx context.Context, workflowID string, runID string) error {
	return c.client.CancelWorkflow(ctx, workflowID, runID)
}

// TerminateWorkflow terminates an existing workflow execution
func (c *hybridClient) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error {
	return c.client.TerminateWorkflow(ctx, workflowID, runID, reason, details...)
}

// test.opaque.Hybrid.SignalHybrid sends a(n) test.opaque.Hybrid.SignalHybrid signal to an existing workflow
func (c *hybridClient) SignalHybrid(ctx context.Context, workflowID string, runID string, signal *HybridExample) error {
	return c.client.SignalWorkflow(ctx, workflowID, runID, SignalHybridSignalName, signal)
}

// PutHybridExampleOptions provides configuration for a test.opaque.Hybrid.PutHybridExample workflow operation
type PutHybridExampleOptions struct {
	options                  client.StartWorkflowOptions
	executionTimeout         *time.Duration
	id                       *string
	idReusePolicy            enumsv1.WorkflowIdReusePolicy
	retryPolicy              *temporal.RetryPolicy
	runTimeout               *time.Duration
	searchAttributes         map[string]any
	taskQueue                *string
	taskTimeout              *time.Duration
	workflowIdConflictPolicy enumsv1.WorkflowIdConflictPolicy
}

// NewPutHybridExampleOptions initializes a new PutHybridExampleOptions value
func NewPutHybridExampleOptions() *PutHybridExampleOptions {
	return &PutHybridExampleOptions{}
}

// Build initializes a new go.temporal.io/sdk/client.StartWorkflowOptions value with defaults and overrides applied
func (o *PutHybridExampleOptions) Build(req protoreflect.Message) (client.StartWorkflowOptions, error) {
	opts := o.options
	if v := o.id; v != nil {
		opts.ID = *v
	}
	if v := o.idReusePolicy; v != enumsv1.WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED {
		opts.WorkflowIDReusePolicy = v
	}
	if v := o.workflowIdConflictPolicy; v != enumsv1.WORKFLOW_ID_CONFLICT_POLICY_UNSPECIFIED {
		opts.WorkflowIDConflictPolicy = v
	}
	if v := o.taskQueue; v != nil {
		opts.TaskQueue = *v
	} else if opts.TaskQueue == "" {
		opts.TaskQueue = HybridTaskQueue
	}
	if v := o.retryPolicy; v != nil {
		opts.RetryPolicy = v
	}
	if v := o.searchAttributes; v != nil {
		opts.SearchAttributes = o.searchAttributes
	}
	if v := o.executionTimeout; v != nil {
		opts.WorkflowExecutionTimeout = *v
	}
	if v := o.runTimeout; v != nil {
		opts.WorkflowRunTimeout = *v
	}
	if v := o.taskTimeout; v != nil {
		opts.WorkflowTaskTimeout = *v
	}
	return opts, nil
}

// WithStartWorkflowOptions sets the initial go.temporal.io/sdk/client.StartWorkflowOptions
func (o *PutHybridExampleOptions) WithStartWorkflowOptions(options client.StartWorkflowOptions) *PutHybridExampleOptions {
	o.options = options
	return o
}

// WithExecutionTimeout sets the WorkflowExecutionTimeout value
func (o *PutHybridExampleOptions) WithExecutionTimeout(d time.Duration) *PutHybridExampleOptions {
	o.executionTimeout = &d
	return o
}

// WithID sets the ID value
func (o *PutHybridExampleOptions) WithID(id string) *PutHybridExampleOptions {
	o.id = &id
	return o
}

// WithIDReusePolicy sets the WorkflowIDReusePolicy value
func (o *PutHybridExampleOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *PutHybridExampleOptions {
	o.idReusePolicy = policy
	return o
}

// WithRetryPolicy sets the RetryPolicy value
func (o *PutHybridExampleOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *PutHybridExampleOptions {
	o.retryPolicy = policy
	return o
}

// WithRunTimeout sets the WorkflowRunTimeout value
func (o *PutHybridExampleOptions) WithRunTimeout(d time.Duration) *PutHybridExampleOptions {
	o.runTimeout = &d
	return o
}

// WithSearchAttributes sets the SearchAttributes value
func (o *PutHybridExampleOptions) WithSearchAttributes(sa map[string]any) *PutHybridExampleOptions {
	o.searchAttributes = sa
	return o
}

// WithTaskTimeout sets the WorkflowTaskTimeout value
func (o *PutHybridExampleOptions) WithTaskTimeout(d time.Duration) *PutHybridExampleOptions {
	o.taskTimeout = &d
	return o
}

// WithTaskQueue sets the TaskQueue value
func (o *PutHybridExampleOptions) WithTaskQueue(tq string) *PutHybridExampleOptions {
	o.taskQueue = &tq
	return o
}

// WithWorkflowIdConflictPolicy sets the WorkflowIdConflictPolicy value
func (o *PutHybridExampleOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *PutHybridExampleOptions {
	o.workflowIdConflictPolicy = policy
	return o
}

// PutHybridExampleRun describes a(n) test.opaque.Hybrid.PutHybridExample workflow run
type PutHybridExampleRun interface {
	// ID returns the workflow ID
	ID() string

	// RunID returns the workflow instance ID
	RunID() string

	// Run returns the inner client.WorkflowRun
	Run() client.WorkflowRun

	// Get blocks until the workflow is complete and returns the result
	Get(ctx context.Context) (*HybridExample, error)

	// Cancel requests cancellation of a workflow in execution, returning an error if applicable
	Cancel(ctx context.Context) error

	// Terminate terminates a workflow in execution, returning an error if applicable
	Terminate(ctx context.Context, reason string, details ...interface{}) error

	// test.opaque.Hybrid.SignalHybrid sends a(n) test.opaque.Hybrid.SignalHybrid signal
	SignalHybrid(ctx context.Context, req *HybridExample) error
}

// putHybridExampleRun provides an internal implementation of a(n) PutHybridExampleRunRun
type putHybridExampleRun struct {
	client *hybridClient
	run    client.WorkflowRun
}

// ID returns the workflow ID
func (r *putHybridExampleRun) ID() string {
	return r.run.GetID()
}

// Run returns the inner client.WorkflowRun
func (r *putHybridExampleRun) Run() client.WorkflowRun {
	return r.run
}

// RunID returns the execution ID
func (r *putHybridExampleRun) RunID() string {
	return r.run.GetRunID()
}

// Cancel requests cancellation of a workflow in execution, returning an error if applicable
func (r *putHybridExampleRun) Cancel(ctx context.Context) error {
	return r.client.CancelWorkflow(ctx, r.ID(), r.RunID())
}

// Get blocks until the workflow is complete, returning the result if applicable
func (r *putHybridExampleRun) Get(ctx context.Context) (*HybridExample, error) {
	var resp HybridExample
	if err := r.run.Get(ctx, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

// Terminate terminates a workflow in execution, returning an error if applicable
func (r *putHybridExampleRun) Terminate(ctx context.Context, reason string, details ...interface{}) error {
	return r.client.TerminateWorkflow(ctx, r.ID(), r.RunID(), reason, details...)
}

// test.opaque.Hybrid.SignalHybrid sends a(n) test.opaque.Hybrid.SignalHybrid signal
func (r *putHybridExampleRun) SignalHybrid(ctx context.Context, req *HybridExample) error {
	return r.client.SignalHybrid(ctx, r.ID(), "", req)
}

// Reference to generated workflow functions
var (
	// hybridRegistrationMutex is a mutex for registering test.opaque.Hybrid workflows
	hybridRegistrationMutex sync.Mutex
	// PutHybridExampleFunction implements a "test.opaque.Hybrid.PutHybridExample" workflow
	PutHybridExampleFunction func(workflow.Context, *HybridExample) (*HybridExample, error)
)

// HybridWorkflowFunctions describes a mockable dependency for inlining workflows within other workflows
type (
	// HybridWorkflowFunctions describes a mockable dependency for inlining workflows within other workflows
	HybridWorkflowFunctions interface {
		// PutHybridExample executes a "test.opaque.Hybrid.PutHybridExample" workflow inline
		PutHybridExample(workflow.Context, *HybridExample) (*HybridExample, error)
	}
	// hybridWorkflowFunctions provides an internal HybridWorkflowFunctions implementation
	hybridWorkflowFunctions struct{}
)

func NewHybridWorkflowFunctions() HybridWorkflowFunctions {
	return &hybridWorkflowFunctions{}
}

// PutHybridExample executes a "test.opaque.Hybrid.PutHybridExample" workflow inline
func (f *hybridWorkflowFunctions) PutHybridExample(ctx workflow.Context, req *HybridExample) (*HybridExample, error) {
	if PutHybridExampleFunction == nil {
		return nil, errors.New("PutHybridExample requires workflow registration via RegisterHybridWorkflows or RegisterPutHybridExampleWorkflow")
	}
	return PutHybridExampleFunction(ctx, req)
}

// HybridWorkflows provides methods for initializing new test.opaque.Hybrid workflow values
type HybridWorkflows interface {
	// PutHybridExample initializes a new a(n) PutHybridExampleWorkflow implementation
	PutHybridExample(ctx workflow.Context, input *PutHybridExampleWorkflowInput) (PutHybridExampleWorkflow, error)
}

// RegisterHybridWorkflows registers test.opaque.Hybrid workflows with the given worker
func RegisterHybridWorkflows(r worker.WorkflowRegistry, workflows HybridWorkflows) {
	RegisterPutHybridExampleWorkflow(r, workflows.PutHybridExample)
}

// RegisterPutHybridExampleWorkflow registers a test.opaque.Hybrid.PutHybridExample workflow with the given worker
func RegisterPutHybridExampleWorkflow(r worker.WorkflowRegistry, wf func(workflow.Context, *PutHybridExampleWorkflowInput) (PutHybridExampleWorkflow, error)) {
	hybridRegistrationMutex.Lock()
	defer hybridRegistrationMutex.Unlock()
	PutHybridExampleFunction = buildPutHybridExample(wf)
	r.RegisterWorkflowWithOptions(PutHybridExampleFunction, workflow.RegisterOptions{Name: PutHybridExampleWorkflowName})
}

// buildPutHybridExample converts a PutHybridExample workflow struct into a valid workflow function
func buildPutHybridExample(ctor func(workflow.Context, *PutHybridExampleWorkflowInput) (PutHybridExampleWorkflow, error)) func(workflow.Context, *HybridExample) (*HybridExample, error) {
	return func(ctx workflow.Context, req *HybridExample) (*HybridExample, error) {
		input := &PutHybridExampleWorkflowInput{
			Req: req,
			SignalHybrid: &SignalHybridSignal{
				Channel: workflow.GetSignalChannel(ctx, SignalHybridSignalName),
			},
		}
		wf, err := ctor(ctx, input)
		if err != nil {
			return nil, err
		}
		if initializable, ok := wf.(helpers.Initializable); ok {
			if err := initializable.Initialize(ctx); err != nil {
				return nil, err
			}
		}
		return wf.Execute(ctx)
	}
}

// PutHybridExampleWorkflowInput describes the input to a(n) test.opaque.Hybrid.PutHybridExample workflow constructor
type PutHybridExampleWorkflowInput struct {
	Req          *HybridExample
	SignalHybrid *SignalHybridSignal
}

// PutHybridExampleWorkflow describes a(n) test.opaque.Hybrid.PutHybridExample workflow implementation
type PutHybridExampleWorkflow interface {
	// Execute defines the entrypoint to a(n) test.opaque.Hybrid.PutHybridExample workflow
	Execute(ctx workflow.Context) (*HybridExample, error)
}

// PutHybridExampleChild executes a child test.opaque.Hybrid.PutHybridExample workflow and blocks until error or response received
func PutHybridExampleChild(ctx workflow.Context, req *HybridExample, options ...*PutHybridExampleChildOptions) (*HybridExample, error) {
	childRun, err := PutHybridExampleChildAsync(ctx, req, options...)
	if err != nil {
		return nil, err
	}
	return childRun.Get(ctx)
}

// PutHybridExampleChildAsync starts a child test.opaque.Hybrid.PutHybridExample workflow and returns a handle to the child workflow run
func PutHybridExampleChildAsync(ctx workflow.Context, req *HybridExample, options ...*PutHybridExampleChildOptions) (*PutHybridExampleChildRun, error) {
	var o *PutHybridExampleChildOptions
	if len(options) > 0 && options[0] != nil {
		o = options[0]
	} else {
		o = NewPutHybridExampleChildOptions()
	}
	opts, err := o.Build(ctx, req.ProtoReflect())
	if err != nil {
		return nil, fmt.Errorf("error initializing workflow.ChildWorkflowOptions: %w", err)
	}
	ctx = workflow.WithChildOptions(ctx, opts)
	if o.dc != nil {
		ctx = workflow.WithDataConverter(ctx, o.dc)
	}
	return &PutHybridExampleChildRun{Future: workflow.ExecuteChildWorkflow(ctx, PutHybridExampleWorkflowName, req)}, nil
}

// PutHybridExampleChildOptions provides configuration for a child test.opaque.Hybrid.PutHybridExample workflow operation
type PutHybridExampleChildOptions struct {
	options                  workflow.ChildWorkflowOptions
	executionTimeout         *time.Duration
	id                       *string
	idReusePolicy            enumsv1.WorkflowIdReusePolicy
	retryPolicy              *temporal.RetryPolicy
	runTimeout               *time.Duration
	searchAttributes         map[string]any
	taskQueue                *string
	taskTimeout              *time.Duration
	workflowIdConflictPolicy enumsv1.WorkflowIdConflictPolicy
	dc                       converter.DataConverter
	parentClosePolicy        enumsv1.ParentClosePolicy
	waitForCancellation      *bool
}

// NewPutHybridExampleChildOptions initializes a new PutHybridExampleChildOptions value
func NewPutHybridExampleChildOptions() *PutHybridExampleChildOptions {
	return &PutHybridExampleChildOptions{}
}

// Build initializes a new go.temporal.io/sdk/workflow.ChildWorkflowOptions value with defaults and overrides applied
func (o *PutHybridExampleChildOptions) Build(ctx workflow.Context, req protoreflect.Message) (workflow.ChildWorkflowOptions, error) {
	opts := o.options
	if v := o.id; v != nil {
		opts.WorkflowID = *v
	}
	if v := o.idReusePolicy; v != enumsv1.WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED {
		opts.WorkflowIDReusePolicy = v
	}
	if v := o.taskQueue; v != nil {
		opts.TaskQueue = *v
	} else if opts.TaskQueue == "" {
		opts.TaskQueue = HybridTaskQueue
	}
	if v := o.retryPolicy; v != nil {
		opts.RetryPolicy = v
	}
	if v := o.searchAttributes; v != nil {
		opts.SearchAttributes = o.searchAttributes
	}
	if v := o.executionTimeout; v != nil {
		opts.WorkflowExecutionTimeout = *v
	}
	if v := o.runTimeout; v != nil {
		opts.WorkflowRunTimeout = *v
	}
	if v := o.taskTimeout; v != nil {
		opts.WorkflowTaskTimeout = *v
	}
	if v := o.parentClosePolicy; v != enumsv1.PARENT_CLOSE_POLICY_UNSPECIFIED {
		opts.ParentClosePolicy = v
	}
	if v := o.waitForCancellation; v != nil {
		opts.WaitForCancellation = *v
	}
	return opts, nil
}

// WithChildWorkflowOptions sets the initial go.temporal.io/sdk/workflow.ChildWorkflowOptions
func (o *PutHybridExampleChildOptions) WithChildWorkflowOptions(options workflow.ChildWorkflowOptions) *PutHybridExampleChildOptions {
	o.options = options
	return o
}

// WithDataConverter registers a DataConverter for the child workflow
func (o *PutHybridExampleChildOptions) WithDataConverter(dc converter.DataConverter) *PutHybridExampleChildOptions {
	o.dc = dc
	return o
}

// WithExecutionTimeout sets the WorkflowExecutionTimeout value
func (o *PutHybridExampleChildOptions) WithExecutionTimeout(d time.Duration) *PutHybridExampleChildOptions {
	o.executionTimeout = &d
	return o
}

// WithID sets the WorkflowID value
func (o *PutHybridExampleChildOptions) WithID(id string) *PutHybridExampleChildOptions {
	o.id = &id
	return o
}

// WithIDReusePolicy sets the WorkflowIDReusePolicy value
func (o *PutHybridExampleChildOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *PutHybridExampleChildOptions {
	o.idReusePolicy = policy
	return o
}

// WithParentClosePolicy sets the WorkflowIDReusePolicy value
func (o *PutHybridExampleChildOptions) WithParentClosePolicy(policy enumsv1.ParentClosePolicy) *PutHybridExampleChildOptions {
	o.parentClosePolicy = policy
	return o
}

// WithRetryPolicy sets the RetryPolicy value
func (o *PutHybridExampleChildOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *PutHybridExampleChildOptions {
	o.retryPolicy = policy
	return o
}

// WithRunTimeout sets the WorkflowRunTimeout value
func (o *PutHybridExampleChildOptions) WithRunTimeout(d time.Duration) *PutHybridExampleChildOptions {
	o.runTimeout = &d
	return o
}

// WithSearchAttributes sets the SearchAttributes value
func (o *PutHybridExampleChildOptions) WithSearchAttributes(sa map[string]any) *PutHybridExampleChildOptions {
	o.searchAttributes = sa
	return o
}

// WithTaskTimeout sets the WorkflowTaskTimeout value
func (o *PutHybridExampleChildOptions) WithTaskTimeout(d time.Duration) *PutHybridExampleChildOptions {
	o.taskTimeout = &d
	return o
}

// WithTaskQueue sets the TaskQueue value
func (o *PutHybridExampleChildOptions) WithTaskQueue(tq string) *PutHybridExampleChildOptions {
	o.taskQueue = &tq
	return o
}

// WithWaitForCancellation sets the WaitForCancellation value
func (o *PutHybridExampleChildOptions) WithWaitForCancellation(wait bool) *PutHybridExampleChildOptions {
	o.waitForCancellation = &wait
	return o
}

// WithWorkflowIdConflictPolicy sets the WorkflowIdConflictPolicy value
func (o *PutHybridExampleChildOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *PutHybridExampleChildOptions {
	o.workflowIdConflictPolicy = policy
	return o
}

// PutHybridExampleChildRun describes a child PutHybridExample workflow run
type PutHybridExampleChildRun struct {
	Future workflow.ChildWorkflowFuture
}

// Get blocks until the workflow is completed, returning the response value
func (r *PutHybridExampleChildRun) Get(ctx workflow.Context) (*HybridExample, error) {
	var resp HybridExample
	if err := r.Future.Get(ctx, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

// Select adds this completion to the selector. Callback can be nil.
func (r *PutHybridExampleChildRun) Select(sel workflow.Selector, fn func(*PutHybridExampleChildRun)) workflow.Selector {
	return sel.AddFuture(r.Future, func(workflow.Future) {
		if fn != nil {
			fn(r)
		}
	})
}

// SelectStart adds waiting for start to the selector. Callback can be nil.
func (r *PutHybridExampleChildRun) SelectStart(sel workflow.Selector, fn func(*PutHybridExampleChildRun)) workflow.Selector {
	return sel.AddFuture(r.Future.GetChildWorkflowExecution(), func(workflow.Future) {
		if fn != nil {
			fn(r)
		}
	})
}

// WaitStart waits for the child workflow to start
func (r *PutHybridExampleChildRun) WaitStart(ctx workflow.Context) (*workflow.Execution, error) {
	var exec workflow.Execution
	if err := r.Future.GetChildWorkflowExecution().Get(ctx, &exec); err != nil {
		return nil, err
	}
	return &exec, nil
}

// SignalHybrid sends a(n) "test.opaque.Hybrid.SignalHybrid" signal request to the child workflow
func (r *PutHybridExampleChildRun) SignalHybrid(ctx workflow.Context, input *HybridExample) error {
	return r.SignalHybridAsync(ctx, input).Get(ctx, nil)
}

// SignalHybridAsync sends a(n) "test.opaque.Hybrid.SignalHybrid" signal request to the child workflow
func (r *PutHybridExampleChildRun) SignalHybridAsync(ctx workflow.Context, input *HybridExample) workflow.Future {
	return r.Future.SignalChildWorkflow(ctx, SignalHybridSignalName, input)
}

// SignalHybridSignal describes a(n) test.opaque.Hybrid.SignalHybrid signal
type SignalHybridSignal struct {
	Channel workflow.ReceiveChannel
}

// NewSignalHybridSignal initializes a new test.opaque.Hybrid.SignalHybrid signal wrapper
func NewSignalHybridSignal(ctx workflow.Context) *SignalHybridSignal {
	return &SignalHybridSignal{Channel: workflow.GetSignalChannel(ctx, SignalHybridSignalName)}
}

// Receive blocks until a(n) test.opaque.Hybrid.SignalHybrid signal is received
func (s *SignalHybridSignal) Receive(ctx workflow.Context) (*HybridExample, bool) {
	var resp HybridExample
	more := s.Channel.Receive(ctx, &resp)
	return &resp, more
}

// ReceiveAsync checks for a test.opaque.Hybrid.SignalHybrid signal without blocking
func (s *SignalHybridSignal) ReceiveAsync() *HybridExample {
	var resp HybridExample
	if ok := s.Channel.ReceiveAsync(&resp); !ok {
		return nil
	}
	return &resp
}

// ReceiveWithTimeout blocks until a(n) test.opaque.Hybrid.SignalHybrid signal is received or timeout expires.
// Returns more value of false when Channel is closed.
// Returns ok value of false when no value was found in the channel for the duration of timeout or the ctx was canceled.
// resp will be nil if ok is false.
func (s *SignalHybridSignal) ReceiveWithTimeout(ctx workflow.Context, timeout time.Duration) (resp *HybridExample, ok bool, more bool) {
	resp = &HybridExample{}
	if ok, more = s.Channel.ReceiveWithTimeout(ctx, timeout, &resp); !ok {
		return nil, false, more
	}
	return
}

// Select checks for a(n) test.opaque.Hybrid.SignalHybrid signal without blocking
func (s *SignalHybridSignal) Select(sel workflow.Selector, fn func(*HybridExample)) workflow.Selector {
	return sel.AddReceive(s.Channel, func(workflow.ReceiveChannel, bool) {
		req := s.ReceiveAsync()
		if fn != nil {
			fn(req)
		}
	})
}

// SignalHybridExternal sends a(n) test.opaque.Hybrid.SignalHybrid signal to an existing workflow
func SignalHybridExternal(ctx workflow.Context, workflowID string, runID string, req *HybridExample) error {
	return SignalHybridExternalAsync(ctx, workflowID, runID, req).Get(ctx, nil)
}

// SignalHybridExternalAsync sends a(n) test.opaque.Hybrid.SignalHybrid signal to an existing workflow
func SignalHybridExternalAsync(ctx workflow.Context, workflowID string, runID string, req *HybridExample) workflow.Future {
	return workflow.SignalExternalWorkflow(ctx, workflowID, runID, SignalHybridSignalName, req)
}

// HybridActivities describes available worker activities
type HybridActivities interface{}

// RegisterHybridActivities registers activities with a worker
func RegisterHybridActivities(r worker.ActivityRegistry, activities HybridActivities) {}

// TestClient provides a testsuite-compatible Client
type TestHybridClient struct {
	env       *testsuite.TestWorkflowEnvironment
	workflows HybridWorkflows
}

var _ HybridClient = &TestHybridClient{}

// NewTestHybridClient initializes a new TestHybridClient value
func NewTestHybridClient(env *testsuite.TestWorkflowEnvironment, workflows HybridWorkflows, activities HybridActivities) *TestHybridClient {
	if workflows != nil {
		RegisterHybridWorkflows(env, workflows)
	}
	if activities != nil {
		RegisterHybridActivities(env, activities)
	}
	return &TestHybridClient{env, workflows}
}

// PutHybridExample executes a(n) test.opaque.Hybrid.PutHybridExample workflow in the test environment
func (c *TestHybridClient) PutHybridExample(ctx context.Context, req *HybridExample, opts ...*PutHybridExampleOptions) (*HybridExample, error) {
	run, err := c.PutHybridExampleAsync(ctx, req, opts...)
	if err != nil {
		return nil, err
	}
	return run.Get(ctx)
}

// PutHybridExampleAsync executes a(n) test.opaque.Hybrid.PutHybridExample workflow in the test environment
func (c *TestHybridClient) PutHybridExampleAsync(ctx context.Context, req *HybridExample, options ...*PutHybridExampleOptions) (PutHybridExampleRun, error) {
	var o *PutHybridExampleOptions
	if len(options) > 0 && options[0] != nil {
		o = options[0]
	} else {
		o = NewPutHybridExampleOptions()
	}
	opts, err := o.Build(req.ProtoReflect())
	if err != nil {
		return nil, fmt.Errorf("error initializing client.StartWorkflowOptions: %w", err)
	}
	return &testPutHybridExampleRun{client: c, env: c.env, opts: &opts, req: req, workflows: c.workflows}, nil
}

// GetPutHybridExample is a noop
func (c *TestHybridClient) GetPutHybridExample(ctx context.Context, workflowID string, runID string) PutHybridExampleRun {
	return &testPutHybridExampleRun{env: c.env, workflows: c.workflows}
}

// PutHybridExampleWithSignalHybrid sends a(n) test.opaque.Hybrid.SignalHybrid signal to a(n) test.opaque.Hybrid.PutHybridExample workflow, starting it if necessary
func (c *TestHybridClient) PutHybridExampleWithSignalHybrid(ctx context.Context, req *HybridExample, signal *HybridExample, opts ...*PutHybridExampleOptions) (*HybridExample, error) {
	c.env.RegisterDelayedCallback(func() {
		c.env.SignalWorkflow(SignalHybridSignalName, signal)
	}, 0)
	return c.PutHybridExample(ctx, req, opts...)
}

// PutHybridExampleWithSignalHybridAsync sends a(n) test.opaque.Hybrid.SignalHybrid signal to a(n) test.opaque.Hybrid.PutHybridExample workflow, starting it if necessary
func (c *TestHybridClient) PutHybridExampleWithSignalHybridAsync(ctx context.Context, req *HybridExample, signal *HybridExample, opts ...*PutHybridExampleOptions) (PutHybridExampleRun, error) {
	c.env.RegisterDelayedCallback(func() {
		c.env.SignalWorkflow(SignalHybridSignalName, signal)
	}, 0)
	return c.PutHybridExampleAsync(ctx, req, opts...)
}

// CancelWorkflow requests cancellation of an existing workflow execution
func (c *TestHybridClient) CancelWorkflow(ctx context.Context, workflowID string, runID string) error {
	c.env.CancelWorkflow()
	return nil
}

// TerminateWorkflow terminates an existing workflow execution
func (c *TestHybridClient) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error {
	return c.CancelWorkflow(ctx, workflowID, runID)
}

// SignalHybrid executes a test.opaque.Hybrid.SignalHybrid signal
func (c *TestHybridClient) SignalHybrid(ctx context.Context, workflowID string, runID string, req *HybridExample) error {
	c.env.SignalWorkflow(SignalHybridSignalName, req)
	return nil
}

var _ PutHybridExampleRun = &testPutHybridExampleRun{}

// testPutHybridExampleRun provides convenience methods for interacting with a(n) test.opaque.Hybrid.PutHybridExample workflow in the test environment
type testPutHybridExampleRun struct {
	client    *TestHybridClient
	env       *testsuite.TestWorkflowEnvironment
	isStarted atomic.Bool
	opts      *client.StartWorkflowOptions
	req       *HybridExample
	workflows HybridWorkflows
}

// Cancel requests cancellation of a workflow in execution, returning an error if applicable
func (r *testPutHybridExampleRun) Cancel(ctx context.Context) error {
	return r.client.CancelWorkflow(ctx, r.ID(), r.RunID())
}

// Get retrieves a test test.opaque.Hybrid.PutHybridExample workflow result
func (r *testPutHybridExampleRun) Get(context.Context) (*HybridExample, error) {
	if r.isStarted.CompareAndSwap(false, true) {
		r.env.ExecuteWorkflow(PutHybridExampleWorkflowName, r.req)
	}
	if !r.env.IsWorkflowCompleted() {
		return nil, errors.New("workflow in progress")
	}
	if err := r.env.GetWorkflowError(); err != nil {
		return nil, err
	}
	var result HybridExample
	if err := r.env.GetWorkflowResult(&result); err != nil {
		return nil, err
	}
	return &result, nil
}

// ID returns a test test.opaque.Hybrid.PutHybridExample workflow run's workflow ID
func (r *testPutHybridExampleRun) ID() string {
	if r.opts != nil {
		return r.opts.ID
	}
	return ""
}

// Run noop implementation
func (r *testPutHybridExampleRun) Run() client.WorkflowRun {
	return nil
}

// RunID noop implementation
func (r *testPutHybridExampleRun) RunID() string {
	return ""
}

// Terminate terminates a workflow in execution, returning an error if applicable
func (r *testPutHybridExampleRun) Terminate(ctx context.Context, reason string, details ...interface{}) error {
	return r.client.TerminateWorkflow(ctx, r.ID(), r.RunID(), reason, details...)
}

// SignalHybrid executes a test.opaque.Hybrid.SignalHybrid signal against a test test.opaque.Hybrid.PutHybridExample workflow
func (r *testPutHybridExampleRun) SignalHybrid(ctx context.Context, req *HybridExample) error {
	return r.client.SignalHybrid(ctx, r.ID(), r.RunID(), req)
}

// HybridCliOptions describes runtime configuration for test.opaque.Hybrid cli
type HybridCliOptions struct {
	after            func(*v2.Context) error
	before           func(*v2.Context) error
	clientForCommand func(*v2.Context) (client.Client, error)
	worker           func(*v2.Context, client.Client) (worker.Worker, error)
}

// NewHybridCliOptions initializes a new HybridCliOptions value
func NewHybridCliOptions() *HybridCliOptions {
	return &HybridCliOptions{}
}

// WithAfter injects a custom After hook to be run after any command invocation
func (opts *HybridCliOptions) WithAfter(fn func(*v2.Context) error) *HybridCliOptions {
	opts.after = fn
	return opts
}

// WithBefore injects a custom Before hook to be run prior to any command invocation
func (opts *HybridCliOptions) WithBefore(fn func(*v2.Context) error) *HybridCliOptions {
	opts.before = fn
	return opts
}

// WithClient provides a Temporal client factory for use by commands
func (opts *HybridCliOptions) WithClient(fn func(*v2.Context) (client.Client, error)) *HybridCliOptions {
	opts.clientForCommand = fn
	return opts
}

// WithWorker provides an method for initializing a worker
func (opts *HybridCliOptions) WithWorker(fn func(*v2.Context, client.Client) (worker.Worker, error)) *HybridCliOptions {
	opts.worker = fn
	return opts
}

// NewHybridCli initializes a cli for a(n) test.opaque.Hybrid service
func NewHybridCli(options ...*HybridCliOptions) (*v2.App, error) {
	commands, err := newHybridCommands(options...)
	if err != nil {
		return nil, fmt.Errorf("error initializing subcommands: %w", err)
	}
	return &v2.App{
		Name:                      "hybrid",
		Commands:                  commands,
		DisableSliceFlagSeparator: true,
	}, nil
}

// NewHybridCliCommand initializes a cli command for a test.opaque.Hybrid service with subcommands for each query, signal, update, and workflow
func NewHybridCliCommand(options ...*HybridCliOptions) (*v2.Command, error) {
	subcommands, err := newHybridCommands(options...)
	if err != nil {
		return nil, fmt.Errorf("error initializing subcommands: %w", err)
	}
	return &v2.Command{
		Name:        "hybrid",
		Subcommands: subcommands,
	}, nil
}

// newHybridCommands initializes (sub)commands for a test.opaque.Hybrid cli or command
func newHybridCommands(options ...*HybridCliOptions) ([]*v2.Command, error) {
	opts := &HybridCliOptions{}
	if len(options) > 0 {
		opts = options[0]
	}
	if opts.clientForCommand == nil {
		opts.clientForCommand = func(*v2.Context) (client.Client, error) {
			return client.Dial(client.Options{})
		}
	}
	commands := []*v2.Command{
		{
			Name:                   "signal-hybrid",
			Usage:                  "executes a test.opaque.Hybrid.SignalHybrid signal",
			Category:               "SIGNALS",
			UseShortOptionHandling: true,
			Before:                 opts.before,
			After:                  opts.after,
			Flags: []v2.Flag{
				&v2.StringFlag{
					Name:     "workflow-id",
					Usage:    "workflow id",
					Required: true,
					Aliases:  []string{"w"},
				},
				&v2.StringFlag{
					Name:    "run-id",
					Usage:   "run id",
					Aliases: []string{"r"},
				},
				&v2.StringFlag{
					Name:     "input-file",
					Usage:    "path to json-formatted input file",
					Aliases:  []string{"f"},
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "name",
					Usage:    "set the value of the operation's \"Name\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "score",
					Usage:    "set the value of the operation's \"Score\" parameter",
					Category: "INPUT",
				},
				&v2.Float64SliceFlag{
					Name:     "scores",
					Usage:    "set the value of the operation's \"Scores\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "ratio",
					Usage:    "set the value of the operation's \"Ratio\" parameter",
					Category: "INPUT",
				},
				&v2.Float64SliceFlag{
					Name:     "ratios",
					Usage:    "set the value of the operation's \"Ratios\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "age",
					Usage:    "set the value of the operation's \"Age\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "ages",
					Usage:    "set the value of the operation's \"Ages\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "id",
					Usage:    "set the value of the operation's \"Id\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "ids",
					Usage:    "set the value of the operation's \"Ids\" parameter",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "emails",
					Usage:    "set the value of the operation's \"Emails\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "extra",
					Usage:    "set the value of the operation's \"Extra\" parameter (json-encoded: {key: <string>, value: <string>})",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "status",
					Usage:    "set the value of the operation's \"Status\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "statuses",
					Usage:    "set the value of the operation's \"Statuses\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "size",
					Usage:    "set the value of the operation's \"Size\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "sizes",
					Usage:    "set the value of the operation's \"Sizes\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "length",
					Usage:    "set the value of the operation's \"Length\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "lengths",
					Usage:    "set the value of the operation's \"Lengths\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "connection-id",
					Usage:    "set the value of the operation's \"ConnectionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "connection-ids",
					Usage:    "set the value of the operation's \"ConnectionIds\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "session-id",
					Usage:    "set the value of the operation's \"SessionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "session-ids",
					Usage:    "set the value of the operation's \"SessionIds\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "fixed-size",
					Usage:    "set the value of the operation's \"FixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "fixed-sizes",
					Usage:    "set the value of the operation's \"FixedSizes\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "fixed-length",
					Usage:    "set the value of the operation's \"FixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "fixed-lengths",
					Usage:    "set the value of the operation's \"FixedLengths\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "sfixed-size",
					Usage:    "set the value of the operation's \"SfixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "sfixed-sizes",
					Usage:    "set the value of the operation's \"SfixedSizes\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "sfixed-length",
					Usage:    "set the value of the operation's \"SfixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "sfixed-lengths",
					Usage:    "set the value of the operation's \"SfixedLengths\" parameter",
					Category: "INPUT",
				},
				&v2.BoolFlag{
					Name:     "is-active",
					Usage:    "set the value of the operation's \"IsActive\" parameter",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "is-actives",
					Usage:    "set the value of the operation's \"IsActives\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "data",
					Usage:    "set the value of the operation's \"Data\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "datas",
					Usage:    "set the value of the operation's \"Datas\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "address",
					Usage:    "set the value of the operation's \"Address\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "previous-addresses",
					Usage:    "set the value of the operation's \"PreviousAddresses\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-name",
					Usage:    "set the value of the operation's \"OneofName\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "oneof-score",
					Usage:    "set the value of the operation's \"OneofScore\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "oneof-ratio",
					Usage:    "set the value of the operation's \"OneofRatio\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-age",
					Usage:    "set the value of the operation's \"OneofAge\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-id",
					Usage:    "set the value of the operation's \"OneofId\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-status",
					Usage:    "set the value of the operation's \"OneofStatus\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-size",
					Usage:    "set the value of the operation's \"OneofSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-length",
					Usage:    "set the value of the operation's \"OneofLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-connection-id",
					Usage:    "set the value of the operation's \"OneofConnectionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-session-id",
					Usage:    "set the value of the operation's \"OneofSessionId\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-fixed-size",
					Usage:    "set the value of the operation's \"OneofFixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-fixed-length",
					Usage:    "set the value of the operation's \"OneofFixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-sfixed-size",
					Usage:    "set the value of the operation's \"OneofSfixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-sfixed-length",
					Usage:    "set the value of the operation's \"OneofSfixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.BoolFlag{
					Name:     "oneof-is-active",
					Usage:    "set the value of the operation's \"OneofIsActive\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-data",
					Usage:    "set the value of the operation's \"OneofData\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-address",
					Usage:    "set the value of the operation's \"OneofAddress\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
			},
			Action: func(cmd *v2.Context) error {
				c, err := opts.clientForCommand(cmd)
				if err != nil {
					return fmt.Errorf("error initializing client for command: %w", err)
				}
				defer c.Close()
				client := NewHybridClient(c)
				req, err := UnmarshalCliFlagsToHybridExample(cmd, helpers.UnmarshalCliFlagsOptions{FromFile: "input-file"})
				if err != nil {
					return fmt.Errorf("error unmarshalling request: %w", err)
				}
				if err := client.SignalHybrid(cmd.Context, cmd.String("workflow-id"), cmd.String("run-id"), req); err != nil {
					return fmt.Errorf("error sending %q signal: %w", SignalHybridSignalName, err)
				}
				fmt.Println("success")
				return nil
			},
		},
		{
			Name:                   "put-hybrid-example",
			Usage:                  "executes a(n) test.opaque.Hybrid.PutHybridExample workflow",
			Category:               "WORKFLOWS",
			UseShortOptionHandling: true,
			Before:                 opts.before,
			After:                  opts.after,
			Flags: []v2.Flag{
				&v2.BoolFlag{
					Name:    "detach",
					Usage:   "run workflow in the background and print workflow and execution id",
					Aliases: []string{"d"},
				},
				&v2.StringFlag{
					Name:    "task-queue",
					Usage:   "task queue name",
					Aliases: []string{"t"},
					EnvVars: []string{"TEMPORAL_TASK_QUEUE_NAME", "TEMPORAL_TASK_QUEUE", "TASK_QUEUE_NAME", "TASK_QUEUE"},
					Value:   "opaque-hybrid",
				},
				&v2.StringFlag{
					Name:     "input-file",
					Usage:    "path to json-formatted input file",
					Aliases:  []string{"f"},
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "name",
					Usage:    "set the value of the operation's \"Name\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "score",
					Usage:    "set the value of the operation's \"Score\" parameter",
					Category: "INPUT",
				},
				&v2.Float64SliceFlag{
					Name:     "scores",
					Usage:    "set the value of the operation's \"Scores\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "ratio",
					Usage:    "set the value of the operation's \"Ratio\" parameter",
					Category: "INPUT",
				},
				&v2.Float64SliceFlag{
					Name:     "ratios",
					Usage:    "set the value of the operation's \"Ratios\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "age",
					Usage:    "set the value of the operation's \"Age\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "ages",
					Usage:    "set the value of the operation's \"Ages\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "id",
					Usage:    "set the value of the operation's \"Id\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "ids",
					Usage:    "set the value of the operation's \"Ids\" parameter",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "emails",
					Usage:    "set the value of the operation's \"Emails\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "extra",
					Usage:    "set the value of the operation's \"Extra\" parameter (json-encoded: {key: <string>, value: <string>})",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "status",
					Usage:    "set the value of the operation's \"Status\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "statuses",
					Usage:    "set the value of the operation's \"Statuses\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "size",
					Usage:    "set the value of the operation's \"Size\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "sizes",
					Usage:    "set the value of the operation's \"Sizes\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "length",
					Usage:    "set the value of the operation's \"Length\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "lengths",
					Usage:    "set the value of the operation's \"Lengths\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "connection-id",
					Usage:    "set the value of the operation's \"ConnectionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "connection-ids",
					Usage:    "set the value of the operation's \"ConnectionIds\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "session-id",
					Usage:    "set the value of the operation's \"SessionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "session-ids",
					Usage:    "set the value of the operation's \"SessionIds\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "fixed-size",
					Usage:    "set the value of the operation's \"FixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "fixed-sizes",
					Usage:    "set the value of the operation's \"FixedSizes\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "fixed-length",
					Usage:    "set the value of the operation's \"FixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "fixed-lengths",
					Usage:    "set the value of the operation's \"FixedLengths\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "sfixed-size",
					Usage:    "set the value of the operation's \"SfixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "sfixed-sizes",
					Usage:    "set the value of the operation's \"SfixedSizes\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "sfixed-length",
					Usage:    "set the value of the operation's \"SfixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "sfixed-lengths",
					Usage:    "set the value of the operation's \"SfixedLengths\" parameter",
					Category: "INPUT",
				},
				&v2.BoolFlag{
					Name:     "is-active",
					Usage:    "set the value of the operation's \"IsActive\" parameter",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "is-actives",
					Usage:    "set the value of the operation's \"IsActives\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "data",
					Usage:    "set the value of the operation's \"Data\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "datas",
					Usage:    "set the value of the operation's \"Datas\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "address",
					Usage:    "set the value of the operation's \"Address\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "previous-addresses",
					Usage:    "set the value of the operation's \"PreviousAddresses\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-name",
					Usage:    "set the value of the operation's \"OneofName\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "oneof-score",
					Usage:    "set the value of the operation's \"OneofScore\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "oneof-ratio",
					Usage:    "set the value of the operation's \"OneofRatio\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-age",
					Usage:    "set the value of the operation's \"OneofAge\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-id",
					Usage:    "set the value of the operation's \"OneofId\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-status",
					Usage:    "set the value of the operation's \"OneofStatus\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-size",
					Usage:    "set the value of the operation's \"OneofSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-length",
					Usage:    "set the value of the operation's \"OneofLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-connection-id",
					Usage:    "set the value of the operation's \"OneofConnectionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-session-id",
					Usage:    "set the value of the operation's \"OneofSessionId\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-fixed-size",
					Usage:    "set the value of the operation's \"OneofFixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-fixed-length",
					Usage:    "set the value of the operation's \"OneofFixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-sfixed-size",
					Usage:    "set the value of the operation's \"OneofSfixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-sfixed-length",
					Usage:    "set the value of the operation's \"OneofSfixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.BoolFlag{
					Name:     "oneof-is-active",
					Usage:    "set the value of the operation's \"OneofIsActive\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-data",
					Usage:    "set the value of the operation's \"OneofData\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-address",
					Usage:    "set the value of the operation's \"OneofAddress\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
			},
			Action: func(cmd *v2.Context) error {
				tc, err := opts.clientForCommand(cmd)
				if err != nil {
					return fmt.Errorf("error initializing client for command: %w", err)
				}
				defer tc.Close()
				c := NewHybridClient(tc)
				req, err := UnmarshalCliFlagsToHybridExample(cmd, helpers.UnmarshalCliFlagsOptions{FromFile: "input-file"})
				if err != nil {
					return fmt.Errorf("error unmarshalling request: %w", err)
				}
				opts := client.StartWorkflowOptions{}
				if tq := cmd.String("task-queue"); tq != "" {
					opts.TaskQueue = tq
				}
				run, err := c.PutHybridExampleAsync(cmd.Context, req, NewPutHybridExampleOptions().WithStartWorkflowOptions(opts))
				if err != nil {
					return fmt.Errorf("error starting %s workflow: %w", PutHybridExampleWorkflowName, err)
				}
				if cmd.Bool("detach") {
					fmt.Println("success")
					fmt.Printf("workflow id: %s\n", run.ID())
					fmt.Printf("run id: %s\n", run.RunID())
					return nil
				}
				if resp, err := run.Get(cmd.Context); err != nil {
					return err
				} else {
					b, err := protojson.Marshal(resp)
					if err != nil {
						return fmt.Errorf("error serializing response json: %w", err)
					}
					var out bytes.Buffer
					if err := json.Indent(&out, b, "", "  "); err != nil {
						return fmt.Errorf("error formatting json: %w", err)
					}
					fmt.Println(out.String())
					return nil
				}
			},
		},
		// sends a test.opaque.Hybrid.SignalHybrid signal to a test.opaque.Hybrid.PutHybridExample workflow, starting it if necessary,
		{
			Name:                   "put-hybrid-example-with-signal-hybrid",
			Usage:                  "sends a test.opaque.Hybrid.SignalHybrid signal to a test.opaque.Hybrid.PutHybridExample workflow, starting it if necessary",
			Category:               "WORKFLOWS",
			UseShortOptionHandling: true,
			Before:                 opts.before,
			After:                  opts.after,
			Flags: []v2.Flag{
				&v2.BoolFlag{
					Name:    "detach",
					Usage:   "run workflow in the background and print workflow and execution id",
					Aliases: []string{"d"},
				},
				&v2.StringFlag{
					Name:     "input-file",
					Usage:    "path to json-formatted input file",
					Aliases:  []string{"f"},
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "name",
					Usage:    "set the value of the operation's \"Name\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "score",
					Usage:    "set the value of the operation's \"Score\" parameter",
					Category: "INPUT",
				},
				&v2.Float64SliceFlag{
					Name:     "scores",
					Usage:    "set the value of the operation's \"Scores\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "ratio",
					Usage:    "set the value of the operation's \"Ratio\" parameter",
					Category: "INPUT",
				},
				&v2.Float64SliceFlag{
					Name:     "ratios",
					Usage:    "set the value of the operation's \"Ratios\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "age",
					Usage:    "set the value of the operation's \"Age\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "ages",
					Usage:    "set the value of the operation's \"Ages\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "id",
					Usage:    "set the value of the operation's \"Id\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "ids",
					Usage:    "set the value of the operation's \"Ids\" parameter",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "emails",
					Usage:    "set the value of the operation's \"Emails\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "extra",
					Usage:    "set the value of the operation's \"Extra\" parameter (json-encoded: {key: <string>, value: <string>})",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "status",
					Usage:    "set the value of the operation's \"Status\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "statuses",
					Usage:    "set the value of the operation's \"Statuses\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "size",
					Usage:    "set the value of the operation's \"Size\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "sizes",
					Usage:    "set the value of the operation's \"Sizes\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "length",
					Usage:    "set the value of the operation's \"Length\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "lengths",
					Usage:    "set the value of the operation's \"Lengths\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "connection-id",
					Usage:    "set the value of the operation's \"ConnectionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "connection-ids",
					Usage:    "set the value of the operation's \"ConnectionIds\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "session-id",
					Usage:    "set the value of the operation's \"SessionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "session-ids",
					Usage:    "set the value of the operation's \"SessionIds\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "fixed-size",
					Usage:    "set the value of the operation's \"FixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "fixed-sizes",
					Usage:    "set the value of the operation's \"FixedSizes\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "fixed-length",
					Usage:    "set the value of the operation's \"FixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64SliceFlag{
					Name:     "fixed-lengths",
					Usage:    "set the value of the operation's \"FixedLengths\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "sfixed-size",
					Usage:    "set the value of the operation's \"SfixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "sfixed-sizes",
					Usage:    "set the value of the operation's \"SfixedSizes\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "sfixed-length",
					Usage:    "set the value of the operation's \"SfixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64SliceFlag{
					Name:     "sfixed-lengths",
					Usage:    "set the value of the operation's \"SfixedLengths\" parameter",
					Category: "INPUT",
				},
				&v2.BoolFlag{
					Name:     "is-active",
					Usage:    "set the value of the operation's \"IsActive\" parameter",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "is-actives",
					Usage:    "set the value of the operation's \"IsActives\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "data",
					Usage:    "set the value of the operation's \"Data\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "datas",
					Usage:    "set the value of the operation's \"Datas\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "address",
					Usage:    "set the value of the operation's \"Address\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
				&v2.StringSliceFlag{
					Name:     "previous-addresses",
					Usage:    "set the value of the operation's \"PreviousAddresses\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-name",
					Usage:    "set the value of the operation's \"OneofName\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "oneof-score",
					Usage:    "set the value of the operation's \"OneofScore\" parameter",
					Category: "INPUT",
				},
				&v2.Float64Flag{
					Name:     "oneof-ratio",
					Usage:    "set the value of the operation's \"OneofRatio\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-age",
					Usage:    "set the value of the operation's \"OneofAge\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-id",
					Usage:    "set the value of the operation's \"OneofId\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-status",
					Usage:    "set the value of the operation's \"OneofStatus\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-size",
					Usage:    "set the value of the operation's \"OneofSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-length",
					Usage:    "set the value of the operation's \"OneofLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-connection-id",
					Usage:    "set the value of the operation's \"OneofConnectionId\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-session-id",
					Usage:    "set the value of the operation's \"OneofSessionId\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-fixed-size",
					Usage:    "set the value of the operation's \"OneofFixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Uint64Flag{
					Name:     "oneof-fixed-length",
					Usage:    "set the value of the operation's \"OneofFixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-sfixed-size",
					Usage:    "set the value of the operation's \"OneofSfixedSize\" parameter",
					Category: "INPUT",
				},
				&v2.Int64Flag{
					Name:     "oneof-sfixed-length",
					Usage:    "set the value of the operation's \"OneofSfixedLength\" parameter",
					Category: "INPUT",
				},
				&v2.BoolFlag{
					Name:     "oneof-is-active",
					Usage:    "set the value of the operation's \"OneofIsActive\" parameter",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-data",
					Usage:    "set the value of the operation's \"OneofData\" parameter (base64-encoded)",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "oneof-address",
					Usage:    "set the value of the operation's \"OneofAddress\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "INPUT",
				},
				&v2.StringFlag{
					Name:     "signal-file",
					Usage:    "path to json-formatted input file",
					Aliases:  []string{"s"},
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-name",
					Usage:    "set the value of the operation's \"Name\" parameter",
					Category: "SIGNAL",
				},
				&v2.Float64Flag{
					Name:     "signal-hybrid-score",
					Usage:    "set the value of the operation's \"Score\" parameter",
					Category: "SIGNAL",
				},
				&v2.Float64SliceFlag{
					Name:     "signal-hybrid-scores",
					Usage:    "set the value of the operation's \"Scores\" parameter",
					Category: "SIGNAL",
				},
				&v2.Float64Flag{
					Name:     "signal-hybrid-ratio",
					Usage:    "set the value of the operation's \"Ratio\" parameter",
					Category: "SIGNAL",
				},
				&v2.Float64SliceFlag{
					Name:     "signal-hybrid-ratios",
					Usage:    "set the value of the operation's \"Ratios\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-age",
					Usage:    "set the value of the operation's \"Age\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64SliceFlag{
					Name:     "signal-hybrid-ages",
					Usage:    "set the value of the operation's \"Ages\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-id",
					Usage:    "set the value of the operation's \"Id\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64SliceFlag{
					Name:     "signal-hybrid-ids",
					Usage:    "set the value of the operation's \"Ids\" parameter",
					Category: "SIGNAL",
				},
				&v2.StringSliceFlag{
					Name:     "signal-hybrid-emails",
					Usage:    "set the value of the operation's \"Emails\" parameter",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-extra",
					Usage:    "set the value of the operation's \"Extra\" parameter (json-encoded: {key: <string>, value: <string>})",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-status",
					Usage:    "set the value of the operation's \"Status\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "SIGNAL",
				},
				&v2.StringSliceFlag{
					Name:     "signal-hybrid-statuses",
					Usage:    "set the value of the operation's \"Statuses\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-size",
					Usage:    "set the value of the operation's \"Size\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64SliceFlag{
					Name:     "signal-hybrid-sizes",
					Usage:    "set the value of the operation's \"Sizes\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-length",
					Usage:    "set the value of the operation's \"Length\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64SliceFlag{
					Name:     "signal-hybrid-lengths",
					Usage:    "set the value of the operation's \"Lengths\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-connection-id",
					Usage:    "set the value of the operation's \"ConnectionId\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64SliceFlag{
					Name:     "signal-hybrid-connection-ids",
					Usage:    "set the value of the operation's \"ConnectionIds\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-session-id",
					Usage:    "set the value of the operation's \"SessionId\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64SliceFlag{
					Name:     "signal-hybrid-session-ids",
					Usage:    "set the value of the operation's \"SessionIds\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-fixed-size",
					Usage:    "set the value of the operation's \"FixedSize\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64SliceFlag{
					Name:     "signal-hybrid-fixed-sizes",
					Usage:    "set the value of the operation's \"FixedSizes\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-fixed-length",
					Usage:    "set the value of the operation's \"FixedLength\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64SliceFlag{
					Name:     "signal-hybrid-fixed-lengths",
					Usage:    "set the value of the operation's \"FixedLengths\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-sfixed-size",
					Usage:    "set the value of the operation's \"SfixedSize\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64SliceFlag{
					Name:     "signal-hybrid-sfixed-sizes",
					Usage:    "set the value of the operation's \"SfixedSizes\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-sfixed-length",
					Usage:    "set the value of the operation's \"SfixedLength\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64SliceFlag{
					Name:     "signal-hybrid-sfixed-lengths",
					Usage:    "set the value of the operation's \"SfixedLengths\" parameter",
					Category: "SIGNAL",
				},
				&v2.BoolFlag{
					Name:     "signal-hybrid-is-active",
					Usage:    "set the value of the operation's \"IsActive\" parameter",
					Category: "SIGNAL",
				},
				&v2.StringSliceFlag{
					Name:     "signal-hybrid-is-actives",
					Usage:    "set the value of the operation's \"IsActives\" parameter",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-data",
					Usage:    "set the value of the operation's \"Data\" parameter (base64-encoded)",
					Category: "SIGNAL",
				},
				&v2.StringSliceFlag{
					Name:     "signal-hybrid-datas",
					Usage:    "set the value of the operation's \"Datas\" parameter (base64-encoded)",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-address",
					Usage:    "set the value of the operation's \"Address\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "SIGNAL",
				},
				&v2.StringSliceFlag{
					Name:     "signal-hybrid-previous-addresses",
					Usage:    "set the value of the operation's \"PreviousAddresses\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-oneof-name",
					Usage:    "set the value of the operation's \"OneofName\" parameter",
					Category: "SIGNAL",
				},
				&v2.Float64Flag{
					Name:     "signal-hybrid-oneof-score",
					Usage:    "set the value of the operation's \"OneofScore\" parameter",
					Category: "SIGNAL",
				},
				&v2.Float64Flag{
					Name:     "signal-hybrid-oneof-ratio",
					Usage:    "set the value of the operation's \"OneofRatio\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-oneof-age",
					Usage:    "set the value of the operation's \"OneofAge\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-oneof-id",
					Usage:    "set the value of the operation's \"OneofId\" parameter",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-oneof-status",
					Usage:    "set the value of the operation's \"OneofStatus\" parameter (STATUS_UNSPECIFIED, STATUS_OK, STATUS_ERROR)",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-oneof-size",
					Usage:    "set the value of the operation's \"OneofSize\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-oneof-length",
					Usage:    "set the value of the operation's \"OneofLength\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-oneof-connection-id",
					Usage:    "set the value of the operation's \"OneofConnectionId\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-oneof-session-id",
					Usage:    "set the value of the operation's \"OneofSessionId\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-oneof-fixed-size",
					Usage:    "set the value of the operation's \"OneofFixedSize\" parameter",
					Category: "SIGNAL",
				},
				&v2.Uint64Flag{
					Name:     "signal-hybrid-oneof-fixed-length",
					Usage:    "set the value of the operation's \"OneofFixedLength\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-oneof-sfixed-size",
					Usage:    "set the value of the operation's \"OneofSfixedSize\" parameter",
					Category: "SIGNAL",
				},
				&v2.Int64Flag{
					Name:     "signal-hybrid-oneof-sfixed-length",
					Usage:    "set the value of the operation's \"OneofSfixedLength\" parameter",
					Category: "SIGNAL",
				},
				&v2.BoolFlag{
					Name:     "signal-hybrid-oneof-is-active",
					Usage:    "set the value of the operation's \"OneofIsActive\" parameter",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-oneof-data",
					Usage:    "set the value of the operation's \"OneofData\" parameter (base64-encoded)",
					Category: "SIGNAL",
				},
				&v2.StringFlag{
					Name:     "signal-hybrid-oneof-address",
					Usage:    "set the value of the operation's \"OneofAddress\" parameter (json-encoded: {street: <string>, city: <string>, state: <string>, zip: <string>})",
					Category: "SIGNAL",
				},
			},
			Action: func(cmd *v2.Context) error {
				c, err := opts.clientForCommand(cmd)
				if err != nil {
					return fmt.Errorf("error initializing client for command: %w", err)
				}
				defer c.Close()
				client := NewHybridClient(c)
				req, err := UnmarshalCliFlagsToHybridExample(cmd, helpers.UnmarshalCliFlagsOptions{FromFile: "input-file"})
				if err != nil {
					return fmt.Errorf("error unmarshalling request: %w", err)
				}
				signal, err := UnmarshalCliFlagsToHybridExample(cmd, helpers.UnmarshalCliFlagsOptions{FromFile: "signal-file"}, helpers.UnmarshalCliFlagsOptions{
					Prefix: "signal-hybrid",
					PrefixFlags: map[string]struct{}{
						"address":             {},
						"age":                 {},
						"ages":                {},
						"connection-id":       {},
						"connection-ids":      {},
						"data":                {},
						"datas":               {},
						"emails":              {},
						"extra":               {},
						"fixed-length":        {},
						"fixed-lengths":       {},
						"fixed-size":          {},
						"fixed-sizes":         {},
						"id":                  {},
						"ids":                 {},
						"is-active":           {},
						"is-actives":          {},
						"length":              {},
						"lengths":             {},
						"name":                {},
						"oneof-address":       {},
						"oneof-age":           {},
						"oneof-connection-id": {},
						"oneof-data":          {},
						"oneof-fixed-length":  {},
						"oneof-fixed-size":    {},
						"oneof-id":            {},
						"oneof-is-active":     {},
						"oneof-length":        {},
						"oneof-name":          {},
						"oneof-ratio":         {},
						"oneof-score":         {},
						"oneof-session-id":    {},
						"oneof-sfixed-length": {},
						"oneof-sfixed-size":   {},
						"oneof-size":          {},
						"oneof-status":        {},
						"previous-addresses":  {},
						"ratio":               {},
						"ratios":              {},
						"score":               {},
						"scores":              {},
						"session-id":          {},
						"session-ids":         {},
						"sfixed-length":       {},
						"sfixed-lengths":      {},
						"sfixed-size":         {},
						"sfixed-sizes":        {},
						"size":                {},
						"sizes":               {},
						"status":              {},
						"statuses":            {},
					},
				})
				if err != nil {
					return fmt.Errorf("error unmarshalling signal: %w", err)
				}
				run, err := client.PutHybridExampleWithSignalHybridAsync(cmd.Context, req, signal)
				if err != nil {
					return fmt.Errorf("error starting %s workflow with %s signal: %w", PutHybridExampleWorkflowName, SignalHybridSignalName, err)
				}
				if cmd.Bool("detach") {
					fmt.Println("success")
					fmt.Printf("workflow id: %s\n", run.ID())
					fmt.Printf("run id: %s\n", run.RunID())
					return nil
				}
				if resp, err := run.Get(cmd.Context); err != nil {
					return err
				} else {
					b, err := protojson.Marshal(resp)
					if err != nil {
						return fmt.Errorf("error serializing response json: %w", err)
					}
					var out bytes.Buffer
					if err := json.Indent(&out, b, "", "  "); err != nil {
						return fmt.Errorf("error formatting json: %w", err)
					}
					fmt.Println(out.String())
					return nil
				}
			},
		},
	}
	if opts.worker != nil {
		commands = append(commands, []*v2.Command{
			{
				Name:                   "worker",
				Usage:                  "runs a test.opaque.Hybrid worker process",
				UseShortOptionHandling: true,
				Before:                 opts.before,
				After:                  opts.after,
				Action: func(cmd *v2.Context) error {
					c, err := opts.clientForCommand(cmd)
					if err != nil {
						return fmt.Errorf("error initializing client for command: %w", err)
					}
					defer c.Close()
					w, err := opts.worker(cmd, c)
					if opts.worker != nil {
						if err != nil {
							return fmt.Errorf("error initializing worker: %w", err)
						}
					}
					if err := w.Start(); err != nil {
						return fmt.Errorf("error starting worker: %w", err)
					}
					defer w.Stop()
					<-cmd.Context.Done()
					return nil
				},
			},
		}...)
	}
	sort.Slice(commands, func(i, j int) bool {
		return commands[i].Name < commands[j].Name
	})
	return commands, nil
}

// UnmarshalCliFlagsToHybridExample unmarshals a HybridExample from command line flags
func UnmarshalCliFlagsToHybridExample(cmd *v2.Context, options ...helpers.UnmarshalCliFlagsOptions) (*HybridExample, error) {
	opts := helpers.FlattenUnmarshalCliFlagsOptions(options...)
	var result HybridExample
	if opts.FromFile != "" && cmd.IsSet(opts.FromFile) {
		f, err := gohomedir.Expand(cmd.String(opts.FromFile))
		if err != nil {
			f = cmd.String(opts.FromFile)
		}
		b, err := os.ReadFile(f)
		if err != nil {
			return nil, fmt.Errorf("error reading %s: %w", opts.FromFile, err)
		}
		if err := protojson.Unmarshal(b, &result); err != nil {
			return nil, fmt.Errorf("error parsing %s json: %w", opts.FromFile, err)
		}
	}
	if flag := opts.FlagName("name"); cmd.IsSet(flag) {
		value := cmd.String(flag)
		result.SetName(value)
	}
	if flag := opts.FlagName("score"); cmd.IsSet(flag) {
		value := cmd.Float64(flag)
		result.SetScore(value)
	}
	if flag := opts.FlagName("scores"); cmd.IsSet(flag) {
		value := cmd.Float64Slice(flag)
		result.SetScores(value)
	}
	if flag := opts.FlagName("ratio"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[float64, float32](cmd.Float64(flag))
		if err != nil {
			return nil, err
		}
		result.SetRatio(value)
	}
	if flag := opts.FlagName("ratios"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.Float64Slice(flag), func(v float64) (result float32, err error) {
			value, err := convert.SafeCast[float64, float32](v)
			if err != nil {
				return result, err
			}
			return value, nil
		})
		if err != nil {
			return nil, err
		}
		result.SetRatios(value)
	}
	if flag := opts.FlagName("age"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[int64, int32](cmd.Int64(flag))
		if err != nil {
			return nil, err
		}
		result.SetAge(value)
	}
	if flag := opts.FlagName("ages"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.Int64Slice(flag), func(v int64) (result int32, err error) {
			value, err := convert.SafeCast[int64, int32](v)
			if err != nil {
				return result, err
			}
			return value, nil
		})
		if err != nil {
			return nil, err
		}
		result.SetAges(value)
	}
	if flag := opts.FlagName("id"); cmd.IsSet(flag) {
		value := cmd.Int64(flag)
		result.SetId(value)
	}
	if flag := opts.FlagName("ids"); cmd.IsSet(flag) {
		value := cmd.Int64Slice(flag)
		result.SetIds(value)
	}
	if flag := opts.FlagName("emails"); cmd.IsSet(flag) {
		value := cmd.StringSlice(flag)
		result.SetEmails(value)
	}
	if flag := opts.FlagName("extra"); cmd.IsSet(flag) {
		var tmp HybridExample
		if err := protojson.Unmarshal([]byte(fmt.Sprintf("{\"extra\":%s}", cmd.String(flag))), &tmp); err != nil {
			return nil, fmt.Errorf("error unmarshalling \"extra\" map flag: %w", err)
		}
		value := tmp.GetExtra()
		result.SetExtra(value)
	}
	if flag := opts.FlagName("status"); cmd.IsSet(flag) {
		enumID, ok := Status_value[cmd.String(flag)]
		if !ok {
			return nil, fmt.Errorf("invalid value for enum field %s", "Status")
		}
		value := Status(enumID)
		result.SetStatus(value)
	}
	if flag := opts.FlagName("statuses"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.StringSlice(flag), func(v string) (result Status, err error) {
			enumID, ok := Status_value[v]
			if !ok {
				return result, fmt.Errorf("invalid value for enum field %s", "Statuses")
			}
			return Status(enumID), nil
		})
		if err != nil {
			return nil, err
		}
		result.SetStatuses(value)
	}
	if flag := opts.FlagName("size"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[uint64, uint32](cmd.Uint64(flag))
		if err != nil {
			return nil, err
		}
		result.SetSize(value)
	}
	if flag := opts.FlagName("sizes"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.Uint64Slice(flag), func(v uint64) (result uint32, err error) {
			value, err := convert.SafeCast[uint64, uint32](v)
			if err != nil {
				return result, err
			}
			return value, nil
		})
		if err != nil {
			return nil, err
		}
		result.SetSizes(value)
	}
	if flag := opts.FlagName("length"); cmd.IsSet(flag) {
		value := cmd.Uint64(flag)
		result.SetLength(value)
	}
	if flag := opts.FlagName("lengths"); cmd.IsSet(flag) {
		value := cmd.Uint64Slice(flag)
		result.SetLengths(value)
	}
	if flag := opts.FlagName("connection-id"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[int64, int32](cmd.Int64(flag))
		if err != nil {
			return nil, err
		}
		result.SetConnectionId(value)
	}
	if flag := opts.FlagName("connection-ids"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.Int64Slice(flag), func(v int64) (result int32, err error) {
			value, err := convert.SafeCast[int64, int32](v)
			if err != nil {
				return result, err
			}
			return value, nil
		})
		if err != nil {
			return nil, err
		}
		result.SetConnectionIds(value)
	}
	if flag := opts.FlagName("session-id"); cmd.IsSet(flag) {
		value := cmd.Int64(flag)
		result.SetSessionId(value)
	}
	if flag := opts.FlagName("session-ids"); cmd.IsSet(flag) {
		value := cmd.Int64Slice(flag)
		result.SetSessionIds(value)
	}
	if flag := opts.FlagName("fixed-size"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[uint64, uint32](cmd.Uint64(flag))
		if err != nil {
			return nil, err
		}
		result.SetFixedSize(value)
	}
	if flag := opts.FlagName("fixed-sizes"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.Uint64Slice(flag), func(v uint64) (result uint32, err error) {
			value, err := convert.SafeCast[uint64, uint32](v)
			if err != nil {
				return result, err
			}
			return value, nil
		})
		if err != nil {
			return nil, err
		}
		result.SetFixedSizes(value)
	}
	if flag := opts.FlagName("fixed-length"); cmd.IsSet(flag) {
		value := cmd.Uint64(flag)
		result.SetFixedLength(value)
	}
	if flag := opts.FlagName("fixed-lengths"); cmd.IsSet(flag) {
		value := cmd.Uint64Slice(flag)
		result.SetFixedLengths(value)
	}
	if flag := opts.FlagName("sfixed-size"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[int64, int32](cmd.Int64(flag))
		if err != nil {
			return nil, err
		}
		result.SetSfixedSize(value)
	}
	if flag := opts.FlagName("sfixed-sizes"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.Int64Slice(flag), func(v int64) (result int32, err error) {
			value, err := convert.SafeCast[int64, int32](v)
			if err != nil {
				return result, err
			}
			return value, nil
		})
		if err != nil {
			return nil, err
		}
		result.SetSfixedSizes(value)
	}
	if flag := opts.FlagName("sfixed-length"); cmd.IsSet(flag) {
		value := cmd.Int64(flag)
		result.SetSfixedLength(value)
	}
	if flag := opts.FlagName("sfixed-lengths"); cmd.IsSet(flag) {
		value := cmd.Int64Slice(flag)
		result.SetSfixedLengths(value)
	}
	if flag := opts.FlagName("is-active"); cmd.IsSet(flag) {
		value := cmd.Bool(flag)
		result.SetIsActive(value)
	}
	if flag := opts.FlagName("is-actives"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.StringSlice(flag), func(v string) (result bool, err error) {
			return strconv.ParseBool(v)
		})
		if err != nil {
			return nil, err
		}
		result.SetIsActives(value)
	}
	if flag := opts.FlagName("data"); cmd.IsSet(flag) {
		value, err := base64.StdEncoding.DecodeString(cmd.String(flag))
		if err != nil {
			return nil, err
		}
		result.SetData(value)
	}
	if flag := opts.FlagName("datas"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.StringSlice(flag), func(v string) (result []byte, err error) {
			return base64.StdEncoding.DecodeString(v)
		})
		if err != nil {
			return nil, err
		}
		result.SetDatas(value)
	}
	if flag := opts.FlagName("address"); cmd.IsSet(flag) {
		var tmp Address
		if err := protojson.Unmarshal([]byte(cmd.String(flag)), &tmp); err != nil {
			return nil, fmt.Errorf("error unmarshalling \"address\" flag: %w", err)
		}
		value := &tmp
		result.SetAddress(value)
	}
	if flag := opts.FlagName("previous-addresses"); cmd.IsSet(flag) {
		value, err := convert.MapSliceFunc(cmd.StringSlice(flag), func(v string) (*Address, error) {
			var tmp Address
			if err := protojson.Unmarshal([]byte(v), &tmp); err != nil {
				return nil, fmt.Errorf("error unmarshalling \"previous-addresses\" flag: %w", err)
			}
			return &tmp, nil
		})
		if err != nil {
			return nil, err
		}
		result.SetPreviousAddresses(value)
	}
	if flag := opts.FlagName("oneof-name"); cmd.IsSet(flag) {
		value := cmd.String(flag)
		result.SetOneofName(value)
	}
	if flag := opts.FlagName("oneof-score"); cmd.IsSet(flag) {
		value := cmd.Float64(flag)
		result.SetOneofScore(value)
	}
	if flag := opts.FlagName("oneof-ratio"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[float64, float32](cmd.Float64(flag))
		if err != nil {
			return nil, err
		}
		result.SetOneofRatio(value)
	}
	if flag := opts.FlagName("oneof-age"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[int64, int32](cmd.Int64(flag))
		if err != nil {
			return nil, err
		}
		result.SetOneofAge(value)
	}
	if flag := opts.FlagName("oneof-id"); cmd.IsSet(flag) {
		value := cmd.Int64(flag)
		result.SetOneofId(value)
	}
	if flag := opts.FlagName("oneof-status"); cmd.IsSet(flag) {
		enumID, ok := Status_value[cmd.String(flag)]
		if !ok {
			return nil, fmt.Errorf("invalid value for enum field %s", "OneofStatus")
		}
		value := Status(enumID)
		result.SetOneofStatus(value)
	}
	if flag := opts.FlagName("oneof-size"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[uint64, uint32](cmd.Uint64(flag))
		if err != nil {
			return nil, err
		}
		result.SetOneofSize(value)
	}
	if flag := opts.FlagName("oneof-length"); cmd.IsSet(flag) {
		value := cmd.Uint64(flag)
		result.SetOneofLength(value)
	}
	if flag := opts.FlagName("oneof-connection-id"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[int64, int32](cmd.Int64(flag))
		if err != nil {
			return nil, err
		}
		result.SetOneofConnectionId(value)
	}
	if flag := opts.FlagName("oneof-session-id"); cmd.IsSet(flag) {
		value := cmd.Int64(flag)
		result.SetOneofSessionId(value)
	}
	if flag := opts.FlagName("oneof-fixed-size"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[uint64, uint32](cmd.Uint64(flag))
		if err != nil {
			return nil, err
		}
		result.SetOneofFixedSize(value)
	}
	if flag := opts.FlagName("oneof-fixed-length"); cmd.IsSet(flag) {
		value := cmd.Uint64(flag)
		result.SetOneofFixedLength(value)
	}
	if flag := opts.FlagName("oneof-sfixed-size"); cmd.IsSet(flag) {
		value, err := convert.SafeCast[int64, int32](cmd.Int64(flag))
		if err != nil {
			return nil, err
		}
		result.SetOneofSfixedSize(value)
	}
	if flag := opts.FlagName("oneof-sfixed-length"); cmd.IsSet(flag) {
		value := cmd.Int64(flag)
		result.SetOneofSfixedLength(value)
	}
	if flag := opts.FlagName("oneof-is-active"); cmd.IsSet(flag) {
		value := cmd.Bool(flag)
		result.SetOneofIsActive(value)
	}
	if flag := opts.FlagName("oneof-data"); cmd.IsSet(flag) {
		value, err := base64.StdEncoding.DecodeString(cmd.String(flag))
		if err != nil {
			return nil, err
		}
		result.SetOneofData(value)
	}
	if flag := opts.FlagName("oneof-address"); cmd.IsSet(flag) {
		var tmp Address
		if err := protojson.Unmarshal([]byte(cmd.String(flag)), &tmp); err != nil {
			return nil, fmt.Errorf("error unmarshalling \"oneof-address\" flag: %w", err)
		}
		value := &tmp
		result.SetOneofAddress(value)
	}
	return &result, nil
}

// WithHybridSchemeTypes registers all Hybrid protobuf types with the given scheme
func WithHybridSchemeTypes() scheme.Option {
	return func(s *scheme.Scheme) {
		s.RegisterType(File_test_opaque_hybrid_proto.Messages().ByName("HybridExample"))
		s.RegisterType(File_test_opaque_hybrid_proto.Messages().ByName("HybridExample").Messages().ByName("ExtraEntry"))
	}
}
