Skip to content

Commit da97d1d

Browse files
authored
Merge branch 'autogen' into feat/add-ast-utilities
2 parents 595e59f + 5a9a4c6 commit da97d1d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

scripts/microgenerator/templates/_helpers.py.j2

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
117
from typing import Any, Dict, List, Optional, Type
218

319

scripts/microgenerator/templates/partials/_method_with_request_builder.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
def {{ method.name }}(
22
self,
3+
{# Assumes the primary resource ID is the last arg in request_id_args #}
34
{{ method.request_id_args[-1] }}: Optional[str] = None,
45
*,
6+
{# Assumes the request class is a nested type within the service, e.g., bigquery_v2.types.dataset.GetDatasetRequest #}
57
request: Optional[{{ '.'.join(method.request_class_full_name.split('.')[-2:]) }}] = None,
68
retry: OptionalRetry = DEFAULT_RETRY,
79
timeout: Union[float, object] = DEFAULT_TIMEOUT,
@@ -40,4 +42,4 @@ def {{ method.name }}(
4042
retry=retry,
4143
timeout=timeout,
4244
metadata=metadata,
43-
)
45+
)

0 commit comments

Comments
 (0)