api_endpoint.go raw

   1  // Code generated by sdkgen-v2. DO NOT EDIT.
   2  package endpointsdk
   3  
   4  import (
   5  	"context"
   6  
   7  	endpoint "github.com/yandex-cloud/go-genproto/yandex/cloud/endpoint"
   8  	"github.com/yandex-cloud/go-sdk/v2/pkg/transport"
   9  	"google.golang.org/grpc"
  10  	"google.golang.org/protobuf/reflect/protoreflect"
  11  )
  12  
  13  // ApiEndpointClient provides methods for managing ApiEndpoint resources of Yandex.Cloud Endpoint.
  14  type ApiEndpointClient interface {
  15  	Get(context.Context, *endpoint.GetApiEndpointRequest, ...grpc.CallOption) (*endpoint.ApiEndpoint, error)
  16  	List(context.Context, *endpoint.ListApiEndpointsRequest, ...grpc.CallOption) (*endpoint.ListApiEndpointsResponse, error)
  17  }
  18  
  19  var _ ApiEndpointClient = apiEndpointClient{}
  20  
  21  type apiEndpointClient struct {
  22  	connector transport.Connector
  23  }
  24  
  25  // NewApiEndpointClient returns ApiEndpointClient implementation.
  26  func NewApiEndpointClient(connector transport.Connector) ApiEndpointClient {
  27  	return apiEndpointClient{connector}
  28  }
  29  
  30  // Get is an operation of Yandex.Cloud Endpoint ApiEndpoint service.
  31  func (c apiEndpointClient) Get(ctx context.Context, in *endpoint.GetApiEndpointRequest, opts ...grpc.CallOption) (*endpoint.ApiEndpoint, error) {
  32  	connection, err := c.connector.GetConnection(ctx, ApiEndpointGet, opts...)
  33  	if err != nil {
  34  		return nil, err
  35  	}
  36  	return endpoint.NewApiEndpointServiceClient(connection).Get(ctx, in, opts...)
  37  }
  38  
  39  // List is an operation of Yandex.Cloud Endpoint ApiEndpoint service.
  40  func (c apiEndpointClient) List(ctx context.Context, in *endpoint.ListApiEndpointsRequest, opts ...grpc.CallOption) (*endpoint.ListApiEndpointsResponse, error) {
  41  	connection, err := c.connector.GetConnection(ctx, ApiEndpointList, opts...)
  42  	if err != nil {
  43  		return nil, err
  44  	}
  45  	return endpoint.NewApiEndpointServiceClient(connection).List(ctx, in, opts...)
  46  }
  47  
  48  var (
  49  	ApiEndpointGet  = protoreflect.FullName("yandex.cloud.endpoint.ApiEndpointService.Get")
  50  	ApiEndpointList = protoreflect.FullName("yandex.cloud.endpoint.ApiEndpointService.List")
  51  )
  52