Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add gapic_metadata_pb2 #38

Merged
merged 3 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
"java",
"sh",
"Dockerfile",
"yaml",
"py",
"html",
"txt"
]
}
10 changes: 10 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ python3 -m pip uninstall --yes --quiet nox-automation
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If this is a continuous build, send the test log to the FlakyBot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
cleanup() {
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
}
trap cleanup EXIT HUP
fi

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
Expand Down
76 changes: 37 additions & 39 deletions google/api/client.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2019 Google LLC.
// Copyright 2020 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
// http://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,
Expand All @@ -24,43 +24,6 @@ option java_outer_classname = "ClientProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";


extend google.protobuf.ServiceOptions {
// The hostname for this service.
// This should be specified with no prefix or protocol.
//
// Example:
//
// service Foo {
// option (google.api.default_host) = "foo.googleapi.com";
// ...
// }
string default_host = 1049;

// OAuth scopes needed for the client.
//
// Example:
//
// service Foo {
// option (google.api.oauth_scopes) = \
// "https://www.googleapis.com/auth/cloud-platform";
// ...
// }
//
// If there is more than one scope, use a comma-separated string:
//
// Example:
//
// service Foo {
// option (google.api.oauth_scopes) = \
// "https://www.googleapis.com/auth/cloud-platform,"
// "https://www.googleapis.com/auth/monitoring";
// ...
// }
string oauth_scopes = 1050;
}


extend google.protobuf.MethodOptions {
// A definition of a client library method signature.
//
Expand Down Expand Up @@ -99,3 +62,38 @@ extend google.protobuf.MethodOptions {
// change.
repeated string method_signature = 1051;
}

extend google.protobuf.ServiceOptions {
// The hostname for this service.
// This should be specified with no prefix or protocol.
//
// Example:
//
// service Foo {
// option (google.api.default_host) = "foo.googleapi.com";
// ...
// }
string default_host = 1049;

// OAuth scopes needed for the client.
//
// Example:
//
// service Foo {
// option (google.api.oauth_scopes) = \
// "https://www.googleapis.com/auth/cloud-platform";
// ...
// }
//
// If there is more than one scope, use a comma-separated string:
//
// Example:
//
// service Foo {
// option (google.api.oauth_scopes) = \
// "https://www.googleapis.com/auth/cloud-platform,"
// "https://www.googleapis.com/auth/monitoring";
// ...
// }
string oauth_scopes = 1050;
}
46 changes: 23 additions & 23 deletions google/api/client_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
syntax="proto3",
serialized_options=b"\n\016com.google.apiB\013ClientProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI",
create_key=_descriptor._internal_create_key,
serialized_pb=b"\n\x17google/api/client.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto:6\n\x0c\x64\x65\x66\x61ult_host\x12\x1f.google.protobuf.ServiceOptions\x18\x99\x08 \x01(\t:6\n\x0coauth_scopes\x12\x1f.google.protobuf.ServiceOptions\x18\x9a\x08 \x01(\t:9\n\x10method_signature\x12\x1e.google.protobuf.MethodOptions\x18\x9b\x08 \x03(\tBi\n\x0e\x63om.google.apiB\x0b\x43lientProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3",
serialized_pb=b"\n\x17google/api/client.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto:9\n\x10method_signature\x12\x1e.google.protobuf.MethodOptions\x18\x9b\x08 \x03(\t:6\n\x0c\x64\x65\x66\x61ult_host\x12\x1f.google.protobuf.ServiceOptions\x18\x99\x08 \x01(\t:6\n\x0coauth_scopes\x12\x1f.google.protobuf.ServiceOptions\x18\x9a\x08 \x01(\tBi\n\x0e\x63om.google.apiB\x0b\x43lientProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3",
dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR],
)


DEFAULT_HOST_FIELD_NUMBER = 1049
default_host = _descriptor.FieldDescriptor(
name="default_host",
full_name="google.api.default_host",
METHOD_SIGNATURE_FIELD_NUMBER = 1051
method_signature = _descriptor.FieldDescriptor(
name="method_signature",
full_name="google.api.method_signature",
index=0,
number=1049,
number=1051,
type=9,
cpp_type=9,
label=1,
label=3,
has_default_value=False,
default_value=b"".decode("utf-8"),
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
Expand All @@ -61,12 +61,12 @@
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
OAUTH_SCOPES_FIELD_NUMBER = 1050
oauth_scopes = _descriptor.FieldDescriptor(
name="oauth_scopes",
full_name="google.api.oauth_scopes",
DEFAULT_HOST_FIELD_NUMBER = 1049
default_host = _descriptor.FieldDescriptor(
name="default_host",
full_name="google.api.default_host",
index=1,
number=1050,
number=1049,
type=9,
cpp_type=9,
label=1,
Expand All @@ -81,17 +81,17 @@
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
METHOD_SIGNATURE_FIELD_NUMBER = 1051
method_signature = _descriptor.FieldDescriptor(
name="method_signature",
full_name="google.api.method_signature",
OAUTH_SCOPES_FIELD_NUMBER = 1050
oauth_scopes = _descriptor.FieldDescriptor(
name="oauth_scopes",
full_name="google.api.oauth_scopes",
index=2,
number=1051,
number=1050,
type=9,
cpp_type=9,
label=3,
label=1,
has_default_value=False,
default_value=[],
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
Expand All @@ -102,16 +102,16 @@
create_key=_descriptor._internal_create_key,
)

DESCRIPTOR.extensions_by_name["method_signature"] = method_signature
DESCRIPTOR.extensions_by_name["default_host"] = default_host
DESCRIPTOR.extensions_by_name["oauth_scopes"] = oauth_scopes
DESCRIPTOR.extensions_by_name["method_signature"] = method_signature
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(default_host)
google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(oauth_scopes)
google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(
method_signature
)
google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(default_host)
google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(oauth_scopes)

DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)
40 changes: 22 additions & 18 deletions google/api/field_behavior.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2019 Google LLC.
// Copyright 2020 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
// http://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,
Expand All @@ -24,6 +24,21 @@ option java_outer_classname = "FieldBehaviorProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";

extend google.protobuf.FieldOptions {
// A designation of a specific field behavior (required, output only, etc.)
// in protobuf messages.
//
// Examples:
//
// string name = 1 [(google.api.field_behavior) = REQUIRED];
// State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// google.protobuf.Duration ttl = 1
// [(google.api.field_behavior) = INPUT_ONLY];
// google.protobuf.Timestamp expire_time = 1
// [(google.api.field_behavior) = OUTPUT_ONLY,
// (google.api.field_behavior) = IMMUTABLE];
repeated google.api.FieldBehavior field_behavior = 1052;
}

// An indicator of the behavior of a given field (for example, that a field
// is required in requests, or given as output but ignored as input).
Expand Down Expand Up @@ -60,21 +75,10 @@ enum FieldBehavior {
// This indicates that the field may be set once in a request to create a
// resource, but may not be changed thereafter.
IMMUTABLE = 5;
}


extend google.protobuf.FieldOptions {
// A designation of a specific field behavior (required, output only, etc.)
// in protobuf messages.
//
// Examples:
//
// string name = 1 [(google.api.field_behavior) = REQUIRED];
// State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// google.protobuf.Duration ttl = 1
// [(google.api.field_behavior) = INPUT_ONLY];
// google.protobuf.Timestamp expire_time = 1
// [(google.api.field_behavior) = OUTPUT_ONLY,
// (google.api.field_behavior) = IMMUTABLE];
repeated FieldBehavior field_behavior = 1052;
// Denotes that a (repeated) field is an unordered list.
// This indicates that the service may provide the elements of the list
// in any arbitrary order, rather than the order the user originally
// provided. Additionally, the list's order may or may not be stable.
UNORDERED_LIST = 6;
}
15 changes: 12 additions & 3 deletions google/api/field_behavior_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
syntax="proto3",
serialized_options=b"\n\016com.google.apiB\022FieldBehaviorProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI",
create_key=_descriptor._internal_create_key,
serialized_pb=b"\n\x1fgoogle/api/field_behavior.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto*{\n\rFieldBehavior\x12\x1e\n\x1a\x46IELD_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x0c\n\x08OPTIONAL\x10\x01\x12\x0c\n\x08REQUIRED\x10\x02\x12\x0f\n\x0bOUTPUT_ONLY\x10\x03\x12\x0e\n\nINPUT_ONLY\x10\x04\x12\r\n\tIMMUTABLE\x10\x05:Q\n\x0e\x66ield_behavior\x12\x1d.google.protobuf.FieldOptions\x18\x9c\x08 \x03(\x0e\x32\x19.google.api.FieldBehaviorBp\n\x0e\x63om.google.apiB\x12\x46ieldBehaviorProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3",
serialized_pb=b"\n\x1fgoogle/api/field_behavior.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto*\x8f\x01\n\rFieldBehavior\x12\x1e\n\x1a\x46IELD_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x0c\n\x08OPTIONAL\x10\x01\x12\x0c\n\x08REQUIRED\x10\x02\x12\x0f\n\x0bOUTPUT_ONLY\x10\x03\x12\x0e\n\nINPUT_ONLY\x10\x04\x12\r\n\tIMMUTABLE\x10\x05\x12\x12\n\x0eUNORDERED_LIST\x10\x06:Q\n\x0e\x66ield_behavior\x12\x1d.google.protobuf.FieldOptions\x18\x9c\x08 \x03(\x0e\x32\x19.google.api.FieldBehaviorBp\n\x0e\x63om.google.apiB\x12\x46ieldBehaviorProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3",
dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR],
)

Expand Down Expand Up @@ -96,11 +96,19 @@
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="UNORDERED_LIST",
index=6,
number=6,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=81,
serialized_end=204,
serialized_start=82,
serialized_end=225,
)
_sym_db.RegisterEnumDescriptor(_FIELDBEHAVIOR)

Expand All @@ -111,6 +119,7 @@
OUTPUT_ONLY = 3
INPUT_ONLY = 4
IMMUTABLE = 5
UNORDERED_LIST = 6

FIELD_BEHAVIOR_FIELD_NUMBER = 1052
field_behavior = _descriptor.FieldDescriptor(
Expand Down
Empty file.