iam_policy.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/iam/v1/iam_policy.proto
  3. /*
  4. Package iam is a generated protocol buffer package.
  5. It is generated from these files:
  6. google/iam/v1/iam_policy.proto
  7. google/iam/v1/policy.proto
  8. It has these top-level messages:
  9. SetIamPolicyRequest
  10. GetIamPolicyRequest
  11. TestIamPermissionsRequest
  12. TestIamPermissionsResponse
  13. Policy
  14. Binding
  15. PolicyDelta
  16. BindingDelta
  17. */
  18. package iam
  19. import proto "github.com/golang/protobuf/proto"
  20. import fmt "fmt"
  21. import math "math"
  22. import _ "google.golang.org/genproto/googleapis/api/annotations"
  23. import (
  24. context "golang.org/x/net/context"
  25. grpc "google.golang.org/grpc"
  26. )
  27. // Reference imports to suppress errors if they are not otherwise used.
  28. var _ = proto.Marshal
  29. var _ = fmt.Errorf
  30. var _ = math.Inf
  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 _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  36. // Request message for `SetIamPolicy` method.
  37. type SetIamPolicyRequest struct {
  38. // REQUIRED: The resource for which the policy is being specified.
  39. // `resource` is usually specified as a path. For example, a Project
  40. // resource is specified as `projects/{project}`.
  41. Resource string `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"`
  42. // REQUIRED: The complete policy to be applied to the `resource`. The size of
  43. // the policy is limited to a few 10s of KB. An empty policy is a
  44. // valid policy but certain Cloud Platform services (such as Projects)
  45. // might reject them.
  46. Policy *Policy `protobuf:"bytes,2,opt,name=policy" json:"policy,omitempty"`
  47. }
  48. func (m *SetIamPolicyRequest) Reset() { *m = SetIamPolicyRequest{} }
  49. func (m *SetIamPolicyRequest) String() string { return proto.CompactTextString(m) }
  50. func (*SetIamPolicyRequest) ProtoMessage() {}
  51. func (*SetIamPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  52. func (m *SetIamPolicyRequest) GetResource() string {
  53. if m != nil {
  54. return m.Resource
  55. }
  56. return ""
  57. }
  58. func (m *SetIamPolicyRequest) GetPolicy() *Policy {
  59. if m != nil {
  60. return m.Policy
  61. }
  62. return nil
  63. }
  64. // Request message for `GetIamPolicy` method.
  65. type GetIamPolicyRequest struct {
  66. // REQUIRED: The resource for which the policy is being requested.
  67. // `resource` is usually specified as a path. For example, a Project
  68. // resource is specified as `projects/{project}`.
  69. Resource string `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"`
  70. }
  71. func (m *GetIamPolicyRequest) Reset() { *m = GetIamPolicyRequest{} }
  72. func (m *GetIamPolicyRequest) String() string { return proto.CompactTextString(m) }
  73. func (*GetIamPolicyRequest) ProtoMessage() {}
  74. func (*GetIamPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  75. func (m *GetIamPolicyRequest) GetResource() string {
  76. if m != nil {
  77. return m.Resource
  78. }
  79. return ""
  80. }
  81. // Request message for `TestIamPermissions` method.
  82. type TestIamPermissionsRequest struct {
  83. // REQUIRED: The resource for which the policy detail is being requested.
  84. // `resource` is usually specified as a path. For example, a Project
  85. // resource is specified as `projects/{project}`.
  86. Resource string `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"`
  87. // The set of permissions to check for the `resource`. Permissions with
  88. // wildcards (such as '*' or 'storage.*') are not allowed. For more
  89. // information see
  90. // [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
  91. Permissions []string `protobuf:"bytes,2,rep,name=permissions" json:"permissions,omitempty"`
  92. }
  93. func (m *TestIamPermissionsRequest) Reset() { *m = TestIamPermissionsRequest{} }
  94. func (m *TestIamPermissionsRequest) String() string { return proto.CompactTextString(m) }
  95. func (*TestIamPermissionsRequest) ProtoMessage() {}
  96. func (*TestIamPermissionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
  97. func (m *TestIamPermissionsRequest) GetResource() string {
  98. if m != nil {
  99. return m.Resource
  100. }
  101. return ""
  102. }
  103. func (m *TestIamPermissionsRequest) GetPermissions() []string {
  104. if m != nil {
  105. return m.Permissions
  106. }
  107. return nil
  108. }
  109. // Response message for `TestIamPermissions` method.
  110. type TestIamPermissionsResponse struct {
  111. // A subset of `TestPermissionsRequest.permissions` that the caller is
  112. // allowed.
  113. Permissions []string `protobuf:"bytes,1,rep,name=permissions" json:"permissions,omitempty"`
  114. }
  115. func (m *TestIamPermissionsResponse) Reset() { *m = TestIamPermissionsResponse{} }
  116. func (m *TestIamPermissionsResponse) String() string { return proto.CompactTextString(m) }
  117. func (*TestIamPermissionsResponse) ProtoMessage() {}
  118. func (*TestIamPermissionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
  119. func (m *TestIamPermissionsResponse) GetPermissions() []string {
  120. if m != nil {
  121. return m.Permissions
  122. }
  123. return nil
  124. }
  125. func init() {
  126. proto.RegisterType((*SetIamPolicyRequest)(nil), "google.iam.v1.SetIamPolicyRequest")
  127. proto.RegisterType((*GetIamPolicyRequest)(nil), "google.iam.v1.GetIamPolicyRequest")
  128. proto.RegisterType((*TestIamPermissionsRequest)(nil), "google.iam.v1.TestIamPermissionsRequest")
  129. proto.RegisterType((*TestIamPermissionsResponse)(nil), "google.iam.v1.TestIamPermissionsResponse")
  130. }
  131. // Reference imports to suppress errors if they are not otherwise used.
  132. var _ context.Context
  133. var _ grpc.ClientConn
  134. // This is a compile-time assertion to ensure that this generated file
  135. // is compatible with the grpc package it is being compiled against.
  136. const _ = grpc.SupportPackageIsVersion4
  137. // Client API for IAMPolicy service
  138. type IAMPolicyClient interface {
  139. // Sets the access control policy on the specified resource. Replaces any
  140. // existing policy.
  141. SetIamPolicy(ctx context.Context, in *SetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error)
  142. // Gets the access control policy for a resource.
  143. // Returns an empty policy if the resource exists and does not have a policy
  144. // set.
  145. GetIamPolicy(ctx context.Context, in *GetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error)
  146. // Returns permissions that a caller has on the specified resource.
  147. // If the resource does not exist, this will return an empty set of
  148. // permissions, not a NOT_FOUND error.
  149. TestIamPermissions(ctx context.Context, in *TestIamPermissionsRequest, opts ...grpc.CallOption) (*TestIamPermissionsResponse, error)
  150. }
  151. type iAMPolicyClient struct {
  152. cc *grpc.ClientConn
  153. }
  154. func NewIAMPolicyClient(cc *grpc.ClientConn) IAMPolicyClient {
  155. return &iAMPolicyClient{cc}
  156. }
  157. func (c *iAMPolicyClient) SetIamPolicy(ctx context.Context, in *SetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) {
  158. out := new(Policy)
  159. err := grpc.Invoke(ctx, "/google.iam.v1.IAMPolicy/SetIamPolicy", in, out, c.cc, opts...)
  160. if err != nil {
  161. return nil, err
  162. }
  163. return out, nil
  164. }
  165. func (c *iAMPolicyClient) GetIamPolicy(ctx context.Context, in *GetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) {
  166. out := new(Policy)
  167. err := grpc.Invoke(ctx, "/google.iam.v1.IAMPolicy/GetIamPolicy", in, out, c.cc, opts...)
  168. if err != nil {
  169. return nil, err
  170. }
  171. return out, nil
  172. }
  173. func (c *iAMPolicyClient) TestIamPermissions(ctx context.Context, in *TestIamPermissionsRequest, opts ...grpc.CallOption) (*TestIamPermissionsResponse, error) {
  174. out := new(TestIamPermissionsResponse)
  175. err := grpc.Invoke(ctx, "/google.iam.v1.IAMPolicy/TestIamPermissions", in, out, c.cc, opts...)
  176. if err != nil {
  177. return nil, err
  178. }
  179. return out, nil
  180. }
  181. // Server API for IAMPolicy service
  182. type IAMPolicyServer interface {
  183. // Sets the access control policy on the specified resource. Replaces any
  184. // existing policy.
  185. SetIamPolicy(context.Context, *SetIamPolicyRequest) (*Policy, error)
  186. // Gets the access control policy for a resource.
  187. // Returns an empty policy if the resource exists and does not have a policy
  188. // set.
  189. GetIamPolicy(context.Context, *GetIamPolicyRequest) (*Policy, error)
  190. // Returns permissions that a caller has on the specified resource.
  191. // If the resource does not exist, this will return an empty set of
  192. // permissions, not a NOT_FOUND error.
  193. TestIamPermissions(context.Context, *TestIamPermissionsRequest) (*TestIamPermissionsResponse, error)
  194. }
  195. func RegisterIAMPolicyServer(s *grpc.Server, srv IAMPolicyServer) {
  196. s.RegisterService(&_IAMPolicy_serviceDesc, srv)
  197. }
  198. func _IAMPolicy_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  199. in := new(SetIamPolicyRequest)
  200. if err := dec(in); err != nil {
  201. return nil, err
  202. }
  203. if interceptor == nil {
  204. return srv.(IAMPolicyServer).SetIamPolicy(ctx, in)
  205. }
  206. info := &grpc.UnaryServerInfo{
  207. Server: srv,
  208. FullMethod: "/google.iam.v1.IAMPolicy/SetIamPolicy",
  209. }
  210. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  211. return srv.(IAMPolicyServer).SetIamPolicy(ctx, req.(*SetIamPolicyRequest))
  212. }
  213. return interceptor(ctx, in, info, handler)
  214. }
  215. func _IAMPolicy_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  216. in := new(GetIamPolicyRequest)
  217. if err := dec(in); err != nil {
  218. return nil, err
  219. }
  220. if interceptor == nil {
  221. return srv.(IAMPolicyServer).GetIamPolicy(ctx, in)
  222. }
  223. info := &grpc.UnaryServerInfo{
  224. Server: srv,
  225. FullMethod: "/google.iam.v1.IAMPolicy/GetIamPolicy",
  226. }
  227. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  228. return srv.(IAMPolicyServer).GetIamPolicy(ctx, req.(*GetIamPolicyRequest))
  229. }
  230. return interceptor(ctx, in, info, handler)
  231. }
  232. func _IAMPolicy_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  233. in := new(TestIamPermissionsRequest)
  234. if err := dec(in); err != nil {
  235. return nil, err
  236. }
  237. if interceptor == nil {
  238. return srv.(IAMPolicyServer).TestIamPermissions(ctx, in)
  239. }
  240. info := &grpc.UnaryServerInfo{
  241. Server: srv,
  242. FullMethod: "/google.iam.v1.IAMPolicy/TestIamPermissions",
  243. }
  244. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  245. return srv.(IAMPolicyServer).TestIamPermissions(ctx, req.(*TestIamPermissionsRequest))
  246. }
  247. return interceptor(ctx, in, info, handler)
  248. }
  249. var _IAMPolicy_serviceDesc = grpc.ServiceDesc{
  250. ServiceName: "google.iam.v1.IAMPolicy",
  251. HandlerType: (*IAMPolicyServer)(nil),
  252. Methods: []grpc.MethodDesc{
  253. {
  254. MethodName: "SetIamPolicy",
  255. Handler: _IAMPolicy_SetIamPolicy_Handler,
  256. },
  257. {
  258. MethodName: "GetIamPolicy",
  259. Handler: _IAMPolicy_GetIamPolicy_Handler,
  260. },
  261. {
  262. MethodName: "TestIamPermissions",
  263. Handler: _IAMPolicy_TestIamPermissions_Handler,
  264. },
  265. },
  266. Streams: []grpc.StreamDesc{},
  267. Metadata: "google/iam/v1/iam_policy.proto",
  268. }
  269. func init() { proto.RegisterFile("google/iam/v1/iam_policy.proto", fileDescriptor0) }
  270. var fileDescriptor0 = []byte{
  271. // 411 bytes of a gzipped FileDescriptorProto
  272. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
  273. 0xcf, 0x49, 0xd5, 0xcf, 0x4c, 0xcc, 0xd5, 0x2f, 0x33, 0x04, 0x51, 0xf1, 0x05, 0xf9, 0x39, 0x99,
  274. 0xc9, 0x95, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xbc, 0x10, 0x79, 0xbd, 0xcc, 0xc4, 0x5c,
  275. 0xbd, 0x32, 0x43, 0x29, 0x19, 0xa8, 0xf2, 0xc4, 0x82, 0x4c, 0xfd, 0xc4, 0xbc, 0xbc, 0xfc, 0x92,
  276. 0xc4, 0x92, 0xcc, 0xfc, 0xbc, 0x62, 0x88, 0x62, 0x29, 0x29, 0x54, 0xc3, 0x90, 0x0d, 0x52, 0x4a,
  277. 0xe0, 0x12, 0x0e, 0x4e, 0x2d, 0xf1, 0x4c, 0xcc, 0x0d, 0x00, 0x8b, 0x06, 0xa5, 0x16, 0x96, 0xa6,
  278. 0x16, 0x97, 0x08, 0x49, 0x71, 0x71, 0x14, 0xa5, 0x16, 0xe7, 0x97, 0x16, 0x25, 0xa7, 0x4a, 0x30,
  279. 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xf9, 0x42, 0xba, 0x5c, 0x6c, 0x10, 0x23, 0x24, 0x98, 0x14,
  280. 0x18, 0x35, 0xb8, 0x8d, 0x44, 0xf5, 0x50, 0x1c, 0xa3, 0x07, 0x35, 0x09, 0xaa, 0x48, 0xc9, 0x90,
  281. 0x4b, 0xd8, 0x9d, 0x34, 0x1b, 0x94, 0x22, 0xb9, 0x24, 0x43, 0x52, 0x8b, 0xc1, 0x7a, 0x52, 0x8b,
  282. 0x72, 0x33, 0x8b, 0x8b, 0x41, 0x9e, 0x21, 0xc6, 0x69, 0x0a, 0x5c, 0xdc, 0x05, 0x08, 0x1d, 0x12,
  283. 0x4c, 0x0a, 0xcc, 0x1a, 0x9c, 0x41, 0xc8, 0x42, 0x4a, 0x76, 0x5c, 0x52, 0xd8, 0x8c, 0x2e, 0x2e,
  284. 0xc8, 0xcf, 0x2b, 0xc6, 0xd0, 0xcf, 0x88, 0xa1, 0xdf, 0x68, 0x0a, 0x33, 0x17, 0xa7, 0xa7, 0xa3,
  285. 0x2f, 0xc4, 0x2f, 0x42, 0x25, 0x5c, 0x3c, 0xc8, 0xa1, 0x27, 0xa4, 0x84, 0x16, 0x14, 0x58, 0x82,
  286. 0x56, 0x0a, 0x7b, 0x70, 0x29, 0x69, 0x36, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x59, 0x49, 0x0e, 0x14,
  287. 0x45, 0xd5, 0x30, 0x1f, 0xd9, 0x6a, 0x69, 0xd5, 0x5a, 0x15, 0x23, 0x99, 0x62, 0xc5, 0xa8, 0x05,
  288. 0xb2, 0xd5, 0x1d, 0x9f, 0xad, 0xee, 0x54, 0xb1, 0x35, 0x1d, 0xcd, 0xd6, 0x59, 0x8c, 0x5c, 0x42,
  289. 0x98, 0x41, 0x27, 0xa4, 0x81, 0x66, 0x30, 0xce, 0x88, 0x93, 0xd2, 0x24, 0x42, 0x25, 0x24, 0x1e,
  290. 0x94, 0xf4, 0xc1, 0xce, 0xd2, 0x54, 0x52, 0xc1, 0x74, 0x56, 0x09, 0x86, 0x2e, 0x2b, 0x46, 0x2d,
  291. 0xa7, 0x36, 0x46, 0x2e, 0xc1, 0xe4, 0xfc, 0x5c, 0x54, 0x1b, 0x9c, 0xf8, 0xe0, 0x1e, 0x08, 0x00,
  292. 0x25, 0xf6, 0x00, 0xc6, 0x28, 0x03, 0xa8, 0x82, 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0xbd, 0xfc,
  293. 0xa2, 0x74, 0xfd, 0xf4, 0xd4, 0x3c, 0x70, 0x56, 0xd0, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0x43,
  294. 0x73, 0x8a, 0x75, 0x66, 0x62, 0xee, 0x0f, 0x46, 0xc6, 0x55, 0x4c, 0xc2, 0xee, 0x10, 0x5d, 0xce,
  295. 0x39, 0xf9, 0xa5, 0x29, 0x7a, 0x9e, 0x89, 0xb9, 0x7a, 0x61, 0x86, 0xa7, 0x60, 0xa2, 0x31, 0x60,
  296. 0xd1, 0x18, 0xcf, 0xc4, 0xdc, 0x98, 0x30, 0xc3, 0x24, 0x36, 0xb0, 0x59, 0xc6, 0x80, 0x00, 0x00,
  297. 0x00, 0xff, 0xff, 0xea, 0x62, 0x8f, 0x22, 0xc1, 0x03, 0x00, 0x00,
  298. }