// Code generated by protoc-gen-go-nexus-temporal. DO NOT EDIT.
// versions:
//
//	protoc-gen-go-nexus-temporal dev (latest)
//	go go1.23.6
//	protoc (unknown)
//
// source: example/nexus/v1/nexus.proto
package nexusv1nexustemporal

import (
	v1 "github.com/cludden/protoc-gen-go-temporal/gen/example/nexus/v1"
	nexusv1nexus "github.com/cludden/protoc-gen-go-temporal/gen/example/nexus/v1/nexusv1nexus"
	workflow "go.temporal.io/sdk/workflow"
)

type GreetingServiceNexusClient struct {
	client workflow.NexusClient
}

// NewGreetingServiceNexusClient initializes a new GreetingServiceNexusClient.
func NewGreetingServiceNexusClient(endpoint string) *GreetingServiceNexusClient {
	return &GreetingServiceNexusClient{
		client: workflow.NewNexusClient(endpoint, nexusv1nexus.GreetingServiceServiceName),
	}
}

type HelloFuture struct {
	workflow.NexusOperationFuture
}

func (f *HelloFuture) GetTyped(ctx workflow.Context) (*v1.HelloOutput, error) {
	var output v1.HelloOutput
	err := f.Get(ctx, &output)
	return &output, err
}
func (c *GreetingServiceNexusClient) HelloAsync(ctx workflow.Context, input *v1.HelloInput, options workflow.NexusOperationOptions) HelloFuture {
	fut := c.client.ExecuteOperation(ctx, nexusv1nexus.GreetingServiceHelloOperationName, input, options)
	return HelloFuture{
		fut,
	}
}
func (c *GreetingServiceNexusClient) Hello(ctx workflow.Context, input *v1.HelloInput, options workflow.NexusOperationOptions) (*v1.HelloOutput, error) {
	var output v1.HelloOutput
	fut := c.client.ExecuteOperation(ctx, nexusv1nexus.GreetingServiceHelloOperationName, input, options)
	err := fut.Get(ctx, &output)
	return &output, err
}
