|
1 | 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
2 | 2 | import grpc |
3 | 3 |
|
4 | | -from google.cloud.logging_v2.proto import logging_metrics_pb2 as google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2 |
| 4 | +from google.cloud.logging_v2.proto import ( |
| 5 | + logging_metrics_pb2 as google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2, |
| 6 | +) |
5 | 7 | from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 |
6 | 8 |
|
7 | 9 |
|
8 | 10 | class MetricsServiceV2Stub(object): |
9 | | - """Service for configuring logs-based metrics. |
| 11 | + """Service for configuring logs-based metrics. |
10 | 12 | """ |
11 | 13 |
|
12 | | - def __init__(self, channel): |
13 | | - """Constructor. |
| 14 | + def __init__(self, channel): |
| 15 | + """Constructor. |
14 | 16 |
|
15 | 17 | Args: |
16 | 18 | channel: A grpc.Channel. |
17 | 19 | """ |
18 | | - self.ListLogMetrics = channel.unary_unary( |
19 | | - '/google.logging.v2.MetricsServiceV2/ListLogMetrics', |
20 | | - request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsRequest.SerializeToString, |
21 | | - response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsResponse.FromString, |
| 20 | + self.ListLogMetrics = channel.unary_unary( |
| 21 | + "/google.logging.v2.MetricsServiceV2/ListLogMetrics", |
| 22 | + request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsRequest.SerializeToString, |
| 23 | + response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsResponse.FromString, |
22 | 24 | ) |
23 | | - self.GetLogMetric = channel.unary_unary( |
24 | | - '/google.logging.v2.MetricsServiceV2/GetLogMetric', |
25 | | - request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.GetLogMetricRequest.SerializeToString, |
26 | | - response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.FromString, |
| 25 | + self.GetLogMetric = channel.unary_unary( |
| 26 | + "/google.logging.v2.MetricsServiceV2/GetLogMetric", |
| 27 | + request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.GetLogMetricRequest.SerializeToString, |
| 28 | + response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.FromString, |
27 | 29 | ) |
28 | | - self.CreateLogMetric = channel.unary_unary( |
29 | | - '/google.logging.v2.MetricsServiceV2/CreateLogMetric', |
30 | | - request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.CreateLogMetricRequest.SerializeToString, |
31 | | - response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.FromString, |
| 30 | + self.CreateLogMetric = channel.unary_unary( |
| 31 | + "/google.logging.v2.MetricsServiceV2/CreateLogMetric", |
| 32 | + request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.CreateLogMetricRequest.SerializeToString, |
| 33 | + response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.FromString, |
32 | 34 | ) |
33 | | - self.UpdateLogMetric = channel.unary_unary( |
34 | | - '/google.logging.v2.MetricsServiceV2/UpdateLogMetric', |
35 | | - request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.UpdateLogMetricRequest.SerializeToString, |
36 | | - response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.FromString, |
| 35 | + self.UpdateLogMetric = channel.unary_unary( |
| 36 | + "/google.logging.v2.MetricsServiceV2/UpdateLogMetric", |
| 37 | + request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.UpdateLogMetricRequest.SerializeToString, |
| 38 | + response_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.FromString, |
37 | 39 | ) |
38 | | - self.DeleteLogMetric = channel.unary_unary( |
39 | | - '/google.logging.v2.MetricsServiceV2/DeleteLogMetric', |
40 | | - request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.DeleteLogMetricRequest.SerializeToString, |
41 | | - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| 40 | + self.DeleteLogMetric = channel.unary_unary( |
| 41 | + "/google.logging.v2.MetricsServiceV2/DeleteLogMetric", |
| 42 | + request_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.DeleteLogMetricRequest.SerializeToString, |
| 43 | + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
42 | 44 | ) |
43 | 45 |
|
44 | 46 |
|
45 | 47 | class MetricsServiceV2Servicer(object): |
46 | | - """Service for configuring logs-based metrics. |
| 48 | + """Service for configuring logs-based metrics. |
47 | 49 | """ |
48 | 50 |
|
49 | | - def ListLogMetrics(self, request, context): |
50 | | - """Lists logs-based metrics. |
| 51 | + def ListLogMetrics(self, request, context): |
| 52 | + """Lists logs-based metrics. |
51 | 53 | """ |
52 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
53 | | - context.set_details('Method not implemented!') |
54 | | - raise NotImplementedError('Method not implemented!') |
| 54 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 55 | + context.set_details("Method not implemented!") |
| 56 | + raise NotImplementedError("Method not implemented!") |
55 | 57 |
|
56 | | - def GetLogMetric(self, request, context): |
57 | | - """Gets a logs-based metric. |
| 58 | + def GetLogMetric(self, request, context): |
| 59 | + """Gets a logs-based metric. |
58 | 60 | """ |
59 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
60 | | - context.set_details('Method not implemented!') |
61 | | - raise NotImplementedError('Method not implemented!') |
| 61 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 62 | + context.set_details("Method not implemented!") |
| 63 | + raise NotImplementedError("Method not implemented!") |
62 | 64 |
|
63 | | - def CreateLogMetric(self, request, context): |
64 | | - """Creates a logs-based metric. |
| 65 | + def CreateLogMetric(self, request, context): |
| 66 | + """Creates a logs-based metric. |
65 | 67 | """ |
66 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
67 | | - context.set_details('Method not implemented!') |
68 | | - raise NotImplementedError('Method not implemented!') |
| 68 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 69 | + context.set_details("Method not implemented!") |
| 70 | + raise NotImplementedError("Method not implemented!") |
69 | 71 |
|
70 | | - def UpdateLogMetric(self, request, context): |
71 | | - """Creates or updates a logs-based metric. |
| 72 | + def UpdateLogMetric(self, request, context): |
| 73 | + """Creates or updates a logs-based metric. |
72 | 74 | """ |
73 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
74 | | - context.set_details('Method not implemented!') |
75 | | - raise NotImplementedError('Method not implemented!') |
| 75 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 76 | + context.set_details("Method not implemented!") |
| 77 | + raise NotImplementedError("Method not implemented!") |
76 | 78 |
|
77 | | - def DeleteLogMetric(self, request, context): |
78 | | - """Deletes a logs-based metric. |
| 79 | + def DeleteLogMetric(self, request, context): |
| 80 | + """Deletes a logs-based metric. |
79 | 81 | """ |
80 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
81 | | - context.set_details('Method not implemented!') |
82 | | - raise NotImplementedError('Method not implemented!') |
| 82 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 83 | + context.set_details("Method not implemented!") |
| 84 | + raise NotImplementedError("Method not implemented!") |
83 | 85 |
|
84 | 86 |
|
85 | 87 | def add_MetricsServiceV2Servicer_to_server(servicer, server): |
86 | | - rpc_method_handlers = { |
87 | | - 'ListLogMetrics': grpc.unary_unary_rpc_method_handler( |
88 | | - servicer.ListLogMetrics, |
89 | | - request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsRequest.FromString, |
90 | | - response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsResponse.SerializeToString, |
91 | | - ), |
92 | | - 'GetLogMetric': grpc.unary_unary_rpc_method_handler( |
93 | | - servicer.GetLogMetric, |
94 | | - request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.GetLogMetricRequest.FromString, |
95 | | - response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.SerializeToString, |
96 | | - ), |
97 | | - 'CreateLogMetric': grpc.unary_unary_rpc_method_handler( |
98 | | - servicer.CreateLogMetric, |
99 | | - request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.CreateLogMetricRequest.FromString, |
100 | | - response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.SerializeToString, |
101 | | - ), |
102 | | - 'UpdateLogMetric': grpc.unary_unary_rpc_method_handler( |
103 | | - servicer.UpdateLogMetric, |
104 | | - request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.UpdateLogMetricRequest.FromString, |
105 | | - response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.SerializeToString, |
106 | | - ), |
107 | | - 'DeleteLogMetric': grpc.unary_unary_rpc_method_handler( |
108 | | - servicer.DeleteLogMetric, |
109 | | - request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.DeleteLogMetricRequest.FromString, |
110 | | - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
111 | | - ), |
112 | | - } |
113 | | - generic_handler = grpc.method_handlers_generic_handler( |
114 | | - 'google.logging.v2.MetricsServiceV2', rpc_method_handlers) |
115 | | - server.add_generic_rpc_handlers((generic_handler,)) |
| 88 | + rpc_method_handlers = { |
| 89 | + "ListLogMetrics": grpc.unary_unary_rpc_method_handler( |
| 90 | + servicer.ListLogMetrics, |
| 91 | + request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsRequest.FromString, |
| 92 | + response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.ListLogMetricsResponse.SerializeToString, |
| 93 | + ), |
| 94 | + "GetLogMetric": grpc.unary_unary_rpc_method_handler( |
| 95 | + servicer.GetLogMetric, |
| 96 | + request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.GetLogMetricRequest.FromString, |
| 97 | + response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.SerializeToString, |
| 98 | + ), |
| 99 | + "CreateLogMetric": grpc.unary_unary_rpc_method_handler( |
| 100 | + servicer.CreateLogMetric, |
| 101 | + request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.CreateLogMetricRequest.FromString, |
| 102 | + response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.SerializeToString, |
| 103 | + ), |
| 104 | + "UpdateLogMetric": grpc.unary_unary_rpc_method_handler( |
| 105 | + servicer.UpdateLogMetric, |
| 106 | + request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.UpdateLogMetricRequest.FromString, |
| 107 | + response_serializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.LogMetric.SerializeToString, |
| 108 | + ), |
| 109 | + "DeleteLogMetric": grpc.unary_unary_rpc_method_handler( |
| 110 | + servicer.DeleteLogMetric, |
| 111 | + request_deserializer=google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__metrics__pb2.DeleteLogMetricRequest.FromString, |
| 112 | + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| 113 | + ), |
| 114 | + } |
| 115 | + generic_handler = grpc.method_handlers_generic_handler( |
| 116 | + "google.logging.v2.MetricsServiceV2", rpc_method_handlers |
| 117 | + ) |
| 118 | + server.add_generic_rpc_handlers((generic_handler,)) |
0 commit comments