<spanid="enumeration-description"></span><h1>Interface definition language to python mapping for enumerated types<aclass="headerlink"href="#interface-definition-language-to-python-mapping-for-enumerated-types"title="Permalink to this headline">¶</a></h1>
<p>The interface language definition type system includes enumerated types. Python
SDK supports both 2.x and 3.x versions of Python. Since Python 2.x does
not have first class support for enumerations, special classes are
generated to represent enumerated types from the interface definition
language. The special class contains class attributes which represent
the values of the enumerated type.</p>
<p>This documentation explains the following:</p>
<ulclass="simple">
<li><p>How the class variables are defined in the module. This specifies the names that you can use in your program.</p></li>
<li><p>How you instantiate a class to use it for communication with future versions of the service.</p></li>
<h2>Example of an enumerated type documentation<aclass="headerlink"href="#example-of-an-enumerated-type-documentation"title="Permalink to this headline">¶</a></h2>
<p>This class represents an enumerated type in the interface language definition type system. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports a newer version of the API, you instantiate this class. See <aclass="reference internal"href="#enumeration-description"><spanclass="std std-ref">enumerated type description page</span></a>.</p>
</div>
<p><strong>Parameters</strong> : <strong>string</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">str</span></code>) – String value for the SourceType instance.</p>
<dlclass="simple">
<dt><strong>FILE</strong> = <em>SourceType(string=’FILE’)</em></dt><dd><p>If the source is backed by a file.</p>
</dd>
<dt><strong>REMOTE</strong> = <em>SourceType(string=’REMOTE’)</em></dt><dd><p>If the source is backed by a remote service.</p>
</dd>
</dl>
</dd>
</dl>
</div>
<divclass="section"id="code-examples">
<h2>Code Examples<aclass="headerlink"href="#code-examples"title="Permalink to this headline">¶</a></h2>
<p>The enumerated type classes are defined in python modules that your code
imports. You can use these in your code.</p>
<olclass="arabic simple">
<li><p>If you want to pass an enumerated type value in a method to a server, specify the class variable of the enumerated type class.</p></li>
</ol>
<divclass="highlight-python notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># SourceType is an enumerated type</span>
<li><p>Sending a new enumerated type value to a server that has a newer version of the enumerated type.</p></li>
</ol>
<p>To use new values of the enumerated type in communication with a server that supports a newer version of the API, you instantiate the
enumerated type class.</p>
<divclass="highlight-python notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># If a newer version of SourceType has a new value FOLDER, FOLDER would be one</span>
<spanclass="c1"># of the class attributes for SourceType. In the older version, SourceType has</span>
<spanclass="c1"># only two class attributes, FILE and REMOTE</span>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.