github.com/cloudwan/edgelq-sdk@v1.15.4/iam/client/v1/authorization/authorization_service.pb.client.go (about) 1 // Code generated by protoc-gen-goten-client 2 // API: AuthorizationService 3 // DO NOT EDIT!!! 4 5 package authorization_client 6 7 import ( 8 "context" 9 10 "google.golang.org/grpc" 11 "google.golang.org/protobuf/runtime/protoimpl" 12 ) 13 14 // proto imports 15 import ( 16 role_binding "github.com/cloudwan/edgelq-sdk/iam/resources/v1/role_binding" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var ( 21 _ = protoimpl.DescBuilder{} 22 _ = new(context.Context) 23 _ = grpc.ClientConn{} 24 ) 25 26 // make sure we're using proto imports 27 var ( 28 _ = &role_binding.RoleBinding{} 29 ) 30 31 // This is a compile-time assertion to ensure that this generated file 32 // is compatible with the proto package it is being compiled against. 33 // A compilation error at this line likely means your copy of the 34 // proto package needs to be updated. 35 const ( 36 // Verify that this generated code is sufficiently up-to-date. 37 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 38 // Verify that runtime/protoimpl is sufficiently up-to-date. 39 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 40 ) 41 42 // This is a compile-time assertion to ensure that this generated file 43 // is compatible with the grpc package it is being compiled against. 44 const _ = grpc.SupportPackageIsVersion6 45 46 // AuthorizationServiceClient is the client API for AuthorizationService. 47 // 48 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 49 type AuthorizationServiceClient interface { 50 GetPrincipal(ctx context.Context, in *GetPrincipalRequest, opts ...grpc.CallOption) (*GetPrincipalResponse, error) 51 WatchPrincipalUpdates(ctx context.Context, in *WatchPrincipalUpdatesRequest, opts ...grpc.CallOption) (WatchPrincipalUpdatesClientStream, error) 52 CheckMyRoleBindings(ctx context.Context, in *CheckMyRoleBindingsRequest, opts ...grpc.CallOption) (*CheckMyRoleBindingsResponse, error) 53 } 54 55 type client struct { 56 cc grpc.ClientConnInterface 57 } 58 59 func NewAuthorizationServiceClient(cc grpc.ClientConnInterface) AuthorizationServiceClient { 60 return &client{cc} 61 } 62 63 func (c *client) GetPrincipal(ctx context.Context, in *GetPrincipalRequest, opts ...grpc.CallOption) (*GetPrincipalResponse, error) { 64 out := new(GetPrincipalResponse) 65 err := c.cc.Invoke(ctx, "/ntt.iam.v1.AuthorizationService/GetPrincipal", in, out, opts...) 66 if err != nil { 67 return nil, err 68 } 69 return out, nil 70 } 71 72 func (c *client) WatchPrincipalUpdates(ctx context.Context, in *WatchPrincipalUpdatesRequest, opts ...grpc.CallOption) (WatchPrincipalUpdatesClientStream, error) { 73 stream, err := c.cc.NewStream(ctx, 74 &grpc.StreamDesc{ 75 StreamName: "WatchPrincipalUpdates", 76 ServerStreams: true, 77 }, 78 "/ntt.iam.v1.AuthorizationService/WatchPrincipalUpdates", opts...) 79 if err != nil { 80 return nil, err 81 } 82 x := &watchPrincipalUpdatesWatchPrincipalUpdatesClient{stream} 83 if err := x.ClientStream.SendMsg(in); err != nil { 84 return nil, err 85 } 86 if err := x.ClientStream.CloseSend(); err != nil { 87 return nil, err 88 } 89 return x, nil 90 } 91 92 type WatchPrincipalUpdatesClientStream interface { 93 Recv() (*WatchPrincipalUpdatesResponse, error) 94 grpc.ClientStream 95 } 96 97 type watchPrincipalUpdatesWatchPrincipalUpdatesClient struct { 98 grpc.ClientStream 99 } 100 101 func (x *watchPrincipalUpdatesWatchPrincipalUpdatesClient) Recv() (*WatchPrincipalUpdatesResponse, error) { 102 m := new(WatchPrincipalUpdatesResponse) 103 if err := x.ClientStream.RecvMsg(m); err != nil { 104 return nil, err 105 } 106 return m, nil 107 } 108 109 func (c *client) CheckMyRoleBindings(ctx context.Context, in *CheckMyRoleBindingsRequest, opts ...grpc.CallOption) (*CheckMyRoleBindingsResponse, error) { 110 out := new(CheckMyRoleBindingsResponse) 111 err := c.cc.Invoke(ctx, "/ntt.iam.v1.AuthorizationService/CheckMyRoleBindings", in, out, opts...) 112 if err != nil { 113 return nil, err 114 } 115 return out, nil 116 }