feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,187 @@
"""Generated client library for iamcredentials version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
# NOTENOTE: This file has been gently hand-edited. Do not simply replace
# with an autogenerated version - merge with this version!
# For instance, the __future__ import immediately below...
from __future__ import absolute_import
import platform
import sys
from apitools.base.py import base_api
import gslib.third_party.iamcredentials_apitools.iamcredentials_v1_messages as messages
import gslib
from gslib.metrics import MetricsCollector
from gslib.utils import system_util
class IamcredentialsV1(base_api.BaseApiClient):
"""Generated client library for service iamcredentials version v1."""
MESSAGES_MODULE = messages
BASE_URL = u'https://iamcredentials.googleapis.com/'
_PACKAGE = u'iamcredentials'
_SCOPES = [u'https://www.googleapis.com/auth/cloud-platform']
_VERSION = u'v1'
_CLIENT_ID = 'nomatter'
_CLIENT_SECRET = 'nomatter'
_USER_AGENT = 'apitools gsutil/%s Python/%s (%s)' % (
gslib.VERSION, platform.python_version(), sys.platform)
if system_util.InvokedViaCloudSdk():
_USER_AGENT += ' google-cloud-sdk'
if system_util.CloudSdkVersion():
_USER_AGENT += '/%s' % system_util.CloudSdkVersion()
if MetricsCollector.IsDisabled():
_USER_AGENT += ' analytics/disabled'
else:
_USER_AGENT += ' analytics/enabled'
_CLIENT_CLASS_NAME = u'IamcredentialsV1'
_URL_VERSION = u'v1'
_API_KEY = None
def __init__(self, url='', credentials=None,
get_credentials=True, http=None, model=None,
log_request=False, log_response=False,
credentials_args=None, default_global_params=None,
additional_http_headers=None, response_encoding=None):
"""Create a new iamcredentials handle."""
url = url or self.BASE_URL
super(IamcredentialsV1, self).__init__(
url, credentials=credentials,
get_credentials=get_credentials, http=http, model=model,
log_request=log_request, log_response=log_response,
credentials_args=credentials_args,
default_global_params=default_global_params,
additional_http_headers=additional_http_headers,
response_encoding=response_encoding)
self.projects_serviceAccounts = self.ProjectsServiceAccountsService(self)
self.projects = self.ProjectsService(self)
class ProjectsServiceAccountsService(base_api.BaseApiService):
"""Service class for the projects_serviceAccounts resource."""
_NAME = u'projects_serviceAccounts'
def __init__(self, client):
super(IamcredentialsV1.ProjectsServiceAccountsService, self).__init__(client)
self._upload_configs = {
}
def GenerateAccessToken(self, request, global_params=None):
"""Generates an OAuth 2.0 access token for a service account.
Args:
request: (IamcredentialsProjectsServiceAccountsGenerateAccessTokenRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(GenerateAccessTokenResponse) The response message.
"""
config = self.GetMethodConfig('GenerateAccessToken')
return self._RunMethod(
config, request, global_params=global_params)
GenerateAccessToken.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateAccessToken',
http_method=u'POST',
method_id=u'iamcredentials.projects.serviceAccounts.generateAccessToken',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:generateAccessToken',
request_field=u'generateAccessTokenRequest',
request_type_name=u'IamcredentialsProjectsServiceAccountsGenerateAccessTokenRequest',
response_type_name=u'GenerateAccessTokenResponse',
supports_download=False,
)
def GenerateIdToken(self, request, global_params=None):
r"""Generates an OpenID Connect ID token for a service account.
Args:
request: (IamcredentialsProjectsServiceAccountsGenerateIdTokenRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(GenerateIdTokenResponse) The response message.
"""
config = self.GetMethodConfig('GenerateIdToken')
return self._RunMethod(
config, request, global_params=global_params)
GenerateIdToken.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateIdToken',
http_method=u'POST',
method_id=u'iamcredentials.projects.serviceAccounts.generateIdToken',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:generateIdToken',
request_field=u'generateIdTokenRequest',
request_type_name=u'IamcredentialsProjectsServiceAccountsGenerateIdTokenRequest',
response_type_name=u'GenerateIdTokenResponse',
supports_download=False,
)
def SignBlob(self, request, global_params=None):
r"""Signs a blob using a service account's system-managed private key.
Args:
request: (IamcredentialsProjectsServiceAccountsSignBlobRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(SignBlobResponse) The response message.
"""
config = self.GetMethodConfig('SignBlob')
return self._RunMethod(
config, request, global_params=global_params)
SignBlob.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob',
http_method=u'POST',
method_id=u'iamcredentials.projects.serviceAccounts.signBlob',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:signBlob',
request_field=u'signBlobRequest',
request_type_name=u'IamcredentialsProjectsServiceAccountsSignBlobRequest',
response_type_name=u'SignBlobResponse',
supports_download=False,
)
def SignJwt(self, request, global_params=None):
r"""Signs a JWT using a service account's system-managed private key.
Args:
request: (IamcredentialsProjectsServiceAccountsSignJwtRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(SignJwtResponse) The response message.
"""
config = self.GetMethodConfig('SignJwt')
return self._RunMethod(
config, request, global_params=global_params)
SignJwt.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt',
http_method=u'POST',
method_id=u'iamcredentials.projects.serviceAccounts.signJwt',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:signJwt',
request_field=u'signJwtRequest',
request_type_name=u'IamcredentialsProjectsServiceAccountsSignJwtRequest',
response_type_name=u'SignJwtResponse',
supports_download=False,
)
class ProjectsService(base_api.BaseApiService):
"""Service class for the projects resource."""
_NAME = u'projects'
def __init__(self, client):
super(IamcredentialsV1.ProjectsService, self).__init__(client)
self._upload_configs = {
}

View File

@@ -0,0 +1,293 @@
"""Generated message classes for iamcredentials version v1.
Creates short-lived, limited-privilege credentials for IAM service accounts.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
package = 'iamcredentials'
class GenerateAccessTokenRequest(_messages.Message):
r"""A GenerateAccessTokenRequest object.
Fields:
delegates: The sequence of service accounts in a delegation chain. Each
service account must be granted the
`roles/iam.serviceAccountTokenCreator` role on its next service account
in the chain. The last service account in the chain must be granted the
`roles/iam.serviceAccountTokenCreator` role on the service account that
is specified in the `name` field of the request. The delegates must
have the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
lifetime: The desired lifetime duration of the access token in seconds.
Must be set to a value less than or equal to 3600 (1 hour). If a value
is not specified, the token's lifetime will be set to a default value of
one hour.
scope: Code to identify the scopes to be included in the OAuth 2.0 access
token. See https://developers.google.com/identity/protocols/googlescopes
for more information. At least one value required.
"""
delegates = _messages.StringField(1, repeated=True)
lifetime = _messages.StringField(2)
scope = _messages.StringField(3, repeated=True)
class GenerateAccessTokenResponse(_messages.Message):
r"""A GenerateAccessTokenResponse object.
Fields:
accessToken: The OAuth 2.0 access token.
expireTime: Token expiration time. The expiration time is always set.
"""
accessToken = _messages.StringField(1)
expireTime = _messages.StringField(2)
class GenerateIdTokenRequest(_messages.Message):
r"""A GenerateIdTokenRequest object.
Fields:
audience: The audience for the token, such as the API or account that this
token grants access to.
delegates: The sequence of service accounts in a delegation chain. Each
service account must be granted the
`roles/iam.serviceAccountTokenCreator` role on its next service account
in the chain. The last service account in the chain must be granted the
`roles/iam.serviceAccountTokenCreator` role on the service account that
is specified in the `name` field of the request. The delegates must
have the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
includeEmail: Include the service account email in the token. If set to
`true`, the token will contain `email` and `email_verified` claims.
"""
audience = _messages.StringField(1)
delegates = _messages.StringField(2, repeated=True)
includeEmail = _messages.BooleanField(3)
class GenerateIdTokenResponse(_messages.Message):
r"""A GenerateIdTokenResponse object.
Fields:
token: The OpenId Connect ID token.
"""
token = _messages.StringField(1)
class IamcredentialsProjectsServiceAccountsGenerateAccessTokenRequest(_messages.Message):
r"""A IamcredentialsProjectsServiceAccountsGenerateAccessTokenRequest
object.
Fields:
generateAccessTokenRequest: A GenerateAccessTokenRequest resource to be
passed as the request body.
name: The resource name of the service account for which the credentials
are requested, in the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
"""
generateAccessTokenRequest = _messages.MessageField('GenerateAccessTokenRequest', 1)
name = _messages.StringField(2, required=True)
class IamcredentialsProjectsServiceAccountsGenerateIdTokenRequest(_messages.Message):
r"""A IamcredentialsProjectsServiceAccountsGenerateIdTokenRequest object.
Fields:
generateIdTokenRequest: A GenerateIdTokenRequest resource to be passed as
the request body.
name: The resource name of the service account for which the credentials
are requested, in the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
"""
generateIdTokenRequest = _messages.MessageField('GenerateIdTokenRequest', 1)
name = _messages.StringField(2, required=True)
class IamcredentialsProjectsServiceAccountsSignBlobRequest(_messages.Message):
r"""A IamcredentialsProjectsServiceAccountsSignBlobRequest object.
Fields:
name: The resource name of the service account for which the credentials
are requested, in the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
signBlobRequest: A SignBlobRequest resource to be passed as the request
body.
"""
name = _messages.StringField(1, required=True)
signBlobRequest = _messages.MessageField('SignBlobRequest', 2)
class IamcredentialsProjectsServiceAccountsSignJwtRequest(_messages.Message):
r"""A IamcredentialsProjectsServiceAccountsSignJwtRequest object.
Fields:
name: The resource name of the service account for which the credentials
are requested, in the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
signJwtRequest: A SignJwtRequest resource to be passed as the request
body.
"""
name = _messages.StringField(1, required=True)
signJwtRequest = _messages.MessageField('SignJwtRequest', 2)
class SignBlobRequest(_messages.Message):
r"""A SignBlobRequest object.
Fields:
delegates: The sequence of service accounts in a delegation chain. Each
service account must be granted the
`roles/iam.serviceAccountTokenCreator` role on its next service account
in the chain. The last service account in the chain must be granted the
`roles/iam.serviceAccountTokenCreator` role on the service account that
is specified in the `name` field of the request. The delegates must
have the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
payload: The bytes to sign.
"""
delegates = _messages.StringField(1, repeated=True)
payload = _messages.BytesField(2)
class SignBlobResponse(_messages.Message):
r"""A SignBlobResponse object.
Fields:
keyId: The ID of the key used to sign the blob.
signedBlob: The signed blob.
"""
keyId = _messages.StringField(1)
signedBlob = _messages.BytesField(2)
class SignJwtRequest(_messages.Message):
r"""A SignJwtRequest object.
Fields:
delegates: The sequence of service accounts in a delegation chain. Each
service account must be granted the
`roles/iam.serviceAccountTokenCreator` role on its next service account
in the chain. The last service account in the chain must be granted the
`roles/iam.serviceAccountTokenCreator` role on the service account that
is specified in the `name` field of the request. The delegates must
have the following format:
`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-`
wildcard character is required; replacing it with a project ID is
invalid.
payload: The JWT payload to sign: a JSON object that contains a JWT Claims
Set.
"""
delegates = _messages.StringField(1, repeated=True)
payload = _messages.StringField(2)
class SignJwtResponse(_messages.Message):
r"""A SignJwtResponse object.
Fields:
keyId: The ID of the key used to sign the JWT.
signedJwt: The signed JWT.
"""
keyId = _messages.StringField(1)
signedJwt = _messages.StringField(2)
class StandardQueryParameters(_messages.Message):
r"""Query parameters accepted by all methods.
Enums:
FXgafvValueValuesEnum: V1 error format.
AltValueValuesEnum: Data format for response.
Fields:
f__xgafv: V1 error format.
access_token: OAuth access token.
alt: Data format for response.
callback: JSONP
fields: Selector specifying which fields to include in a partial response.
key: API key. Your API key identifies your project and provides you with
API access, quota, and reports. Required unless you provide an OAuth 2.0
token.
oauth_token: OAuth 2.0 token for the current user.
prettyPrint: Returns response with indentations and line breaks.
quotaUser: Available to use for quota purposes for server-side
applications. Can be any arbitrary string assigned to a user, but should
not exceed 40 characters.
trace: A tracing token of the form "token:<tokenid>" to include in api
requests.
uploadType: Legacy upload protocol for media (e.g. "media", "multipart").
upload_protocol: Upload protocol for media (e.g. "raw", "multipart").
"""
class AltValueValuesEnum(_messages.Enum):
r"""Data format for response.
Values:
json: Responses with Content-Type of application/json
media: Media download with context-dependent Content-Type
proto: Responses with Content-Type of application/x-protobuf
"""
json = 0
media = 1
proto = 2
class FXgafvValueValuesEnum(_messages.Enum):
r"""V1 error format.
Values:
_1: v1 error format
_2: v2 error format
"""
_1 = 0
_2 = 1
f__xgafv = _messages.EnumField('FXgafvValueValuesEnum', 1)
access_token = _messages.StringField(2)
alt = _messages.EnumField('AltValueValuesEnum', 3, default=u'json')
callback = _messages.StringField(4)
fields = _messages.StringField(5)
key = _messages.StringField(6)
oauth_token = _messages.StringField(7)
prettyPrint = _messages.BooleanField(8, default=True)
quotaUser = _messages.StringField(9)
trace = _messages.StringField(10)
uploadType = _messages.StringField(11)
upload_protocol = _messages.StringField(12)
encoding.AddCustomJsonFieldMapping(
StandardQueryParameters, 'f__xgafv', '$.xgafv')
encoding.AddCustomJsonEnumMapping(
StandardQueryParameters.FXgafvValueValuesEnum, '_1', '1')
encoding.AddCustomJsonEnumMapping(
StandardQueryParameters.FXgafvValueValuesEnum, '_2', '2')

View File

@@ -0,0 +1,809 @@
"""Generated client library for cloudkms version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
# NOTENOTE: This file has been gently hand-edited. Do not simply replace
# with an autogenerated version - merge with this version!
# For instance, the __future__ import immediately below...
from __future__ import absolute_import
import os
import platform
import sys
from apitools.base.py import base_api
import gslib.third_party.kms_apitools.cloudkms_v1_messages as messages
import gslib
from gslib.metrics import MetricsCollector
from gslib.utils import system_util
class CloudkmsV1(base_api.BaseApiClient):
"""Generated client library for service cloudkms version v1."""
MESSAGES_MODULE = messages
BASE_URL = u'https://cloudkms.googleapis.com/'
_PACKAGE = u'cloudkms'
_SCOPES = [u'https://www.googleapis.com/auth/cloud-platform']
_VERSION = u'v1'
_CLIENT_ID = 'nomatter'
_CLIENT_SECRET = 'nomatter'
_USER_AGENT = 'apitools gsutil/%s Python/%s (%s)' % (
gslib.VERSION, platform.python_version(), sys.platform)
if system_util.InvokedViaCloudSdk():
_USER_AGENT += ' google-cloud-sdk'
if system_util.CloudSdkVersion():
_USER_AGENT += '/%s' % system_util.CloudSdkVersion()
if MetricsCollector.IsDisabled():
_USER_AGENT += ' analytics/disabled'
else:
_USER_AGENT += ' analytics/enabled'
_CLIENT_CLASS_NAME = u'CloudkmsV1'
_URL_VERSION = u'v1'
_API_KEY = None
def __init__(self, url='', credentials=None,
get_credentials=True, http=None, model=None,
log_request=False, log_response=False,
credentials_args=None, default_global_params=None,
additional_http_headers=None):
"""Create a new cloudkms handle."""
url = url or self.BASE_URL
super(CloudkmsV1, self).__init__(
url, credentials=credentials,
get_credentials=get_credentials, http=http, model=model,
log_request=log_request, log_response=log_response,
credentials_args=credentials_args,
default_global_params=default_global_params,
additional_http_headers=additional_http_headers)
self.projects_locations_keyRings_cryptoKeys_cryptoKeyVersions = self.ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService(self)
self.projects_locations_keyRings_cryptoKeys = self.ProjectsLocationsKeyRingsCryptoKeysService(self)
self.projects_locations_keyRings = self.ProjectsLocationsKeyRingsService(self)
self.projects_locations = self.ProjectsLocationsService(self)
self.projects = self.ProjectsService(self)
class ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService(base_api.BaseApiService):
"""Service class for the projects_locations_keyRings_cryptoKeys_cryptoKeyVersions resource."""
_NAME = u'projects_locations_keyRings_cryptoKeys_cryptoKeyVersions'
def __init__(self, client):
super(CloudkmsV1.ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService, self).__init__(client)
self._upload_configs = {
}
def Create(self, request, global_params=None):
"""Create a new CryptoKeyVersion in a CryptoKey.
The server will assign the next sequential id. If unset,
state will be set to
ENABLED.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKeyVersion) The response message.
"""
config = self.GetMethodConfig('Create')
return self._RunMethod(
config, request, global_params=global_params)
Create.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create',
ordered_params=[u'parent'],
path_params=[u'parent'],
query_params=[],
relative_path=u'v1/{+parent}/cryptoKeyVersions',
request_field=u'cryptoKeyVersion',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateRequest',
response_type_name=u'CryptoKeyVersion',
supports_download=False,
)
def Destroy(self, request, global_params=None):
"""Schedule a CryptoKeyVersion for destruction.
Upon calling this method, CryptoKeyVersion.state will be set to
DESTROY_SCHEDULED
and destroy_time will be set to a time 24
hours in the future, at which point the state
will be changed to
DESTROYED, and the key
material will be irrevocably destroyed.
Before the destroy_time is reached,
RestoreCryptoKeyVersion may be called to reverse the process.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKeyVersion) The response message.
"""
config = self.GetMethodConfig('Destroy')
return self._RunMethod(
config, request, global_params=global_params)
Destroy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}:destroy',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:destroy',
request_field=u'destroyCryptoKeyVersionRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyRequest',
response_type_name=u'CryptoKeyVersion',
supports_download=False,
)
def Get(self, request, global_params=None):
"""Returns metadata for a given CryptoKeyVersion.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKeyVersion) The response message.
"""
config = self.GetMethodConfig('Get')
return self._RunMethod(
config, request, global_params=global_params)
Get.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetRequest',
response_type_name=u'CryptoKeyVersion',
supports_download=False,
)
def List(self, request, global_params=None):
"""Lists CryptoKeyVersions.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ListCryptoKeyVersionsResponse) The response message.
"""
config = self.GetMethodConfig('List')
return self._RunMethod(
config, request, global_params=global_params)
List.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list',
ordered_params=[u'parent'],
path_params=[u'parent'],
query_params=[u'pageSize', u'pageToken'],
relative_path=u'v1/{+parent}/cryptoKeyVersions',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListRequest',
response_type_name=u'ListCryptoKeyVersionsResponse',
supports_download=False,
)
def Patch(self, request, global_params=None):
"""Update a CryptoKeyVersion's metadata.
state may be changed between
ENABLED and
DISABLED using this
method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to
move between other states.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKeyVersion) The response message.
"""
config = self.GetMethodConfig('Patch')
return self._RunMethod(
config, request, global_params=global_params)
Patch.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}',
http_method=u'PATCH',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[u'updateMask'],
relative_path=u'v1/{+name}',
request_field=u'cryptoKeyVersion',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchRequest',
response_type_name=u'CryptoKeyVersion',
supports_download=False,
)
def Restore(self, request, global_params=None):
"""Restore a CryptoKeyVersion in the.
DESTROY_SCHEDULED,
state.
Upon restoration of the CryptoKeyVersion, state
will be set to DISABLED,
and destroy_time will be cleared.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKeyVersion) The response message.
"""
config = self.GetMethodConfig('Restore')
return self._RunMethod(
config, request, global_params=global_params)
Restore.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}:restore',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:restore',
request_field=u'restoreCryptoKeyVersionRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreRequest',
response_type_name=u'CryptoKeyVersion',
supports_download=False,
)
class ProjectsLocationsKeyRingsCryptoKeysService(base_api.BaseApiService):
"""Service class for the projects_locations_keyRings_cryptoKeys resource."""
_NAME = u'projects_locations_keyRings_cryptoKeys'
def __init__(self, client):
super(CloudkmsV1.ProjectsLocationsKeyRingsCryptoKeysService, self).__init__(client)
self._upload_configs = {
}
def Create(self, request, global_params=None):
"""Create a new CryptoKey within a KeyRing.
CryptoKey.purpose is required.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysCreateRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKey) The response message.
"""
config = self.GetMethodConfig('Create')
return self._RunMethod(
config, request, global_params=global_params)
Create.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.create',
ordered_params=[u'parent'],
path_params=[u'parent'],
query_params=[u'cryptoKeyId'],
relative_path=u'v1/{+parent}/cryptoKeys',
request_field=u'cryptoKey',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysCreateRequest',
response_type_name=u'CryptoKey',
supports_download=False,
)
def Decrypt(self, request, global_params=None):
"""Decrypts data that was protected by Encrypt.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysDecryptRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(DecryptResponse) The response message.
"""
config = self.GetMethodConfig('Decrypt')
return self._RunMethod(
config, request, global_params=global_params)
Decrypt.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:decrypt',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.decrypt',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:decrypt',
request_field=u'decryptRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysDecryptRequest',
response_type_name=u'DecryptResponse',
supports_download=False,
)
def Encrypt(self, request, global_params=None):
"""Encrypts data, so that it can only be recovered by a call to Decrypt.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysEncryptRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(EncryptResponse) The response message.
"""
config = self.GetMethodConfig('Encrypt')
return self._RunMethod(
config, request, global_params=global_params)
Encrypt.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:encrypt',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.encrypt',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:encrypt',
request_field=u'encryptRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysEncryptRequest',
response_type_name=u'EncryptResponse',
supports_download=False,
)
def Get(self, request, global_params=None):
"""Returns metadata for a given CryptoKey, as well as its.
primary CryptoKeyVersion.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKey) The response message.
"""
config = self.GetMethodConfig('Get')
return self._RunMethod(
config, request, global_params=global_params)
Get.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.get',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysGetRequest',
response_type_name=u'CryptoKey',
supports_download=False,
)
def GetIamPolicy(self, request, global_params=None):
"""Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy
set.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysGetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('GetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
GetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:getIamPolicy',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:getIamPolicy',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysGetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def List(self, request, global_params=None):
"""Lists CryptoKeys.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ListCryptoKeysResponse) The response message.
"""
config = self.GetMethodConfig('List')
return self._RunMethod(
config, request, global_params=global_params)
List.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.list',
ordered_params=[u'parent'],
path_params=[u'parent'],
query_params=[u'pageSize', u'pageToken'],
relative_path=u'v1/{+parent}/cryptoKeys',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysListRequest',
response_type_name=u'ListCryptoKeysResponse',
supports_download=False,
)
def Patch(self, request, global_params=None):
"""Update a CryptoKey.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysPatchRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKey) The response message.
"""
config = self.GetMethodConfig('Patch')
return self._RunMethod(
config, request, global_params=global_params)
Patch.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}',
http_method=u'PATCH',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.patch',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[u'updateMask'],
relative_path=u'v1/{+name}',
request_field=u'cryptoKey',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysPatchRequest',
response_type_name=u'CryptoKey',
supports_download=False,
)
def SetIamPolicy(self, request, global_params=None):
"""Sets the access control policy on the specified resource. Replaces any.
existing policy.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysSetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('SetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
SetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:setIamPolicy',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:setIamPolicy',
request_field=u'setIamPolicyRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysSetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def TestIamPermissions(self, request, global_params=None):
"""Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestIamPermissionsResponse) The response message.
"""
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(
config, request, global_params=global_params)
TestIamPermissions.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:testIamPermissions',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:testIamPermissions',
request_field=u'testIamPermissionsRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsRequest',
response_type_name=u'TestIamPermissionsResponse',
supports_download=False,
)
def UpdatePrimaryVersion(self, request, global_params=None):
"""Update the version of a CryptoKey that will be used in Encrypt.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(CryptoKey) The response message.
"""
config = self.GetMethodConfig('UpdatePrimaryVersion')
return self._RunMethod(
config, request, global_params=global_params)
UpdatePrimaryVersion.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:updatePrimaryVersion',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}:updatePrimaryVersion',
request_field=u'updateCryptoKeyPrimaryVersionRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionRequest',
response_type_name=u'CryptoKey',
supports_download=False,
)
class ProjectsLocationsKeyRingsService(base_api.BaseApiService):
"""Service class for the projects_locations_keyRings resource."""
_NAME = u'projects_locations_keyRings'
def __init__(self, client):
super(CloudkmsV1.ProjectsLocationsKeyRingsService, self).__init__(client)
self._upload_configs = {
}
def Create(self, request, global_params=None):
"""Create a new KeyRing in a given Project and Location.
Args:
request: (CloudkmsProjectsLocationsKeyRingsCreateRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(KeyRing) The response message.
"""
config = self.GetMethodConfig('Create')
return self._RunMethod(
config, request, global_params=global_params)
Create.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.create',
ordered_params=[u'parent'],
path_params=[u'parent'],
query_params=[u'keyRingId'],
relative_path=u'v1/{+parent}/keyRings',
request_field=u'keyRing',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsCreateRequest',
response_type_name=u'KeyRing',
supports_download=False,
)
def Get(self, request, global_params=None):
"""Returns metadata for a given KeyRing.
Args:
request: (CloudkmsProjectsLocationsKeyRingsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(KeyRing) The response message.
"""
config = self.GetMethodConfig('Get')
return self._RunMethod(
config, request, global_params=global_params)
Get.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.get',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsGetRequest',
response_type_name=u'KeyRing',
supports_download=False,
)
def GetIamPolicy(self, request, global_params=None):
"""Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy
set.
Args:
request: (CloudkmsProjectsLocationsKeyRingsGetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('GetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
GetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:getIamPolicy',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.getIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:getIamPolicy',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsGetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def List(self, request, global_params=None):
"""Lists KeyRings.
Args:
request: (CloudkmsProjectsLocationsKeyRingsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ListKeyRingsResponse) The response message.
"""
config = self.GetMethodConfig('List')
return self._RunMethod(
config, request, global_params=global_params)
List.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.keyRings.list',
ordered_params=[u'parent'],
path_params=[u'parent'],
query_params=[u'pageSize', u'pageToken'],
relative_path=u'v1/{+parent}/keyRings',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsListRequest',
response_type_name=u'ListKeyRingsResponse',
supports_download=False,
)
def SetIamPolicy(self, request, global_params=None):
"""Sets the access control policy on the specified resource. Replaces any.
existing policy.
Args:
request: (CloudkmsProjectsLocationsKeyRingsSetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('SetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
SetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:setIamPolicy',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.setIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:setIamPolicy',
request_field=u'setIamPolicyRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsSetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def TestIamPermissions(self, request, global_params=None):
"""Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.
Args:
request: (CloudkmsProjectsLocationsKeyRingsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestIamPermissionsResponse) The response message.
"""
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(
config, request, global_params=global_params)
TestIamPermissions.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:testIamPermissions',
http_method=u'POST',
method_id=u'cloudkms.projects.locations.keyRings.testIamPermissions',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:testIamPermissions',
request_field=u'testIamPermissionsRequest',
request_type_name=u'CloudkmsProjectsLocationsKeyRingsTestIamPermissionsRequest',
response_type_name=u'TestIamPermissionsResponse',
supports_download=False,
)
class ProjectsLocationsService(base_api.BaseApiService):
"""Service class for the projects_locations resource."""
_NAME = u'projects_locations'
def __init__(self, client):
super(CloudkmsV1.ProjectsLocationsService, self).__init__(client)
self._upload_configs = {
}
def Get(self, request, global_params=None):
"""Get information about a location.
Args:
request: (CloudkmsProjectsLocationsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Location) The response message.
"""
config = self.GetMethodConfig('Get')
return self._RunMethod(
config, request, global_params=global_params)
Get.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations/{locationsId}',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.get',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsGetRequest',
response_type_name=u'Location',
supports_download=False,
)
def List(self, request, global_params=None):
"""Lists information about the supported locations for this service.
Args:
request: (CloudkmsProjectsLocationsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ListLocationsResponse) The response message.
"""
config = self.GetMethodConfig('List')
return self._RunMethod(
config, request, global_params=global_params)
List.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/locations',
http_method=u'GET',
method_id=u'cloudkms.projects.locations.list',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[u'filter', u'pageSize', u'pageToken'],
relative_path=u'v1/{+name}/locations',
request_field='',
request_type_name=u'CloudkmsProjectsLocationsListRequest',
response_type_name=u'ListLocationsResponse',
supports_download=False,
)
class ProjectsService(base_api.BaseApiService):
"""Service class for the projects resource."""
_NAME = u'projects'
def __init__(self, client):
super(CloudkmsV1.ProjectsService, self).__init__(client)
self._upload_configs = {
}

View File

@@ -0,0 +1,70 @@
# Copyright 2015 Google Inc. All Rights Reserved.
#
# 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
#
# 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,
# 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.
"""Resource definitions for cloud platform apis."""
import enum
BASE_URL = 'https://cloudkms.googleapis.com/v1/'
class Collections(enum.Enum):
"""Collections for all supported apis."""
PROJECTS_LOCATIONS = (
'projects.locations',
'{+name}',
{
'':
'projects/{projectsId}/locations/{locationsId}',
},
[u'name']
)
PROJECTS_LOCATIONS_KEYRINGS = (
'projects.locations.keyRings',
'{+name}',
{
'':
'projects/{projectsId}/locations/{locationsId}/keyRings/'
'{keyRingsId}',
},
[u'name']
)
PROJECTS_LOCATIONS_KEYRINGS_CRYPTOKEYS = (
'projects.locations.keyRings.cryptoKeys',
'{+name}',
{
'':
'projects/{projectsId}/locations/{locationsId}/keyRings/'
'{keyRingsId}/cryptoKeys/{cryptoKeysId}',
},
[u'name']
)
PROJECTS_LOCATIONS_KEYRINGS_CRYPTOKEYS_CRYPTOKEYVERSIONS = (
'projects.locations.keyRings.cryptoKeys.cryptoKeyVersions',
'{+name}',
{
'':
'projects/{projectsId}/locations/{locationsId}/keyRings/'
'{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/'
'{cryptoKeyVersionsId}',
},
[u'name']
)
def __init__(self, collection_name, path, flat_paths, params):
self.collection_name = collection_name
self.path = path
self.flat_paths = flat_paths
self.params = params

View File

@@ -0,0 +1,798 @@
"""Generated client library for pubsub version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
# NOTENOTE: This file has been gently hand-edited. Do not simply replace
# with an autogenerated version - merge with this version!
# For instance, the __future__ import immediately below...
from __future__ import absolute_import
import os
import platform
import sys
from apitools.base.py import base_api
import gslib.third_party.pubsub_apitools.pubsub_v1_messages as messages
import gslib
from gslib.metrics import MetricsCollector
from gslib.utils import system_util
class PubsubV1(base_api.BaseApiClient):
"""Generated client library for service pubsub version v1."""
MESSAGES_MODULE = messages
BASE_URL = u'https://pubsub.googleapis.com/'
_PACKAGE = u'pubsub'
_SCOPES = [u'https://www.googleapis.com/auth/cloud-platform', u'https://www.googleapis.com/auth/pubsub']
_VERSION = u'v1'
_CLIENT_ID = 'nomatter'
_CLIENT_SECRET = 'nomatter'
_USER_AGENT = 'apitools gsutil/%s Python/%s (%s)' % (
gslib.VERSION, platform.python_version(), sys.platform)
if system_util.InvokedViaCloudSdk():
_USER_AGENT += ' google-cloud-sdk'
if system_util.CloudSdkVersion():
_USER_AGENT += '/%s' % system_util.CloudSdkVersion()
if MetricsCollector.IsDisabled():
_USER_AGENT += ' analytics/disabled'
else:
_USER_AGENT += ' analytics/enabled'
_CLIENT_CLASS_NAME = u'PubsubV1'
_URL_VERSION = u'v1'
_API_KEY = None
def __init__(self, url='', credentials=None,
get_credentials=True, http=None, model=None,
log_request=False, log_response=False,
credentials_args=None, default_global_params=None,
additional_http_headers=None):
"""Create a new pubsub handle."""
url = url or self.BASE_URL
super(PubsubV1, self).__init__(
url, credentials=credentials,
get_credentials=get_credentials, http=http, model=model,
log_request=log_request, log_response=log_response,
credentials_args=credentials_args,
default_global_params=default_global_params,
additional_http_headers=additional_http_headers)
self.projects_snapshots = self.ProjectsSnapshotsService(self)
self.projects_subscriptions = self.ProjectsSubscriptionsService(self)
self.projects_topics_subscriptions = self.ProjectsTopicsSubscriptionsService(self)
self.projects_topics = self.ProjectsTopicsService(self)
self.projects = self.ProjectsService(self)
class ProjectsSnapshotsService(base_api.BaseApiService):
"""Service class for the projects_snapshots resource."""
_NAME = u'projects_snapshots'
def __init__(self, client):
super(PubsubV1.ProjectsSnapshotsService, self).__init__(client)
self._upload_configs = {
}
def GetIamPolicy(self, request, global_params=None):
"""Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy
set.
Args:
request: (PubsubProjectsSnapshotsGetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('GetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
GetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/snapshots/{snapshotsId}:getIamPolicy',
http_method=u'GET',
method_id=u'pubsub.projects.snapshots.getIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:getIamPolicy',
request_field='',
request_type_name=u'PubsubProjectsSnapshotsGetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def SetIamPolicy(self, request, global_params=None):
"""Sets the access control policy on the specified resource. Replaces any.
existing policy.
Args:
request: (PubsubProjectsSnapshotsSetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('SetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
SetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/snapshots/{snapshotsId}:setIamPolicy',
http_method=u'POST',
method_id=u'pubsub.projects.snapshots.setIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:setIamPolicy',
request_field=u'setIamPolicyRequest',
request_type_name=u'PubsubProjectsSnapshotsSetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def TestIamPermissions(self, request, global_params=None):
"""Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.
Args:
request: (PubsubProjectsSnapshotsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestIamPermissionsResponse) The response message.
"""
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(
config, request, global_params=global_params)
TestIamPermissions.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/snapshots/{snapshotsId}:testIamPermissions',
http_method=u'POST',
method_id=u'pubsub.projects.snapshots.testIamPermissions',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:testIamPermissions',
request_field=u'testIamPermissionsRequest',
request_type_name=u'PubsubProjectsSnapshotsTestIamPermissionsRequest',
response_type_name=u'TestIamPermissionsResponse',
supports_download=False,
)
class ProjectsSubscriptionsService(base_api.BaseApiService):
"""Service class for the projects_subscriptions resource."""
_NAME = u'projects_subscriptions'
def __init__(self, client):
super(PubsubV1.ProjectsSubscriptionsService, self).__init__(client)
self._upload_configs = {
}
def Acknowledge(self, request, global_params=None):
"""Acknowledges the messages associated with the `ack_ids` in the.
`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
from the subscription.
Acknowledging a message whose ack deadline has expired may succeed,
but such a message may be redelivered later. Acknowledging a message more
than once will not result in an error.
Args:
request: (PubsubProjectsSubscriptionsAcknowledgeRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Empty) The response message.
"""
config = self.GetMethodConfig('Acknowledge')
return self._RunMethod(
config, request, global_params=global_params)
Acknowledge.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge',
http_method=u'POST',
method_id=u'pubsub.projects.subscriptions.acknowledge',
ordered_params=[u'subscription'],
path_params=[u'subscription'],
query_params=[],
relative_path=u'v1/{+subscription}:acknowledge',
request_field=u'acknowledgeRequest',
request_type_name=u'PubsubProjectsSubscriptionsAcknowledgeRequest',
response_type_name=u'Empty',
supports_download=False,
)
def Create(self, request, global_params=None):
"""Creates a subscription to a given topic.
If the subscription already exists, returns `ALREADY_EXISTS`.
If the corresponding topic doesn't exist, returns `NOT_FOUND`.
If the name is not provided in the request, the server will assign a random
name for this subscription on the same project as the topic, conforming
to the
[resource name format](https://cloud.google.com/pubsub/docs/overview#names).
The generated name is populated in the returned Subscription object.
Note that for REST API requests, you must specify a name in the request.
Args:
request: (Subscription) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Subscription) The response message.
"""
config = self.GetMethodConfig('Create')
return self._RunMethod(
config, request, global_params=global_params)
Create.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}',
http_method=u'PUT',
method_id=u'pubsub.projects.subscriptions.create',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}',
request_field='<request>',
request_type_name=u'Subscription',
response_type_name=u'Subscription',
supports_download=False,
)
def Delete(self, request, global_params=None):
"""Deletes an existing subscription. All messages retained in the subscription.
are immediately dropped. Calls to `Pull` after deletion will return
`NOT_FOUND`. After a subscription is deleted, a new one may be created with
the same name, but the new one has no association with the old
subscription or its topic unless the same topic is specified.
Args:
request: (PubsubProjectsSubscriptionsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Empty) The response message.
"""
config = self.GetMethodConfig('Delete')
return self._RunMethod(
config, request, global_params=global_params)
Delete.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}',
http_method=u'DELETE',
method_id=u'pubsub.projects.subscriptions.delete',
ordered_params=[u'subscription'],
path_params=[u'subscription'],
query_params=[],
relative_path=u'v1/{+subscription}',
request_field='',
request_type_name=u'PubsubProjectsSubscriptionsDeleteRequest',
response_type_name=u'Empty',
supports_download=False,
)
def Get(self, request, global_params=None):
"""Gets the configuration details of a subscription.
Args:
request: (PubsubProjectsSubscriptionsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Subscription) The response message.
"""
config = self.GetMethodConfig('Get')
return self._RunMethod(
config, request, global_params=global_params)
Get.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}',
http_method=u'GET',
method_id=u'pubsub.projects.subscriptions.get',
ordered_params=[u'subscription'],
path_params=[u'subscription'],
query_params=[],
relative_path=u'v1/{+subscription}',
request_field='',
request_type_name=u'PubsubProjectsSubscriptionsGetRequest',
response_type_name=u'Subscription',
supports_download=False,
)
def GetIamPolicy(self, request, global_params=None):
"""Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy
set.
Args:
request: (PubsubProjectsSubscriptionsGetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('GetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
GetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}:getIamPolicy',
http_method=u'GET',
method_id=u'pubsub.projects.subscriptions.getIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:getIamPolicy',
request_field='',
request_type_name=u'PubsubProjectsSubscriptionsGetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def List(self, request, global_params=None):
"""Lists matching subscriptions.
Args:
request: (PubsubProjectsSubscriptionsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ListSubscriptionsResponse) The response message.
"""
config = self.GetMethodConfig('List')
return self._RunMethod(
config, request, global_params=global_params)
List.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions',
http_method=u'GET',
method_id=u'pubsub.projects.subscriptions.list',
ordered_params=[u'project'],
path_params=[u'project'],
query_params=[u'pageSize', u'pageToken'],
relative_path=u'v1/{+project}/subscriptions',
request_field='',
request_type_name=u'PubsubProjectsSubscriptionsListRequest',
response_type_name=u'ListSubscriptionsResponse',
supports_download=False,
)
def ModifyAckDeadline(self, request, global_params=None):
"""Modifies the ack deadline for a specific message. This method is useful.
to indicate that more time is needed to process a message by the
subscriber, or to make the message available for redelivery if the
processing was interrupted. Note that this does not modify the
subscription-level `ackDeadlineSeconds` used for subsequent messages.
Args:
request: (PubsubProjectsSubscriptionsModifyAckDeadlineRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Empty) The response message.
"""
config = self.GetMethodConfig('ModifyAckDeadline')
return self._RunMethod(
config, request, global_params=global_params)
ModifyAckDeadline.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyAckDeadline',
http_method=u'POST',
method_id=u'pubsub.projects.subscriptions.modifyAckDeadline',
ordered_params=[u'subscription'],
path_params=[u'subscription'],
query_params=[],
relative_path=u'v1/{+subscription}:modifyAckDeadline',
request_field=u'modifyAckDeadlineRequest',
request_type_name=u'PubsubProjectsSubscriptionsModifyAckDeadlineRequest',
response_type_name=u'Empty',
supports_download=False,
)
def ModifyPushConfig(self, request, global_params=None):
"""Modifies the `PushConfig` for a specified subscription.
This may be used to change a push subscription to a pull one (signified by
an empty `PushConfig`) or vice versa, or change the endpoint URL and other
attributes of a push subscription. Messages will accumulate for delivery
continuously through the call regardless of changes to the `PushConfig`.
Args:
request: (PubsubProjectsSubscriptionsModifyPushConfigRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Empty) The response message.
"""
config = self.GetMethodConfig('ModifyPushConfig')
return self._RunMethod(
config, request, global_params=global_params)
ModifyPushConfig.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyPushConfig',
http_method=u'POST',
method_id=u'pubsub.projects.subscriptions.modifyPushConfig',
ordered_params=[u'subscription'],
path_params=[u'subscription'],
query_params=[],
relative_path=u'v1/{+subscription}:modifyPushConfig',
request_field=u'modifyPushConfigRequest',
request_type_name=u'PubsubProjectsSubscriptionsModifyPushConfigRequest',
response_type_name=u'Empty',
supports_download=False,
)
def Pull(self, request, global_params=None):
"""Pulls messages from the server. Returns an empty list if there are no.
messages available in the backlog. The server may return `UNAVAILABLE` if
there are too many concurrent pull requests pending for the given
subscription.
Args:
request: (PubsubProjectsSubscriptionsPullRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(PullResponse) The response message.
"""
config = self.GetMethodConfig('Pull')
return self._RunMethod(
config, request, global_params=global_params)
Pull.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}:pull',
http_method=u'POST',
method_id=u'pubsub.projects.subscriptions.pull',
ordered_params=[u'subscription'],
path_params=[u'subscription'],
query_params=[],
relative_path=u'v1/{+subscription}:pull',
request_field=u'pullRequest',
request_type_name=u'PubsubProjectsSubscriptionsPullRequest',
response_type_name=u'PullResponse',
supports_download=False,
)
def SetIamPolicy(self, request, global_params=None):
"""Sets the access control policy on the specified resource. Replaces any.
existing policy.
Args:
request: (PubsubProjectsSubscriptionsSetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('SetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
SetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}:setIamPolicy',
http_method=u'POST',
method_id=u'pubsub.projects.subscriptions.setIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:setIamPolicy',
request_field=u'setIamPolicyRequest',
request_type_name=u'PubsubProjectsSubscriptionsSetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def TestIamPermissions(self, request, global_params=None):
"""Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.
Args:
request: (PubsubProjectsSubscriptionsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestIamPermissionsResponse) The response message.
"""
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(
config, request, global_params=global_params)
TestIamPermissions.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/subscriptions/{subscriptionsId}:testIamPermissions',
http_method=u'POST',
method_id=u'pubsub.projects.subscriptions.testIamPermissions',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:testIamPermissions',
request_field=u'testIamPermissionsRequest',
request_type_name=u'PubsubProjectsSubscriptionsTestIamPermissionsRequest',
response_type_name=u'TestIamPermissionsResponse',
supports_download=False,
)
class ProjectsTopicsSubscriptionsService(base_api.BaseApiService):
"""Service class for the projects_topics_subscriptions resource."""
_NAME = u'projects_topics_subscriptions'
def __init__(self, client):
super(PubsubV1.ProjectsTopicsSubscriptionsService, self).__init__(client)
self._upload_configs = {
}
def List(self, request, global_params=None):
"""Lists the name of the subscriptions for this topic.
Args:
request: (PubsubProjectsTopicsSubscriptionsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ListTopicSubscriptionsResponse) The response message.
"""
config = self.GetMethodConfig('List')
return self._RunMethod(
config, request, global_params=global_params)
List.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}/subscriptions',
http_method=u'GET',
method_id=u'pubsub.projects.topics.subscriptions.list',
ordered_params=[u'topic'],
path_params=[u'topic'],
query_params=[u'pageSize', u'pageToken'],
relative_path=u'v1/{+topic}/subscriptions',
request_field='',
request_type_name=u'PubsubProjectsTopicsSubscriptionsListRequest',
response_type_name=u'ListTopicSubscriptionsResponse',
supports_download=False,
)
class ProjectsTopicsService(base_api.BaseApiService):
"""Service class for the projects_topics resource."""
_NAME = u'projects_topics'
def __init__(self, client):
super(PubsubV1.ProjectsTopicsService, self).__init__(client)
self._upload_configs = {
}
def Create(self, request, global_params=None):
"""Creates the given topic with the given name.
Args:
request: (Topic) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Topic) The response message.
"""
config = self.GetMethodConfig('Create')
return self._RunMethod(
config, request, global_params=global_params)
Create.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}',
http_method=u'PUT',
method_id=u'pubsub.projects.topics.create',
ordered_params=[u'name'],
path_params=[u'name'],
query_params=[],
relative_path=u'v1/{+name}',
request_field='<request>',
request_type_name=u'Topic',
response_type_name=u'Topic',
supports_download=False,
)
def Delete(self, request, global_params=None):
"""Deletes the topic with the given name. Returns `NOT_FOUND` if the topic.
does not exist. After a topic is deleted, a new topic may be created with
the same name; this is an entirely new topic with none of the old
configuration or subscriptions. Existing subscriptions to this topic are
not deleted, but their `topic` field is set to `_deleted-topic_`.
Args:
request: (PubsubProjectsTopicsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Empty) The response message.
"""
config = self.GetMethodConfig('Delete')
return self._RunMethod(
config, request, global_params=global_params)
Delete.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}',
http_method=u'DELETE',
method_id=u'pubsub.projects.topics.delete',
ordered_params=[u'topic'],
path_params=[u'topic'],
query_params=[],
relative_path=u'v1/{+topic}',
request_field='',
request_type_name=u'PubsubProjectsTopicsDeleteRequest',
response_type_name=u'Empty',
supports_download=False,
)
def Get(self, request, global_params=None):
"""Gets the configuration of a topic.
Args:
request: (PubsubProjectsTopicsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Topic) The response message.
"""
config = self.GetMethodConfig('Get')
return self._RunMethod(
config, request, global_params=global_params)
Get.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}',
http_method=u'GET',
method_id=u'pubsub.projects.topics.get',
ordered_params=[u'topic'],
path_params=[u'topic'],
query_params=[],
relative_path=u'v1/{+topic}',
request_field='',
request_type_name=u'PubsubProjectsTopicsGetRequest',
response_type_name=u'Topic',
supports_download=False,
)
def GetIamPolicy(self, request, global_params=None):
"""Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy
set.
Args:
request: (PubsubProjectsTopicsGetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('GetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
GetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}:getIamPolicy',
http_method=u'GET',
method_id=u'pubsub.projects.topics.getIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:getIamPolicy',
request_field='',
request_type_name=u'PubsubProjectsTopicsGetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def List(self, request, global_params=None):
"""Lists matching topics.
Args:
request: (PubsubProjectsTopicsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ListTopicsResponse) The response message.
"""
config = self.GetMethodConfig('List')
return self._RunMethod(
config, request, global_params=global_params)
List.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics',
http_method=u'GET',
method_id=u'pubsub.projects.topics.list',
ordered_params=[u'project'],
path_params=[u'project'],
query_params=[u'pageSize', u'pageToken'],
relative_path=u'v1/{+project}/topics',
request_field='',
request_type_name=u'PubsubProjectsTopicsListRequest',
response_type_name=u'ListTopicsResponse',
supports_download=False,
)
def Publish(self, request, global_params=None):
"""Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic.
does not exist. The message payload must not be empty; it must contain
either a non-empty data field, or at least one attribute.
Args:
request: (PubsubProjectsTopicsPublishRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(PublishResponse) The response message.
"""
config = self.GetMethodConfig('Publish')
return self._RunMethod(
config, request, global_params=global_params)
Publish.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}:publish',
http_method=u'POST',
method_id=u'pubsub.projects.topics.publish',
ordered_params=[u'topic'],
path_params=[u'topic'],
query_params=[],
relative_path=u'v1/{+topic}:publish',
request_field=u'publishRequest',
request_type_name=u'PubsubProjectsTopicsPublishRequest',
response_type_name=u'PublishResponse',
supports_download=False,
)
def SetIamPolicy(self, request, global_params=None):
"""Sets the access control policy on the specified resource. Replaces any.
existing policy.
Args:
request: (PubsubProjectsTopicsSetIamPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Policy) The response message.
"""
config = self.GetMethodConfig('SetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params)
SetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}:setIamPolicy',
http_method=u'POST',
method_id=u'pubsub.projects.topics.setIamPolicy',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:setIamPolicy',
request_field=u'setIamPolicyRequest',
request_type_name=u'PubsubProjectsTopicsSetIamPolicyRequest',
response_type_name=u'Policy',
supports_download=False,
)
def TestIamPermissions(self, request, global_params=None):
"""Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.
Args:
request: (PubsubProjectsTopicsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestIamPermissionsResponse) The response message.
"""
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(
config, request, global_params=global_params)
TestIamPermissions.method_config = lambda: base_api.ApiMethodInfo(
flat_path=u'v1/projects/{projectsId}/topics/{topicsId}:testIamPermissions',
http_method=u'POST',
method_id=u'pubsub.projects.topics.testIamPermissions',
ordered_params=[u'resource'],
path_params=[u'resource'],
query_params=[],
relative_path=u'v1/{+resource}:testIamPermissions',
request_field=u'testIamPermissionsRequest',
request_type_name=u'PubsubProjectsTopicsTestIamPermissionsRequest',
response_type_name=u'TestIamPermissionsResponse',
supports_download=False,
)
class ProjectsService(base_api.BaseApiService):
"""Service class for the projects resource."""
_NAME = u'projects'
def __init__(self, client):
super(PubsubV1.ProjectsService, self).__init__(client)
self._upload_configs = {
}

View File

@@ -0,0 +1,823 @@
"""Generated message classes for pubsub version v1.
Provides reliable, many-to-many, asynchronous messaging between applications.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
package = 'pubsub'
class AcknowledgeRequest(_messages.Message):
"""Request for the Acknowledge method.
Fields:
ackIds: The acknowledgment ID for the messages being acknowledged that was
returned by the Pub/Sub system in the `Pull` response. Must not be
empty.
"""
ackIds = _messages.StringField(1, repeated=True)
class Binding(_messages.Message):
"""Associates `members` with a `role`.
Fields:
members: Specifies the identities requesting access for a Cloud Platform
resource. `members` can have the following values: * `allUsers`: A
special identifier that represents anyone who is on the internet;
with or without a Google account. * `allAuthenticatedUsers`: A special
identifier that represents anyone who is authenticated with a Google
account or a service account. * `user:{emailid}`: An email address that
represents a specific Google account. For example, `alice@gmail.com`
or `joe@example.com`. * `serviceAccount:{emailid}`: An email address
that represents a service account. For example, `my-other-
app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address
that represents a Google group. For example, `admins@example.com`.
* `domain:{domain}`: A Google Apps domain name that represents all the
users of that domain. For example, `google.com` or `example.com`.
role: Role that is assigned to `members`. For example, `roles/viewer`,
`roles/editor`, or `roles/owner`. Required
"""
members = _messages.StringField(1, repeated=True)
role = _messages.StringField(2)
class Empty(_messages.Message):
"""A generic empty message that you can re-use to avoid defining duplicated
empty messages in your APIs. A typical example is to use it as the request
or the response type of an API method. For instance: service Foo {
rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
JSON representation for `Empty` is empty JSON object `{}`.
"""
class ListSubscriptionsResponse(_messages.Message):
"""Response for the `ListSubscriptions` method.
Fields:
nextPageToken: If not empty, indicates that there may be more
subscriptions that match the request; this value should be passed in a
new `ListSubscriptionsRequest` to get more subscriptions.
subscriptions: The subscriptions that match the request.
"""
nextPageToken = _messages.StringField(1)
subscriptions = _messages.MessageField('Subscription', 2, repeated=True)
class ListTopicSubscriptionsResponse(_messages.Message):
"""Response for the `ListTopicSubscriptions` method.
Fields:
nextPageToken: If not empty, indicates that there may be more
subscriptions that match the request; this value should be passed in a
new `ListTopicSubscriptionsRequest` to get more subscriptions.
subscriptions: The names of the subscriptions that match the request.
"""
nextPageToken = _messages.StringField(1)
subscriptions = _messages.StringField(2, repeated=True)
class ListTopicsResponse(_messages.Message):
"""Response for the `ListTopics` method.
Fields:
nextPageToken: If not empty, indicates that there may be more topics that
match the request; this value should be passed in a new
`ListTopicsRequest`.
topics: The resulting topics.
"""
nextPageToken = _messages.StringField(1)
topics = _messages.MessageField('Topic', 2, repeated=True)
class ModifyAckDeadlineRequest(_messages.Message):
"""Request for the ModifyAckDeadline method.
Fields:
ackDeadlineSeconds: The new ack deadline with respect to the time this
request was sent to the Pub/Sub system. For example, if the value is 10,
the new ack deadline will expire 10 seconds after the
`ModifyAckDeadline` call was made. Specifying zero may immediately make
the message available for another pull request. The minimum deadline you
can specify is 0 seconds. The maximum deadline you can specify is 600
seconds (10 minutes).
ackIds: List of acknowledgment IDs.
"""
ackDeadlineSeconds = _messages.IntegerField(1, variant=_messages.Variant.INT32)
ackIds = _messages.StringField(2, repeated=True)
class ModifyPushConfigRequest(_messages.Message):
"""Request for the ModifyPushConfig method.
Fields:
pushConfig: The push configuration for future deliveries. An empty
`pushConfig` indicates that the Pub/Sub system should stop pushing
messages from the given subscription and allow messages to be pulled and
acknowledged - effectively pausing the subscription if `Pull` or
`StreamingPull` is not called.
"""
pushConfig = _messages.MessageField('PushConfig', 1)
class Policy(_messages.Message):
"""Defines an Identity and Access Management (IAM) policy. It is used to
specify access control policies for Cloud Platform resources. A `Policy`
consists of a list of `bindings`. A `Binding` binds a list of `members` to a
`role`, where the members can be user accounts, Google groups, Google
domains, and service accounts. A `role` is a named list of permissions
defined by IAM. **Example** { "bindings": [ {
"role": "roles/owner", "members": [
"user:mike@example.com", "group:admins@example.com",
"domain:google.com", "serviceAccount:my-other-
app@appspot.gserviceaccount.com", ] }, {
"role": "roles/viewer", "members": ["user:sean@example.com"]
} ] } For a description of IAM and its features, see the [IAM
developer's guide](https://cloud.google.com/iam).
Fields:
bindings: Associates a list of `members` to a `role`. `bindings` with no
members will result in an error.
etag: `etag` is used for optimistic concurrency control as a way to help
prevent simultaneous updates of a policy from overwriting each other. It
is strongly suggested that systems make use of the `etag` in the read-
modify-write cycle to perform policy updates in order to avoid race
conditions: An `etag` is returned in the response to `getIamPolicy`, and
systems are expected to put that etag in the request to `setIamPolicy`
to ensure that their change will be applied to the same version of the
policy. If no `etag` is provided in the call to `setIamPolicy`, then
the existing policy is overwritten blindly.
version: Version of the `Policy`. The default version is 0.
"""
bindings = _messages.MessageField('Binding', 1, repeated=True)
etag = _messages.BytesField(2)
version = _messages.IntegerField(3, variant=_messages.Variant.INT32)
class PublishRequest(_messages.Message):
"""Request for the Publish method.
Fields:
messages: The messages to publish.
"""
messages = _messages.MessageField('PubsubMessage', 1, repeated=True)
class PublishResponse(_messages.Message):
"""Response for the `Publish` method.
Fields:
messageIds: The server-assigned ID of each published message, in the same
order as the messages in the request. IDs are guaranteed to be unique
within the topic.
"""
messageIds = _messages.StringField(1, repeated=True)
class PubsubMessage(_messages.Message):
"""A message data and its attributes. The message payload must not be empty;
it must contain either a non-empty data field, or at least one attribute.
Messages:
AttributesValue: Optional attributes for this message.
Fields:
attributes: Optional attributes for this message.
data: The message payload.
messageId: ID of this message, assigned by the server when the message is
published. Guaranteed to be unique within the topic. This value may be
read by a subscriber that receives a `PubsubMessage` via a `Pull` call
or a push delivery. It must not be populated by the publisher in a
`Publish` call.
publishTime: The time at which the message was published, populated by the
server when it receives the `Publish` call. It must not be populated by
the publisher in a `Publish` call.
"""
@encoding.MapUnrecognizedFields('additionalProperties')
class AttributesValue(_messages.Message):
"""Optional attributes for this message.
Messages:
AdditionalProperty: An additional property for a AttributesValue object.
Fields:
additionalProperties: Additional properties of type AttributesValue
"""
class AdditionalProperty(_messages.Message):
"""An additional property for a AttributesValue object.
Fields:
key: Name of the additional property.
value: A string attribute.
"""
key = _messages.StringField(1)
value = _messages.StringField(2)
additionalProperties = _messages.MessageField('AdditionalProperty', 1, repeated=True)
attributes = _messages.MessageField('AttributesValue', 1)
data = _messages.BytesField(2)
messageId = _messages.StringField(3)
publishTime = _messages.StringField(4)
class PubsubProjectsSnapshotsGetIamPolicyRequest(_messages.Message):
"""A PubsubProjectsSnapshotsGetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being requested.
See the operation documentation for the appropriate value for this
field.
"""
resource = _messages.StringField(1, required=True)
class PubsubProjectsSnapshotsSetIamPolicyRequest(_messages.Message):
"""A PubsubProjectsSnapshotsSetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being specified.
See the operation documentation for the appropriate value for this
field.
setIamPolicyRequest: A SetIamPolicyRequest resource to be passed as the
request body.
"""
resource = _messages.StringField(1, required=True)
setIamPolicyRequest = _messages.MessageField('SetIamPolicyRequest', 2)
class PubsubProjectsSnapshotsTestIamPermissionsRequest(_messages.Message):
"""A PubsubProjectsSnapshotsTestIamPermissionsRequest object.
Fields:
resource: REQUIRED: The resource for which the policy detail is being
requested. See the operation documentation for the appropriate value for
this field.
testIamPermissionsRequest: A TestIamPermissionsRequest resource to be
passed as the request body.
"""
resource = _messages.StringField(1, required=True)
testIamPermissionsRequest = _messages.MessageField('TestIamPermissionsRequest', 2)
class PubsubProjectsSubscriptionsAcknowledgeRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsAcknowledgeRequest object.
Fields:
acknowledgeRequest: A AcknowledgeRequest resource to be passed as the
request body.
subscription: The subscription whose message is being acknowledged. Format
is `projects/{project}/subscriptions/{sub}`.
"""
acknowledgeRequest = _messages.MessageField('AcknowledgeRequest', 1)
subscription = _messages.StringField(2, required=True)
class PubsubProjectsSubscriptionsDeleteRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsDeleteRequest object.
Fields:
subscription: The subscription to delete. Format is
`projects/{project}/subscriptions/{sub}`.
"""
subscription = _messages.StringField(1, required=True)
class PubsubProjectsSubscriptionsGetIamPolicyRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsGetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being requested.
See the operation documentation for the appropriate value for this
field.
"""
resource = _messages.StringField(1, required=True)
class PubsubProjectsSubscriptionsGetRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsGetRequest object.
Fields:
subscription: The name of the subscription to get. Format is
`projects/{project}/subscriptions/{sub}`.
"""
subscription = _messages.StringField(1, required=True)
class PubsubProjectsSubscriptionsListRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsListRequest object.
Fields:
pageSize: Maximum number of subscriptions to return.
pageToken: The value returned by the last `ListSubscriptionsResponse`;
indicates that this is a continuation of a prior `ListSubscriptions`
call, and that the system should return the next page of data.
project: The name of the cloud project that subscriptions belong to.
Format is `projects/{project}`.
"""
pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32)
pageToken = _messages.StringField(2)
project = _messages.StringField(3, required=True)
class PubsubProjectsSubscriptionsModifyAckDeadlineRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsModifyAckDeadlineRequest object.
Fields:
modifyAckDeadlineRequest: A ModifyAckDeadlineRequest resource to be passed
as the request body.
subscription: The name of the subscription. Format is
`projects/{project}/subscriptions/{sub}`.
"""
modifyAckDeadlineRequest = _messages.MessageField('ModifyAckDeadlineRequest', 1)
subscription = _messages.StringField(2, required=True)
class PubsubProjectsSubscriptionsModifyPushConfigRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsModifyPushConfigRequest object.
Fields:
modifyPushConfigRequest: A ModifyPushConfigRequest resource to be passed
as the request body.
subscription: The name of the subscription. Format is
`projects/{project}/subscriptions/{sub}`.
"""
modifyPushConfigRequest = _messages.MessageField('ModifyPushConfigRequest', 1)
subscription = _messages.StringField(2, required=True)
class PubsubProjectsSubscriptionsPullRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsPullRequest object.
Fields:
pullRequest: A PullRequest resource to be passed as the request body.
subscription: The subscription from which messages should be pulled.
Format is `projects/{project}/subscriptions/{sub}`.
"""
pullRequest = _messages.MessageField('PullRequest', 1)
subscription = _messages.StringField(2, required=True)
class PubsubProjectsSubscriptionsSetIamPolicyRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsSetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being specified.
See the operation documentation for the appropriate value for this
field.
setIamPolicyRequest: A SetIamPolicyRequest resource to be passed as the
request body.
"""
resource = _messages.StringField(1, required=True)
setIamPolicyRequest = _messages.MessageField('SetIamPolicyRequest', 2)
class PubsubProjectsSubscriptionsTestIamPermissionsRequest(_messages.Message):
"""A PubsubProjectsSubscriptionsTestIamPermissionsRequest object.
Fields:
resource: REQUIRED: The resource for which the policy detail is being
requested. See the operation documentation for the appropriate value for
this field.
testIamPermissionsRequest: A TestIamPermissionsRequest resource to be
passed as the request body.
"""
resource = _messages.StringField(1, required=True)
testIamPermissionsRequest = _messages.MessageField('TestIamPermissionsRequest', 2)
class PubsubProjectsTopicsDeleteRequest(_messages.Message):
"""A PubsubProjectsTopicsDeleteRequest object.
Fields:
topic: Name of the topic to delete. Format is
`projects/{project}/topics/{topic}`.
"""
topic = _messages.StringField(1, required=True)
class PubsubProjectsTopicsGetIamPolicyRequest(_messages.Message):
"""A PubsubProjectsTopicsGetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being requested.
See the operation documentation for the appropriate value for this
field.
"""
resource = _messages.StringField(1, required=True)
class PubsubProjectsTopicsGetRequest(_messages.Message):
"""A PubsubProjectsTopicsGetRequest object.
Fields:
topic: The name of the topic to get. Format is
`projects/{project}/topics/{topic}`.
"""
topic = _messages.StringField(1, required=True)
class PubsubProjectsTopicsListRequest(_messages.Message):
"""A PubsubProjectsTopicsListRequest object.
Fields:
pageSize: Maximum number of topics to return.
pageToken: The value returned by the last `ListTopicsResponse`; indicates
that this is a continuation of a prior `ListTopics` call, and that the
system should return the next page of data.
project: The name of the cloud project that topics belong to. Format is
`projects/{project}`.
"""
pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32)
pageToken = _messages.StringField(2)
project = _messages.StringField(3, required=True)
class PubsubProjectsTopicsPublishRequest(_messages.Message):
"""A PubsubProjectsTopicsPublishRequest object.
Fields:
publishRequest: A PublishRequest resource to be passed as the request
body.
topic: The messages in the request will be published on this topic. Format
is `projects/{project}/topics/{topic}`.
"""
publishRequest = _messages.MessageField('PublishRequest', 1)
topic = _messages.StringField(2, required=True)
class PubsubProjectsTopicsSetIamPolicyRequest(_messages.Message):
"""A PubsubProjectsTopicsSetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being specified.
See the operation documentation for the appropriate value for this
field.
setIamPolicyRequest: A SetIamPolicyRequest resource to be passed as the
request body.
"""
resource = _messages.StringField(1, required=True)
setIamPolicyRequest = _messages.MessageField('SetIamPolicyRequest', 2)
class PubsubProjectsTopicsSubscriptionsListRequest(_messages.Message):
"""A PubsubProjectsTopicsSubscriptionsListRequest object.
Fields:
pageSize: Maximum number of subscription names to return.
pageToken: The value returned by the last
`ListTopicSubscriptionsResponse`; indicates that this is a continuation
of a prior `ListTopicSubscriptions` call, and that the system should
return the next page of data.
topic: The name of the topic that subscriptions are attached to. Format is
`projects/{project}/topics/{topic}`.
"""
pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32)
pageToken = _messages.StringField(2)
topic = _messages.StringField(3, required=True)
class PubsubProjectsTopicsTestIamPermissionsRequest(_messages.Message):
"""A PubsubProjectsTopicsTestIamPermissionsRequest object.
Fields:
resource: REQUIRED: The resource for which the policy detail is being
requested. See the operation documentation for the appropriate value for
this field.
testIamPermissionsRequest: A TestIamPermissionsRequest resource to be
passed as the request body.
"""
resource = _messages.StringField(1, required=True)
testIamPermissionsRequest = _messages.MessageField('TestIamPermissionsRequest', 2)
class PullRequest(_messages.Message):
"""Request for the `Pull` method.
Fields:
maxMessages: The maximum number of messages returned for this request. The
Pub/Sub system may return fewer than the number specified.
returnImmediately: If this field set to true, the system will respond
immediately even if it there are no messages available to return in the
`Pull` response. Otherwise, the system may wait (for a bounded amount of
time) until at least one message is available, rather than returning no
messages. The client may cancel the request if it does not wish to wait
any longer for the response.
"""
maxMessages = _messages.IntegerField(1, variant=_messages.Variant.INT32)
returnImmediately = _messages.BooleanField(2)
class PullResponse(_messages.Message):
"""Response for the `Pull` method.
Fields:
receivedMessages: Received Pub/Sub messages. The Pub/Sub system will
return zero messages if there are no more available in the backlog. The
Pub/Sub system may return fewer than the `maxMessages` requested even if
there are more messages available in the backlog.
"""
receivedMessages = _messages.MessageField('ReceivedMessage', 1, repeated=True)
class PushConfig(_messages.Message):
"""Configuration for a push delivery endpoint.
Messages:
AttributesValue: Endpoint configuration attributes. Every endpoint has a
set of API supported attributes that can be used to control different
aspects of the message delivery. The currently supported attribute is
`x-goog-version`, which you can use to change the format of the pushed
message. This attribute indicates the version of the data expected by
the endpoint. This controls the shape of the pushed message (i.e., its
fields and metadata). The endpoint version is based on the version of
the Pub/Sub API. If not present during the `CreateSubscription` call,
it will default to the version of the API used to make such call. If not
present during a `ModifyPushConfig` call, its value will not be changed.
`GetSubscription` calls will always return a valid version, even if the
subscription was created without this attribute. The possible values
for this attribute are: * `v1beta1`: uses the push format defined in
the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format
defined in the v1 Pub/Sub API.
Fields:
attributes: Endpoint configuration attributes. Every endpoint has a set
of API supported attributes that can be used to control different
aspects of the message delivery. The currently supported attribute is
`x-goog-version`, which you can use to change the format of the pushed
message. This attribute indicates the version of the data expected by
the endpoint. This controls the shape of the pushed message (i.e., its
fields and metadata). The endpoint version is based on the version of
the Pub/Sub API. If not present during the `CreateSubscription` call,
it will default to the version of the API used to make such call. If not
present during a `ModifyPushConfig` call, its value will not be changed.
`GetSubscription` calls will always return a valid version, even if the
subscription was created without this attribute. The possible values
for this attribute are: * `v1beta1`: uses the push format defined in
the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format
defined in the v1 Pub/Sub API.
pushEndpoint: A URL locating the endpoint to which messages should be
pushed. For example, a Webhook endpoint might use
"https://example.com/push".
"""
@encoding.MapUnrecognizedFields('additionalProperties')
class AttributesValue(_messages.Message):
"""Endpoint configuration attributes. Every endpoint has a set of API
supported attributes that can be used to control different aspects of the
message delivery. The currently supported attribute is `x-goog-version`,
which you can use to change the format of the pushed message. This
attribute indicates the version of the data expected by the endpoint. This
controls the shape of the pushed message (i.e., its fields and metadata).
The endpoint version is based on the version of the Pub/Sub API. If not
present during the `CreateSubscription` call, it will default to the
version of the API used to make such call. If not present during a
`ModifyPushConfig` call, its value will not be changed. `GetSubscription`
calls will always return a valid version, even if the subscription was
created without this attribute. The possible values for this attribute
are: * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub
API. * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub
API.
Messages:
AdditionalProperty: An additional property for a AttributesValue object.
Fields:
additionalProperties: Additional properties of type AttributesValue
"""
class AdditionalProperty(_messages.Message):
"""An additional property for a AttributesValue object.
Fields:
key: Name of the additional property.
value: A string attribute.
"""
key = _messages.StringField(1)
value = _messages.StringField(2)
additionalProperties = _messages.MessageField('AdditionalProperty', 1, repeated=True)
attributes = _messages.MessageField('AttributesValue', 1)
pushEndpoint = _messages.StringField(2)
class ReceivedMessage(_messages.Message):
"""A message and its corresponding acknowledgment ID.
Fields:
ackId: This ID can be used to acknowledge the received message.
message: The message.
"""
ackId = _messages.StringField(1)
message = _messages.MessageField('PubsubMessage', 2)
class SetIamPolicyRequest(_messages.Message):
"""Request message for `SetIamPolicy` method.
Fields:
policy: REQUIRED: The complete policy to be applied to the `resource`. The
size of the policy is limited to a few 10s of KB. An empty policy is a
valid policy but certain Cloud Platform services (such as Projects)
might reject them.
"""
policy = _messages.MessageField('Policy', 1)
class StandardQueryParameters(_messages.Message):
"""Query parameters accepted by all methods.
Enums:
FXgafvValueValuesEnum: V1 error format.
AltValueValuesEnum: Data format for response.
Fields:
f__xgafv: V1 error format.
access_token: OAuth access token.
alt: Data format for response.
bearer_token: OAuth bearer token.
callback: JSONP
fields: Selector specifying which fields to include in a partial response.
key: API key. Your API key identifies your project and provides you with
API access, quota, and reports. Required unless you provide an OAuth 2.0
token.
oauth_token: OAuth 2.0 token for the current user.
pp: Pretty-print response.
prettyPrint: Returns response with indentations and line breaks.
quotaUser: Available to use for quota purposes for server-side
applications. Can be any arbitrary string assigned to a user, but should
not exceed 40 characters.
trace: A tracing token of the form "token:<tokenid>" to include in api
requests.
uploadType: Legacy upload protocol for media (e.g. "media", "multipart").
upload_protocol: Upload protocol for media (e.g. "raw", "multipart").
"""
class AltValueValuesEnum(_messages.Enum):
"""Data format for response.
Values:
json: Responses with Content-Type of application/json
media: Media download with context-dependent Content-Type
proto: Responses with Content-Type of application/x-protobuf
"""
json = 0
media = 1
proto = 2
class FXgafvValueValuesEnum(_messages.Enum):
"""V1 error format.
Values:
_1: v1 error format
_2: v2 error format
"""
_1 = 0
_2 = 1
f__xgafv = _messages.EnumField('FXgafvValueValuesEnum', 1)
access_token = _messages.StringField(2)
alt = _messages.EnumField('AltValueValuesEnum', 3, default=u'json')
bearer_token = _messages.StringField(4)
callback = _messages.StringField(5)
fields = _messages.StringField(6)
key = _messages.StringField(7)
oauth_token = _messages.StringField(8)
pp = _messages.BooleanField(9, default=True)
prettyPrint = _messages.BooleanField(10, default=True)
quotaUser = _messages.StringField(11)
trace = _messages.StringField(12)
uploadType = _messages.StringField(13)
upload_protocol = _messages.StringField(14)
class Subscription(_messages.Message):
"""A subscription resource.
Fields:
ackDeadlineSeconds: This value is the maximum time after a subscriber
receives a message before the subscriber should acknowledge the message.
After message delivery but before the ack deadline expires and before
the message is acknowledged, it is an outstanding message and will not
be delivered again during that time (on a best-effort basis). For pull
subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
`ModifyAckDeadline` with the corresponding `ack_id` if using non-
streaming pull or send the `ack_id` in a
`StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum
custom deadline you can specify is 10 seconds. The maximum custom
deadline you can specify is 600 seconds (10 minutes). If this parameter
is 0, a default value of 10 seconds is used. For push delivery, this
value is also used to set the request timeout for the call to the push
endpoint. If the subscriber never acknowledges the message, the Pub/Sub
system will eventually redeliver the message.
name: The name of the subscription. It must have the format
`"projects/{project}/subscriptions/{subscription}"`. `{subscription}`
must start with a letter, and contain only letters (`[A-Za-z]`), numbers
(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
plus (`+`) or percent signs (`%`). It must be between 3 and 255
characters in length, and it must not start with `"goog"`.
pushConfig: If push delivery is used with this subscription, this field is
used to configure it. An empty `pushConfig` signifies that the
subscriber will pull and ack messages using API methods.
topic: The name of the topic from which this subscription is receiving
messages. Format is `projects/{project}/topics/{topic}`. The value of
this field will be `_deleted-topic_` if the topic has been deleted.
"""
ackDeadlineSeconds = _messages.IntegerField(1, variant=_messages.Variant.INT32)
name = _messages.StringField(2)
pushConfig = _messages.MessageField('PushConfig', 3)
topic = _messages.StringField(4)
class TestIamPermissionsRequest(_messages.Message):
"""Request message for `TestIamPermissions` method.
Fields:
permissions: The set of permissions to check for the `resource`.
Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
For more information see [IAM
Overview](https://cloud.google.com/iam/docs/overview#permissions).
"""
permissions = _messages.StringField(1, repeated=True)
class TestIamPermissionsResponse(_messages.Message):
"""Response message for `TestIamPermissions` method.
Fields:
permissions: A subset of `TestPermissionsRequest.permissions` that the
caller is allowed.
"""
permissions = _messages.StringField(1, repeated=True)
class Topic(_messages.Message):
"""A topic resource.
Fields:
name: The name of the topic. It must have the format
`"projects/{project}/topics/{topic}"`. `{topic}` must start with a
letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes
(`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or
percent signs (`%`). It must be between 3 and 255 characters in length,
and it must not start with `"goog"`.
"""
name = _messages.StringField(1)
encoding.AddCustomJsonFieldMapping(
StandardQueryParameters, 'f__xgafv', '$.xgafv')
encoding.AddCustomJsonEnumMapping(
StandardQueryParameters.FXgafvValueValuesEnum, '_1', '1')
encoding.AddCustomJsonEnumMapping(
StandardQueryParameters.FXgafvValueValuesEnum, '_2', '2')

View File

@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. All Rights Reserved.
#
# 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
#
# 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,
# 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.
"""Shim for backwards-compatibility for moving GCE credentials.
oauth2client loads credentials classes based on the module name where
they were created; this means that moving GceAssertionCredentials from
here to third_party requires a shim mapping the old name to the new
one. Once loaded, the credential will be re-serialized with the new
path, meaning that we can (at some point) consider removing this file.
"""
# TODO: Remove this module once this change has been around long
# enough that old credentials are likely to be rare.
from apitools.base.py import GceAssertionCredentials