// Code generated by sdkgen. DO NOT EDIT.

//nolint
package awscompatibility

import (
	"context"

	"github.com/golang/protobuf/ptypes/empty"
	"google.golang.org/grpc"

	"github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1/awscompatibility"
)

//revive:disable

// AccessKeyServiceClient is a awscompatibility.AccessKeyServiceClient with
// lazy GRPC connection initialization.
type AccessKeyServiceClient struct {
	getConn func(ctx context.Context) (*grpc.ClientConn, error)
}

var _ awscompatibility.AccessKeyServiceClient = &AccessKeyServiceClient{}

// Create implements awscompatibility.AccessKeyServiceClient
func (c *AccessKeyServiceClient) Create(ctx context.Context, in *awscompatibility.CreateAccessKeyRequest, opts ...grpc.CallOption) (*awscompatibility.CreateAccessKeyResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return awscompatibility.NewAccessKeyServiceClient(conn).Create(ctx, in, opts...)
}

// Delete implements awscompatibility.AccessKeyServiceClient
func (c *AccessKeyServiceClient) Delete(ctx context.Context, in *awscompatibility.DeleteAccessKeyRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return awscompatibility.NewAccessKeyServiceClient(conn).Delete(ctx, in, opts...)
}

// Get implements awscompatibility.AccessKeyServiceClient
func (c *AccessKeyServiceClient) Get(ctx context.Context, in *awscompatibility.GetAccessKeyRequest, opts ...grpc.CallOption) (*awscompatibility.AccessKey, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return awscompatibility.NewAccessKeyServiceClient(conn).Get(ctx, in, opts...)
}

// List implements awscompatibility.AccessKeyServiceClient
func (c *AccessKeyServiceClient) List(ctx context.Context, in *awscompatibility.ListAccessKeysRequest, opts ...grpc.CallOption) (*awscompatibility.ListAccessKeysResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return awscompatibility.NewAccessKeyServiceClient(conn).List(ctx, in, opts...)
}
