|
| 1 | +# Copyright 2015 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 | +"""gcloud storage client for interacting with API.""" |
| 16 | + |
| 17 | + |
| 18 | +from gcloud.client import JSONClient |
| 19 | +from gcloud.storage.connection import Connection |
| 20 | + |
| 21 | + |
| 22 | +class Client(JSONClient): |
| 23 | + """Client to bundle configuration needed for API requests. |
| 24 | +
|
| 25 | + :type project: string |
| 26 | + :param project: the project which the client acts on behalf of. Will be |
| 27 | + passed when creating a topic. If not passed, |
| 28 | + falls back to the default inferred from the environment. |
| 29 | +
|
| 30 | + :type credentials: :class:`oauth2client.client.OAuth2Credentials` or |
| 31 | + :class:`NoneType` |
| 32 | + :param credentials: The OAuth2 Credentials to use for the connection |
| 33 | + owned by this client. If not passed (and if no ``http`` |
| 34 | + object is passed), falls back to the default inferred |
| 35 | + from the environment. |
| 36 | +
|
| 37 | + :type http: :class:`httplib2.Http` or class that defines ``request()``. |
| 38 | + :param http: An optional HTTP object to make requests. If not passed, an |
| 39 | + ``http`` object is created that is bound to the |
| 40 | + ``credentials`` for the current object. |
| 41 | + """ |
| 42 | + |
| 43 | + _connection_class = Connection |
0 commit comments