You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: datastore-api.html
+1-11Lines changed: 1 addition & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -271,7 +271,7 @@ <h3>Try it yourself<a class="headerlink" href="#try-it-yourself" title="Permalin
271
271
<p>Connections to gcloud datastore API servers.</p>
272
272
<dlclass="class">
273
273
<dtid="gcloud.datastore.connection.Connection">
274
-
<emclass="property">class </em><ttclass="descclassname">gcloud.datastore.connection.</tt><ttclass="descname">Connection</tt><big>(</big><em>credentials=None</em><big>)</big><aclass="reference internal" href="_modules/gcloud/datastore/connection.html#Connection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#gcloud.datastore.connection.Connection" title="Permalink to this definition">#</a></dt>
274
+
<emclass="property">class </em><ttclass="descclassname">gcloud.datastore.connection.</tt><ttclass="descname">Connection</tt><big>(</big><em>credentials=None</em>, <em>http=None</em><big>)</big><aclass="reference internal" href="_modules/gcloud/datastore/connection.html#Connection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#gcloud.datastore.connection.Connection" title="Permalink to this definition">#</a></dt>
<ttclass="descname">API_URL_TEMPLATE</tt><emclass="property"> = '{api_base}/datastore/{api_version}/datasets/{dataset_id}/{method}'</em><aclass="headerlink" href="#gcloud.datastore.connection.Connection.API_URL_TEMPLATE" title="Permalink to this definition">#</a></dt>
<p>Shared implementation of connections to API servers.</p>
86
86
<dlclass="class">
87
87
<dtid="gcloud.connection.Connection">
88
-
<emclass="property">class </em><ttclass="descclassname">gcloud.connection.</tt><ttclass="descname">Connection</tt><big>(</big><em>credentials=None</em><big>)</big><aclass="reference internal" href="_modules/gcloud/connection.html#Connection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#gcloud.connection.Connection" title="Permalink to this definition">#</a></dt>
88
+
<emclass="property">class </em><ttclass="descclassname">gcloud.connection.</tt><ttclass="descname">Connection</tt><big>(</big><em>credentials=None</em>, <em>http=None</em><big>)</big><aclass="reference internal" href="_modules/gcloud/connection.html#Connection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#gcloud.connection.Connection" title="Permalink to this definition">#</a></dt>
<p>A generic connection to Google Cloud Platform.</p>
91
91
<p>Subclasses should understand only the basic types in method arguments,
92
92
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 <ttclass="docutils literal"><spanclass="pre">http</span></tt>, a <ttclass="xref py py-class docutils literal"><spanclass="pre">httplib2.Http</span></tt> object
94
+
will be created and authorized with the <ttclass="docutils literal"><spanclass="pre">credentials</span></tt>. If not, the
95
+
<ttclass="docutils literal"><spanclass="pre">credentials</span></tt> and <ttclass="docutils literal"><spanclass="pre">http</span></tt> need not be related.</p>
96
+
<p>Subclasses may seek to use the private key from <ttclass="docutils literal"><spanclass="pre">credentials</span></tt> to sign
97
+
data.</p>
98
+
<p>A custom (non-<ttclass="docutils literal"><spanclass="pre">httplib2</span></tt>) HTTP object must have a <ttclass="docutils literal"><spanclass="pre">request</span></tt> method
<p>In addition, <ttclass="docutils literal"><spanclass="pre">redirections</span></tt> and <ttclass="docutils literal"><spanclass="pre">connection_type</span></tt> may be used.</p>
107
+
<p>Without the use of <ttclass="docutils literal"><spanclass="pre">credentials.authorize(http)</span></tt>, a custom <ttclass="docutils literal"><spanclass="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>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>credentials</strong> (<ttclass="xref py py-class docutils literal"><spanclass="pre">oauth2client.client.OAuth2Credentials</span></tt> or
99
-
<ttclass="xref py py-class docutils literal"><spanclass="pre">NoneType</span></tt>) – The OAuth2 Credentials to use for this connection.</td>
114
+
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><ulclass="first last simple">
115
+
<li><strong>credentials</strong> (<ttclass="xref py py-class docutils literal"><spanclass="pre">oauth2client.client.OAuth2Credentials</span></tt> or
116
+
<ttclass="xref py py-class docutils literal"><spanclass="pre">NoneType</span></tt>) – The OAuth2 Credentials to use for this connection.</li>
117
+
<li><strong>http</strong> (<ttclass="xref py py-class docutils literal"><spanclass="pre">httplib2.Http</span></tt> or class that defines <ttclass="docutils literal"><spanclass="pre">request()</span></tt>.) – An optional HTTP object to make requests.</li>
0 commit comments