easy_hubspot 0.1.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -4
- data/Gemfile +4 -0
- data/README.md +39 -2
- data/easy_hubspot.gemspec +1 -0
- data/lib/easy_hubspot/deal.rb +36 -0
- data/lib/easy_hubspot/version.rb +1 -1
- data/lib/easy_hubspot.rb +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d4c8f01d51cfd846f1687d8f2ee3f51a0dba0ad695adfc29fe676366ad4bc02
|
4
|
+
data.tar.gz: c0958ecdbc0702449e1f6955a2167984586e92c885631fa63a53df4739c180a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d5c584b66c728f4216e2e3a77f272623f5d92b1fffb0cd7aa6e2ebccd11ceee2761c255b7b370578f24cfd25a1c2e8a694a71f47cfa36cd18a745326897d7e8
|
7
|
+
data.tar.gz: b8813814c8559cc0675ca2b978ee3fdb613e17565d31f1572d4198b19bfc71a7d5d5420e423d81c1478ccaf12b65f0be9a08660b51ca9f59c5ea9a76503ea4be
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
## [Official Release]
|
2
|
-
- [0.
|
3
|
-
- [0.1.8] - 2023-02-10
|
4
|
-
- [0.1.9] - 2023-02-14 https://github.com/oroth8/easy_hubspot/pull/6
|
2
|
+
- [1.0.0] - 2023-02-22 https://github.com/oroth8/easy_hubspot/pull/10
|
5
3
|
|
6
4
|
## [Unreleased]
|
7
5
|
|
8
|
-
## [Initial releases]
|
6
|
+
## [Initial releases (Beta)]
|
9
7
|
- [0.1.0] - 2023-02-08
|
10
8
|
- [0.1.1] - 2023-02-09
|
11
9
|
- [0.1.2] - 2023-02-09
|
@@ -13,3 +11,7 @@
|
|
13
11
|
- [0.1.4] - 2023-02-09
|
14
12
|
- [0.1.5] - 2023-02-09
|
15
13
|
- [0.1.6] - 2023-02-09
|
14
|
+
- [0.1.7] - 2023-02-10
|
15
|
+
- [0.1.8] - 2023-02-10
|
16
|
+
- [0.1.9] - 2023-02-14 https://github.com/oroth8/easy_hubspot/pull/6
|
17
|
+
- [0.1.10] - 2023-02-14 https://github.com/oroth8/easy_hubspot/pull/7
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,20 @@
|
|
1
1
|
# EasyHubspot
|
2
|
-
Stable: 
|
3
|
+
Latest: 
|
4
4
|
[](https://github.com/oroth8/easy_hubspot/actions/workflows/ci.yml)
|
5
5
|
[](https://codeclimate.com/github/oroth8/easy_hubspot)
|
6
|
+
[](https://codeclimate.com/github/oroth8/easy_hubspot/test_coverage)
|
6
7
|
|
7
8
|
This is a lightweight wrapper for the Hubspot API. It is designed to be easy to use and to provide a simple setup for the most common use cases.
|
8
9
|
|
9
10
|
This gem utilizes the `v3` hubspot-api
|
10
11
|
|
12
|
+
## CRM Objects
|
13
|
+
- [Contacts](#contacts)
|
14
|
+
- [Deals](#deals)
|
15
|
+
|
16
|
+
- [Error Handling](#error-handling)
|
17
|
+
|
11
18
|
### Dependencies
|
12
19
|
- [gem "httparty", "~> 0.21.0"](https://github.com/jnunemaker/httparty)
|
13
20
|
|
@@ -101,6 +108,36 @@ Please refrence the [hubspot docs](https://developers.hubspot.com/docs/api/crm/c
|
|
101
108
|
:archived=>false}
|
102
109
|
```
|
103
110
|
|
111
|
+
### Deals
|
112
|
+
```ruby
|
113
|
+
# Create a deal
|
114
|
+
# required: body
|
115
|
+
# returns: parsed hubspot deal
|
116
|
+
EasyHubspot::Deal.create_deal(properties: { dealname: '', amount: '', etc: ''})
|
117
|
+
|
118
|
+
# Update a deal
|
119
|
+
# required: deal_id, body
|
120
|
+
# - deal_id: must be a hubspot deal_id
|
121
|
+
# returns: parsed hubspot deal
|
122
|
+
EasyHubspot::Deal.update_deal(123, properties: { dealname: '', amount: '', etc: ''})
|
123
|
+
|
124
|
+
# Get a deal
|
125
|
+
# required: deal_id
|
126
|
+
# - deal_id: must be a hubspot deal_id
|
127
|
+
# returns: parsed hubspot deal
|
128
|
+
EasyHubspot::Deal.get_deal(123)
|
129
|
+
|
130
|
+
# Get all deals
|
131
|
+
# returns: parsed hubspot deals
|
132
|
+
EasyHubspot::Deal.get_deals
|
133
|
+
|
134
|
+
# Delete a deal
|
135
|
+
# required: deal_id
|
136
|
+
# - deal_id: must be a hubspot deal_id
|
137
|
+
# returns: {status: 'success'}
|
138
|
+
EasyHubspot::Deal.delete_deal(123)
|
139
|
+
```
|
140
|
+
|
104
141
|
## Error Handling
|
105
142
|
|
106
143
|
```ruby
|
data/easy_hubspot.gemspec
CHANGED
@@ -44,5 +44,6 @@ Gem::Specification.new do |spec|
|
|
44
44
|
spec.add_development_dependency 'rubocop', '~> 1.2'
|
45
45
|
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
46
46
|
spec.add_development_dependency 'rubocop-rspec', '~> 2.18.1'
|
47
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.0'
|
47
48
|
spec.add_development_dependency 'webmock', '~> 3.14'
|
48
49
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EasyHubspot
|
4
|
+
# class EasyHubspot::deal
|
5
|
+
class Deal < EasyHubspot::Base
|
6
|
+
class << self
|
7
|
+
DEAL_ENDPOINT = 'crm/v3/objects/deals'
|
8
|
+
|
9
|
+
def get_deal(deal_id)
|
10
|
+
Client.do_get(deal_id_endpoint(deal_id), headers)
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_deals
|
14
|
+
Client.do_get(DEAL_ENDPOINT, headers)
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_deal(body)
|
18
|
+
Client.do_post(DEAL_ENDPOINT, body, headers)
|
19
|
+
end
|
20
|
+
|
21
|
+
def update_deal(deal_id, body)
|
22
|
+
Client.do_patch(deal_id_endpoint(deal_id), body, headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def delete_deal(deal_id)
|
26
|
+
Client.do_delete(deal_id_endpoint(deal_id), headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def deal_id_endpoint(deal_id)
|
32
|
+
"#{DEAL_ENDPOINT}/#{deal_id}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/easy_hubspot/version.rb
CHANGED
data/lib/easy_hubspot.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_hubspot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Roth
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 2.18.1
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: simplecov
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.17.0
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.17.0
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: webmock
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,6 +198,7 @@ files:
|
|
184
198
|
- lib/easy_hubspot/base.rb
|
185
199
|
- lib/easy_hubspot/client.rb
|
186
200
|
- lib/easy_hubspot/contact.rb
|
201
|
+
- lib/easy_hubspot/deal.rb
|
187
202
|
- lib/easy_hubspot/exceptions.rb
|
188
203
|
- lib/easy_hubspot/generators/install_generator.rb
|
189
204
|
- lib/easy_hubspot/generators/templates/easy_hubspot.rb
|