Skip to content

Commit a8df46b

Browse files
author
travis-ci
committed
Update docs after merge to master.
1 parent 7dc93ab commit a8df46b

5 files changed

Lines changed: 56 additions & 24 deletions

File tree

_modules/gcloud/connection.html

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,34 @@ <h1>Source code for gcloud.connection</h1><div class="highlight"><pre>
9898

9999
<span class="sd"> Subclasses should understand only the basic types in method arguments,</span>
100100
<span class="sd"> however they should be capable of returning advanced types.</span>
101+
102+
<span class="sd"> If no value is passed in for ``http``, a :class:`httplib2.Http` object</span>
103+
<span class="sd"> will be created and authorized with the ``credentials``. If not, the</span>
104+
<span class="sd"> ``credentials`` and ``http`` need not be related.</span>
105+
106+
<span class="sd"> Subclasses may seek to use the private key from ``credentials`` to sign</span>
107+
<span class="sd"> data.</span>
108+
109+
<span class="sd"> A custom (non-``httplib2``) HTTP object must have a ``request`` method</span>
110+
<span class="sd"> which accepts the following arguments:</span>
111+
112+
<span class="sd"> * ``uri``</span>
113+
<span class="sd"> * ``method``</span>
114+
<span class="sd"> * ``body``</span>
115+
<span class="sd"> * ``headers``</span>
116+
117+
<span class="sd"> In addition, ``redirections`` and ``connection_type`` may be used.</span>
118+
119+
<span class="sd"> Without the use of ``credentials.authorize(http)``, a custom ``http``</span>
120+
<span class="sd"> object will also need to be able to add a bearer token to API</span>
121+
<span class="sd"> requests and handle token refresh on 401 errors.</span>
122+
123+
<span class="sd"> :type credentials: :class:`oauth2client.client.OAuth2Credentials` or</span>
124+
<span class="sd"> :class:`NoneType`</span>
125+
<span class="sd"> :param credentials: The OAuth2 Credentials to use for this connection.</span>
126+
127+
<span class="sd"> :type http: :class:`httplib2.Http` or class that defines ``request()``.</span>
128+
<span class="sd"> :param http: An optional HTTP object to make requests.</span>
101129
<span class="sd"> &quot;&quot;&quot;</span>
102130

103131
<span class="n">API_BASE_URL</span> <span class="o">=</span> <span class="s">&#39;https://www.googleapis.com&#39;</span>
@@ -109,14 +137,8 @@ <h1>Source code for gcloud.connection</h1><div class="highlight"><pre>
109137
<span class="n">USER_AGENT</span> <span class="o">=</span> <span class="s">&quot;gcloud-python/{0}&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">get_distribution</span><span class="p">(</span><span class="s">&#39;gcloud&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">version</span><span class="p">)</span>
110138
<span class="sd">&quot;&quot;&quot;The user agent for gcloud-python requests.&quot;&quot;&quot;</span>
111139

112-
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">credentials</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
113-
<span class="sd">&quot;&quot;&quot;Constructor for Connection.</span>
114-
115-
<span class="sd"> :type credentials: :class:`oauth2client.client.OAuth2Credentials` or</span>
116-
<span class="sd"> :class:`NoneType`</span>
117-
<span class="sd"> :param credentials: The OAuth2 Credentials to use for this connection.</span>
118-
<span class="sd"> &quot;&quot;&quot;</span>
119-
<span class="bp">self</span><span class="o">.</span><span class="n">_http</span> <span class="o">=</span> <span class="bp">None</span>
140+
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">credentials</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">http</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
141+
<span class="bp">self</span><span class="o">.</span><span class="n">_http</span> <span class="o">=</span> <span class="n">http</span>
120142
<span class="bp">self</span><span class="o">.</span><span class="n">_credentials</span> <span class="o">=</span> <span class="n">credentials</span>
121143

122144
<span class="nd">@property</span>

datastore-api.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ <h3>Try it yourself<a class="headerlink" href="#try-it-yourself" title="Permalin
271271
<p>Connections to gcloud datastore API servers.</p>
272272
<dl class="class">
273273
<dt id="gcloud.datastore.connection.Connection">
274-
<em class="property">class </em><tt class="descclassname">gcloud.datastore.connection.</tt><tt class="descname">Connection</tt><big>(</big><em>credentials=None</em><big>)</big><a class="reference internal" href="_modules/gcloud/datastore/connection.html#Connection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gcloud.datastore.connection.Connection" title="Permalink to this definition">#</a></dt>
274+
<em class="property">class </em><tt class="descclassname">gcloud.datastore.connection.</tt><tt class="descname">Connection</tt><big>(</big><em>credentials=None</em>, <em>http=None</em><big>)</big><a class="reference internal" href="_modules/gcloud/datastore/connection.html#Connection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gcloud.datastore.connection.Connection" title="Permalink to this definition">#</a></dt>
275275
<dd><p>Bases: <a class="reference internal" href="gcloud-api.html#gcloud.connection.Connection" title="gcloud.connection.Connection"><tt class="xref py py-class docutils literal"><span class="pre">gcloud.connection.Connection</span></tt></a></p>
276276
<p>A connection to the Google Cloud Datastore via the Protobuf API.</p>
277277
<p>This class should understand only the basic types (and protobufs)
@@ -284,16 +284,6 @@ <h3>Try it yourself<a class="headerlink" href="#try-it-yourself" title="Permalin
284284
</tr>
285285
</tbody>
286286
</table>
287-
<p>Constructor for Connection.</p>
288-
<table class="docutils field-list" frame="void" rules="none">
289-
<col class="field-name" />
290-
<col class="field-body" />
291-
<tbody valign="top">
292-
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>credentials</strong> (<tt class="xref py py-class docutils literal"><span class="pre">oauth2client.client.OAuth2Credentials</span></tt> or
293-
<tt class="xref py py-class docutils literal"><span class="pre">NoneType</span></tt>) &#8211; The OAuth2 Credentials to use for this connection.</td>
294-
</tr>
295-
</tbody>
296-
</table>
297287
<dl class="attribute">
298288
<dt id="gcloud.datastore.connection.Connection.API_URL_TEMPLATE">
299289
<tt class="descname">API_URL_TEMPLATE</tt><em class="property"> = '{api_base}/datastore/{api_version}/datasets/{dataset_id}/{method}'</em><a class="headerlink" href="#gcloud.datastore.connection.Connection.API_URL_TEMPLATE" title="Permalink to this definition">#</a></dt>

gcloud-api.html

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,38 @@ <h1>GCloud Package<a class="headerlink" href="#gcloud-package" title="Permalink
8585
<p>Shared implementation of connections to API servers.</p>
8686
<dl class="class">
8787
<dt id="gcloud.connection.Connection">
88-
<em class="property">class </em><tt class="descclassname">gcloud.connection.</tt><tt class="descname">Connection</tt><big>(</big><em>credentials=None</em><big>)</big><a class="reference internal" href="_modules/gcloud/connection.html#Connection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gcloud.connection.Connection" title="Permalink to this definition">#</a></dt>
88+
<em class="property">class </em><tt class="descclassname">gcloud.connection.</tt><tt class="descname">Connection</tt><big>(</big><em>credentials=None</em>, <em>http=None</em><big>)</big><a class="reference internal" href="_modules/gcloud/connection.html#Connection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gcloud.connection.Connection" title="Permalink to this definition">#</a></dt>
8989
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
9090
<p>A generic connection to Google Cloud Platform.</p>
9191
<p>Subclasses should understand only the basic types in method arguments,
9292
however they should be capable of returning advanced types.</p>
93-
<p>Constructor for Connection.</p>
93+
<p>If no value is passed in for <tt class="docutils literal"><span class="pre">http</span></tt>, a <tt class="xref py py-class docutils literal"><span class="pre">httplib2.Http</span></tt> object
94+
will be created and authorized with the <tt class="docutils literal"><span class="pre">credentials</span></tt>. If not, the
95+
<tt class="docutils literal"><span class="pre">credentials</span></tt> and <tt class="docutils literal"><span class="pre">http</span></tt> need not be related.</p>
96+
<p>Subclasses may seek to use the private key from <tt class="docutils literal"><span class="pre">credentials</span></tt> to sign
97+
data.</p>
98+
<p>A custom (non-<tt class="docutils literal"><span class="pre">httplib2</span></tt>) HTTP object must have a <tt class="docutils literal"><span class="pre">request</span></tt> method
99+
which accepts the following arguments:</p>
100+
<ul class="simple">
101+
<li><tt class="docutils literal"><span class="pre">uri</span></tt></li>
102+
<li><tt class="docutils literal"><span class="pre">method</span></tt></li>
103+
<li><tt class="docutils literal"><span class="pre">body</span></tt></li>
104+
<li><tt class="docutils literal"><span class="pre">headers</span></tt></li>
105+
</ul>
106+
<p>In addition, <tt class="docutils literal"><span class="pre">redirections</span></tt> and <tt class="docutils literal"><span class="pre">connection_type</span></tt> may be used.</p>
107+
<p>Without the use of <tt class="docutils literal"><span class="pre">credentials.authorize(http)</span></tt>, a custom <tt class="docutils literal"><span class="pre">http</span></tt>
108+
object will also need to be able to add a bearer token to API
109+
requests and handle token refresh on 401 errors.</p>
94110
<table class="docutils field-list" frame="void" rules="none">
95111
<col class="field-name" />
96112
<col class="field-body" />
97113
<tbody valign="top">
98-
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>credentials</strong> (<tt class="xref py py-class docutils literal"><span class="pre">oauth2client.client.OAuth2Credentials</span></tt> or
99-
<tt class="xref py py-class docutils literal"><span class="pre">NoneType</span></tt>) &#8211; The OAuth2 Credentials to use for this connection.</td>
114+
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
115+
<li><strong>credentials</strong> (<tt class="xref py py-class docutils literal"><span class="pre">oauth2client.client.OAuth2Credentials</span></tt> or
116+
<tt class="xref py py-class docutils literal"><span class="pre">NoneType</span></tt>) &#8211; The OAuth2 Credentials to use for this connection.</li>
117+
<li><strong>http</strong> (<tt class="xref py py-class docutils literal"><span class="pre">httplib2.Http</span></tt> or class that defines <tt class="docutils literal"><span class="pre">request()</span></tt>.) &#8211; An optional HTTP object to make requests.</li>
118+
</ul>
119+
</td>
100120
</tr>
101121
</tbody>
102122
</table>

objects.inv

-24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)