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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10948cb420b0963c35938bdfbc87c017236894bcdb5072ee32e0be6c7e67b313
4
- data.tar.gz: 3a4c3668452becd0bada81aa3c9e270606e3d5c7e4347fd9e614d36da27e8234
3
+ metadata.gz: e3bedf368c82ea90f5c0b8762a73b85e8ffb612b6cdc12fb1675aa37e988ca59
4
+ data.tar.gz: 4886a66107567facb93da095cc9025b26c47d433757213adb2aa67823a7ead9f
5
5
  SHA512:
6
- metadata.gz: 28470604e252338702a3fd8f8d64bf3c15bdd438032dd1b894a8dc88469aaac423e8fc26c8c7ab75605f934e4a57a7c03ea39ac9852da98d3db6d7a12136d020
7
- data.tar.gz: fe41f9081b7534da09bf8e425e9c9fa7f60beb0c870f3aec52ad649d5f4bf8ceb2361b7644c03fb79efb964b87d4d8afa0ee527cdd7cfc0fcd42e19fac52b19f
6
+ metadata.gz: c99f809956ec2c4432941218fafc0f52b6ecccd27f0a34c47f18f5b7dc2c1e6ab676e59ce5ffa2cfbf360570b41076e0ceb561140ccd24b847eb83ee4616950d
7
+ data.tar.gz: 02e13fb5fecc8b6ff01d119482ce6489a8e7064595a9db88848e1157df4b11d052fc242c82391ca8a9a2d0f487b5f6c1f10e742110849f29cd77443ab8560862
data/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
  - [0.1.7] - 2023-02-10
3
3
  - [0.1.8] - 2023-02-10
4
4
  - [0.1.9] - 2023-02-14 https://github.com/oroth8/easy_hubspot/pull/6
5
+ - [0.1.10] - 2023-02-14 https://github.com/oroth8/easy_hubspot/pull/7
5
6
 
6
7
  ## [Unreleased]
7
8
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # EasyHubspot
2
- Stable: ![stable version](https://img.shields.io/badge/version-0.1.8-green)
3
- Latest: ![latest version](https://img.shields.io/badge/version-0.1.9-yellow)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyHubspot
4
- VERSION = '0.1.9'
4
+ VERSION = '0.1.10'
5
5
  end
data/lib/easy_hubspot.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'easy_hubspot/base'
4
4
  require 'easy_hubspot/client'
5
5
  require 'easy_hubspot/contact'
6
+ require 'easy_hubspot/deal'
6
7
  require 'easy_hubspot/version'
7
8
  require 'easy_hubspot/generators/install_generator'
8
9
  require 'easy_hubspot/exceptions'
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.9
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-14 00:00:00.000000000 Z
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