Skip to content

Commit 2a72d86

Browse files
authored
GAPIC generation fixes. (#7061)
* Pick up stub docstring fix from GAPIC generator. * Pick up order-of-enum fix from GAPIC generator.
1 parent 62cbcf6 commit 2a72d86

File tree

5 files changed

+105
-66
lines changed

5 files changed

+105
-66
lines changed

google/cloud/logging_v2/gapic/enums.py

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,6 @@ class LaunchStage(enum.IntEnum):
6161
DEPRECATED = 5
6262

6363

64-
class NullValue(enum.IntEnum):
65-
"""
66-
``NullValue`` is a singleton enumeration to represent the null value for
67-
the ``Value`` type union.
68-
69-
The JSON representation for ``NullValue`` is JSON ``null``.
70-
71-
Attributes:
72-
NULL_VALUE (int): Null value.
73-
"""
74-
75-
NULL_VALUE = 0
76-
77-
7864
class LogSeverity(enum.IntEnum):
7965
"""
8066
The severity of the event described in a log entry, expressed as one of
@@ -120,6 +106,20 @@ class LogSeverity(enum.IntEnum):
120106
EMERGENCY = 800
121107

122108

109+
class NullValue(enum.IntEnum):
110+
"""
111+
``NullValue`` is a singleton enumeration to represent the null value for
112+
the ``Value`` type union.
113+
114+
The JSON representation for ``NullValue`` is JSON ``null``.
115+
116+
Attributes:
117+
NULL_VALUE (int): Null value.
118+
"""
119+
120+
NULL_VALUE = 0
121+
122+
123123
class LabelDescriptor(object):
124124
class ValueType(enum.IntEnum):
125125
"""
@@ -136,6 +136,38 @@ class ValueType(enum.IntEnum):
136136
INT64 = 2
137137

138138

139+
class LogMetric(object):
140+
class ApiVersion(enum.IntEnum):
141+
"""
142+
Logging API version.
143+
144+
Attributes:
145+
V2 (int): Logging API v2.
146+
V1 (int): Logging API v1.
147+
"""
148+
149+
V2 = 0
150+
V1 = 1
151+
152+
153+
class LogSink(object):
154+
class VersionFormat(enum.IntEnum):
155+
"""
156+
Available log entry formats. Log entries can be written to
157+
Logging in either format and can be exported in either format.
158+
Version 2 is the preferred format.
159+
160+
Attributes:
161+
VERSION_FORMAT_UNSPECIFIED (int): An unspecified format version that will default to V2.
162+
V2 (int): ``LogEntry`` version 2 format.
163+
V1 (int): ``LogEntry`` version 1 format.
164+
"""
165+
166+
VERSION_FORMAT_UNSPECIFIED = 0
167+
V2 = 1
168+
V1 = 2
169+
170+
139171
class MetricDescriptor(object):
140172
class MetricKind(enum.IntEnum):
141173
"""
@@ -180,35 +212,3 @@ class ValueType(enum.IntEnum):
180212
STRING = 4
181213
DISTRIBUTION = 5
182214
MONEY = 6
183-
184-
185-
class LogMetric(object):
186-
class ApiVersion(enum.IntEnum):
187-
"""
188-
Logging API version.
189-
190-
Attributes:
191-
V2 (int): Logging API v2.
192-
V1 (int): Logging API v1.
193-
"""
194-
195-
V2 = 0
196-
V1 = 1
197-
198-
199-
class LogSink(object):
200-
class VersionFormat(enum.IntEnum):
201-
"""
202-
Available log entry formats. Log entries can be written to
203-
Logging in either format and can be exported in either format.
204-
Version 2 is the preferred format.
205-
206-
Attributes:
207-
VERSION_FORMAT_UNSPECIFIED (int): An unspecified format version that will default to V2.
208-
V2 (int): ``LogEntry`` version 2 format.
209-
V1 (int): ``LogEntry`` version 1 format.
210-
"""
211-
212-
VERSION_FORMAT_UNSPECIFIED = 0
213-
V2 = 1
214-
V1 = 2

google/cloud/logging_v2/gapic/transports/config_service_v2_grpc_transport.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def channel(self):
105105

106106
@property
107107
def list_sinks(self):
108-
"""Return the gRPC stub for {$apiMethod.name}.
108+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.list_sinks`.
109109
110110
Lists sinks.
111111
@@ -118,7 +118,7 @@ def list_sinks(self):
118118

119119
@property
120120
def get_sink(self):
121-
"""Return the gRPC stub for {$apiMethod.name}.
121+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.get_sink`.
122122
123123
Gets a sink.
124124
@@ -131,7 +131,7 @@ def get_sink(self):
131131

132132
@property
133133
def create_sink(self):
134-
"""Return the gRPC stub for {$apiMethod.name}.
134+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.create_sink`.
135135
136136
Creates a sink that exports specified log entries to a destination. The
137137
export of newly-ingested log entries begins immediately, unless the
@@ -147,7 +147,7 @@ def create_sink(self):
147147

148148
@property
149149
def update_sink(self):
150-
"""Return the gRPC stub for {$apiMethod.name}.
150+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.update_sink`.
151151
152152
Updates a sink. This method replaces the following fields in the
153153
existing sink with values from the new sink: ``destination``, and
@@ -163,7 +163,7 @@ def update_sink(self):
163163

164164
@property
165165
def delete_sink(self):
166-
"""Return the gRPC stub for {$apiMethod.name}.
166+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.delete_sink`.
167167
168168
Deletes a sink. If the sink has a unique ``writer_identity``, then that
169169
service account is also deleted.
@@ -177,7 +177,7 @@ def delete_sink(self):
177177

178178
@property
179179
def list_exclusions(self):
180-
"""Return the gRPC stub for {$apiMethod.name}.
180+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.list_exclusions`.
181181
182182
Lists all the exclusions in a parent resource.
183183
@@ -190,7 +190,7 @@ def list_exclusions(self):
190190

191191
@property
192192
def get_exclusion(self):
193-
"""Return the gRPC stub for {$apiMethod.name}.
193+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.get_exclusion`.
194194
195195
Gets the description of an exclusion.
196196
@@ -203,7 +203,7 @@ def get_exclusion(self):
203203

204204
@property
205205
def create_exclusion(self):
206-
"""Return the gRPC stub for {$apiMethod.name}.
206+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.create_exclusion`.
207207
208208
Creates a new exclusion in a specified parent resource.
209209
Only log entries belonging to that resource can be excluded.
@@ -218,7 +218,7 @@ def create_exclusion(self):
218218

219219
@property
220220
def update_exclusion(self):
221-
"""Return the gRPC stub for {$apiMethod.name}.
221+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.update_exclusion`.
222222
223223
Changes one or more properties of an existing exclusion.
224224
@@ -231,7 +231,7 @@ def update_exclusion(self):
231231

232232
@property
233233
def delete_exclusion(self):
234-
"""Return the gRPC stub for {$apiMethod.name}.
234+
"""Return the gRPC stub for :meth:`ConfigServiceV2Client.delete_exclusion`.
235235
236236
Deletes an exclusion.
237237

google/cloud/logging_v2/gapic/transports/logging_service_v2_grpc_transport.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def channel(self):
103103

104104
@property
105105
def delete_log(self):
106-
"""Return the gRPC stub for {$apiMethod.name}.
106+
"""Return the gRPC stub for :meth:`LoggingServiceV2Client.delete_log`.
107107
108108
Deletes all the log entries in a log.
109109
The log reappears if it receives new entries.
@@ -119,7 +119,7 @@ def delete_log(self):
119119

120120
@property
121121
def write_log_entries(self):
122-
"""Return the gRPC stub for {$apiMethod.name}.
122+
"""Return the gRPC stub for :meth:`LoggingServiceV2Client.write_log_entries`.
123123
124124
Writes log entries to Logging. This API method is the
125125
only way to send log entries to Logging. This method
@@ -138,7 +138,7 @@ def write_log_entries(self):
138138

139139
@property
140140
def list_log_entries(self):
141-
"""Return the gRPC stub for {$apiMethod.name}.
141+
"""Return the gRPC stub for :meth:`LoggingServiceV2Client.list_log_entries`.
142142
143143
Lists log entries. Use this method to retrieve log entries from Logging.
144144
For ways to export log entries, see `Exporting
@@ -153,7 +153,7 @@ def list_log_entries(self):
153153

154154
@property
155155
def list_monitored_resource_descriptors(self):
156-
"""Return the gRPC stub for {$apiMethod.name}.
156+
"""Return the gRPC stub for :meth:`LoggingServiceV2Client.list_monitored_resource_descriptors`.
157157
158158
Lists the descriptors for monitored resource types used by Logging.
159159
@@ -166,7 +166,7 @@ def list_monitored_resource_descriptors(self):
166166

167167
@property
168168
def list_logs(self):
169-
"""Return the gRPC stub for {$apiMethod.name}.
169+
"""Return the gRPC stub for :meth:`LoggingServiceV2Client.list_logs`.
170170
171171
Lists the logs in projects, organizations, folders, or billing accounts.
172172
Only logs that have entries are listed.

google/cloud/logging_v2/gapic/transports/metrics_service_v2_grpc_transport.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def channel(self):
105105

106106
@property
107107
def list_log_metrics(self):
108-
"""Return the gRPC stub for {$apiMethod.name}.
108+
"""Return the gRPC stub for :meth:`MetricsServiceV2Client.list_log_metrics`.
109109
110110
Lists logs-based metrics.
111111
@@ -118,7 +118,7 @@ def list_log_metrics(self):
118118

119119
@property
120120
def get_log_metric(self):
121-
"""Return the gRPC stub for {$apiMethod.name}.
121+
"""Return the gRPC stub for :meth:`MetricsServiceV2Client.get_log_metric`.
122122
123123
Gets a logs-based metric.
124124
@@ -131,7 +131,7 @@ def get_log_metric(self):
131131

132132
@property
133133
def create_log_metric(self):
134-
"""Return the gRPC stub for {$apiMethod.name}.
134+
"""Return the gRPC stub for :meth:`MetricsServiceV2Client.create_log_metric`.
135135
136136
Creates a logs-based metric.
137137
@@ -144,7 +144,7 @@ def create_log_metric(self):
144144

145145
@property
146146
def update_log_metric(self):
147-
"""Return the gRPC stub for {$apiMethod.name}.
147+
"""Return the gRPC stub for :meth:`MetricsServiceV2Client.update_log_metric`.
148148
149149
Creates or updates a logs-based metric.
150150
@@ -157,7 +157,7 @@ def update_log_metric(self):
157157

158158
@property
159159
def delete_log_metric(self):
160-
"""Return the gRPC stub for {$apiMethod.name}.
160+
"""Return the gRPC stub for :meth:`MetricsServiceV2Client.delete_log_metric`.
161161
162162
Deletes a logs-based metric.
163163

synth.metadata

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"updateTime": "2019-01-05T17:54:33.074139Z",
3+
"sources": [
4+
{
5+
"generator": {
6+
"name": "artman",
7+
"version": "0.16.4",
8+
"dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857"
9+
}
10+
},
11+
{
12+
"git": {
13+
"name": "googleapis",
14+
"remote": "https://github.com/googleapis/googleapis.git",
15+
"sha": "a111a53c0c6722afcd793b64724ceef7862db5b9",
16+
"internalRef": "227896184"
17+
}
18+
},
19+
{
20+
"template": {
21+
"name": "python_library",
22+
"origin": "synthtool.gcp",
23+
"version": "2018.12.6"
24+
}
25+
}
26+
],
27+
"destinations": [
28+
{
29+
"client": {
30+
"source": "googleapis",
31+
"apiName": "logging",
32+
"apiVersion": "v2",
33+
"language": "python",
34+
"generator": "gapic",
35+
"config": "google/logging/artman_logging.yaml"
36+
}
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)