easy_hubspot 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/README.md +38 -2
- data/lib/easy_hubspot/deal.rb +36 -0
- data/lib/easy_hubspot/version.rb +1 -1
- data/lib/easy_hubspot.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3bedf368c82ea90f5c0b8762a73b85e8ffb612b6cdc12fb1675aa37e988ca59
|
4
|
+
data.tar.gz: 4886a66107567facb93da095cc9025b26c47d433757213adb2aa67823a7ead9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c99f809956ec2c4432941218fafc0f52b6ecccd27f0a34c47f18f5b7dc2c1e6ab676e59ce5ffa2cfbf360570b41076e0ceb561140ccd24b847eb83ee4616950d
|
7
|
+
data.tar.gz: 02e13fb5fecc8b6ff01d119482ce6489a8e7064595a9db88848e1157df4b11d052fc242c82391ca8a9a2d0f487b5f6c1f10e742110849f29cd77443ab8560862
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# EasyHubspot
|
2
|
-
Stable: ![stable version](https://img.shields.io/badge/version-0.1.
|
3
|
-
Latest: ![latest version](https://img.shields.io/badge/version-0.1.
|
2
|
+
Stable: ![stable version](https://img.shields.io/badge/version-0.1.10-green)
|
3
|
+
Latest: ![latest version](https://img.shields.io/badge/version-0.1.10-yellow)
|
4
4
|
[![CI](https://github.com/oroth8/easy_hubspot/actions/workflows/ci.yml/badge.svg)](https://github.com/oroth8/easy_hubspot/actions/workflows/ci.yml)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/oroth8/easy_hubspot/badges/gpa.svg)](https://codeclimate.com/github/oroth8/easy_hubspot)
|
6
6
|
|
@@ -8,6 +8,12 @@ This is a lightweight wrapper for the Hubspot API. It is designed to be easy to
|
|
8
8
|
|
9
9
|
This gem utilizes the `v3` hubspot-api
|
10
10
|
|
11
|
+
## CRM Objects
|
12
|
+
- [Contacts](#contacts)
|
13
|
+
- [Deals](#deals)
|
14
|
+
|
15
|
+
- [Error Handling](#error-handling)
|
16
|
+
|
11
17
|
### Dependencies
|
12
18
|
- [gem "httparty", "~> 0.21.0"](https://github.com/jnunemaker/httparty)
|
13
19
|
|
@@ -101,6 +107,36 @@ Please refrence the [hubspot docs](https://developers.hubspot.com/docs/api/crm/c
|
|
101
107
|
:archived=>false}
|
102
108
|
```
|
103
109
|
|
110
|
+
### Deals
|
111
|
+
```ruby
|
112
|
+
# Create a deal
|
113
|
+
# required: body
|
114
|
+
# returns: parsed hubspot deal
|
115
|
+
EasyHubspot::Deal.create_deal(properties: { dealname: '', amount: '', etc: ''})
|
116
|
+
|
117
|
+
# Update a deal
|
118
|
+
# required: deal_id, body
|
119
|
+
# - deal_id: must be a hubspot deal_id
|
120
|
+
# returns: parsed hubspot deal
|
121
|
+
EasyHubspot::Deal.update_deal(123, properties: { dealname: '', amount: '', etc: ''})
|
122
|
+
|
123
|
+
# Get a deal
|
124
|
+
# required: deal_id
|
125
|
+
# - deal_id: must be a hubspot deal_id
|
126
|
+
# returns: parsed hubspot deal
|
127
|
+
EasyHubspot::Deal.get_deal(123)
|
128
|
+
|
129
|
+
# Get all deals
|
130
|
+
# returns: parsed hubspot deals
|
131
|
+
EasyHubspot::Deal.get_deals
|
132
|
+
|
133
|
+
# Delete a deal
|
134
|
+
# required: deal_id
|
135
|
+
# - deal_id: must be a hubspot deal_id
|
136
|
+
# returns: {status: 'success'}
|
137
|
+
EasyHubspot::Deal.delete_deal(123)
|
138
|
+
```
|
139
|
+
|
104
140
|
## Error Handling
|
105
141
|
|
106
142
|
```ruby
|
@@ -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.1.
|
4
|
+
version: 0.1.10
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- lib/easy_hubspot/base.rb
|
185
185
|
- lib/easy_hubspot/client.rb
|
186
186
|
- lib/easy_hubspot/contact.rb
|
187
|
+
- lib/easy_hubspot/deal.rb
|
187
188
|
- lib/easy_hubspot/exceptions.rb
|
188
189
|
- lib/easy_hubspot/generators/install_generator.rb
|
189
190
|
- lib/easy_hubspot/generators/templates/easy_hubspot.rb
|