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.
 
 
 

659 lines
27 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/api/servicecontrol/v1/service_controller.proto
  3. package servicecontrol // import "google.golang.org/genproto/googleapis/api/servicecontrol/v1"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _ "google.golang.org/genproto/googleapis/api/annotations"
  8. import status "google.golang.org/genproto/googleapis/rpc/status"
  9. import (
  10. context "golang.org/x/net/context"
  11. grpc "google.golang.org/grpc"
  12. )
  13. // Reference imports to suppress errors if they are not otherwise used.
  14. var _ = proto.Marshal
  15. var _ = fmt.Errorf
  16. var _ = math.Inf
  17. // This is a compile-time assertion to ensure that this generated file
  18. // is compatible with the proto package it is being compiled against.
  19. // A compilation error at this line likely means your copy of the
  20. // proto package needs to be updated.
  21. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  22. // Request message for the Check method.
  23. type CheckRequest struct {
  24. // The service name as specified in its service configuration. For example,
  25. // `"pubsub.googleapis.com"`.
  26. //
  27. // See
  28. // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
  29. // for the definition of a service name.
  30. ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
  31. // The operation to be checked.
  32. Operation *Operation `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"`
  33. // Specifies which version of service configuration should be used to process
  34. // the request.
  35. //
  36. // If unspecified or no matching version can be found, the
  37. // latest one will be used.
  38. ServiceConfigId string `protobuf:"bytes,4,opt,name=service_config_id,json=serviceConfigId,proto3" json:"service_config_id,omitempty"`
  39. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  40. XXX_unrecognized []byte `json:"-"`
  41. XXX_sizecache int32 `json:"-"`
  42. }
  43. func (m *CheckRequest) Reset() { *m = CheckRequest{} }
  44. func (m *CheckRequest) String() string { return proto.CompactTextString(m) }
  45. func (*CheckRequest) ProtoMessage() {}
  46. func (*CheckRequest) Descriptor() ([]byte, []int) {
  47. return fileDescriptor_service_controller_63b84d9abfbd86ce, []int{0}
  48. }
  49. func (m *CheckRequest) XXX_Unmarshal(b []byte) error {
  50. return xxx_messageInfo_CheckRequest.Unmarshal(m, b)
  51. }
  52. func (m *CheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  53. return xxx_messageInfo_CheckRequest.Marshal(b, m, deterministic)
  54. }
  55. func (dst *CheckRequest) XXX_Merge(src proto.Message) {
  56. xxx_messageInfo_CheckRequest.Merge(dst, src)
  57. }
  58. func (m *CheckRequest) XXX_Size() int {
  59. return xxx_messageInfo_CheckRequest.Size(m)
  60. }
  61. func (m *CheckRequest) XXX_DiscardUnknown() {
  62. xxx_messageInfo_CheckRequest.DiscardUnknown(m)
  63. }
  64. var xxx_messageInfo_CheckRequest proto.InternalMessageInfo
  65. func (m *CheckRequest) GetServiceName() string {
  66. if m != nil {
  67. return m.ServiceName
  68. }
  69. return ""
  70. }
  71. func (m *CheckRequest) GetOperation() *Operation {
  72. if m != nil {
  73. return m.Operation
  74. }
  75. return nil
  76. }
  77. func (m *CheckRequest) GetServiceConfigId() string {
  78. if m != nil {
  79. return m.ServiceConfigId
  80. }
  81. return ""
  82. }
  83. // Response message for the Check method.
  84. type CheckResponse struct {
  85. // The same operation_id value used in the
  86. // [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
  87. // and diagnostics purposes.
  88. OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"`
  89. // Indicate the decision of the check.
  90. //
  91. // If no check errors are present, the service should process the operation.
  92. // Otherwise the service should use the list of errors to determine the
  93. // appropriate action.
  94. CheckErrors []*CheckError `protobuf:"bytes,2,rep,name=check_errors,json=checkErrors,proto3" json:"check_errors,omitempty"`
  95. // The actual config id used to process the request.
  96. ServiceConfigId string `protobuf:"bytes,5,opt,name=service_config_id,json=serviceConfigId,proto3" json:"service_config_id,omitempty"`
  97. // Feedback data returned from the server during processing a Check request.
  98. CheckInfo *CheckResponse_CheckInfo `protobuf:"bytes,6,opt,name=check_info,json=checkInfo,proto3" json:"check_info,omitempty"`
  99. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  100. XXX_unrecognized []byte `json:"-"`
  101. XXX_sizecache int32 `json:"-"`
  102. }
  103. func (m *CheckResponse) Reset() { *m = CheckResponse{} }
  104. func (m *CheckResponse) String() string { return proto.CompactTextString(m) }
  105. func (*CheckResponse) ProtoMessage() {}
  106. func (*CheckResponse) Descriptor() ([]byte, []int) {
  107. return fileDescriptor_service_controller_63b84d9abfbd86ce, []int{1}
  108. }
  109. func (m *CheckResponse) XXX_Unmarshal(b []byte) error {
  110. return xxx_messageInfo_CheckResponse.Unmarshal(m, b)
  111. }
  112. func (m *CheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  113. return xxx_messageInfo_CheckResponse.Marshal(b, m, deterministic)
  114. }
  115. func (dst *CheckResponse) XXX_Merge(src proto.Message) {
  116. xxx_messageInfo_CheckResponse.Merge(dst, src)
  117. }
  118. func (m *CheckResponse) XXX_Size() int {
  119. return xxx_messageInfo_CheckResponse.Size(m)
  120. }
  121. func (m *CheckResponse) XXX_DiscardUnknown() {
  122. xxx_messageInfo_CheckResponse.DiscardUnknown(m)
  123. }
  124. var xxx_messageInfo_CheckResponse proto.InternalMessageInfo
  125. func (m *CheckResponse) GetOperationId() string {
  126. if m != nil {
  127. return m.OperationId
  128. }
  129. return ""
  130. }
  131. func (m *CheckResponse) GetCheckErrors() []*CheckError {
  132. if m != nil {
  133. return m.CheckErrors
  134. }
  135. return nil
  136. }
  137. func (m *CheckResponse) GetServiceConfigId() string {
  138. if m != nil {
  139. return m.ServiceConfigId
  140. }
  141. return ""
  142. }
  143. func (m *CheckResponse) GetCheckInfo() *CheckResponse_CheckInfo {
  144. if m != nil {
  145. return m.CheckInfo
  146. }
  147. return nil
  148. }
  149. type CheckResponse_CheckInfo struct {
  150. // Consumer info of this check.
  151. ConsumerInfo *CheckResponse_ConsumerInfo `protobuf:"bytes,2,opt,name=consumer_info,json=consumerInfo,proto3" json:"consumer_info,omitempty"`
  152. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  153. XXX_unrecognized []byte `json:"-"`
  154. XXX_sizecache int32 `json:"-"`
  155. }
  156. func (m *CheckResponse_CheckInfo) Reset() { *m = CheckResponse_CheckInfo{} }
  157. func (m *CheckResponse_CheckInfo) String() string { return proto.CompactTextString(m) }
  158. func (*CheckResponse_CheckInfo) ProtoMessage() {}
  159. func (*CheckResponse_CheckInfo) Descriptor() ([]byte, []int) {
  160. return fileDescriptor_service_controller_63b84d9abfbd86ce, []int{1, 0}
  161. }
  162. func (m *CheckResponse_CheckInfo) XXX_Unmarshal(b []byte) error {
  163. return xxx_messageInfo_CheckResponse_CheckInfo.Unmarshal(m, b)
  164. }
  165. func (m *CheckResponse_CheckInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  166. return xxx_messageInfo_CheckResponse_CheckInfo.Marshal(b, m, deterministic)
  167. }
  168. func (dst *CheckResponse_CheckInfo) XXX_Merge(src proto.Message) {
  169. xxx_messageInfo_CheckResponse_CheckInfo.Merge(dst, src)
  170. }
  171. func (m *CheckResponse_CheckInfo) XXX_Size() int {
  172. return xxx_messageInfo_CheckResponse_CheckInfo.Size(m)
  173. }
  174. func (m *CheckResponse_CheckInfo) XXX_DiscardUnknown() {
  175. xxx_messageInfo_CheckResponse_CheckInfo.DiscardUnknown(m)
  176. }
  177. var xxx_messageInfo_CheckResponse_CheckInfo proto.InternalMessageInfo
  178. func (m *CheckResponse_CheckInfo) GetConsumerInfo() *CheckResponse_ConsumerInfo {
  179. if m != nil {
  180. return m.ConsumerInfo
  181. }
  182. return nil
  183. }
  184. // `ConsumerInfo` provides information about the consumer project.
  185. type CheckResponse_ConsumerInfo struct {
  186. // The Google cloud project number, e.g. 1234567890. A value of 0 indicates
  187. // no project number is found.
  188. ProjectNumber int64 `protobuf:"varint,1,opt,name=project_number,json=projectNumber,proto3" json:"project_number,omitempty"`
  189. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  190. XXX_unrecognized []byte `json:"-"`
  191. XXX_sizecache int32 `json:"-"`
  192. }
  193. func (m *CheckResponse_ConsumerInfo) Reset() { *m = CheckResponse_ConsumerInfo{} }
  194. func (m *CheckResponse_ConsumerInfo) String() string { return proto.CompactTextString(m) }
  195. func (*CheckResponse_ConsumerInfo) ProtoMessage() {}
  196. func (*CheckResponse_ConsumerInfo) Descriptor() ([]byte, []int) {
  197. return fileDescriptor_service_controller_63b84d9abfbd86ce, []int{1, 1}
  198. }
  199. func (m *CheckResponse_ConsumerInfo) XXX_Unmarshal(b []byte) error {
  200. return xxx_messageInfo_CheckResponse_ConsumerInfo.Unmarshal(m, b)
  201. }
  202. func (m *CheckResponse_ConsumerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  203. return xxx_messageInfo_CheckResponse_ConsumerInfo.Marshal(b, m, deterministic)
  204. }
  205. func (dst *CheckResponse_ConsumerInfo) XXX_Merge(src proto.Message) {
  206. xxx_messageInfo_CheckResponse_ConsumerInfo.Merge(dst, src)
  207. }
  208. func (m *CheckResponse_ConsumerInfo) XXX_Size() int {
  209. return xxx_messageInfo_CheckResponse_ConsumerInfo.Size(m)
  210. }
  211. func (m *CheckResponse_ConsumerInfo) XXX_DiscardUnknown() {
  212. xxx_messageInfo_CheckResponse_ConsumerInfo.DiscardUnknown(m)
  213. }
  214. var xxx_messageInfo_CheckResponse_ConsumerInfo proto.InternalMessageInfo
  215. func (m *CheckResponse_ConsumerInfo) GetProjectNumber() int64 {
  216. if m != nil {
  217. return m.ProjectNumber
  218. }
  219. return 0
  220. }
  221. // Request message for the Report method.
  222. type ReportRequest struct {
  223. // The service name as specified in its service configuration. For example,
  224. // `"pubsub.googleapis.com"`.
  225. //
  226. // See
  227. // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
  228. // for the definition of a service name.
  229. ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
  230. // Operations to be reported.
  231. //
  232. // Typically the service should report one operation per request.
  233. // Putting multiple operations into a single request is allowed, but should
  234. // be used only when multiple operations are natually available at the time
  235. // of the report.
  236. //
  237. // If multiple operations are in a single request, the total request size
  238. // should be no larger than 1MB. See
  239. // [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
  240. // for partial failure behavior.
  241. Operations []*Operation `protobuf:"bytes,2,rep,name=operations,proto3" json:"operations,omitempty"`
  242. // Specifies which version of service config should be used to process the
  243. // request.
  244. //
  245. // If unspecified or no matching version can be found, the
  246. // latest one will be used.
  247. ServiceConfigId string `protobuf:"bytes,3,opt,name=service_config_id,json=serviceConfigId,proto3" json:"service_config_id,omitempty"`
  248. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  249. XXX_unrecognized []byte `json:"-"`
  250. XXX_sizecache int32 `json:"-"`
  251. }
  252. func (m *ReportRequest) Reset() { *m = ReportRequest{} }
  253. func (m *ReportRequest) String() string { return proto.CompactTextString(m) }
  254. func (*ReportRequest) ProtoMessage() {}
  255. func (*ReportRequest) Descriptor() ([]byte, []int) {
  256. return fileDescriptor_service_controller_63b84d9abfbd86ce, []int{2}
  257. }
  258. func (m *ReportRequest) XXX_Unmarshal(b []byte) error {
  259. return xxx_messageInfo_ReportRequest.Unmarshal(m, b)
  260. }
  261. func (m *ReportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  262. return xxx_messageInfo_ReportRequest.Marshal(b, m, deterministic)
  263. }
  264. func (dst *ReportRequest) XXX_Merge(src proto.Message) {
  265. xxx_messageInfo_ReportRequest.Merge(dst, src)
  266. }
  267. func (m *ReportRequest) XXX_Size() int {
  268. return xxx_messageInfo_ReportRequest.Size(m)
  269. }
  270. func (m *ReportRequest) XXX_DiscardUnknown() {
  271. xxx_messageInfo_ReportRequest.DiscardUnknown(m)
  272. }
  273. var xxx_messageInfo_ReportRequest proto.InternalMessageInfo
  274. func (m *ReportRequest) GetServiceName() string {
  275. if m != nil {
  276. return m.ServiceName
  277. }
  278. return ""
  279. }
  280. func (m *ReportRequest) GetOperations() []*Operation {
  281. if m != nil {
  282. return m.Operations
  283. }
  284. return nil
  285. }
  286. func (m *ReportRequest) GetServiceConfigId() string {
  287. if m != nil {
  288. return m.ServiceConfigId
  289. }
  290. return ""
  291. }
  292. // Response message for the Report method.
  293. type ReportResponse struct {
  294. // Partial failures, one for each `Operation` in the request that failed
  295. // processing. There are three possible combinations of the RPC status:
  296. //
  297. // 1. The combination of a successful RPC status and an empty `report_errors`
  298. // list indicates a complete success where all `Operations` in the
  299. // request are processed successfully.
  300. // 2. The combination of a successful RPC status and a non-empty
  301. // `report_errors` list indicates a partial success where some
  302. // `Operations` in the request succeeded. Each
  303. // `Operation` that failed processing has a corresponding item
  304. // in this list.
  305. // 3. A failed RPC status indicates a general non-deterministic failure.
  306. // When this happens, it's impossible to know which of the
  307. // 'Operations' in the request succeeded or failed.
  308. ReportErrors []*ReportResponse_ReportError `protobuf:"bytes,1,rep,name=report_errors,json=reportErrors,proto3" json:"report_errors,omitempty"`
  309. // The actual config id used to process the request.
  310. ServiceConfigId string `protobuf:"bytes,2,opt,name=service_config_id,json=serviceConfigId,proto3" json:"service_config_id,omitempty"`
  311. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  312. XXX_unrecognized []byte `json:"-"`
  313. XXX_sizecache int32 `json:"-"`
  314. }
  315. func (m *ReportResponse) Reset() { *m = ReportResponse{} }
  316. func (m *ReportResponse) String() string { return proto.CompactTextString(m) }
  317. func (*ReportResponse) ProtoMessage() {}
  318. func (*ReportResponse) Descriptor() ([]byte, []int) {
  319. return fileDescriptor_service_controller_63b84d9abfbd86ce, []int{3}
  320. }
  321. func (m *ReportResponse) XXX_Unmarshal(b []byte) error {
  322. return xxx_messageInfo_ReportResponse.Unmarshal(m, b)
  323. }
  324. func (m *ReportResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  325. return xxx_messageInfo_ReportResponse.Marshal(b, m, deterministic)
  326. }
  327. func (dst *ReportResponse) XXX_Merge(src proto.Message) {
  328. xxx_messageInfo_ReportResponse.Merge(dst, src)
  329. }
  330. func (m *ReportResponse) XXX_Size() int {
  331. return xxx_messageInfo_ReportResponse.Size(m)
  332. }
  333. func (m *ReportResponse) XXX_DiscardUnknown() {
  334. xxx_messageInfo_ReportResponse.DiscardUnknown(m)
  335. }
  336. var xxx_messageInfo_ReportResponse proto.InternalMessageInfo
  337. func (m *ReportResponse) GetReportErrors() []*ReportResponse_ReportError {
  338. if m != nil {
  339. return m.ReportErrors
  340. }
  341. return nil
  342. }
  343. func (m *ReportResponse) GetServiceConfigId() string {
  344. if m != nil {
  345. return m.ServiceConfigId
  346. }
  347. return ""
  348. }
  349. // Represents the processing error of one
  350. // [Operation][google.api.servicecontrol.v1.Operation] in the request.
  351. type ReportResponse_ReportError struct {
  352. // The
  353. // [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
  354. // value from the request.
  355. OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"`
  356. // Details of the error when processing the
  357. // [Operation][google.api.servicecontrol.v1.Operation].
  358. Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
  359. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  360. XXX_unrecognized []byte `json:"-"`
  361. XXX_sizecache int32 `json:"-"`
  362. }
  363. func (m *ReportResponse_ReportError) Reset() { *m = ReportResponse_ReportError{} }
  364. func (m *ReportResponse_ReportError) String() string { return proto.CompactTextString(m) }
  365. func (*ReportResponse_ReportError) ProtoMessage() {}
  366. func (*ReportResponse_ReportError) Descriptor() ([]byte, []int) {
  367. return fileDescriptor_service_controller_63b84d9abfbd86ce, []int{3, 0}
  368. }
  369. func (m *ReportResponse_ReportError) XXX_Unmarshal(b []byte) error {
  370. return xxx_messageInfo_ReportResponse_ReportError.Unmarshal(m, b)
  371. }
  372. func (m *ReportResponse_ReportError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  373. return xxx_messageInfo_ReportResponse_ReportError.Marshal(b, m, deterministic)
  374. }
  375. func (dst *ReportResponse_ReportError) XXX_Merge(src proto.Message) {
  376. xxx_messageInfo_ReportResponse_ReportError.Merge(dst, src)
  377. }
  378. func (m *ReportResponse_ReportError) XXX_Size() int {
  379. return xxx_messageInfo_ReportResponse_ReportError.Size(m)
  380. }
  381. func (m *ReportResponse_ReportError) XXX_DiscardUnknown() {
  382. xxx_messageInfo_ReportResponse_ReportError.DiscardUnknown(m)
  383. }
  384. var xxx_messageInfo_ReportResponse_ReportError proto.InternalMessageInfo
  385. func (m *ReportResponse_ReportError) GetOperationId() string {
  386. if m != nil {
  387. return m.OperationId
  388. }
  389. return ""
  390. }
  391. func (m *ReportResponse_ReportError) GetStatus() *status.Status {
  392. if m != nil {
  393. return m.Status
  394. }
  395. return nil
  396. }
  397. func init() {
  398. proto.RegisterType((*CheckRequest)(nil), "google.api.servicecontrol.v1.CheckRequest")
  399. proto.RegisterType((*CheckResponse)(nil), "google.api.servicecontrol.v1.CheckResponse")
  400. proto.RegisterType((*CheckResponse_CheckInfo)(nil), "google.api.servicecontrol.v1.CheckResponse.CheckInfo")
  401. proto.RegisterType((*CheckResponse_ConsumerInfo)(nil), "google.api.servicecontrol.v1.CheckResponse.ConsumerInfo")
  402. proto.RegisterType((*ReportRequest)(nil), "google.api.servicecontrol.v1.ReportRequest")
  403. proto.RegisterType((*ReportResponse)(nil), "google.api.servicecontrol.v1.ReportResponse")
  404. proto.RegisterType((*ReportResponse_ReportError)(nil), "google.api.servicecontrol.v1.ReportResponse.ReportError")
  405. }
  406. // Reference imports to suppress errors if they are not otherwise used.
  407. var _ context.Context
  408. var _ grpc.ClientConn
  409. // This is a compile-time assertion to ensure that this generated file
  410. // is compatible with the grpc package it is being compiled against.
  411. const _ = grpc.SupportPackageIsVersion4
  412. // ServiceControllerClient is the client API for ServiceController service.
  413. //
  414. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  415. type ServiceControllerClient interface {
  416. // Checks an operation with Google Service Control to decide whether
  417. // the given operation should proceed. It should be called before the
  418. // operation is executed.
  419. //
  420. // If feasible, the client should cache the check results and reuse them for
  421. // 60 seconds. In case of server errors, the client can rely on the cached
  422. // results for longer time.
  423. //
  424. // NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the
  425. // size limit of 64KB.
  426. //
  427. // This method requires the `servicemanagement.services.check` permission
  428. // on the specified service. For more information, see
  429. // [Google Cloud IAM](https://cloud.google.com/iam).
  430. Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
  431. // Reports operation results to Google Service Control, such as logs and
  432. // metrics. It should be called after an operation is completed.
  433. //
  434. // If feasible, the client should aggregate reporting data for up to 5
  435. // seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
  436. // reduce data loss during client crashes. Clients should carefully choose
  437. // the aggregation time window to avoid data loss risk more than 0.01%
  438. // for business and compliance reasons.
  439. //
  440. // NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has
  441. // the size limit of 1MB.
  442. //
  443. // This method requires the `servicemanagement.services.report` permission
  444. // on the specified service. For more information, see
  445. // [Google Cloud IAM](https://cloud.google.com/iam).
  446. Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error)
  447. }
  448. type serviceControllerClient struct {
  449. cc *grpc.ClientConn
  450. }
  451. func NewServiceControllerClient(cc *grpc.ClientConn) ServiceControllerClient {
  452. return &serviceControllerClient{cc}
  453. }
  454. func (c *serviceControllerClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
  455. out := new(CheckResponse)
  456. err := c.cc.Invoke(ctx, "/google.api.servicecontrol.v1.ServiceController/Check", in, out, opts...)
  457. if err != nil {
  458. return nil, err
  459. }
  460. return out, nil
  461. }
  462. func (c *serviceControllerClient) Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) {
  463. out := new(ReportResponse)
  464. err := c.cc.Invoke(ctx, "/google.api.servicecontrol.v1.ServiceController/Report", in, out, opts...)
  465. if err != nil {
  466. return nil, err
  467. }
  468. return out, nil
  469. }
  470. // ServiceControllerServer is the server API for ServiceController service.
  471. type ServiceControllerServer interface {
  472. // Checks an operation with Google Service Control to decide whether
  473. // the given operation should proceed. It should be called before the
  474. // operation is executed.
  475. //
  476. // If feasible, the client should cache the check results and reuse them for
  477. // 60 seconds. In case of server errors, the client can rely on the cached
  478. // results for longer time.
  479. //
  480. // NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the
  481. // size limit of 64KB.
  482. //
  483. // This method requires the `servicemanagement.services.check` permission
  484. // on the specified service. For more information, see
  485. // [Google Cloud IAM](https://cloud.google.com/iam).
  486. Check(context.Context, *CheckRequest) (*CheckResponse, error)
  487. // Reports operation results to Google Service Control, such as logs and
  488. // metrics. It should be called after an operation is completed.
  489. //
  490. // If feasible, the client should aggregate reporting data for up to 5
  491. // seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
  492. // reduce data loss during client crashes. Clients should carefully choose
  493. // the aggregation time window to avoid data loss risk more than 0.01%
  494. // for business and compliance reasons.
  495. //
  496. // NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has
  497. // the size limit of 1MB.
  498. //
  499. // This method requires the `servicemanagement.services.report` permission
  500. // on the specified service. For more information, see
  501. // [Google Cloud IAM](https://cloud.google.com/iam).
  502. Report(context.Context, *ReportRequest) (*ReportResponse, error)
  503. }
  504. func RegisterServiceControllerServer(s *grpc.Server, srv ServiceControllerServer) {
  505. s.RegisterService(&_ServiceController_serviceDesc, srv)
  506. }
  507. func _ServiceController_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  508. in := new(CheckRequest)
  509. if err := dec(in); err != nil {
  510. return nil, err
  511. }
  512. if interceptor == nil {
  513. return srv.(ServiceControllerServer).Check(ctx, in)
  514. }
  515. info := &grpc.UnaryServerInfo{
  516. Server: srv,
  517. FullMethod: "/google.api.servicecontrol.v1.ServiceController/Check",
  518. }
  519. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  520. return srv.(ServiceControllerServer).Check(ctx, req.(*CheckRequest))
  521. }
  522. return interceptor(ctx, in, info, handler)
  523. }
  524. func _ServiceController_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  525. in := new(ReportRequest)
  526. if err := dec(in); err != nil {
  527. return nil, err
  528. }
  529. if interceptor == nil {
  530. return srv.(ServiceControllerServer).Report(ctx, in)
  531. }
  532. info := &grpc.UnaryServerInfo{
  533. Server: srv,
  534. FullMethod: "/google.api.servicecontrol.v1.ServiceController/Report",
  535. }
  536. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  537. return srv.(ServiceControllerServer).Report(ctx, req.(*ReportRequest))
  538. }
  539. return interceptor(ctx, in, info, handler)
  540. }
  541. var _ServiceController_serviceDesc = grpc.ServiceDesc{
  542. ServiceName: "google.api.servicecontrol.v1.ServiceController",
  543. HandlerType: (*ServiceControllerServer)(nil),
  544. Methods: []grpc.MethodDesc{
  545. {
  546. MethodName: "Check",
  547. Handler: _ServiceController_Check_Handler,
  548. },
  549. {
  550. MethodName: "Report",
  551. Handler: _ServiceController_Report_Handler,
  552. },
  553. },
  554. Streams: []grpc.StreamDesc{},
  555. Metadata: "google/api/servicecontrol/v1/service_controller.proto",
  556. }
  557. func init() {
  558. proto.RegisterFile("google/api/servicecontrol/v1/service_controller.proto", fileDescriptor_service_controller_63b84d9abfbd86ce)
  559. }
  560. var fileDescriptor_service_controller_63b84d9abfbd86ce = []byte{
  561. // 619 bytes of a gzipped FileDescriptorProto
  562. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x6e, 0xd3, 0x4c,
  563. 0x10, 0xd6, 0x3a, 0x6d, 0xa4, 0x4c, 0x9c, 0xfe, 0xea, 0x1e, 0x7e, 0x22, 0xab, 0x87, 0xd4, 0x12,
  564. 0x34, 0x4a, 0x8b, 0xad, 0x16, 0x55, 0x42, 0xe1, 0x44, 0xa3, 0xaa, 0x0a, 0x48, 0xa5, 0x72, 0x38,
  565. 0x21, 0xaa, 0xc8, 0xdd, 0x6c, 0x8c, 0x4b, 0xb2, 0x6b, 0xd6, 0x4e, 0x2e, 0x88, 0x0b, 0x0f, 0xc0,
  566. 0xa1, 0xbc, 0x01, 0xaa, 0xc4, 0x33, 0xf0, 0x1c, 0xbc, 0x02, 0x0f, 0x01, 0x37, 0x94, 0xdd, 0xb5,
  567. 0xeb, 0x08, 0x63, 0x92, 0x9b, 0xf7, 0xdb, 0x99, 0xf9, 0xbe, 0x9d, 0xf9, 0x3c, 0x70, 0x1c, 0x70,
  568. 0x1e, 0x4c, 0xa8, 0xeb, 0x47, 0xa1, 0x1b, 0x53, 0x31, 0x0f, 0x09, 0x25, 0x9c, 0x25, 0x82, 0x4f,
  569. 0xdc, 0xf9, 0x61, 0x8a, 0x0c, 0x35, 0x34, 0xa1, 0xc2, 0x89, 0x04, 0x4f, 0x38, 0xde, 0x51, 0x69,
  570. 0x8e, 0x1f, 0x85, 0xce, 0x72, 0x9a, 0x33, 0x3f, 0xb4, 0x76, 0x72, 0x45, 0x7d, 0xc6, 0x78, 0xe2,
  571. 0x27, 0x21, 0x67, 0xb1, 0xca, 0xb5, 0x9c, 0x52, 0x4a, 0xf2, 0x86, 0x92, 0xb7, 0x43, 0x2a, 0x04,
  572. 0xd7, 0x5c, 0xd6, 0x41, 0x69, 0x3c, 0x8f, 0xa8, 0x90, 0xe5, 0x75, 0xf4, 0x3d, 0x1d, 0x2d, 0x22,
  573. 0xe2, 0xc6, 0x89, 0x9f, 0xcc, 0x34, 0xad, 0x7d, 0x8b, 0xc0, 0xec, 0x2d, 0x8a, 0x7b, 0xf4, 0xdd,
  574. 0x8c, 0xc6, 0x09, 0xde, 0x05, 0x33, 0x7d, 0x1f, 0xf3, 0xa7, 0xb4, 0x89, 0x5a, 0xa8, 0x5d, 0xf3,
  575. 0xea, 0x1a, 0x3b, 0xf7, 0xa7, 0x14, 0x9f, 0x42, 0x2d, 0xab, 0xdf, 0x34, 0x5a, 0xa8, 0x5d, 0x3f,
  576. 0xda, 0x73, 0xca, 0x9e, 0xee, 0xbc, 0x48, 0xc3, 0xbd, 0xbb, 0x4c, 0xdc, 0x81, 0xed, 0x5c, 0x27,
  577. 0xc7, 0x61, 0x30, 0x0c, 0x47, 0xcd, 0x0d, 0x49, 0xf7, 0x9f, 0xbe, 0xe8, 0x49, 0xbc, 0x3f, 0xb2,
  578. 0x6f, 0x2b, 0xd0, 0xd0, 0x32, 0xe3, 0x88, 0xb3, 0x98, 0x2e, 0x74, 0x66, 0xa5, 0x16, 0x89, 0x5a,
  579. 0x67, 0x86, 0xf5, 0x47, 0xf8, 0x39, 0x98, 0xb9, 0xbe, 0xc5, 0x4d, 0xa3, 0x55, 0x69, 0xd7, 0x8f,
  580. 0xda, 0xe5, 0x52, 0x25, 0xcb, 0xe9, 0x22, 0xc1, 0xab, 0x93, 0xec, 0x3b, 0x2e, 0x56, 0xbb, 0x59,
  581. 0xa8, 0x16, 0xbf, 0x04, 0x50, 0xc4, 0x21, 0x1b, 0xf3, 0x66, 0x55, 0x76, 0xe8, 0x78, 0x05, 0xda,
  582. 0xf4, 0x71, 0xea, 0xd4, 0x67, 0x63, 0xee, 0xd5, 0x48, 0xfa, 0x69, 0x5d, 0x43, 0x2d, 0xc3, 0xf1,
  583. 0x25, 0x34, 0x08, 0x67, 0xf1, 0x6c, 0x4a, 0x85, 0x62, 0x51, 0x73, 0x78, 0xbc, 0x16, 0x8b, 0x2e,
  584. 0x20, 0x89, 0x4c, 0x92, 0x3b, 0x59, 0xc7, 0x60, 0xe6, 0x6f, 0xf1, 0x7d, 0xd8, 0x8a, 0x04, 0xbf,
  585. 0xa6, 0x24, 0x19, 0xb2, 0xd9, 0xf4, 0x8a, 0x0a, 0xd9, 0xef, 0x8a, 0xd7, 0xd0, 0xe8, 0xb9, 0x04,
  586. 0xed, 0xaf, 0x08, 0x1a, 0x1e, 0x8d, 0xb8, 0x48, 0xd6, 0xb0, 0xd3, 0x19, 0x40, 0x36, 0xb5, 0x74,
  587. 0x48, 0x2b, 0xfb, 0x29, 0x97, 0x5a, 0x3c, 0xa2, 0x4a, 0xb1, 0xa1, 0x7e, 0x21, 0xd8, 0x4a, 0x95,
  588. 0x6a, 0x47, 0x5d, 0x42, 0x43, 0x48, 0x24, 0xf5, 0x0b, 0x92, 0x52, 0xfe, 0xd1, 0xd2, 0xe5, 0x22,
  589. 0xfa, 0xa8, 0xfc, 0x63, 0x8a, 0xbb, 0xc3, 0x5f, 0xd4, 0x19, 0x85, 0xea, 0xac, 0xd7, 0x50, 0xcf,
  590. 0x15, 0x5a, 0xc5, 0xeb, 0x1d, 0xa8, 0xaa, 0xff, 0x5a, 0x1b, 0x01, 0xa7, 0xaa, 0x45, 0x44, 0x9c,
  591. 0x81, 0xbc, 0xf1, 0x74, 0xc4, 0xd1, 0x37, 0x03, 0xb6, 0x07, 0x19, 0xa3, 0x5e, 0x61, 0xf8, 0x13,
  592. 0x82, 0x4d, 0xe9, 0x0f, 0xdc, 0x59, 0xc9, 0x44, 0x72, 0xbe, 0xd6, 0xfe, 0x1a, 0x86, 0xb3, 0x0f,
  593. 0x3e, 0x7e, 0xff, 0xf1, 0xd9, 0x78, 0x60, 0xef, 0xe6, 0xb6, 0x68, 0xec, 0xbe, 0xcf, 0x1b, 0xe4,
  594. 0x43, 0x57, 0x1a, 0xbe, 0x8b, 0x3a, 0xf8, 0x06, 0x41, 0x55, 0x75, 0x01, 0xef, 0xaf, 0x36, 0x03,
  595. 0x25, 0xe9, 0x60, 0x9d, 0x81, 0xd9, 0x0f, 0xa5, 0xa6, 0x3d, 0xdb, 0x2e, 0xd3, 0xa4, 0x06, 0xd9,
  596. 0x45, 0x9d, 0x93, 0x1b, 0x04, 0x2d, 0xc2, 0xa7, 0xa5, 0x14, 0x27, 0xff, 0xff, 0xd1, 0xdd, 0x8b,
  597. 0xc5, 0xb2, 0xbd, 0x40, 0xaf, 0x9e, 0xe9, 0xbc, 0x80, 0x4f, 0x7c, 0x16, 0x38, 0x5c, 0x04, 0x6e,
  598. 0x40, 0x99, 0x5c, 0xc5, 0xae, 0xba, 0xf2, 0xa3, 0x30, 0x2e, 0x5e, 0xea, 0x4f, 0x96, 0x91, 0x9f,
  599. 0x08, 0x7d, 0x31, 0x36, 0xce, 0x9e, 0x0e, 0x7a, 0x57, 0x55, 0x59, 0xe0, 0xd1, 0xef, 0x00, 0x00,
  600. 0x00, 0xff, 0xff, 0x5e, 0x28, 0x7b, 0xe6, 0xb7, 0x06, 0x00, 0x00,
  601. }