mirror of https://github.com/hashicorp/boundary
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
411 lines
18 KiB
411 lines
18 KiB
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc (unknown)
|
|
// source: controller/api/services/v1/account_service.proto
|
|
|
|
package services
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
AccountService_GetAccount_FullMethodName = "/controller.api.services.v1.AccountService/GetAccount"
|
|
AccountService_ListAccounts_FullMethodName = "/controller.api.services.v1.AccountService/ListAccounts"
|
|
AccountService_CreateAccount_FullMethodName = "/controller.api.services.v1.AccountService/CreateAccount"
|
|
AccountService_UpdateAccount_FullMethodName = "/controller.api.services.v1.AccountService/UpdateAccount"
|
|
AccountService_DeleteAccount_FullMethodName = "/controller.api.services.v1.AccountService/DeleteAccount"
|
|
AccountService_SetPassword_FullMethodName = "/controller.api.services.v1.AccountService/SetPassword"
|
|
AccountService_ChangePassword_FullMethodName = "/controller.api.services.v1.AccountService/ChangePassword"
|
|
)
|
|
|
|
// AccountServiceClient is the client API for AccountService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
type AccountServiceClient interface {
|
|
// GetAccount returns a stored account if present. The provided request must
|
|
// include the id for the account be retrieved. If missing, malformed or
|
|
// referencing a non existing account an error is returned.
|
|
GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*GetAccountResponse, error)
|
|
// ListAccounts returns a list of stored accounts which exist inside the
|
|
// provided auth method. The request must include the auth method id which
|
|
// contains the accounts being listed. If missing or malformed, an error
|
|
// is returned.
|
|
ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error)
|
|
// CreateAccount creates and stores an account in boundary. The provided
|
|
// request must include the auth method ID in which the account will be
|
|
// created. If the auth method ID is missing, malformed, or references a non
|
|
// existing resource an error is returned. If a name or login_name is
|
|
// provided that is in use in another account in the same auth method an
|
|
// error is returned.
|
|
CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error)
|
|
// UpdateAccount updates an existing account in boundary. The provided account
|
|
// must not have any read only fields set. The update mask must be included in
|
|
// the request and contain at least 1 mutable field. To unset a field's value,
|
|
// include the field in the update mask and don't set it in the provided
|
|
// account. An error is returned if the account id is missing or references a
|
|
// non-existing resource. An error is also returned if the request attempts
|
|
// to update the name or login_name to one that is already in use in the
|
|
// containing auth method.
|
|
UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...grpc.CallOption) (*UpdateAccountResponse, error)
|
|
// DeleteAccount removes an account from Boundary. If the provided account Id
|
|
// is malformed or not provided an error is returned.
|
|
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error)
|
|
// SetPassword sets the account's password to the one provided in the
|
|
// request. This method is intended for administration purpose and as such
|
|
// does not require the old password.
|
|
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*SetPasswordResponse, error)
|
|
// ChangePassword changes the account's password to the one provided in the
|
|
// request. This method is intended for end users and requires the existing
|
|
// password to be provided for authentication purposes.
|
|
ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
|
|
}
|
|
|
|
type accountServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient {
|
|
return &accountServiceClient{cc}
|
|
}
|
|
|
|
func (c *accountServiceClient) GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*GetAccountResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetAccountResponse)
|
|
err := c.cc.Invoke(ctx, AccountService_GetAccount_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountServiceClient) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListAccountsResponse)
|
|
err := c.cc.Invoke(ctx, AccountService_ListAccounts_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountServiceClient) CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CreateAccountResponse)
|
|
err := c.cc.Invoke(ctx, AccountService_CreateAccount_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountServiceClient) UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...grpc.CallOption) (*UpdateAccountResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(UpdateAccountResponse)
|
|
err := c.cc.Invoke(ctx, AccountService_UpdateAccount_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountServiceClient) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeleteAccountResponse)
|
|
err := c.cc.Invoke(ctx, AccountService_DeleteAccount_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountServiceClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*SetPasswordResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SetPasswordResponse)
|
|
err := c.cc.Invoke(ctx, AccountService_SetPassword_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountServiceClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ChangePasswordResponse)
|
|
err := c.cc.Invoke(ctx, AccountService_ChangePassword_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AccountServiceServer is the server API for AccountService service.
|
|
// All implementations must embed UnimplementedAccountServiceServer
|
|
// for forward compatibility.
|
|
type AccountServiceServer interface {
|
|
// GetAccount returns a stored account if present. The provided request must
|
|
// include the id for the account be retrieved. If missing, malformed or
|
|
// referencing a non existing account an error is returned.
|
|
GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error)
|
|
// ListAccounts returns a list of stored accounts which exist inside the
|
|
// provided auth method. The request must include the auth method id which
|
|
// contains the accounts being listed. If missing or malformed, an error
|
|
// is returned.
|
|
ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error)
|
|
// CreateAccount creates and stores an account in boundary. The provided
|
|
// request must include the auth method ID in which the account will be
|
|
// created. If the auth method ID is missing, malformed, or references a non
|
|
// existing resource an error is returned. If a name or login_name is
|
|
// provided that is in use in another account in the same auth method an
|
|
// error is returned.
|
|
CreateAccount(context.Context, *CreateAccountRequest) (*CreateAccountResponse, error)
|
|
// UpdateAccount updates an existing account in boundary. The provided account
|
|
// must not have any read only fields set. The update mask must be included in
|
|
// the request and contain at least 1 mutable field. To unset a field's value,
|
|
// include the field in the update mask and don't set it in the provided
|
|
// account. An error is returned if the account id is missing or references a
|
|
// non-existing resource. An error is also returned if the request attempts
|
|
// to update the name or login_name to one that is already in use in the
|
|
// containing auth method.
|
|
UpdateAccount(context.Context, *UpdateAccountRequest) (*UpdateAccountResponse, error)
|
|
// DeleteAccount removes an account from Boundary. If the provided account Id
|
|
// is malformed or not provided an error is returned.
|
|
DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error)
|
|
// SetPassword sets the account's password to the one provided in the
|
|
// request. This method is intended for administration purpose and as such
|
|
// does not require the old password.
|
|
SetPassword(context.Context, *SetPasswordRequest) (*SetPasswordResponse, error)
|
|
// ChangePassword changes the account's password to the one provided in the
|
|
// request. This method is intended for end users and requires the existing
|
|
// password to be provided for authentication purposes.
|
|
ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
|
|
mustEmbedUnimplementedAccountServiceServer()
|
|
}
|
|
|
|
// UnimplementedAccountServiceServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedAccountServiceServer struct{}
|
|
|
|
func (UnimplementedAccountServiceServer) GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetAccount not implemented")
|
|
}
|
|
func (UnimplementedAccountServiceServer) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListAccounts not implemented")
|
|
}
|
|
func (UnimplementedAccountServiceServer) CreateAccount(context.Context, *CreateAccountRequest) (*CreateAccountResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateAccount not implemented")
|
|
}
|
|
func (UnimplementedAccountServiceServer) UpdateAccount(context.Context, *UpdateAccountRequest) (*UpdateAccountResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateAccount not implemented")
|
|
}
|
|
func (UnimplementedAccountServiceServer) DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteAccount not implemented")
|
|
}
|
|
func (UnimplementedAccountServiceServer) SetPassword(context.Context, *SetPasswordRequest) (*SetPasswordResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
|
|
}
|
|
func (UnimplementedAccountServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented")
|
|
}
|
|
func (UnimplementedAccountServiceServer) mustEmbedUnimplementedAccountServiceServer() {}
|
|
func (UnimplementedAccountServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AccountServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAccountServiceServer interface {
|
|
mustEmbedUnimplementedAccountServiceServer()
|
|
}
|
|
|
|
func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedAccountServiceServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&AccountService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AccountService_GetAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetAccountRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccountServiceServer).GetAccount(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccountService_GetAccount_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccountServiceServer).GetAccount(ctx, req.(*GetAccountRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccountService_ListAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListAccountsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccountServiceServer).ListAccounts(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccountService_ListAccounts_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccountServiceServer).ListAccounts(ctx, req.(*ListAccountsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccountService_CreateAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateAccountRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccountServiceServer).CreateAccount(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccountService_CreateAccount_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccountServiceServer).CreateAccount(ctx, req.(*CreateAccountRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccountService_UpdateAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateAccountRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccountServiceServer).UpdateAccount(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccountService_UpdateAccount_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccountServiceServer).UpdateAccount(ctx, req.(*UpdateAccountRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccountService_DeleteAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteAccountRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccountServiceServer).DeleteAccount(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccountService_DeleteAccount_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccountServiceServer).DeleteAccount(ctx, req.(*DeleteAccountRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccountService_SetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SetPasswordRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccountServiceServer).SetPassword(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccountService_SetPassword_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccountServiceServer).SetPassword(ctx, req.(*SetPasswordRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccountService_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ChangePasswordRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccountServiceServer).ChangePassword(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccountService_ChangePassword_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccountServiceServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AccountService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "controller.api.services.v1.AccountService",
|
|
HandlerType: (*AccountServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetAccount",
|
|
Handler: _AccountService_GetAccount_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListAccounts",
|
|
Handler: _AccountService_ListAccounts_Handler,
|
|
},
|
|
{
|
|
MethodName: "CreateAccount",
|
|
Handler: _AccountService_CreateAccount_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateAccount",
|
|
Handler: _AccountService_UpdateAccount_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteAccount",
|
|
Handler: _AccountService_DeleteAccount_Handler,
|
|
},
|
|
{
|
|
MethodName: "SetPassword",
|
|
Handler: _AccountService_SetPassword_Handler,
|
|
},
|
|
{
|
|
MethodName: "ChangePassword",
|
|
Handler: _AccountService_ChangePassword_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "controller/api/services/v1/account_service.proto",
|
|
}
|