Skip to content

Commit

Permalink
Add forms
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwinchester committed Jul 27, 2016
1 parent a8426e1 commit b596cd8
Show file tree
Hide file tree
Showing 20 changed files with 742 additions and 231 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Hubspot API wrapper in Elixir

[![Hex.pm](https://img.shields.io/hexpm/v/hubspotex.svg?maxAge=2592000)](https://hex.pm/packages/hubspotex)
[![Hex.pm](https://img.shields.io/hexpm/l/hubspotex.svg?maxAge=2592000)](https://hex.pm/packages/hubspotex)
[![Hex.pm](https://img.shields.io/hexpm/l/hubspotex.svg?maxAge=2592000)](https://hex.pm/packages/hubspotex)
[![Hex.pm](https://img.shields.io/hexpm/dt/hubspotex.svg?maxAge=2592000)](https://hex.pm/packages/hubspotex)
[![Build Status](https://travis-ci.org/ryanwinchester/hubspotex.svg?branch=master)](https://travis-ci.org/ryanwinchester/hubspotex)

Expand All @@ -13,12 +13,13 @@
```elixir

Hubspot.Contacts.all
#=> %Hubspot.Request{body: "", endpoint: "/contacts/v1/lists/all/contacts/all", method: :get, query: []}
#=> %Hubspot.HTTP.Request{endpoint: "/contacts/v1/lists/all/contacts/all",
# method: :get, query: [], body: ""}

Hubspot.Contacts.all |> Hubspot.request
#=> {:ok, response}

Hubspot.Contacts.all(["count": 10, "vidOffset": 100]) |> Hubspot.request
Hubspot.Contacts.all([count: 10, vidOffset: 100]) |> Hubspot.request
#=> {:ok, response}
```

Expand All @@ -30,6 +31,6 @@ If [available in Hex](https://hex.pm/docs/publish), the package can be installed

```elixir
def deps do
[{:hubspotex, "~> 0.0.2"}]
[{:hubspotex, "~> 0.0.3"}]
end
```
4 changes: 2 additions & 2 deletions doc/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.13.0">
<title>404 – hubspotex v0.0.2</title>
<title>404 – hubspotex v0.0.3</title>
<link rel="stylesheet" href="dist/app-9c1e3d5aa2.css" />

<link rel="canonical" href="https://hexdocs.pm/hubspotex/404.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
hubspotex
</h1>
<h2 class="sidebar-projectVersion">
v0.0.2
v0.0.3
</h2>
</div>

Expand Down
64 changes: 32 additions & 32 deletions doc/Hubspot.ContactProperties.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.13.0">
<title>Hubspot.ContactProperties – hubspotex v0.0.2</title>
<title>Hubspot.ContactProperties – hubspotex v0.0.3</title>
<link rel="stylesheet" href="dist/app-9c1e3d5aa2.css" />

<link rel="canonical" href="https://hexdocs.pm/hubspotex/Hubspot.ContactProperties.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
hubspotex
</h1>
<h2 class="sidebar-projectVersion">
v0.0.2
v0.0.3
</h2>
</div>

Expand Down Expand Up @@ -61,7 +61,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">hubspotex v0.0.2</small>
<small class="visible-xs">hubspotex v0.0.3</small>
Hubspot.ContactProperties


Expand Down Expand Up @@ -200,7 +200,7 @@ <h1 class="section-heading">
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">all :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">all :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -212,7 +212,7 @@ <h4 class="specs-title">Specs</h4>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/get_contacts_properties">http://developers.hubspot.com/docs/methods/contacts/v2/get_contacts_properties</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.all
%Hubspot.Request{endpoint: &quot;/contacts/v2/properties&quot;,
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/properties&quot;,
method: :get, query: [], body: &quot;&quot;}</code></pre>

</section>
Expand All @@ -231,7 +231,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">create(list) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">create(list) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -242,9 +242,9 @@ <h4 class="specs-title">Specs</h4>
we want to store an invoice number on a separate field on deals.</p>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property">http://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.create([&quot;name&quot;: &quot;test&quot;, &quot;label&quot;: &quot;New test&quot;, &quot;type&quot;: &quot;string&quot;])
%Hubspot.Request{endpoint: &quot;/contacts/v2/properties&quot;,
method: :post, query: [], body: [&quot;name&quot;: &quot;test&quot;, &quot;label&quot;: &quot;New test&quot;, &quot;type&quot;: &quot;string&quot;]}</code></pre>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.create([name: &quot;test&quot;, label: &quot;New test&quot;, type: &quot;string&quot;])
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/properties&quot;,
method: :post, query: [], body: [name: &quot;test&quot;, label: &quot;New test&quot;, type: &quot;string&quot;]}</code></pre>

</section>
</div>
Expand All @@ -262,7 +262,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">create_group(list) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">create_group(list) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -273,9 +273,9 @@ <h4 class="specs-title">Specs</h4>
easily manage properties in a given portal and make contact records easier to parse for the user.</p>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property_group">http://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property_group</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.create_group([&quot;name&quot;: &quot;some_group&quot;])
%Hubspot.Request{endpoint: &quot;/contacts/v2/groups&quot;,
method: :post, query: [], body: [&quot;name&quot;: &quot;some_group&quot;]}</code></pre>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.create_group([name: &quot;some_group&quot;])
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/groups&quot;,
method: :post, query: [], body: [name: &quot;some_group&quot;]}</code></pre>

</section>
</div>
Expand All @@ -293,7 +293,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">delete(<a href="http://elixir-lang.org/docs/stable/elixir/String.html#t:t/0">String.t</a>) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">delete(<a href="http://elixir-lang.org/docs/stable/elixir/String.html#t:t/0">String.t</a>) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -304,7 +304,7 @@ <h4 class="specs-title">Specs</h4>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/delete_contact_property">http://developers.hubspot.com/docs/methods/contacts/v2/delete_contact_property</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.delete(&quot;some_property&quot;)
%Hubspot.Request{endpoint: &quot;/contacts/v2/properties/named/some_property&quot;,
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/properties/named/some_property&quot;,
method: :delete, query: [], body: &quot;&quot;}</code></pre>

</section>
Expand All @@ -323,7 +323,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">delete_group(<a href="http://elixir-lang.org/docs/stable/elixir/String.html#t:t/0">String.t</a>) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">delete_group(<a href="http://elixir-lang.org/docs/stable/elixir/String.html#t:t/0">String.t</a>) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -334,7 +334,7 @@ <h4 class="specs-title">Specs</h4>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/delete_contact_property_group">http://developers.hubspot.com/docs/methods/contacts/v2/delete_contact_property_group</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.delete_group(&quot;test_group&quot;)
%Hubspot.Request{endpoint: &quot;/contacts/v2/groups/named/test_group&quot;,
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/groups/named/test_group&quot;,
method: :delete, query: [], body: &quot;&quot;}</code></pre>

</section>
Expand All @@ -353,7 +353,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">get(<a href="http://elixir-lang.org/docs/stable/elixir/String.html#t:t/0">String.t</a>) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">get(<a href="http://elixir-lang.org/docs/stable/elixir/String.html#t:t/0">String.t</a>) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -364,7 +364,7 @@ <h4 class="specs-title">Specs</h4>
<p>see: <a href="http://developers.hubspot.com/docs/methods/companies/get_contact_property">http://developers.hubspot.com/docs/methods/companies/get_contact_property</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.get(&quot;test&quot;)
%Hubspot.Request{endpoint: &quot;/contacts/v2/properties/named/test&quot;,
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/properties/named/test&quot;,
method: :get, query: [], body: &quot;&quot;}</code></pre>

</section>
Expand All @@ -383,7 +383,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">get_groups(list) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">get_groups(list) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -394,12 +394,12 @@ <h4 class="specs-title">Specs</h4>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/get_contact_property_groups">http://developers.hubspot.com/docs/methods/contacts/v2/get_contact_property_groups</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.get_groups
%Hubspot.Request{endpoint: &quot;/contacts/v2/groups&quot;,
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/groups&quot;,
method: :get, query: [&quot;includeProperties&quot;: false], body: &quot;&quot;}

iex&gt; Hubspot.ContactProperties.get_groups([&quot;includeProperties&quot;: true])
%Hubspot.Request{endpoint: &quot;/contacts/v2/groups&quot;,
method: :get, query: [&quot;includeProperties&quot;: true], body: &quot;&quot;}</code></pre>
iex&gt; Hubspot.ContactProperties.get_groups([includeProperties: true])
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/groups&quot;,
method: :get, query: [includeProperties: true], body: &quot;&quot;}</code></pre>

</section>
</div>
Expand All @@ -417,7 +417,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">update(list) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">update(list) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -427,9 +427,9 @@ <h4 class="specs-title">Specs</h4>
<p>Update a specified contact property.</p>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/update_contact_property">http://developers.hubspot.com/docs/methods/contacts/v2/update_contact_property</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.update([&quot;name&quot;: &quot;test&quot;, &quot;description&quot;: &quot;Cool&quot;])
%Hubspot.Request{endpoint: &quot;/contacts/v2/properties/named/test&quot;,
method: :put, query: [], body: [&quot;name&quot;: &quot;test&quot;, &quot;description&quot;: &quot;Cool&quot;]}</code></pre>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.update([name: &quot;test&quot;, description: &quot;Cool&quot;])
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/properties/named/test&quot;,
method: :put, query: [], body: [name: &quot;test&quot;, description: &quot;Cool&quot;]}</code></pre>

</section>
</div>
Expand All @@ -447,7 +447,7 @@ <h2>Example</h2>
<h4 class="specs-title">Specs</h4>
<div class="specs-list">

<pre><code class="elixir">update_group(list) :: %Hubspot.Request{body: term, endpoint: term, method: term, query: term}</code></pre>
<pre><code class="elixir">update_group(list) :: %Hubspot.HTTP.Request{body: term, endpoint: term, method: term, query: term}</code></pre>

</div>
</div>
Expand All @@ -457,9 +457,9 @@ <h4 class="specs-title">Specs</h4>
<p>Update a previously created contact property group.</p>
<p>see: <a href="http://developers.hubspot.com/docs/methods/contacts/v2/update_contact_property_group">http://developers.hubspot.com/docs/methods/contacts/v2/update_contact_property_group</a></p>
<h2>Example</h2>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.update_group([&quot;name&quot;: &quot;some_group&quot;, &quot;properties&quot;: [&quot;type&quot;: &quot;string&quot;]])
%Hubspot.Request{endpoint: &quot;/contacts/v2/groups/named/some_group&quot;,
method: :put, query: [], body: [&quot;name&quot;: &quot;some_group&quot;, &quot;properties&quot;: [&quot;type&quot;: &quot;string&quot;]]}</code></pre>
<pre><code class="iex elixir">iex&gt; Hubspot.ContactProperties.update_group([name: &quot;some_group&quot;, properties: [type: &quot;string&quot;]])
%Hubspot.HTTP.Request{endpoint: &quot;/contacts/v2/groups/named/some_group&quot;,
method: :put, query: [], body: [name: &quot;some_group&quot;, properties: [type: &quot;string&quot;]]}</code></pre>

</section>
</div>
Expand Down
Loading

0 comments on commit b596cd8

Please sign in to comment.