Files
google-apis-rs/google_appengine1_beta5/index.html
2021-04-02 00:20:57 +08:00

169 lines
24 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `google_appengine1_beta5` crate."><meta name="keywords" content="rust, rustlang, rust-lang, google_appengine1_beta5"><title>google_appengine1_beta5 - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../google_appengine1_beta5/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate google_appengine1_beta5</p><div class="block version"><p>Version 2.0.0+20181005</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all google_appengine1_beta5's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li></ul></div><p class="location"></p><div id="sidebar-vars" data-name="google_appengine1_beta5" data-ty="mod" data-relpath="../"></div></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">google_appengine1_beta5</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/google_appengine1_beta5/lib.rs.html#5-222" title="goto source code">[src]</a></span></h1><div class="docblock"><p>This documentation was generated from <em>appengine</em> crate version <em>2.0.0+20181005</em>, where <em>20181005</em> is the exact revision of the <em>appengine:v1beta5</em> schema built by the <a href="http://www.makotemplates.org/">mako</a> code generator <em>v2.0.0</em>.</p>
<p>Everything else about the <em>appengine</em> <em>v1_beta5</em> API can be found at the
<a href="https://cloud.google.com/appengine/docs/admin-api/">official documentation site</a>.
The original source code is <a href="https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta5">on github</a>.</p>
<h1 id="features" class="section-header"><a href="#features">Features</a></h1>
<p>Handle the following <em>Resources</em> with ease from the central <a href="../google_appengine1_beta5/api/struct.Appengine.html">hub</a> ... </p>
<ul>
<li>apps</li>
<li><a href="../google_appengine1_beta5/api/struct.AppCreateCall.html"><em>create</em></a>, <a href="../google_appengine1_beta5/api/struct.AppGetCall.html"><em>get</em></a>, <a href="../google_appengine1_beta5/api/struct.AppLocationGetCall.html"><em>locations get</em></a>, <a href="../google_appengine1_beta5/api/struct.AppLocationListCall.html"><em>locations list</em></a>, <a href="../google_appengine1_beta5/api/struct.AppOperationGetCall.html"><em>operations get</em></a>, <a href="../google_appengine1_beta5/api/struct.AppOperationListCall.html"><em>operations list</em></a>, <a href="../google_appengine1_beta5/api/struct.AppPatchCall.html"><em>patch</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceDeleteCall.html"><em>services delete</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceGetCall.html"><em>services get</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceListCall.html"><em>services list</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServicePatchCall.html"><em>services patch</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionCreateCall.html"><em>services versions create</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionDeleteCall.html"><em>services versions delete</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionGetCall.html"><em>services versions get</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionInstanceDebugCall.html"><em>services versions instances debug</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionInstanceDeleteCall.html"><em>services versions instances delete</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionInstanceGetCall.html"><em>services versions instances get</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionInstanceListCall.html"><em>services versions instances list</em></a>, <a href="../google_appengine1_beta5/api/struct.AppServiceVersionListCall.html"><em>services versions list</em></a> and <a href="../google_appengine1_beta5/api/struct.AppServiceVersionPatchCall.html"><em>services versions patch</em></a></li>
</ul>
<p>Not what you are looking for ? Find all other Google APIs in their Rust <a href="http://byron.github.io/google-apis-rs">documentation index</a>.</p>
<h1 id="structure-of-this-library" class="section-header"><a href="#structure-of-this-library">Structure of this Library</a></h1>
<p>The API is structured into the following primary items:</p>
<ul>
<li><strong><a href="../google_appengine1_beta5/api/struct.Appengine.html">Hub</a></strong>
<ul>
<li>a central object to maintain state and allow accessing all <em>Activities</em></li>
<li>creates <a href="../google_appengine1_beta5/client/trait.MethodsBuilder.html"><em>Method Builders</em></a> which in turn
allow access to individual <a href="../google_appengine1_beta5/client/trait.CallBuilder.html"><em>Call Builders</em></a></li>
</ul>
</li>
<li><strong><a href="../google_appengine1_beta5/client/trait.Resource.html">Resources</a></strong>
<ul>
<li>primary types that you can apply <em>Activities</em> to</li>
<li>a collection of properties and <em>Parts</em></li>
<li><strong><a href="../google_appengine1_beta5/client/trait.Part.html">Parts</a></strong>
<ul>
<li>a collection of properties</li>
<li>never directly used in <em>Activities</em></li>
</ul>
</li>
</ul>
</li>
<li><strong><a href="../google_appengine1_beta5/client/trait.CallBuilder.html">Activities</a></strong>
<ul>
<li>operations to apply to <em>Resources</em></li>
</ul>
</li>
</ul>
<p>All <em>structures</em> are marked with applicable traits to further categorize them and ease browsing.</p>
<p>Generally speaking, you can invoke <em>Activities</em> like this:</p>
<pre><code class="language-Rust,ignore">let r = hub.resource().activity(...).doit().await
</code></pre>
<p>Or specifically ...</p>
<div class='information'><div class='tooltip ignore'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered ignore">
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">operations_get</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_versions_instances_debug</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_versions_instances_delete</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_versions_create</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_versions_delete</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_versions_patch</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_delete</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_patch</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">create</span>(...).<span class="ident">doit</span>().<span class="kw">await</span>
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">patch</span>(...).<span class="ident">doit</span>().<span class="kw">await</span></pre></div>
<p>The <code>resource()</code> and <code>activity(...)</code> calls create <a href="http://en.wikipedia.org/wiki/Builder_pattern">builders</a>. The second one dealing with <code>Activities</code>
supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
specified right away (i.e. <code>(...)</code>), whereas all optional ones can be <a href="http://en.wikipedia.org/wiki/Builder_pattern">build up</a> as desired.
The <code>doit()</code> method performs the actual communication with the server and returns the respective result.</p>
<h1 id="usage" class="section-header"><a href="#usage">Usage</a></h1><h2 id="setting-up-your-project" class="section-header"><a href="#setting-up-your-project">Setting up your Project</a></h2>
<p>To use this library, you would put the following lines into your <code>Cargo.toml</code> file:</p>
<pre><code class="language-toml">[dependencies]
google-appengine1_beta5 = &quot;*&quot;
# This project intentionally uses an old version of Hyper. See
# https://github.com/Byron/google-apis-rs/issues/173 for more
# information.
hyper = &quot;^0.14&quot;
hyper-rustls = &quot;^0.22&quot;
serde = &quot;^1.0&quot;
serde_json = &quot;^1.0&quot;
yup-oauth2 = &quot;^5.0&quot;
</code></pre>
<h2 id="a-complete-example" class="section-header"><a href="#a-complete-example">A complete example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">hyper</span>;
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">hyper_rustls</span>;
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">yup_oauth2</span> <span class="kw">as</span> <span class="ident">oauth2</span>;
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">google_appengine1_beta5</span> <span class="kw">as</span> <span class="ident">appengine1_beta5</span>;
<span class="kw">use</span> <span class="ident">appengine1_beta5</span>::<span class="ident">api</span>::<span class="ident">DebugInstanceRequest</span>;
<span class="kw">use</span> <span class="ident">appengine1_beta5</span>::{<span class="prelude-ty">Result</span>, <span class="ident">Error</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">default</span>::<span class="ident">Default</span>;
<span class="kw">use</span> <span class="ident">oauth2</span>;
<span class="kw">use</span> <span class="ident">appengine1_beta5</span>::<span class="ident">Appengine</span>;
<span class="comment">// Get an ApplicationSecret instance by some means. It contains the `client_id` and </span>
<span class="comment">// `client_secret`, among other things.</span>
<span class="kw">let</span> <span class="ident">secret</span>: <span class="ident">oauth2</span>::<span class="ident">ApplicationSecret</span> <span class="op">=</span> <span class="ident">Default</span>::<span class="ident">default</span>();
<span class="comment">// Instantiate the authenticator. It will choose a suitable authentication flow for you, </span>
<span class="comment">// unless you replace `None` with the desired Flow.</span>
<span class="comment">// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about </span>
<span class="comment">// what&#39;s going on. You probably want to bring in your own `TokenStorage` to persist tokens and</span>
<span class="comment">// retrieve them from storage.</span>
<span class="kw">let</span> <span class="ident">auth</span> <span class="op">=</span> <span class="ident">yup_oauth2</span>::<span class="ident">InstalledFlowAuthenticator</span>::<span class="ident">builder</span>(
<span class="ident">secret</span>,
<span class="ident">yup_oauth2</span>::<span class="ident">InstalledFlowReturnMethod</span>::<span class="ident">HTTPRedirect</span>,
).<span class="ident">build</span>().<span class="kw">await</span>.<span class="ident">unwrap</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hub</span> <span class="op">=</span> <span class="ident">Appengine</span>::<span class="ident">new</span>(<span class="ident">hyper</span>::<span class="ident">Client</span>::<span class="ident">builder</span>().<span class="ident">build</span>(<span class="ident">hyper_rustls</span>::<span class="ident">HttpsConnector</span>::<span class="ident">with_native_roots</span>()), <span class="ident">auth</span>);
<span class="comment">// As the method needs a request, you would usually fill it with the desired information</span>
<span class="comment">// into the respective structure. Some of the parts shown here might not be applicable !</span>
<span class="comment">// Values shown here are possibly random and not representative !</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">req</span> <span class="op">=</span> <span class="ident">DebugInstanceRequest</span>::<span class="ident">default</span>();
<span class="comment">// You can configure optional parameters by calling the respective setters at will, and</span>
<span class="comment">// execute the final call using `doit()`.</span>
<span class="comment">// Values shown here are possibly random and not representative !</span>
<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">hub</span>.<span class="ident">apps</span>().<span class="ident">services_versions_instances_debug</span>(<span class="ident">req</span>, <span class="string">&quot;appsId&quot;</span>, <span class="string">&quot;servicesId&quot;</span>, <span class="string">&quot;versionsId&quot;</span>, <span class="string">&quot;instancesId&quot;</span>)
.<span class="ident">doit</span>().<span class="kw">await</span>;
<span class="kw">match</span> <span class="ident">result</span> {
<span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="kw">match</span> <span class="ident">e</span> {
<span class="comment">// The Error enum provides details about what exactly happened.</span>
<span class="comment">// You can also just use its `Debug`, `Display` or `Error` traits</span>
<span class="ident">Error</span>::<span class="ident">HttpError</span>(<span class="kw">_</span>)
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">Io</span>(<span class="kw">_</span>)
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">MissingAPIKey</span>
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">MissingToken</span>(<span class="kw">_</span>)
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">Cancelled</span>
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">UploadSizeLimitExceeded</span>(<span class="kw">_</span>, <span class="kw">_</span>)
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">Failure</span>(<span class="kw">_</span>)
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">BadRequest</span>(<span class="kw">_</span>)
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">FieldClash</span>(<span class="kw">_</span>)
<span class="op">|</span><span class="ident">Error</span>::<span class="ident">JsonDecodeError</span>(<span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">e</span>),
},
<span class="prelude-val">Ok</span>(<span class="ident">res</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Success: {:?}&quot;</span>, <span class="ident">res</span>),
}</pre></div>
<h2 id="handling-errors" class="section-header"><a href="#handling-errors">Handling Errors</a></h2>
<p>All errors produced by the system are provided either as <a href="../google_appengine1_beta5/client/type.Result.html">Result</a> enumeration as return value of
the doit() methods, or handed as possibly intermediate results to either the
<a href="../google_appengine1_beta5/client/trait.Delegate.html">Hub Delegate</a>, or the <a href="https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html">Authenticator Delegate</a>.</p>
<p>When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
makes the system potentially resilient to all kinds of errors.</p>
<h2 id="uploads-and-downloads" class="section-header"><a href="#uploads-and-downloads">Uploads and Downloads</a></h2>
<p>If a method supports downloads, the response body, which is part of the <a href="../google_appengine1_beta5/client/type.Result.html">Result</a>, should be
read by you to obtain the media.
If such a method also supports a <a href="../google_appengine1_beta5/client/trait.ResponseResult.html">Response Result</a>, it will return that by default.
You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
this call: <code>.param(&quot;alt&quot;, &quot;media&quot;)</code>.</p>
<p>Methods supporting uploads can do so using up to 2 different protocols:
<em>simple</em> and <em>resumable</em>. The distinctiveness of each is represented by customized
<code>doit(...)</code> methods, which are then named <code>upload(...)</code> and <code>upload_resumable(...)</code> respectively.</p>
<h2 id="customization-and-callbacks" class="section-header"><a href="#customization-and-callbacks">Customization and Callbacks</a></h2>
<p>You may alter the way an <code>doit()</code> method is called by providing a <a href="../google_appengine1_beta5/client/trait.Delegate.html">delegate</a> to the
<a href="../google_appengine1_beta5/client/trait.CallBuilder.html">Method Builder</a> before making the final <code>doit()</code> call.
Respective methods will be called to provide progress information, as well as determine whether the system should
retry on failure.</p>
<p>The <a href="../google_appengine1_beta5/client/trait.Delegate.html">delegate trait</a> is default-implemented, allowing you to customize it with minimal effort.</p>
<h2 id="optional-parts-in-server-requests" class="section-header"><a href="#optional-parts-in-server-requests">Optional Parts in Server-Requests</a></h2>
<p>All structures provided by this library are made to be <a href="../google_appengine1_beta5/client/trait.RequestValue.html">encodable</a> and
<a href="../google_appengine1_beta5/client/trait.ResponseResult.html">decodable</a> via <em>json</em>. Optionals are used to indicate that partial requests are responses
are valid.
Most optionals are are considered <a href="../google_appengine1_beta5/client/trait.Part.html">Parts</a> which are identifiable by name, which will be sent to
the server to indicate either the set parts of the request or the desired parts in the response.</p>
<h2 id="builder-arguments" class="section-header"><a href="#builder-arguments">Builder Arguments</a></h2>
<p>Using <a href="../google_appengine1_beta5/client/trait.CallBuilder.html">method builders</a>, you are able to prepare an action call by repeatedly calling it's methods.
These will always take a single argument, for which the following statements are true.</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Plain_old_data_structure">PODs</a> are handed by copy</li>
<li>strings are passed as <code>&amp;str</code></li>
<li><a href="../google_appengine1_beta5/client/trait.RequestValue.html">request values</a> are moved</li>
</ul>
<p>Arguments will always be copied or cloned into the builder, to make them independent of their original life times.</p>
</div><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use api::<a class="struct" href="../google_appengine1_beta5/api/struct.Appengine.html" title="struct google_appengine1_beta5::api::Appengine">Appengine</a>;</code></td></tr><tr><td><code>pub use client::<a class="type" href="../google_appengine1_beta5/client/type.Result.html" title="type google_appengine1_beta5::client::Result">Result</a>;</code></td></tr><tr><td><code>pub use client::<a class="enum" href="../google_appengine1_beta5/client/enum.Error.html" title="enum google_appengine1_beta5::client::Error">Error</a>;</code></td></tr><tr><td><code>pub use client::<a class="trait" href="../google_appengine1_beta5/client/trait.Delegate.html" title="trait google_appengine1_beta5::client::Delegate">Delegate</a>;</code></td></tr></table><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="api/index.html" title="google_appengine1_beta5::api mod">api</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="client/index.html" title="google_appengine1_beta5::client mod">client</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="google_appengine1_beta5"></div>
<script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>