hubspot-api-ruby 0.15.0 → 0.16.0

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: 5b5da1c5b3161e39ad26020948f72dc349ec275140714ed29b470e9081c0e22d
4
- data.tar.gz: e0fbef872458028ef540fe2fac43816980f2a4ad6862ee3acdaf68f6c12fc907
3
+ metadata.gz: ce2ef58e430507f2d3573dab50231ebdc9d5af9479d678d1f2a063d350e4d10f
4
+ data.tar.gz: 33fc9cbba6bdb66a30c6477a4fda5c31284cbc277993ec1ede750a20c08ab8a2
5
5
  SHA512:
6
- metadata.gz: 2ddeb851b64faacbed0a42a1019d28c7a04b0899454db482188a7c53f6f9c397ad929fdf445d1143b9cfd85742d595b085e7e58c37b2de988307bc74e15665da
7
- data.tar.gz: f2bfebd54dfecd85121f49399d271a1bd3a917b58db832639f983ca98897610e064525a43e645dda305f16d57b4316bae633b65a57289c2211a724c9ac934e8f
6
+ metadata.gz: '06921a719c97ddf74779098da5dfc3b7160716f96a998df6454394f0fc1261b7a7ef104f139d926921a455081f921d4ba07846612d34e3c7b74ac8a1c1358108'
7
+ data.tar.gz: 48ee5aa85a01c9e83e87d7512d4a4471489092f50fea603fcea2d7e941d3f70461e4b43f6eeb696d5971776c31f9e60eb97631516ce68e3ffbdc43877c762f97
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "hubspot-api-ruby"
3
- s.version = "0.15.0"
3
+ s.version = "0.16.0"
4
4
  s.require_paths = ["lib"]
5
5
  s.authors = ["Jonathan"]
6
6
  s.email = ["jonathan@hoggo.com"]
@@ -26,8 +26,11 @@ module Hubspot
26
26
  }
27
27
  end
28
28
 
29
- def find(id)
30
- response = Hubspot::Connection.get_json(MEETING_PATH, { meeting_id: id, properties: BASE_PROPERTIES.join(',') })
29
+ def find(id, opts = {})
30
+ input_properties = opts[:properties].presence || []
31
+ properties = BASE_PROPERTIES | input_properties.compact
32
+
33
+ response = Hubspot::Connection.get_json(MEETING_PATH, { meeting_id: id, properties: properties.join(',') })
31
34
  new(response)
32
35
  end
33
36
 
@@ -36,6 +39,7 @@ module Hubspot
36
39
  limit: opts[:limit].presence || 100,
37
40
  after: opts[:after].presence
38
41
  }.compact
42
+ properties = opts[:properties].presence || []
39
43
 
40
44
  default_filters = [{ propertyName: 'associations.contact', 'operator': 'EQ', value: contact_id }]
41
45
  default_sorts = [{ propertyName: "hs_lastmodifieddate", direction: "DESCENDING" }]
@@ -44,7 +48,7 @@ module Hubspot
44
48
  params: {},
45
49
  body: {
46
50
  **params,
47
- properties: BASE_PROPERTIES,
51
+ properties: BASE_PROPERTIES | properties.compact,
48
52
  filters: (opts[:filters].presence || []) + default_filters,
49
53
  sorts: opts[:sorts].presence || default_sorts
50
54
  }
@@ -94,8 +94,10 @@ RSpec.describe Hubspot::Meeting do
94
94
  end
95
95
  end
96
96
 
97
- context 'when custom filters' do
98
- let(:opts) { { filters: [{ propertyName: 'hs_meeting_title', 'operator': 'EQ', value: 'Hello World' }] } }
97
+ context 'when custom filters and props' do
98
+ let(:filters) { [{ propertyName: 'hs_meeting_title', 'operator': 'EQ', value: 'Hello World' }] }
99
+ let(:properties) { [:hs_timestamp] }
100
+ let(:opts) { { filters: filters, properties: properties } }
99
101
 
100
102
  it 'retrieves meetings' do
101
103
  VCR.use_cassette 'meeting_find_by_contact_custom_filters' do
@@ -110,6 +112,7 @@ RSpec.describe Hubspot::Meeting do
110
112
  expect(first_meeting.properties[:hs_meeting_body]).not_to be nil
111
113
  expect(first_meeting.properties[:hs_meeting_start_time]).not_to be nil
112
114
  expect(first_meeting.properties[:hs_meeting_end_time]).not_to be nil
115
+ expect(first_meeting.properties[:hs_timestamp]).not_to be nil
113
116
  end
114
117
  end
115
118
  end
@@ -131,6 +134,7 @@ RSpec.describe Hubspot::Meeting do
131
134
  expect(first_meeting.properties[:hs_meeting_body]).not_to be nil
132
135
  expect(first_meeting.properties[:hs_meeting_start_time]).not_to be nil
133
136
  expect(first_meeting.properties[:hs_meeting_end_time]).not_to be nil
137
+ expect(first_meeting.properties[:hs_timestamp]).to be nil
134
138
  end
135
139
  end
136
140
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubspot-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-14 00:00:00.000000000 Z
11
+ date: 2022-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport