FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
google-cloud-java/java-errorreporting/owlbot.py at main · yoshi-code-bot/google-cloud-java · GitHub
yoshi-code-bot
/
google-cloud-java
Public
forked from
googleapis/google-cloud-java
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
google-cloud-java
/
java-errorreporting
/
owlbot.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
90 lines (80 loc) · 3.41 KB
Breadcrumbs
google-cloud-java
/
java-errorreporting
/
owlbot.py
Copy path
File metadata and controls
90 lines (80 loc) · 3.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
synthtool
as
s
from
synthtool
.
languages
import
java
for
library
in
s
.
get_staging_dirs
():
# put any special-case replacements here
ERROR_GROUP_OVERLOAD
=
"""
// Inserted by synthtool to preserve backwards-compatibility
/**
* Get the specified group.
*
* <p>Sample code:
*
* <pre><code>
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
* GroupName groupName = GroupName.of("[PROJECT]", "[GROUP]");
* ErrorGroup response = errorGroupServiceClient.getGroup(groupName);
* }
* </code></pre>
*
* @param groupName Required. The group resource name. Written as
* <code>projects/<var>projectID</var>/groups/<var>group_name</var></code>.
* Call <a href="/error-reporting/reference/rest/v1beta1/projects.groupStats/list">
* <code>groupStats.list</code></a> to return a list of groups belonging to
* this project.
* <p>Example: <code>projects/my-project-123/groups/my-group</code>
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
* @deprecated Use ErrorGroupServiceClient#getGroup(ErrorGroupName)
*/
@Deprecated
public final ErrorGroup getGroup(GroupName groupName) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setGroupName(groupName == null ? null : groupName.toString())
.build();
return getGroup(request);
}
"""
ERROR_GROUP_OVERLOAD_PREVIOUS_METHOD
=
r'(\s+public ErrorGroupServiceStub getStub\(\) {\n\s+return stub;\n\s+})'
version
=
library
.
parts
[
len
(
library
.
parts
)
-
1
]
service
=
'errorreporting'
#java.fix_proto_headers('owl-bot-staging/v2beta1/proto-google-cloud-error-reporting-v1beta1')
#java.fix_grpc_headers('owl-bot-staging/v2beta1/grpc-google-cloud-error-reporting-v1beta1', "")
s
.
replace
(
'owl-bot-staging/v1beta1/google-cloud-errorreporting/src/**/ErrorGroupServiceClient.java'
,
ERROR_GROUP_OVERLOAD_PREVIOUS_METHOD
,
"\g<1>
\n
\n
"
+
ERROR_GROUP_OVERLOAD
)
s
.
replace
(
'owl-bot-staging/v1beta1/google-cloud-errorreporting/src/**/ErrorGroupServiceClient.java'
,
"import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroupName;"
,
"import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroupName;
\n
import com.google.devtools.clouderrorreporting.v1beta1.GroupName;"
)
s
.
move
(
library
)
s
.
remove_staging_dirs
()
java
.
common_templates
(
monorepo
=
True
,
excludes
=
[
".github/*"
,
".kokoro/*"
,
"samples/*"
,
"CODE_OF_CONDUCT.md"
,
"CONTRIBUTING.md"
,
"LICENSE"
,
"SECURITY.md"
,
"java.header"
,
"license-checks.xml"
,
"renovate.json"
,
".gitignore"
])
Back
|
FazBrowse Home
|
New Git URL