Skip to content
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.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 3 additions & 5 deletions create_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_type(property: Dict[str, Any]):
quoted_enum_members = [
f'"{enum_member}"' for enum_member in property["enum"]
]
type = f"typing_extensions.Literal[{', '.join(quoted_enum_members)}]"
type = f"typing.Literal[{', '.join(quoted_enum_members)}]"
return type


Expand Down Expand Up @@ -84,7 +84,7 @@ def __exit__(self, exc_type, exc, exc_tb):
def write_typed_dict(writer, typed_dict_description):
writer.write("@typing.type_check_only")
writer.write(
f"class {typed_dict_description['name']}(typing_extensions.TypedDict, total=False):"
f"class {typed_dict_description['name']}(typing.TypedDict, total=False):"
)
properties = typed_dict_description["properties"]
sorted_property_names = sorted(properties)
Expand All @@ -100,7 +100,7 @@ def write_typed_dict(writer, typed_dict_description):
def write_alternative_typed_dict(writer, typed_dict_description):
name = typed_dict_description["name"]
writer.write(
f"Alternative{name} = typing_extensions.TypedDict('Alternative{name}', {{"
f"Alternative{name} = typing.TypedDict('Alternative{name}', {{"
)
properties = typed_dict_description["properties"]
sorted_property_names = sorted(properties)
Expand All @@ -119,7 +119,6 @@ def capitalize(s: str) -> str:

def write_schemas(writer, schemas):
writer.write("import typing")
writer.write("import typing_extensions")
writer.write("_list = list")
sorted_schema_names = sorted(schemas)
for schema_name in sorted_schema_names:
Expand Down Expand Up @@ -154,7 +153,6 @@ def write_resource(writer, resource_name, resource, api, top_level=True) -> Set[
writer.write("from .schemas import *")
writer.write("import httplib2")
writer.write("import typing")
writer.write("import typing_extensions")
writer.write("import collections.abc")
writer.write("_list = list")
response_types = set()
Expand Down
3 changes: 1 addition & 2 deletions discovery.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import types
from email.generator import BytesGenerator
from typing import Any, Protocol, TypeVar, overload
from typing import Any, Literal, Protocol, TypeVar, overload

import google.auth.credentials
import httplib2
import oauth2client # type: ignore[import-not-found]
from _typeshed import Incomplete
from google.api_core.client_options import ClientOptions
from typing_extensions import Literal

from googleapiclient.discovery_cache.base import Cache
from googleapiclient.http import HttpMock, HttpRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import collections.abc
import typing

import httplib2
import typing_extensions

import googleapiclient.discovery
import googleapiclient.http
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import typing

import typing_extensions

_list = list

@typing.type_check_only
class SiteSummaryResponse(typing_extensions.TypedDict, total=False):
abusiveStatus: typing_extensions.Literal["UNKNOWN", "PASSING", "FAILING"]
class SiteSummaryResponse(typing.TypedDict, total=False):
abusiveStatus: typing.Literal["UNKNOWN", "PASSING", "FAILING"]
enforcementTime: str
filterStatus: typing_extensions.Literal["UNKNOWN", "ON", "OFF", "PAUSED", "PENDING"]
filterStatus: typing.Literal["UNKNOWN", "ON", "OFF", "PAUSED", "PENDING"]
lastChangeTime: str
reportUrl: str
reviewedSite: str
underReview: bool

@typing.type_check_only
class ViolatingSitesResponse(typing_extensions.TypedDict, total=False):
class ViolatingSitesResponse(typing.TypedDict, total=False):
violatingSites: _list[SiteSummaryResponse]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import collections.abc
import typing

import httplib2
import typing_extensions

import googleapiclient.discovery
import googleapiclient.http
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import typing

import typing_extensions

_list = list

@typing.type_check_only
class AmpUrl(typing_extensions.TypedDict, total=False):
class AmpUrl(typing.TypedDict, total=False):
ampUrl: str
cdnAmpUrl: str
originalUrl: str

@typing.type_check_only
class AmpUrlError(typing_extensions.TypedDict, total=False):
errorCode: typing_extensions.Literal[
class AmpUrlError(typing.TypedDict, total=False):
errorCode: typing.Literal[
"ERROR_CODE_UNSPECIFIED",
"INPUT_URL_NOT_FOUND",
"NO_AMP_URL",
Expand All @@ -24,11 +22,11 @@ class AmpUrlError(typing_extensions.TypedDict, total=False):
originalUrl: str

@typing.type_check_only
class BatchGetAmpUrlsRequest(typing_extensions.TypedDict, total=False):
lookupStrategy: typing_extensions.Literal["FETCH_LIVE_DOC", "IN_INDEX_DOC"]
class BatchGetAmpUrlsRequest(typing.TypedDict, total=False):
lookupStrategy: typing.Literal["FETCH_LIVE_DOC", "IN_INDEX_DOC"]
urls: _list[str]

@typing.type_check_only
class BatchGetAmpUrlsResponse(typing_extensions.TypedDict, total=False):
class BatchGetAmpUrlsResponse(typing.TypedDict, total=False):
ampUrls: _list[AmpUrl]
urlErrors: _list[AmpUrlError]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import collections.abc
import typing

import httplib2
import typing_extensions

import googleapiclient.discovery
import googleapiclient.http
Expand Down
51 changes: 25 additions & 26 deletions googleapiclient-stubs/_apis/accessapproval/v1/schemas.pyi
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import typing

import typing_extensions

_list = list

@typing.type_check_only
class AccessApprovalServiceAccount(typing_extensions.TypedDict, total=False):
class AccessApprovalServiceAccount(typing.TypedDict, total=False):
accountEmail: str
name: str

@typing.type_check_only
class AccessApprovalSettings(typing_extensions.TypedDict, total=False):
class AccessApprovalSettings(typing.TypedDict, total=False):
activeKeyVersion: str
ancestorHasActiveKeyVersion: bool
ancestorsEnrolledServices: _list[EnrolledService]
Expand All @@ -24,7 +22,7 @@ class AccessApprovalSettings(typing_extensions.TypedDict, total=False):
notificationPubsubTopic: str
preferNoBroadApprovalRequests: bool
preferredRequestExpirationDays: int
requestScopeMaxWidthPreference: typing_extensions.Literal[
requestScopeMaxWidthPreference: typing.Literal[
"REQUEST_SCOPE_MAX_WIDTH_PREFERENCE_UNSPECIFIED",
"ORGANIZATION",
"FOLDER",
Expand All @@ -33,14 +31,14 @@ class AccessApprovalSettings(typing_extensions.TypedDict, total=False):
requireCustomerVisibleJustification: bool

@typing.type_check_only
class AccessLocations(typing_extensions.TypedDict, total=False):
class AccessLocations(typing.TypedDict, total=False):
principalOfficeCountry: str
principalPhysicalLocationCountry: str

@typing.type_check_only
class AccessReason(typing_extensions.TypedDict, total=False):
class AccessReason(typing.TypedDict, total=False):
detail: str
type: typing_extensions.Literal[
type: typing.Literal[
"TYPE_UNSPECIFIED",
"CUSTOMER_INITIATED_SUPPORT",
"GOOGLE_INITIATED_SERVICE",
Expand All @@ -51,7 +49,7 @@ class AccessReason(typing_extensions.TypedDict, total=False):
]

@typing.type_check_only
class ApprovalRequest(typing_extensions.TypedDict, total=False):
class ApprovalRequest(typing.TypedDict, total=False):
approve: ApproveDecision
dismiss: DismissDecision
name: str
Expand All @@ -65,11 +63,11 @@ class ApprovalRequest(typing_extensions.TypedDict, total=False):
requestedResourceProperties: ResourceProperties

@typing.type_check_only
class ApproveApprovalRequestMessage(typing_extensions.TypedDict, total=False):
class ApproveApprovalRequestMessage(typing.TypedDict, total=False):
expireTime: str

@typing.type_check_only
class ApproveDecision(typing_extensions.TypedDict, total=False):
class ApproveDecision(typing.TypedDict, total=False):
approveTime: str
autoApproved: bool
expireTime: str
Expand All @@ -78,12 +76,12 @@ class ApproveDecision(typing_extensions.TypedDict, total=False):
signatureInfo: SignatureInfo

@typing.type_check_only
class AugmentedInfo(typing_extensions.TypedDict, total=False):
class AugmentedInfo(typing.TypedDict, total=False):
command: str

@typing.type_check_only
class CustomerApprovalApprovalPolicy(typing_extensions.TypedDict, total=False):
justificationBasedApprovalPolicy: typing_extensions.Literal[
class CustomerApprovalApprovalPolicy(typing.TypedDict, total=False):
justificationBasedApprovalPolicy: typing.Literal[
"JUSTIFICATION_BASED_APPROVAL_POLICY_UNSPECIFIED",
"JUSTIFICATION_BASED_APPROVAL_ENABLED_ALL",
"JUSTIFICATION_BASED_APPROVAL_ENABLED_EXTERNAL_JUSTIFICATIONS",
Expand All @@ -92,39 +90,37 @@ class CustomerApprovalApprovalPolicy(typing_extensions.TypedDict, total=False):
]

@typing.type_check_only
class DismissApprovalRequestMessage(typing_extensions.TypedDict, total=False): ...
class DismissApprovalRequestMessage(typing.TypedDict, total=False): ...

@typing.type_check_only
class DismissDecision(typing_extensions.TypedDict, total=False):
class DismissDecision(typing.TypedDict, total=False):
dismissTime: str
implicit: bool

@typing.type_check_only
class Empty(typing_extensions.TypedDict, total=False): ...
class Empty(typing.TypedDict, total=False): ...

@typing.type_check_only
class EnrolledService(typing_extensions.TypedDict, total=False):
class EnrolledService(typing.TypedDict, total=False):
cloudProduct: str
enrollmentLevel: typing_extensions.Literal[
"ENROLLMENT_LEVEL_UNSPECIFIED", "BLOCK_ALL"
]
enrollmentLevel: typing.Literal["ENROLLMENT_LEVEL_UNSPECIFIED", "BLOCK_ALL"]

@typing.type_check_only
class InvalidateApprovalRequestMessage(typing_extensions.TypedDict, total=False): ...
class InvalidateApprovalRequestMessage(typing.TypedDict, total=False): ...

@typing.type_check_only
class ListApprovalRequestsResponse(typing_extensions.TypedDict, total=False):
class ListApprovalRequestsResponse(typing.TypedDict, total=False):
approvalRequests: _list[ApprovalRequest]
nextPageToken: str

@typing.type_check_only
class ResourceProperties(typing_extensions.TypedDict, total=False):
class ResourceProperties(typing.TypedDict, total=False):
excludesDescendants: bool

@typing.type_check_only
class SignatureInfo(typing_extensions.TypedDict, total=False):
class SignatureInfo(typing.TypedDict, total=False):
customerKmsKeyVersion: str
googleKeyAlgorithm: typing_extensions.Literal[
googleKeyAlgorithm: typing.Literal[
"CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED",
"GOOGLE_SYMMETRIC_ENCRYPTION",
"AES_128_GCM",
Expand Down Expand Up @@ -172,6 +168,9 @@ class SignatureInfo(typing_extensions.TypedDict, total=False):
"PQ_SIGN_ML_DSA_44_EXTERNAL_MU",
"PQ_SIGN_ML_DSA_65_EXTERNAL_MU",
"PQ_SIGN_ML_DSA_87_EXTERNAL_MU",
"KEM_ECDH_P256",
"KEM_ECDH_P384",
"AES_256_KWP",
]
googlePublicKeyPem: str
serializedApprovalRequest: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import collections.abc
import typing

import httplib2
import typing_extensions

import googleapiclient.discovery
import googleapiclient.http
Expand All @@ -27,7 +26,7 @@ class AccessContextManagerResource(googleapiclient.discovery.Resource):
self,
*,
name: str,
accessLevelFormat: typing_extensions.Literal[
accessLevelFormat: typing.Literal[
"LEVEL_FORMAT_UNSPECIFIED", "AS_DEFINED", "CEL"
]
| None = ...,
Expand All @@ -37,7 +36,7 @@ class AccessContextManagerResource(googleapiclient.discovery.Resource):
self,
*,
parent: str,
accessLevelFormat: typing_extensions.Literal[
accessLevelFormat: typing.Literal[
"LEVEL_FORMAT_UNSPECIFIED", "AS_DEFINED", "CEL"
]
| None = ...,
Expand Down Expand Up @@ -247,6 +246,7 @@ class AccessContextManagerResource(googleapiclient.discovery.Resource):
self,
*,
parent: str,
filter: str | None = ...,
pageSize: int | None = ...,
pageToken: str | None = ...,
**kwargs: typing.Any,
Expand Down
Loading
Loading