@@ -28,6 +28,35 @@ export class Companies extends APIResource {
2828 } ) ;
2929 }
3030
31+ /**
32+ * You can fetch a list of companies that are associated to a contact.
33+ */
34+ list (
35+ contactId : string ,
36+ params ?: CompanyListParams ,
37+ options ?: Core . RequestOptions ,
38+ ) : Core . APIPromise < ContactAttachedCompanies > ;
39+ list ( contactId : string , options ?: Core . RequestOptions ) : Core . APIPromise < ContactAttachedCompanies > ;
40+ list (
41+ contactId : string ,
42+ params : CompanyListParams | Core . RequestOptions = { } ,
43+ options ?: Core . RequestOptions ,
44+ ) : Core . APIPromise < ContactAttachedCompanies > {
45+ if ( isRequestOptions ( params ) ) {
46+ return this . list ( contactId , { } , params ) ;
47+ }
48+ const { 'Intercom-Version' : intercomVersion } = params ;
49+ return this . _client . get ( `/contacts/${ contactId } /companies` , {
50+ ...options ,
51+ headers : {
52+ ...( intercomVersion ?. toString ( ) != null ?
53+ { 'Intercom-Version' : intercomVersion ?. toString ( ) }
54+ : undefined ) ,
55+ ...options ?. headers ,
56+ } ,
57+ } ) ;
58+ }
59+
3160 /**
3261 * You can detach a company from a single contact.
3362 */
@@ -147,6 +176,32 @@ export interface CompanyCreateParams {
147176 | 'Unstable' ;
148177}
149178
179+ export interface CompanyListParams {
180+ /**
181+ * Intercom API version.By default, it's equal to the version set in the app
182+ * package.
183+ */
184+ 'Intercom-Version' ?:
185+ | '1.0'
186+ | '1.1'
187+ | '1.2'
188+ | '1.3'
189+ | '1.4'
190+ | '2.0'
191+ | '2.1'
192+ | '2.2'
193+ | '2.3'
194+ | '2.4'
195+ | '2.5'
196+ | '2.6'
197+ | '2.7'
198+ | '2.8'
199+ | '2.9'
200+ | '2.10'
201+ | '2.11'
202+ | 'Unstable' ;
203+ }
204+
150205export interface CompanyDeleteParams {
151206 /**
152207 * Intercom API version.By default, it's equal to the version set in the app
@@ -176,5 +231,6 @@ export interface CompanyDeleteParams {
176231export namespace Companies {
177232 export import ContactAttachedCompanies = CompaniesAPI . ContactAttachedCompanies ;
178233 export import CompanyCreateParams = CompaniesAPI . CompanyCreateParams ;
234+ export import CompanyListParams = CompaniesAPI . CompanyListParams ;
179235 export import CompanyDeleteParams = CompaniesAPI . CompanyDeleteParams ;
180236}
0 commit comments