diff --git a/lib/hubspot/company.rb b/lib/hubspot/company.rb index 9b57b2d9..b3ece6f3 100644 --- a/lib/hubspot/company.rb +++ b/lib/hubspot/company.rb @@ -151,7 +151,7 @@ def batch_update!(companies) end Hubspot::Connection.post_json(BATCH_UPDATE_PATH, params: {}, body: query) end - + # Adds contact to a company # {http://developers.hubspot.com/docs/methods/companies/add_contact_to_company} # @param company_vid [Integer] The ID of a company to add a contact to @@ -165,6 +165,18 @@ def add_contact!(company_vid, contact_vid) }, body: nil) end + + # Updates the properties of a company + # {http://developers.hubspot.com/docs/methods/companies/update_company} + # @param vid [Integer] hubspot company vid + # @param params [Hash] hash of properties to update + # @return [Hubspot::Company] Company record + def update!(vid, params) + params.stringify_keys! + query = {"properties" => Hubspot::Utils.hash_to_properties(params, key_name: "name")} + response = Hubspot::Connection.put_json(UPDATE_COMPANY_PATH, params: { company_id: vid }, body: query) + new(response) + end end attr_reader :properties @@ -185,8 +197,7 @@ def [](property) # @param params [Hash] hash of properties to update # @return [Hubspot::Company] self def update!(params) - query = {"properties" => Hubspot::Utils.hash_to_properties(params.stringify_keys!, key_name: "name")} - Hubspot::Connection.put_json(UPDATE_COMPANY_PATH, params: { company_id: vid }, body: query) + self.class.update!(vid, params) @properties.merge!(params) self end diff --git a/lib/hubspot/contact.rb b/lib/hubspot/contact.rb index 4a8ea825..994a4c87 100644 --- a/lib/hubspot/contact.rb +++ b/lib/hubspot/contact.rb @@ -163,6 +163,14 @@ def merge!(primary_contact_vid, secondary_contact_vid) body: { vidToMerge: secondary_contact_vid } ) end + + # Updates the properties of a contact + # {https://developers.hubspot.com/docs/methods/contacts/update_contact} + # @param params [Hash] hash of properties to update + def update!(vid, params = {}) + query = {"properties" => Hubspot::Utils.hash_to_properties(params.stringify_keys!)} + Hubspot::Connection.post_json(UPDATE_CONTACT_PATH, params: { contact_id: vid }, body: query) + end end attr_reader :properties, :vid, :is_new @@ -197,8 +205,7 @@ def is_new=(val) # @param params [Hash] hash of properties to update # @return [Hubspot::Contact] self def update!(params) - query = {"properties" => Hubspot::Utils.hash_to_properties(params.stringify_keys!)} - Hubspot::Connection.post_json(UPDATE_CONTACT_PATH, params: { contact_id: vid }, body: query) + self.class.update!(vid, params) @properties.merge!(params) self end diff --git a/lib/hubspot/deal.rb b/lib/hubspot/deal.rb index a7c26a60..5d5be3d1 100644 --- a/lib/hubspot/deal.rb +++ b/lib/hubspot/deal.rb @@ -109,6 +109,18 @@ def find_by_association(object) response = Hubspot::Connection.get_json(path, params) response["results"].map { |deal_id| find(deal_id) } end + + # Updates the properties of a deal + # {http://developers.hubspot.com/docs/methods/deals/update_deal} + # @param deal_id [Integer] hubspot deal_id + # @param params [Hash] hash of properties to update + # @return [Hubspot::Deal] Deal record + def update!(deal_id, params) + params.stringify_keys! + query = {"properties" => Hubspot::Utils.hash_to_properties(params, key_name: "name")} + response = Hubspot::Connection.put_json(UPDATE_DEAL_PATH, params: { deal_id: deal_id }, body: query) + new(response) + end end # Archives the contact in hubspot @@ -132,8 +144,7 @@ def [](property) # @param params [Hash] hash of properties to update # @return [Hubspot::Deal] self def update!(params) - query = {"properties" => Hubspot::Utils.hash_to_properties(params.stringify_keys!, key_name: 'name')} - Hubspot::Connection.put_json(UPDATE_DEAL_PATH, params: { deal_id: deal_id }, body: query) + self.class.update!(deal_id, params) @properties.merge!(params) self end diff --git a/spec/fixtures/vcr_cassettes/company_update.yml b/spec/fixtures/vcr_cassettes/company_update.yml deleted file mode 100644 index 3ed089e9..00000000 --- a/spec/fixtures/vcr_cassettes/company_update.yml +++ /dev/null @@ -1,429 +0,0 @@ ---- -http_interactions: -- request: - method: put - uri: https://api.hubapi.com/companies/v2/companies/?hapikey=demo - body: - encoding: UTF-8 - string: '{"properties":[{"name":"name","value":"Acme Cogs"},{"name":"domain","value":"abccogs.com"}]}' - headers: - Content-Type: - - application/json - response: - status: - code: 405 - message: Method Not Allowed - headers: - Access-Control-Allow-Credentials: - - 'false' - Allow: - - HEAD,POST,GET,OPTIONS - Date: - - Tue, 16 Jun 2015 13:19:11 GMT - Content-Length: - - '0' - Connection: - - keep-alive - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Tue, 16 Jun 2015 13:19:11 GMT -- request: - method: put - uri: https://api.hubapi.com/companies/v2/companies/42839742?hapikey=demo - body: - encoding: UTF-8 - string: '{"properties":[{"name":"name","value":"Acme Cogs"},{"name":"domain","value":"abccogs.com"}]}' - headers: - Content-Type: - - application/json - response: - status: - code: 404 - message: Not Found - headers: - Access-Control-Allow-Credentials: - - 'false' - Content-Type: - - application/json; charset=UTF-8 - Date: - - Tue, 16 Jun 2015 13:19:19 GMT - Content-Length: - - '146' - Connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"status":"error","message":"Couldn''t find a company with the ID ''42839742'' - in portal ''62515''","requestId":"93eabfa4-afe9-4918-80f9-a5f606155a39"}' - http_version: - recorded_at: Tue, 16 Jun 2015 13:19:19 GMT -- request: - method: put - uri: https://api.hubapi.com/companies/v2/companies/21827084?hapikey=demo - body: - encoding: UTF-8 - string: '{"properties":[{"name":"name","value":"Acme Cogs"},{"name":"domain","value":"abccogs.com"}]}' - headers: - Content-Type: - - application/json - response: - status: - code: 200 - message: OK - headers: - Access-Control-Allow-Credentials: - - 'false' - Content-Type: - - application/json; charset=UTF-8 - Date: - - Tue, 16 Jun 2015 13:22:03 GMT - Content-Length: - - '15184' - Connection: - - keep-alive - body: - encoding: ASCII-8BIT - string: !binary |- - eyJwb3J0YWxJZCI6NjI1MTUsImNvbXBhbnlJZCI6MjE4MjcwODQsImlzRGVs - ZXRlZCI6ZmFsc2UsInByb3BlcnRpZXMiOnsiY291bnRyeSI6eyJ2YWx1ZSI6 - IlVuaXRlZCBTdGF0ZXMiLCJ0aW1lc3RhbXAiOjE0MjMyMDU2MDg3OTAsInNv - dXJjZSI6IkJJREVOIiwic291cmNlSWQiOm51bGwsInZlcnNpb25zIjpbeyJu - YW1lIjoiY291bnRyeSIsInZhbHVlIjoiVW5pdGVkIFN0YXRlcyIsIn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3RhbXAiOjE0Mjg1ODcwMzE1 - ODQsInNvdXJjZSI6IkVOR0FHRU1FTlRTIiwic291cmNlSWQiOm51bGwsInZl - cnNpb25zIjpbeyJuYW1lIjoibnVtX25vdGVzIiwidmFsdWUiOiIyIiwidGlt - ZXN0YW1wIjoxNDI4NTg3MDMxNTg0LCJzb3VyY2UiOiJFTkdBR0VNRU5UUyIs - InNvdXJjZVZpZCI6W119XX19fQ== - http_version: - recorded_at: Tue, 16 Jun 2015 13:22:03 GMT -recorded_with: VCR 2.4.0 diff --git a/spec/fixtures/vcr_cassettes/company_update_class.yml b/spec/fixtures/vcr_cassettes/company_update_class.yml new file mode 100644 index 00000000..6b77b44c --- /dev/null +++ b/spec/fixtures/vcr_cassettes/company_update_class.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.hubapi.com/companies/v2/companies/?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"name","value":"New Company 1531234621"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 10 Jul 2018 14:57:01 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '820' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d747f46d492efce9bfad2d9229b45dc771531234621; expires=Wed, 10-Jul-19 + 14:57:01 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2BCC35CC9F6288AB2C80CDEE1A17A0C86356B73020000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4383e15e5fb7b7d1-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"companyId":856953039,"isDeleted":false,"properties":{"hs_lastmodifieddate":{"value":"1531234621266","timestamp":1531234621266,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1531234621266","timestamp":1531234621266,"source":"CALCULATED","sourceVid":[]}]},"name":{"value":"New + Company 1531234621","timestamp":1531234621266,"source":"API","sourceId":null,"versions":[{"name":"name","value":"New + Company 1531234621","timestamp":1531234621266,"source":"API","sourceVid":[]}]},"createdate":{"value":"1531234621266","timestamp":1531234621266,"source":"API","sourceId":"API","versions":[{"name":"createdate","value":"1531234621266","timestamp":1531234621266,"sourceId":"API","source":"API","sourceVid":[]}]}},"additionalDomains":[],"stateChanges":[],"mergeAudits":[]}' + http_version: + recorded_at: Tue, 10 Jul 2018 14:57:01 GMT +- request: + method: put + uri: https://api.hubapi.com/companies/v2/companies/856953039?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"name","value":"Acme Flask"},{"name":"domain","value":"abcflasks.com"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 10 Jul 2018 14:57:01 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '1380' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d38c377bbc96cf20bdef4a5f2a03bdaf11531234621; expires=Wed, 10-Jul-19 + 14:57:01 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2B7DCAC069E745FFFB260BA658AC2B0AD889933138000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4383e1605adea86f-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"companyId":856953039,"isDeleted":false,"properties":{"website":{"value":"abcflasks.com","timestamp":1531234621583,"source":"CALCULATED","sourceId":null,"versions":[{"name":"website","value":"abcflasks.com","timestamp":1531234621583,"source":"CALCULATED","sourceVid":[]}]},"hs_lastmodifieddate":{"value":"1531234621583","timestamp":1531234621583,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1531234621583","timestamp":1531234621583,"source":"CALCULATED","sourceVid":[]},{"name":"hs_lastmodifieddate","value":"1531234621266","timestamp":1531234621266,"source":"CALCULATED","sourceVid":[]}]},"domain":{"value":"abcflasks.com","timestamp":1531234621583,"source":"API","sourceId":"79ce0155-b260-4faa-b01c-3c640d1733f3","versions":[{"name":"domain","value":"abcflasks.com","timestamp":1531234621583,"sourceId":"79ce0155-b260-4faa-b01c-3c640d1733f3","source":"API","sourceVid":[]}]},"name":{"value":"Acme + Flask","timestamp":1531234621583,"source":"API","sourceId":"79ce0155-b260-4faa-b01c-3c640d1733f3","versions":[{"name":"name","value":"Acme + Flask","timestamp":1531234621583,"sourceId":"79ce0155-b260-4faa-b01c-3c640d1733f3","source":"API","sourceVid":[]},{"name":"name","value":"New + Company 1531234621","timestamp":1531234621266,"source":"API","sourceVid":[]}]}},"additionalDomains":[],"stateChanges":[],"mergeAudits":[]}' + http_version: + recorded_at: Tue, 10 Jul 2018 14:57:01 GMT +- request: + method: put + uri: https://api.hubapi.com/companies/v2/companies/?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"name","value":"Acme Flask"},{"name":"domain","value":"abcflasks.com"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 405 + message: Method Not Allowed + headers: + Date: + - Tue, 10 Jul 2018 14:57:01 GMT + Content-Type: + - text/html + Content-Length: + - '0' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d26f49d4cd28c7c0cae45ec3d9b2cf4f41531234621; expires=Wed, 10-Jul-19 + 14:57:01 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Allow: + - HEAD,POST,GET,OPTIONS + X-Trace: + - 2B1497F4AEE26E84FBDFD42EE75E2FE70AA32ABBE0000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4383e16208bea887-CDG + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Tue, 10 Jul 2018 14:57:01 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/company_update_instance.yml b/spec/fixtures/vcr_cassettes/company_update_instance.yml new file mode 100644 index 00000000..c60c368c --- /dev/null +++ b/spec/fixtures/vcr_cassettes/company_update_instance.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.hubapi.com/companies/v2/companies/?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"name","value":"New Company 1531234622"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 10 Jul 2018 14:57:02 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '820' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d027d1cd243dd0ddd74efc88ec03daa411531234622; expires=Wed, 10-Jul-19 + 14:57:02 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2BFD75EDFC0EC316192E4B1FBD87BB710055A0B6EC000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4383e165a849b7bf-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"companyId":856818818,"isDeleted":false,"properties":{"hs_lastmodifieddate":{"value":"1531234622682","timestamp":1531234622682,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1531234622682","timestamp":1531234622682,"source":"CALCULATED","sourceVid":[]}]},"name":{"value":"New + Company 1531234622","timestamp":1531234622682,"source":"API","sourceId":null,"versions":[{"name":"name","value":"New + Company 1531234622","timestamp":1531234622682,"source":"API","sourceVid":[]}]},"createdate":{"value":"1531234622682","timestamp":1531234622682,"source":"API","sourceId":"API","versions":[{"name":"createdate","value":"1531234622682","timestamp":1531234622682,"sourceId":"API","source":"API","sourceVid":[]}]}},"additionalDomains":[],"stateChanges":[],"mergeAudits":[]}' + http_version: + recorded_at: Tue, 10 Jul 2018 14:57:02 GMT +- request: + method: put + uri: https://api.hubapi.com/companies/v2/companies/856818818?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"name","value":"Acme Cogs"},{"name":"domain","value":"abccogs.com"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 10 Jul 2018 14:57:03 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '1370' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=de4fc4d1bb00a3648bfa20266018470b61531234622; expires=Wed, 10-Jul-19 + 14:57:02 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2B04DC3BF7F0AC46E3E1D75351B0C4D48324C0F565000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4383e168ca6469b2-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"companyId":856818818,"isDeleted":false,"properties":{"website":{"value":"abccogs.com","timestamp":1531234623200,"source":"CALCULATED","sourceId":null,"versions":[{"name":"website","value":"abccogs.com","timestamp":1531234623200,"source":"CALCULATED","sourceVid":[]}]},"hs_lastmodifieddate":{"value":"1531234623200","timestamp":1531234623200,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1531234623200","timestamp":1531234623200,"source":"CALCULATED","sourceVid":[]},{"name":"hs_lastmodifieddate","value":"1531234622682","timestamp":1531234622682,"source":"CALCULATED","sourceVid":[]}]},"domain":{"value":"abccogs.com","timestamp":1531234623200,"source":"API","sourceId":"9c180937-4a5e-4b69-995d-5c8e723d67fc","versions":[{"name":"domain","value":"abccogs.com","timestamp":1531234623200,"sourceId":"9c180937-4a5e-4b69-995d-5c8e723d67fc","source":"API","sourceVid":[]}]},"name":{"value":"Acme + Cogs","timestamp":1531234623200,"source":"API","sourceId":"9c180937-4a5e-4b69-995d-5c8e723d67fc","versions":[{"name":"name","value":"Acme + Cogs","timestamp":1531234623200,"sourceId":"9c180937-4a5e-4b69-995d-5c8e723d67fc","source":"API","sourceVid":[]},{"name":"name","value":"New + Company 1531234622","timestamp":1531234622682,"source":"API","sourceVid":[]}]}},"additionalDomains":[],"stateChanges":[],"mergeAudits":[]}' + http_version: + recorded_at: Tue, 10 Jul 2018 14:57:03 GMT +- request: + method: put + uri: https://api.hubapi.com/companies/v2/companies/?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"name","value":"Acme Cogs"},{"name":"domain","value":"abccogs.com"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 405 + message: Method Not Allowed + headers: + Date: + - Tue, 10 Jul 2018 14:57:03 GMT + Content-Type: + - text/html + Content-Length: + - '0' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=de339db906cdbd8809e95e2288e0639151531234623; expires=Wed, 10-Jul-19 + 14:57:03 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Allow: + - HEAD,POST,GET,OPTIONS + X-Trace: + - 2B6106CE17C91AB5BE3DA6C623F3AFBDA73090FB82000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4383e16c4c12bd56-CDG + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Tue, 10 Jul 2018 14:57:03 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/contact_update.yml b/spec/fixtures/vcr_cassettes/contact_update.yml deleted file mode 100644 index 55ab629e..00000000 --- a/spec/fixtures/vcr_cassettes/contact_update.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.hubapi.com/contacts/v1/contact/vid/invalid/profile?hapikey=demo - body: - encoding: US-ASCII - string: ! '{"properties":[{"property":"firstname","value":"Steve"},{"property":"lastname","value":"Cunningham"}]}' - headers: {} - response: - status: - code: 404 - message: Not Found - headers: - Content-Type: - - text/html;charset=utf-8 - Date: - - Fri, 22 Feb 2013 20:29:45 GMT - Server: - - Apache-Coyote/1.1 - Content-Length: - - '979' - Connection: - - keep-alive - body: - encoding: US-ASCII - string: ! 'Apache Tomcat/6.0.30 - Error report

HTTP - Status 404 - Not Found


type Status - report

message Not Found

description The - requested resource (Not Found) is not available.


Apache - Tomcat/6.0.30

' - http_version: - recorded_at: Fri, 22 Feb 2013 20:29:46 GMT -- request: - method: post - uri: https://api.hubapi.com/contacts/v1/contact/vid/82325/profile?hapikey=demo - body: - encoding: US-ASCII - string: ! '{"properties":[{"property":"firstname","value":"Steve"},{"property":"lastname","value":"Cunningham"}]}' - headers: {} - response: - status: - code: 204 - message: No Content - headers: - Access-Control-Allow-Credentials: - - 'false' - Date: - - Fri, 22 Feb 2013 20:31:03 GMT - Server: - - Apache-Coyote/1.1 - Connection: - - keep-alive - body: - encoding: US-ASCII - string: '' - http_version: - recorded_at: Fri, 22 Feb 2013 20:31:03 GMT -recorded_with: VCR 2.4.0 diff --git a/spec/fixtures/vcr_cassettes/contact_update_class.yml b/spec/fixtures/vcr_cassettes/contact_update_class.yml new file mode 100644 index 00000000..282b8cbb --- /dev/null +++ b/spec/fixtures/vcr_cassettes/contact_update_class.yml @@ -0,0 +1,187 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.hubapi.com/contacts/v1/contact?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"property":"email","value":"update_class_contact_1532354159@hsgem.com"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 23 Jul 2018 13:55:59 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d254a723a2f294719902c0b21082d98891532354159; expires=Tue, 23-Jul-19 + 13:55:59 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Vary: + - Accept-Encoding + - Accept-Encoding + X-Trace: + - 2B21774C7272DB8F0F1669681382D64447987AFBB0000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eea5d7abf13c2f-CDG + body: + encoding: UTF-8 + string: '{"vid":8124374,"canonical-vid":8124374,"merged-vids":[],"portal-id":62515,"is-contact":true,"profile-token":"AO_T-mNNSis_wx5BmeNFwSHNq6y-uYmedUiDCm75r0soX-bqzmwgxnjP7krkfVSAff9Q77PQbBnZPaVMFo8YKTL_W41ikNh_dOQNxtTuxdo5QeU4APO8RgPKonSpVJCFze-mdCi0lIpx","profile-url":"https://app.hubspot.com/contacts/62515/lists/public/contact/_AO_T-mNNSis_wx5BmeNFwSHNq6y-uYmedUiDCm75r0soX-bqzmwgxnjP7krkfVSAff9Q77PQbBnZPaVMFo8YKTL_W41ikNh_dOQNxtTuxdo5QeU4APO8RgPKonSpVJCFze-mdCi0lIpx/","properties":{"email":{"value":"update_class_contact_1532354159@hsgem.com","versions":[{"value":"update_class_contact_1532354159@hsgem.com","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354159430,"selected":false}]}},"form-submissions":[],"list-memberships":[],"identity-profiles":[{"vid":8124374,"is-deleted":false,"is-contact":false,"pointer-vid":0,"previous-vid":0,"linked-vids":[],"saved-at-timestamp":0,"deleted-changed-timestamp":0,"identities":[{"type":"EMAIL","value":"update_class_contact_1532354159@hsgem.com","timestamp":1532354159434,"is-primary":true,"source":"UNSPECIFIED"},{"type":"LEAD_GUID","value":"aa7263b2-352b-4d95-afcc-39dce7fcf201","timestamp":1532354159442,"source":"UNSPECIFIED"}]}],"merge-audits":[]}' + http_version: + recorded_at: Mon, 23 Jul 2018 13:55:59 GMT +- request: + method: post + uri: https://api.hubapi.com/contacts/v1/contact/vid/8124374/profile?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"property":"firstname","value":"Steve"},{"property":"lastname","value":"Cunningham"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 23 Jul 2018 13:55:59 GMT + Content-Type: + - application/json;charset=utf-8 + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d2303a20533ba6585cb4ca389410df8b31532354159; expires=Tue, 23-Jul-19 + 13:55:59 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Vary: + - Accept-Encoding + - Accept-Encoding + X-Trace: + - 2BCC561BFB0BF02A2335D6C6D6AACBD70784061C80000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eea5da6b303bff-CDG + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 23 Jul 2018 13:55:59 GMT +- request: + method: get + uri: https://api.hubapi.com/contacts/v1/contact/vid/8124374/profile?hapikey=demo + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 23 Jul 2018 13:56:00 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '736' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d48d8bd5ce085cde34d7561a8280ac7a31532354159; expires=Tue, 23-Jul-19 + 13:55:59 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Vary: + - Accept-Encoding + - Accept-Encoding + X-Trace: + - 2B0E1780950F90A463F86991DE1E557AEC1561A670000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eea5dbb8c13c53-CDG + body: + encoding: ASCII-8BIT + string: '{"vid":8124374,"canonical-vid":8124374,"merged-vids":[],"portal-id":62515,"is-contact":true,"profile-token":"AO_T-mP8iKCl7Jwm5mx9Ds_E_zRnd1qE-s03PN76ne2PQQqPxWr9AvRFPn9-LX6jHN1GlVCalPnG1dWjOof9qRJtuglJ9usO5EI2zkQloSG8phJZKw9eiUcRgCOF9wo4i-XIU5zuNtpd","profile-url":"https://app.hubspot.com/contacts/62515/lists/public/contact/_AO_T-mP8iKCl7Jwm5mx9Ds_E_zRnd1qE-s03PN76ne2PQQqPxWr9AvRFPn9-LX6jHN1GlVCalPnG1dWjOof9qRJtuglJ9usO5EI2zkQloSG8phJZKw9eiUcRgCOF9wo4i-XIU5zuNtpd/","properties":{"firstname":{"value":"Steve","versions":[{"value":"Steve","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354159820,"selected":false}]},"num_conversion_events":{"value":"0","versions":[{"value":"0","source-type":"CALCULATED","source-id":null,"source-label":null,"timestamp":0,"selected":false}]},"lastmodifieddate":{"value":"1532354159832","versions":[{"value":"1532354159832","source-type":"CALCULATED","source-id":null,"source-label":null,"timestamp":1532354159832,"selected":false}]},"num_unique_conversion_events":{"value":"0","versions":[{"value":"0","source-type":"CALCULATED","source-id":null,"source-label":null,"timestamp":0,"selected":false}]},"hs_email_domain":{"value":"hsgem.com","versions":[{"value":"hsgem.com","source-type":"CALCULATED","source-id":null,"source-label":null,"timestamp":0,"selected":false}]},"createdate":{"value":"1532354159434","versions":[{"value":"1532354159434","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354159434,"selected":false}]},"hs_lifecyclestage_subscriber_date":{"value":"1532354159434","versions":[{"value":"1532354159434","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354159434,"selected":false}]},"lifecyclestage":{"value":"subscriber","versions":[{"value":"subscriber","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354159434,"selected":false}]},"email":{"value":"update_class_contact_1532354159@hsgem.com","versions":[{"value":"update_class_contact_1532354159@hsgem.com","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354159434,"selected":false}]},"lastname":{"value":"Cunningham","versions":[{"value":"Cunningham","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354159820,"selected":false}]}},"form-submissions":[],"list-memberships":[],"identity-profiles":[{"vid":8124374,"saved-at-timestamp":1532354159445,"deleted-changed-timestamp":0,"identities":[{"type":"EMAIL","value":"update_class_contact_1532354159@hsgem.com","timestamp":1532354159434,"is-primary":true},{"type":"LEAD_GUID","value":"aa7263b2-352b-4d95-afcc-39dce7fcf201","timestamp":1532354159442}]}],"merge-audits":[]}' + http_version: + recorded_at: Mon, 23 Jul 2018 13:56:00 GMT +- request: + method: post + uri: https://api.hubapi.com/contacts/v1/contact/vid/1/profile?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"property":"firstname","value":"Steve"},{"property":"lastname","value":"Cunningham"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 23 Jul 2018 13:56:00 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d1811dcb25473841396861452238785261532354160; expires=Tue, 23-Jul-19 + 13:56:00 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Vary: + - Accept-Encoding + - Accept-Encoding + X-Hubspot-Notfound: + - 'true' + X-Trace: + - 2B5D8F09278E96C98C9EABCEBFDF199737601647DE000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eea5dd4a96a8b1-CDG + body: + encoding: UTF-8 + string: '{"status":"error","message":"resource not found","correlationId":"9db71737-fc89-4160-805b-dec525acef5f","requestId":"ca4e3486d72fa1cd6d868eac95aa0139"}' + http_version: + recorded_at: Mon, 23 Jul 2018 13:56:00 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/contact_update_instance.yml b/spec/fixtures/vcr_cassettes/contact_update_instance.yml new file mode 100644 index 00000000..71bea2ec --- /dev/null +++ b/spec/fixtures/vcr_cassettes/contact_update_instance.yml @@ -0,0 +1,138 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.hubapi.com/contacts/v1/contact?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"property":"email","value":"update_instance_contact_1532354160@hsgem.com"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 23 Jul 2018 13:56:00 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=dcf64f4d134b8f2015a3c25e797053e771532354160; expires=Tue, 23-Jul-19 + 13:56:00 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Vary: + - Accept-Encoding + - Accept-Encoding + X-Trace: + - 2B6D52AA1879D04C84D4D2DB851A4611E073AF19F8000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eea5de4d39b78f-CDG + body: + encoding: UTF-8 + string: '{"vid":8124424,"canonical-vid":8124424,"merged-vids":[],"portal-id":62515,"is-contact":true,"profile-token":"AO_T-mOIaDVgcSzryZmBfyplKcFUJLOorcXAByH3tJd_fEfFeSP9Xk1fDL1sO7fvIb9n9GFDSes7a8QOFKPVL932mJ5Y623jLyR4LCxyin2rhcTDHjwffQFmDNgbSdzGIPPti4qLciBr","profile-url":"https://app.hubspot.com/contacts/62515/lists/public/contact/_AO_T-mOIaDVgcSzryZmBfyplKcFUJLOorcXAByH3tJd_fEfFeSP9Xk1fDL1sO7fvIb9n9GFDSes7a8QOFKPVL932mJ5Y623jLyR4LCxyin2rhcTDHjwffQFmDNgbSdzGIPPti4qLciBr/","properties":{"email":{"value":"update_instance_contact_1532354160@hsgem.com","versions":[{"value":"update_instance_contact_1532354160@hsgem.com","source-type":"API","source-id":null,"source-label":null,"timestamp":1532354160512,"selected":false}]}},"form-submissions":[],"list-memberships":[],"identity-profiles":[{"vid":8124424,"is-deleted":false,"is-contact":false,"pointer-vid":0,"previous-vid":0,"linked-vids":[],"saved-at-timestamp":0,"deleted-changed-timestamp":0,"identities":[{"type":"EMAIL","value":"update_instance_contact_1532354160@hsgem.com","timestamp":1532354160515,"is-primary":true,"source":"UNSPECIFIED"},{"type":"LEAD_GUID","value":"345340cf-8ca4-4ece-a86b-fa32f61db4e0","timestamp":1532354160525,"source":"UNSPECIFIED"}]}],"merge-audits":[]}' + http_version: + recorded_at: Mon, 23 Jul 2018 13:56:00 GMT +- request: + method: post + uri: https://api.hubapi.com/contacts/v1/contact/vid/8124424/profile?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"property":"firstname","value":"Steve"},{"property":"lastname","value":"Cunningham"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 23 Jul 2018 13:56:01 GMT + Content-Type: + - application/json;charset=utf-8 + Connection: + - keep-alive + Set-Cookie: + - __cfduid=dbfe31dc848ae556041b911fe4920053b1532354160; expires=Tue, 23-Jul-19 + 13:56:00 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Vary: + - Accept-Encoding + - Accept-Encoding + X-Trace: + - 2BFCB8B9612FD84F45A4533E07CC4124225D90721D000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eea5e0f87f3c1d-CDG + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 23 Jul 2018 13:56:01 GMT +- request: + method: post + uri: https://api.hubapi.com/contacts/v1/contact/vid/1/profile?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"property":"firstname","value":"Steve"},{"property":"lastname","value":"Cunningham"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 23 Jul 2018 13:56:01 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d5c72d6487d6a1cdcf8faab3e760532411532354161; expires=Tue, 23-Jul-19 + 13:56:01 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + Vary: + - Accept-Encoding + - Accept-Encoding + X-Hubspot-Notfound: + - 'true' + X-Trace: + - 2B9F8209A2BE107004DFED4F6B39AA8B37BA8EC215000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eea5e2db8a3c2f-CDG + body: + encoding: UTF-8 + string: '{"status":"error","message":"resource not found","correlationId":"1863ffb1-8da0-4628-8f39-35dd30016a0c","requestId":"d5e81f44d0636d46f8391af201e59872"}' + http_version: + recorded_at: Mon, 23 Jul 2018 13:56:01 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/deal_update_class.yml b/spec/fixtures/vcr_cassettes/deal_update_class.yml new file mode 100644 index 00000000..693abcc3 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/deal_update_class.yml @@ -0,0 +1,133 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.hubapi.com/deals/v1/deal?hapikey=demo + body: + encoding: UTF-8 + string: '{"portalId":62515,"associations":{"associatedCompanyIds":[],"associatedVids":[]},"properties":[]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 23 Jul 2018 14:01:06 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '858' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d55db57692991c9a4831db0e02c91af2a1532354466; expires=Tue, 23-Jul-19 + 14:01:06 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2B4AF225A202A3389D38BE025C9BA3B97470D879D4000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eead574f5da8db-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"dealId":325444455,"isDeleted":false,"associations":{"associatedVids":[],"associatedCompanyIds":[],"associatedDealIds":[]},"properties":{"hs_lastmodifieddate":{"value":"1532354466560","timestamp":1532354466560,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1532354466560","timestamp":1532354466560,"source":"CALCULATED","sourceVid":[]}]},"hs_createdate":{"value":"1532354466560","timestamp":1532354466560,"source":"API","sourceId":null,"versions":[{"name":"hs_createdate","value":"1532354466560","timestamp":1532354466560,"source":"API","sourceVid":[]}]},"createdate":{"value":"1532354466560","timestamp":1532354466560,"source":"API","sourceId":null,"versions":[{"name":"createdate","value":"1532354466560","timestamp":1532354466560,"source":"API","sourceVid":[]}]}},"imports":[],"stateChanges":[]}' + http_version: + recorded_at: Mon, 23 Jul 2018 14:01:06 GMT +- request: + method: put + uri: https://api.hubapi.com/deals/v1/deal/325444455?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"dealname","value":"Acme Flask"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 23 Jul 2018 14:01:06 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '1366' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=dcf7fda7a341cdbbced64d53f1eb06f5c1532354466; expires=Tue, 23-Jul-19 + 14:01:06 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2B6AB4327AA23FA27DC3196F31F079C0D1FDCB7CFA000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eead58bb32bd65-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"dealId":325444455,"isDeleted":false,"associations":{"associatedVids":[],"associatedCompanyIds":[],"associatedDealIds":[]},"properties":{"dealname":{"value":"Acme + Flask","timestamp":1532354466804,"source":"API","sourceId":null,"versions":[{"name":"dealname","value":"Acme + Flask","timestamp":1532354466804,"source":"API","sourceVid":[]}]},"hs_lastmodifieddate":{"value":"1532354466804","timestamp":1532354466804,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1532354466804","timestamp":1532354466804,"source":"CALCULATED","sourceVid":[]},{"name":"hs_lastmodifieddate","value":"1532354466560","timestamp":1532354466560,"source":"CALCULATED","sourceVid":[]}]},"num_associated_contacts":{"value":"0","timestamp":0,"source":"CALCULATED","sourceId":null,"versions":[{"name":"num_associated_contacts","value":"0","source":"CALCULATED","sourceVid":[]}]},"hs_createdate":{"value":"1532354466560","timestamp":1532354466560,"source":"API","sourceId":null,"versions":[{"name":"hs_createdate","value":"1532354466560","timestamp":1532354466560,"source":"API","sourceVid":[]}]},"createdate":{"value":"1532354466560","timestamp":1532354466560,"source":"API","sourceId":null,"versions":[{"name":"createdate","value":"1532354466560","timestamp":1532354466560,"source":"API","sourceVid":[]}]}},"imports":[],"stateChanges":[]}' + http_version: + recorded_at: Mon, 23 Jul 2018 14:01:06 GMT +- request: + method: put + uri: https://api.hubapi.com/deals/v1/deal/1?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"dealname","value":"Acme Flask"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 23 Jul 2018 14:01:07 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '174' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d037eaba9e8d965d16ab2f38d35d2963f1532354466; expires=Tue, 23-Jul-19 + 14:01:06 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Hubspot-Notfound: + - 'true' + X-Trace: + - 2BB820995C51F157788C2D5F308F35657CAD76F36C000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eead5a6ae86968-CDG + body: + encoding: UTF-8 + string: '{"status":"error","message":"No deal found for dealId=1 portalId=62515","correlationId":"6441c70d-e3bf-4c4c-9424-e7bc3f40779b","requestId":"b103371cc88b771356fc327bb9f27fd6"}' + http_version: + recorded_at: Mon, 23 Jul 2018 14:01:07 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/deal_update_instance.yml b/spec/fixtures/vcr_cassettes/deal_update_instance.yml new file mode 100644 index 00000000..b7acb306 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/deal_update_instance.yml @@ -0,0 +1,133 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.hubapi.com/deals/v1/deal?hapikey=demo + body: + encoding: UTF-8 + string: '{"portalId":62515,"associations":{"associatedCompanyIds":[],"associatedVids":[]},"properties":[]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 23 Jul 2018 14:01:07 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '858' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=dfa1c9adc118515f3942a42b9c63d68b41532354467; expires=Tue, 23-Jul-19 + 14:01:07 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2B9AB51FF7A8162724246FA71D98CD9C3538B0AFE0000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eead5bce5868ae-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"dealId":325398711,"isDeleted":false,"associations":{"associatedVids":[],"associatedCompanyIds":[],"associatedDealIds":[]},"properties":{"hs_lastmodifieddate":{"value":"1532354467246","timestamp":1532354467246,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1532354467246","timestamp":1532354467246,"source":"CALCULATED","sourceVid":[]}]},"hs_createdate":{"value":"1532354467246","timestamp":1532354467246,"source":"API","sourceId":null,"versions":[{"name":"hs_createdate","value":"1532354467246","timestamp":1532354467246,"source":"API","sourceVid":[]}]},"createdate":{"value":"1532354467246","timestamp":1532354467246,"source":"API","sourceId":null,"versions":[{"name":"createdate","value":"1532354467246","timestamp":1532354467246,"source":"API","sourceVid":[]}]}},"imports":[],"stateChanges":[]}' + http_version: + recorded_at: Mon, 23 Jul 2018 14:01:07 GMT +- request: + method: put + uri: https://api.hubapi.com/deals/v1/deal/325398711?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"dealname","value":"Acme Cogs"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 23 Jul 2018 14:01:07 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '1364' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=def32cfc0ac7d775fa6e0c55073205e471532354467; expires=Tue, 23-Jul-19 + 14:01:07 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Trace: + - 2B6BAC6387F4376B55823ABCA4DEB225538F440D54000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eead5d2f5169ac-CDG + body: + encoding: UTF-8 + string: '{"portalId":62515,"dealId":325398711,"isDeleted":false,"associations":{"associatedVids":[],"associatedCompanyIds":[],"associatedDealIds":[]},"properties":{"dealname":{"value":"Acme + Cogs","timestamp":1532354467460,"source":"API","sourceId":null,"versions":[{"name":"dealname","value":"Acme + Cogs","timestamp":1532354467460,"source":"API","sourceVid":[]}]},"hs_lastmodifieddate":{"value":"1532354467460","timestamp":1532354467460,"source":"CALCULATED","sourceId":null,"versions":[{"name":"hs_lastmodifieddate","value":"1532354467460","timestamp":1532354467460,"source":"CALCULATED","sourceVid":[]},{"name":"hs_lastmodifieddate","value":"1532354467246","timestamp":1532354467246,"source":"CALCULATED","sourceVid":[]}]},"num_associated_contacts":{"value":"0","timestamp":0,"source":"CALCULATED","sourceId":null,"versions":[{"name":"num_associated_contacts","value":"0","source":"CALCULATED","sourceVid":[]}]},"hs_createdate":{"value":"1532354467246","timestamp":1532354467246,"source":"API","sourceId":null,"versions":[{"name":"hs_createdate","value":"1532354467246","timestamp":1532354467246,"source":"API","sourceVid":[]}]},"createdate":{"value":"1532354467246","timestamp":1532354467246,"source":"API","sourceId":null,"versions":[{"name":"createdate","value":"1532354467246","timestamp":1532354467246,"source":"API","sourceVid":[]}]}},"imports":[],"stateChanges":[]}' + http_version: + recorded_at: Mon, 23 Jul 2018 14:01:07 GMT +- request: + method: put + uri: https://api.hubapi.com/deals/v1/deal/1?hapikey=demo + body: + encoding: UTF-8 + string: '{"properties":[{"name":"dealname","value":"Acme Cogs"}]}' + headers: + Content-Type: + - application/json + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 23 Jul 2018 14:01:08 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '174' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=def32cfc0ac7d775fa6e0c55073205e471532354467; expires=Tue, 23-Jul-19 + 14:01:07 GMT; path=/; domain=.hubapi.com; HttpOnly + Access-Control-Allow-Credentials: + - 'false' + X-Hubspot-Notfound: + - 'true' + X-Trace: + - 2B22F2391720E2BE6F86B8E6D856AC51297E93BCD1000000000000000000 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 43eead5e883169ac-CDG + body: + encoding: UTF-8 + string: '{"status":"error","message":"No deal found for dealId=1 portalId=62515","correlationId":"0e09d3b2-d6eb-4d00-a897-49510e29ec1b","requestId":"191bb9f1ca021e018250127dbda00a87"}' + http_version: + recorded_at: Mon, 23 Jul 2018 14:01:08 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/lib/hubspot/company_spec.rb b/spec/lib/hubspot/company_spec.rb index e79c5565..dd7168c9 100644 --- a/spec/lib/hubspot/company_spec.rb +++ b/spec/lib/hubspot/company_spec.rb @@ -49,6 +49,24 @@ its(['num_associated_contacts']) { should eql '1' } end + describe ".update!" do + cassette "company_update_class" + let(:company) { Hubspot::Company.create!("New Company #{Time.now.to_i}") } + let(:params) { { name: "Acme Flask", domain: "abcflasks.com" } } + subject { Hubspot::Company.update!(company.vid, params) } + + it { should be_an_instance_of Hubspot::Company } + its(["name"]) { should == "Acme Flask" } + its(["domain"]) { should == "abcflasks.com" } + + context "when the request is not successful" do + let(:company){ Hubspot::Company.new("vid" => "invalid", "properties" => {})} + it "raises an error" do + expect{ subject }.to raise_error Hubspot::RequestError + end + end + end + describe ".find_by_id" do context 'given an uniq id' do cassette "company_find_by_id" @@ -180,8 +198,8 @@ end describe "#update!" do - cassette "company_update" - let(:company){ Hubspot::Company.new(example_company_hash) } + cassette "company_update_instance" + let(:company){ Hubspot::Company.create!("New Company #{Time.now.to_i}") } let(:params){ {name: "Acme Cogs", domain: "abccogs.com"} } subject{ company.update!(params) } diff --git a/spec/lib/hubspot/contact_spec.rb b/spec/lib/hubspot/contact_spec.rb index c7a25423..f7a8d66d 100644 --- a/spec/lib/hubspot/contact_spec.rb +++ b/spec/lib/hubspot/contact_spec.rb @@ -380,20 +380,43 @@ end end + describe '.update!' do + cassette 'contact_update_class' + let(:contact) { Hubspot::Contact.create!("update_class_contact_#{Time.now.to_i}@hsgem.com") } + let(:params) { { firstname: 'Steve', lastname: 'Cunningham' } } + let(:vid_to_update) { contact.vid } + subject { Hubspot::Contact.update!(vid_to_update, params) } + + it 'updates the contact' do + subject + found_contact = Hubspot::Contact.find_by_id(contact.vid) + found_contact['firstname'].should == 'Steve' + found_contact['lastname'].should == 'Cunningham' + end + + context 'when the request is not successful' do + let(:vid_to_update) { 1 } + + it 'raises an error' do + expect{ subject }.to raise_error Hubspot::RequestError + end + end + end + describe '#update!' do - cassette 'contact_update' - let(:contact){ Hubspot::Contact.new(example_contact_hash) } - let(:params){ {firstname: 'Steve', lastname: 'Cunningham'} } - subject{ contact.update!(params) } + cassette 'contact_update_instance' + let(:contact){ Hubspot::Contact.create!("update_instance_contact_#{Time.now.to_i}@hsgem.com") } + let(:params) { { firstname: 'Steve', lastname: 'Cunningham' } } + subject { contact.update!(params) } - it{ should be_an_instance_of Hubspot::Contact } - its(['firstname']){ should == 'Steve' } - its(['lastname']){ should == 'Cunningham' } + it { should be_an_instance_of Hubspot::Contact } + its(['firstname']) { should == 'Steve' } + its(['lastname']) { should == 'Cunningham' } context 'when the request is not successful' do - let(:contact){ Hubspot::Contact.new({'vid' => 'invalid', 'properties' => {}})} + let(:contact) { Hubspot::Contact.new('vid' => 1, 'properties' => {}) } it 'raises an error' do - expect{ subject }.to raise_error Hubspot::RequestError + expect { subject }.to raise_error Hubspot::RequestError end end end diff --git a/spec/lib/hubspot/deal_spec.rb b/spec/lib/hubspot/deal_spec.rb index 3692f3d1..572e9bfd 100644 --- a/spec/lib/hubspot/deal_spec.rb +++ b/spec/lib/hubspot/deal_spec.rb @@ -82,6 +82,44 @@ end end + describe ".update!" do + cassette "deal_update_class" + let(:deal) { Hubspot::Deal.create!(portal_id, [], [], {}) } + let(:params) { { dealname: "Acme Flask" } } + subject { Hubspot::Deal.update!(deal.deal_id, params) } + + it 'updates the deal' do + subject.should be_an_instance_of Hubspot::Deal + subject["dealname"].should == "Acme Flask" + end + + context 'when the request is not successful' do + let(:deal) { Hubspot::Deal.new('portalID' => portal_id, 'dealId' => 1, 'associations' => {}, 'properties' => {}) } + + it 'raises an error' do + expect { subject }.to raise_error Hubspot::RequestError + end + end + end + + describe "#update!" do + cassette "deal_update_instance" + let(:deal) { Hubspot::Deal.create!(portal_id, [], [], {}) } + let(:params) { { dealname: "Acme Cogs" } } + subject { deal.update!(params) } + + it{ should be_an_instance_of Hubspot::Deal } + its(["dealname"]) { should == "Acme Cogs" } + + context 'when the request is not successful' do + let(:deal) { Hubspot::Deal.new('portalID' => portal_id, 'dealId' => 1, 'associations' => {}, 'properties' => {}) } + + it 'raises an error' do + expect { subject }.to raise_error Hubspot::RequestError + end + end + end + describe '#destroy!' do cassette 'destroy_deal'