OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 Google Inc. All Rights Reserved. |
| 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at |
| 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 # See the License for the specific language governing permissions and |
| 13 # limitations under the License. |
| 14 |
| 15 """Generated client library for servicecontrol version v1.""" |
| 16 |
| 17 # NOTE: This file is originally auto-generated using google-apitools then |
| 18 # style-correcting hand edits were applied. New behaviour should not provided |
| 19 # by hand, please re-generate and restyle. |
| 20 from __future__ import absolute_import |
| 21 |
| 22 from apitools.base.py import base_api |
| 23 from . import servicecontrol_v1_messages as messages |
| 24 |
| 25 |
| 26 class ServicecontrolV1(base_api.BaseApiClient): |
| 27 """Generated client library for service servicecontrol version v1.""" |
| 28 |
| 29 MESSAGES_MODULE = messages |
| 30 |
| 31 _PACKAGE = u'servicecontrol' |
| 32 _SCOPES = [u'https://www.googleapis.com/auth/cloud-platform', |
| 33 u'https://www.googleapis.com/auth/servicecontrol'] |
| 34 _VERSION = u'v1' |
| 35 _CLIENT_CLASS_NAME = u'ServicecontrolV1' |
| 36 _URL_VERSION = u'v1' |
| 37 _API_KEY = None |
| 38 |
| 39 # pylint: disable=too-many-arguments |
| 40 def __init__(self, url='', credentials=None, |
| 41 get_credentials=True, http=None, model=None, |
| 42 log_request=False, log_response=False, |
| 43 credentials_args=None, default_global_params=None, |
| 44 additional_http_headers=None): |
| 45 """Create a new servicecontrol handle.""" |
| 46 url = url or u'https://servicecontrol.googleapis.com/' |
| 47 super(ServicecontrolV1, self).__init__( |
| 48 url, credentials=credentials, |
| 49 get_credentials=get_credentials, http=http, model=model, |
| 50 log_request=log_request, log_response=log_response, |
| 51 credentials_args=credentials_args, |
| 52 default_global_params=default_global_params, |
| 53 additional_http_headers=additional_http_headers) |
| 54 self.services = self.ServicesService(self) |
| 55 |
| 56 class ServicesService(base_api.BaseApiService): |
| 57 """Service class for the services resource.""" |
| 58 |
| 59 _NAME = u'services' |
| 60 |
| 61 def __init__(self, client): |
| 62 super(ServicecontrolV1.ServicesService, self).__init__(client) |
| 63 self._method_configs = { |
| 64 'check': base_api.ApiMethodInfo( |
| 65 http_method=u'POST', |
| 66 method_id=u'servicecontrol.services.check', |
| 67 ordered_params=[u'serviceName'], |
| 68 path_params=[u'serviceName'], |
| 69 query_params=[], |
| 70 relative_path=u'v1/services/{serviceName}:check', |
| 71 request_field=u'checkRequest', |
| 72 request_type_name=u'ServicecontrolServicesCheckRequest', |
| 73 response_type_name=u'CheckResponse', |
| 74 supports_download=False, |
| 75 ), |
| 76 'report': base_api.ApiMethodInfo( |
| 77 http_method=u'POST', |
| 78 method_id=u'servicecontrol.services.report', |
| 79 ordered_params=[u'serviceName'], |
| 80 path_params=[u'serviceName'], |
| 81 query_params=[], |
| 82 relative_path=u'v1/services/{serviceName}:report', |
| 83 request_field=u'reportRequest', |
| 84 request_type_name=u'ServicecontrolServicesReportRequest', |
| 85 response_type_name=u'ReportResponse', |
| 86 supports_download=False, |
| 87 ), |
| 88 } |
| 89 |
| 90 self._upload_configs = { |
| 91 } |
| 92 |
| 93 def check(self, request, global_params=None): |
| 94 """Checks quota, abuse status etc. to decide whether the given |
| 95 operation. should proceed. It should be called by the service |
| 96 before the given operation is executed. |
| 97 This method requires the `servicemanagement.services.check` |
| 98 permission on the specified service. For more information, see |
| 99 [Google Cloud IAM](https://cloud.google.com/iam). |
| 100 Args: |
| 101 request: (ServicecontrolServicesCheckRequest) input message |
| 102 global_params: (StandardQueryParameters, default: None) |
| 103 global arguments |
| 104 Returns: |
| 105 (CheckResponse) The response message. |
| 106 """ |
| 107 config = self.GetMethodConfig('check') |
| 108 return self._RunMethod( |
| 109 config, request, global_params=global_params) |
| 110 |
| 111 def report(self, request, global_params=None): |
| 112 """Reports an operation to the service control features such as |
| 113 billing, logging, monitoring etc. It should be called by the |
| 114 service after the given operation is completed. |
| 115 This method requires the `servicemanagement.services.report` |
| 116 permission on the specified service. For more information, see |
| 117 [Google Cloud IAM](https://cloud.google.com/iam). |
| 118 Args: |
| 119 request: (ServicecontrolServicesReportRequest) input message |
| 120 global_params: (StandardQueryParameters, default: None) global |
| 121 arguments |
| 122 Returns: |
| 123 (ReportResponse) The response message. |
| 124 """ |
| 125 config = self.GetMethodConfig('report') |
| 126 return self._RunMethod( |
| 127 config, request, global_params=global_params) |
OLD | NEW |