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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10948cb420b0963c35938bdfbc87c017236894bcdb5072ee32e0be6c7e67b313
4
- data.tar.gz: 3a4c3668452becd0bada81aa3c9e270606e3d5c7e4347fd9e614d36da27e8234
3
+ metadata.gz: 0d4c8f01d51cfd846f1687d8f2ee3f51a0dba0ad695adfc29fe676366ad4bc02
4
+ data.tar.gz: c0958ecdbc0702449e1f6955a2167984586e92c885631fa63a53df4739c180a0
5
5
  SHA512:
6
- metadata.gz: 28470604e252338702a3fd8f8d64bf3c15bdd438032dd1b894a8dc88469aaac423e8fc26c8c7ab75605f934e4a57a7c03ea39ac9852da98d3db6d7a12136d020
7
- data.tar.gz: fe41f9081b7534da09bf8e425e9c9fa7f60beb0c870f3aec52ad649d5f4bf8ceb2361b7644c03fb79efb964b87d4d8afa0ee527cdd7cfc0fcd42e19fac52b19f
6
+ metadata.gz: 4d5c584b66c728f4216e2e3a77f272623f5d92b1fffb0cd7aa6e2ebccd11ceee2761c255b7b370578f24cfd25a1c2e8a694a71f47cfa36cd18a745326897d7e8
7
+ data.tar.gz: b8813814c8559cc0675ca2b978ee3fdb613e17565d31f1572d4198b19bfc71a7d5d5420e423d81c1478ccaf12b65f0be9a08660b51ca9f59c5ea9a76503ea4be
data/CHANGELOG.md CHANGED
@@ -1,11 +1,9 @@
1
1
  ## [Official Release]
2
- - [0.1.7] - 2023-02-10
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
@@ -12,3 +12,7 @@ group :development, :test do
12
12
  gem 'rspec', '~> 3.0'
13
13
  gem 'rubocop', '~> 1.21'
14
14
  end
15
+
16
+ group :test do
17
+ gem 'simplecov', '~> 0.17.0'
18
+ end
data/README.md CHANGED
@@ -1,13 +1,20 @@
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-1.0.0-green)
3
+ Latest: ![latest version](https://img.shields.io/badge/version-1.0.0-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
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/c55dfda6142769b8209c/test_coverage)](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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyHubspot
4
- VERSION = '0.1.9'
4
+ VERSION = '1.0.0'
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: 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-14 00:00:00.000000000 Z
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