File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,9 @@ $client->companies->update([
371371 'name' => 'foocorp',
372372]);
373373
374+ /** Delete a company by ID */
375+ $client->companies->delete('531ee472cce572a6ec000006');
376+
374377/** List Companies */
375378$client->companies->getCompanies([]);
376379
Original file line number Diff line number Diff line change @@ -32,6 +32,20 @@ public function update($options)
3232 {
3333 return $ this ->create ($ options );
3434 }
35+
36+ /**
37+ * Deletes a Company.
38+ *
39+ * @see https://developers.intercom.com/intercom-api-reference/reference#delete-a-company
40+ * @param array $options
41+ * @return stdClass
42+ * @throws Exception
43+ */
44+ public function delete ($ id , $ options = [])
45+ {
46+ $ path = $ this ->companyPath ($ id );
47+ return $ this ->client ->delete ($ path , $ options );
48+ }
3549
3650 /**
3751 * Attaches a Contact to a Company.
Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ public function testCompanyGet()
2929 $ companies = new IntercomCompanies ($ this ->client );
3030 $ this ->assertSame ('foo ' , $ companies ->getCompanies ([]));
3131 }
32+
33+ public function testCompanyDelete ()
34+ {
35+ $ this ->client ->method ('delete ' )->willReturn ('foo ' );
36+
37+ $ companies = new IntercomCompanies ($ this ->client );
38+ $ this ->assertSame ('foo ' , $ companies ->delete ('' ));
39+ }
3240
3341 public function testCompanyPath ()
3442 {
You can’t perform that action at this time.
0 commit comments