You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update the company.update method
Makes it clearer that this endpoint uses the Intercom ID for a company,
and not the companyID that is optionally provided during creation
closes#356
* Add a createOrUpdate company method
This method actually creates or updates, so add a more appropriately named method and mark the old one as deprecated/
* @deprecated Use `client.companies.createOrUpdate()` instead.
26
+
*/
24
27
create({
25
28
createdAt,
26
29
companyId,
@@ -31,6 +34,34 @@ export default class Company {
31
34
website,
32
35
industry,
33
36
customAttributes,
37
+
}: CreateCompanyData){
38
+
returnthis.createOrUpdate({
39
+
createdAt,
40
+
companyId,
41
+
name,
42
+
monthlySpend,
43
+
plan,
44
+
size,
45
+
website,
46
+
industry,
47
+
customAttributes,
48
+
});
49
+
}
50
+
/**
51
+
* Create or update a company by its `companyId`.
52
+
*
53
+
* Companies are looked up via the `companyId` field. If a company with the given `companyId` does not exist, it will be created. If a company with the given `companyId` does exist, it will be updated.
54
+
**/
55
+
createOrUpdate({
56
+
createdAt,
57
+
companyId,
58
+
name,
59
+
monthlySpend,
60
+
plan,
61
+
size,
62
+
website,
63
+
industry,
64
+
customAttributes,
34
65
}: CreateCompanyData){
35
66
constdata={
36
67
remote_created_at: createdAt,
@@ -49,9 +80,23 @@ export default class Company {
49
80
data,
50
81
});
51
82
}
83
+
84
+
/**
85
+
* Update a single company by its `id`.
86
+
* @param id - The `id` field is required for updating a company. This is distinct from the `companyId` field on the Company object , which is an identifier for the company in your database.
87
+
* @param createdAt - The time the company was created by you.
88
+
* @param name - The name of the company.
89
+
* @param monthlySpend - The amount the company spends on your product each month. How much revenue the company generates for your business.
90
+
* Note that this will truncate floats. i.e. it only allow for whole integers, 155.98 will be truncated to 155. Note that this has an upper limit of 2**31-1 or 2147483647..
91
+
* @param plan - The name of the plan you have associated with the company.
92
+
* @param size - The number of employees the company has.
93
+
* @param website -The URL for this company's website. Please note that the value specified here is not validated. Accepts any string.
94
+
* @param industry - The industry the company operates in.
95
+
* @param customAttributes - A hash of key/value pairs containing any other data about the company you want Intercom to store.
0 commit comments