packer-cn/vendor/github.com/yandex-cloud/go-sdk/gen/triggers/trigger.go

78 lines
2.6 KiB
Go

// Code generated by sdkgen. DO NOT EDIT.
//nolint
package triggers
import (
"context"
"google.golang.org/grpc"
"github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
"github.com/yandex-cloud/go-genproto/yandex/cloud/serverless/triggers/v1"
)
//revive:disable
// TriggerServiceClient is a triggers.TriggerServiceClient with
// lazy GRPC connection initialization.
type TriggerServiceClient struct {
getConn func(ctx context.Context) (*grpc.ClientConn, error)
}
var _ triggers.TriggerServiceClient = &TriggerServiceClient{}
// Create implements triggers.TriggerServiceClient
func (c *TriggerServiceClient) Create(ctx context.Context, in *triggers.CreateTriggerRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return triggers.NewTriggerServiceClient(conn).Create(ctx, in, opts...)
}
// Delete implements triggers.TriggerServiceClient
func (c *TriggerServiceClient) Delete(ctx context.Context, in *triggers.DeleteTriggerRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return triggers.NewTriggerServiceClient(conn).Delete(ctx, in, opts...)
}
// Get implements triggers.TriggerServiceClient
func (c *TriggerServiceClient) Get(ctx context.Context, in *triggers.GetTriggerRequest, opts ...grpc.CallOption) (*triggers.Trigger, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return triggers.NewTriggerServiceClient(conn).Get(ctx, in, opts...)
}
// List implements triggers.TriggerServiceClient
func (c *TriggerServiceClient) List(ctx context.Context, in *triggers.ListTriggersRequest, opts ...grpc.CallOption) (*triggers.ListTriggersResponse, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return triggers.NewTriggerServiceClient(conn).List(ctx, in, opts...)
}
// ListOperations implements triggers.TriggerServiceClient
func (c *TriggerServiceClient) ListOperations(ctx context.Context, in *triggers.ListTriggerOperationsRequest, opts ...grpc.CallOption) (*triggers.ListTriggerOperationsResponse, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return triggers.NewTriggerServiceClient(conn).ListOperations(ctx, in, opts...)
}
// Update implements triggers.TriggerServiceClient
func (c *TriggerServiceClient) Update(ctx context.Context, in *triggers.UpdateTriggerRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return triggers.NewTriggerServiceClient(conn).Update(ctx, in, opts...)
}