Skip to content

Commit

Permalink
[skip ci] Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ci-build committed Dec 12, 2024
1 parent 827b7f8 commit 6c5b642
Show file tree
Hide file tree
Showing 401 changed files with 36 additions and 25 deletions.
2 changes: 1 addition & 1 deletion html/latest/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 11e6d8f96ad65d485dac4425568fe5cc
config: a16c08bb78f283ec65046958535944f4
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified html/latest/.doctrees/actblue.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/action_builder.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/action_kit.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/action_network.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/airmeet.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/airtable.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/alchemer.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/auth0.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/aws.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/azure.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/bill_com.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/bloomerang.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/box.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/braintree.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/build_a_connector.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/capitolcanary.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/catalist.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/census.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/census_geocoder.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/civis.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/contributing.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/controlshift.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/copper.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/crowdtangle.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/databases.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/dbsync.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/donorbox.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/empower.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/environment.pickle
Binary file not shown.
Binary file modified html/latest/.doctrees/facebook_ads.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/formstack.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/freshdesk.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/github.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/google.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/hustle.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/index.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/mailchimp.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/mobilecommons.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/mobilize_america.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/nation_builder.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/newmode.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/ngpvan.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/notifications.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/p2a.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/pdi.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/quickbase.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/redash.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/rockthevote.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/salesforce.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/scytl.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/sftp.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/shopify.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/sisense.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/table.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/targetsmart.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/targetsmart_api.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/targetsmart_automation_workflows.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/training_guides/etl_best_practices.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/training_guides/getting_set_up.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/turbovote.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/twilio.doctree
Binary file not shown.
Binary file not shown.
Binary file modified html/latest/.doctrees/use_cases/contribute_use_cases.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/use_cases/mysql_to_googlesheets.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/use_cases/opt_outs_to_everyaction.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/utilities.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/write_tests.doctree
Binary file not shown.
Binary file modified html/latest/.doctrees/zoom.doctree
Binary file not shown.
36 changes: 22 additions & 14 deletions html/latest/_modules/parsons/action_network/action_network.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h1>Source code for parsons.action_network.action_network</h1><div class="highli
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">warnings</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Union</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Union</span><span class="p">,</span> <span class="n">Literal</span>
<span class="kn">from</span> <span class="nn">parsons</span> <span class="kn">import</span> <span class="n">Table</span>
<span class="kn">from</span> <span class="nn">parsons.utilities</span> <span class="kn">import</span> <span class="n">check_env</span>
<span class="kn">from</span> <span class="nn">parsons.utilities.api_connector</span> <span class="kn">import</span> <span class="n">APIConnector</span>
Expand Down Expand Up @@ -1434,7 +1434,7 @@ <h1>Source code for parsons.action_network.action_network</h1><div class="highli
<span class="n">languages_spoken</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">postal_addresses</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">mobile_number</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">mobile_status</span><span class="o">=</span><span class="s2">&quot;subscribed&quot;</span><span class="p">,</span>
<span class="n">mobile_status</span><span class="p">:</span> <span class="n">Literal</span><span class="p">[</span><span class="s2">&quot;subscribed&quot;</span><span class="p">,</span> <span class="s2">&quot;unsubscribed&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">background_processing</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">):</span>
Expand Down Expand Up @@ -1488,7 +1488,10 @@ <h1>Source code for parsons.action_network.action_network</h1><div class="highli
<span class="sd"> - &quot;subscribed&quot;</span>
<span class="sd"> - &quot;unsubscribed&quot;</span>
<span class="sd"> mobile_status:</span>
<span class="sd"> &#39;subscribed&#39; or &#39;unsubscribed&#39;</span>
<span class="sd"> None, &#39;subscribed&#39; or &#39;unsubscribed&#39;. If included, will update the SMS opt-in</span>
<span class="sd"> status of the phone in ActionNetwork. If not included, won&#39;t update the status.</span>
<span class="sd"> None by default, causes no updates to mobile number status. New numbers are set</span>
<span class="sd"> to &quot;unsubscribed&quot; by default.</span>
<span class="sd"> background_request: bool</span>
<span class="sd"> If set `true`, utilize ActionNetwork&#39;s &quot;background processing&quot;. This will return</span>
<span class="sd"> an immediate success, with an empty JSON body, and send your request to the</span>
Expand Down Expand Up @@ -1518,27 +1521,31 @@ <h1>Source code for parsons.action_network.action_network</h1><div class="highli

<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s2">&quot;[^0-9]&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">mobile_number</span><span class="p">),</span> <span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">mobile_status</span><span class="p">}</span>
<span class="p">]</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="p">[{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s2">&quot;[^0-9]&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">mobile_number</span><span class="p">)}]</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">,</span> <span class="nb">int</span><span class="p">):</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="p">[{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">),</span> <span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">mobile_status</span><span class="p">}]</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="p">[{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">)}]</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="p">(</span><span class="s2">&quot;Action Network allows only 1 phone number per activist&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s2">&quot;[^0-9]&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">cell</span><span class="p">),</span> <span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">mobile_status</span><span class="p">}</span>
<span class="k">for</span> <span class="n">cell</span> <span class="ow">in</span> <span class="n">mobile_number</span>
<span class="p">{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s2">&quot;[^0-9]&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">cell</span><span class="p">)}</span> <span class="k">for</span> <span class="n">cell</span> <span class="ow">in</span> <span class="n">mobile_number</span>
<span class="p">]</span>
<span class="n">mobile_numbers_field</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="s2">&quot;primary&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">int</span><span class="p">):</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">mobile_status</span><span class="p">}</span> <span class="k">for</span> <span class="n">cell</span> <span class="ow">in</span> <span class="n">mobile_number</span>
<span class="p">]</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="p">[{</span><span class="s2">&quot;number&quot;</span><span class="p">:</span> <span class="n">cell</span><span class="p">}</span> <span class="k">for</span> <span class="n">cell</span> <span class="ow">in</span> <span class="n">mobile_number</span><span class="p">]</span>
<span class="n">mobile_numbers_field</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="s2">&quot;primary&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="n">mobile_number</span>

<span class="c1"># Including status in this field changes the opt-in status in</span>
<span class="c1"># ActionNetwork. This is not always desireable, so we should</span>
<span class="c1"># only do so when a status is included.</span>
<span class="k">if</span> <span class="n">mobile_status</span> <span class="ow">and</span> <span class="n">mobile_numbers_field</span><span class="p">:</span>
<span class="k">for</span> <span class="n">field</span> <span class="ow">in</span> <span class="n">mobile_numbers_field</span><span class="p">:</span>
<span class="n">field</span><span class="p">[</span><span class="s2">&quot;status&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">mobile_status</span>

<span class="c1"># If the mobile_number field is passed a list of dictionaries, just use that directly</span>
<span class="k">if</span> <span class="n">mobile_number</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mobile_number</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span>
<span class="n">mobile_numbers_field</span> <span class="o">=</span> <span class="n">mobile_number</span>

<span class="k">if</span> <span class="ow">not</span> <span class="n">email_addresses_field</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">mobile_numbers_field</span><span class="p">:</span>
<span class="k">raise</span> <span class="p">(</span>
Expand Down Expand Up @@ -1568,6 +1575,7 @@ <h1>Source code for parsons.action_network.action_network</h1><div class="highli
<span class="n">url</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">api_url</span><span class="si">}</span><span class="s2">/people&quot;</span>
<span class="k">if</span> <span class="n">background_processing</span><span class="p">:</span>
<span class="n">url</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">url</span><span class="si">}</span><span class="s2">?background_processing=true&quot;</span>

<span class="n">response</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">api</span><span class="o">.</span><span class="n">post_request</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>

<span class="n">identifiers</span> <span class="o">=</span> <span class="n">response</span><span class="p">[</span><span class="s2">&quot;identifiers&quot;</span><span class="p">]</span>
Expand Down
Loading

0 comments on commit 6c5b642

Please sign in to comment.