Skip to content

Commit f74126d

Browse files
committed
feat(api): update via SDK Studio
1 parent 62e438d commit f74126d

File tree

6 files changed

+3
-171
lines changed

6 files changed

+3
-171
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 108
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-74554ca4b1e947254782b93352448c7a35a528fc0f88e9686e91f77e682b1669.yml
1+
configured_endpoints: 106
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-a202b2b4aa0e356eb61376a3bf484132be2e9e3bff3796e1fe4606ab2a3734fd.yml

api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ Types:
168168

169169
Methods:
170170

171-
- <code title="post /contacts/{id}/companies">client.contacts.companies.<a href="./src/resources/contacts/companies.ts">create</a>(id, { ...params }) -> Company</code>
172-
- <code title="get /contacts/{id}/companies">client.contacts.companies.<a href="./src/resources/contacts/companies.ts">list</a>(id, { ...params }) -> ContactAttachedCompanies</code>
173171
- <code title="delete /contacts/{contact_id}/companies/{id}">client.contacts.companies.<a href="./src/resources/contacts/companies.ts">delete</a>(contactId, id, { ...params }) -> Company</code>
174172

175173
## Notes

src/resources/contacts/companies.ts

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,6 @@ import * as CompaniesAPI from './companies';
77
import * as Shared from '../shared';
88

99
export class Companies extends APIResource {
10-
/**
11-
* You can attach a company to a single contact.
12-
*/
13-
create(
14-
id: string,
15-
params: CompanyCreateParams,
16-
options?: Core.RequestOptions,
17-
): Core.APIPromise<Shared.Company> {
18-
const { company_id, 'Intercom-Version': intercomVersion, ...body } = params;
19-
return this._client.post(`/contacts/${id}/companies`, {
20-
body: { id: company_id, ...body },
21-
...options,
22-
headers: {
23-
...(intercomVersion?.toString() != null ?
24-
{ 'Intercom-Version': intercomVersion?.toString() }
25-
: undefined),
26-
...options?.headers,
27-
},
28-
});
29-
}
30-
31-
/**
32-
* You can fetch a list of companies that are associated to a contact.
33-
*/
34-
list(
35-
id: string,
36-
params?: CompanyListParams,
37-
options?: Core.RequestOptions,
38-
): Core.APIPromise<ContactAttachedCompanies>;
39-
list(id: string, options?: Core.RequestOptions): Core.APIPromise<ContactAttachedCompanies>;
40-
list(
41-
id: string,
42-
params: CompanyListParams | Core.RequestOptions = {},
43-
options?: Core.RequestOptions,
44-
): Core.APIPromise<ContactAttachedCompanies> {
45-
if (isRequestOptions(params)) {
46-
return this.list(id, {}, params);
47-
}
48-
const { 'Intercom-Version': intercomVersion } = params;
49-
return this._client.get(`/contacts/${id}/companies`, {
50-
...options,
51-
headers: {
52-
...(intercomVersion?.toString() != null ?
53-
{ 'Intercom-Version': intercomVersion?.toString() }
54-
: undefined),
55-
...options?.headers,
56-
},
57-
});
58-
}
59-
6010
/**
6111
* You can detach a company from a single contact.
6212
*/
@@ -145,63 +95,6 @@ export namespace ContactAttachedCompanies {
14595
}
14696
}
14797

148-
export interface CompanyCreateParams {
149-
/**
150-
* Body param: The unique identifier for the company which is given by Intercom
151-
*/
152-
company_id: string;
153-
154-
/**
155-
* Header param: Intercom API version.By default, it's equal to the version set in
156-
* the app package.
157-
*/
158-
'Intercom-Version'?:
159-
| '1.0'
160-
| '1.1'
161-
| '1.2'
162-
| '1.3'
163-
| '1.4'
164-
| '2.0'
165-
| '2.1'
166-
| '2.2'
167-
| '2.3'
168-
| '2.4'
169-
| '2.5'
170-
| '2.6'
171-
| '2.7'
172-
| '2.8'
173-
| '2.9'
174-
| '2.10'
175-
| '2.11'
176-
| 'Unstable';
177-
}
178-
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-
20598
export interface CompanyDeleteParams {
20699
/**
207100
* Intercom API version.By default, it's equal to the version set in the app
@@ -230,7 +123,5 @@ export interface CompanyDeleteParams {
230123

231124
export namespace Companies {
232125
export import ContactAttachedCompanies = CompaniesAPI.ContactAttachedCompanies;
233-
export import CompanyCreateParams = CompaniesAPI.CompanyCreateParams;
234-
export import CompanyListParams = CompaniesAPI.CompanyListParams;
235126
export import CompanyDeleteParams = CompaniesAPI.CompanyDeleteParams;
236127
}

src/resources/contacts/contacts.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,6 @@ export namespace Contacts {
963963
export import ContactUnarchiveParams = ContactsAPI.ContactUnarchiveParams;
964964
export import Companies = CompaniesAPI.Companies;
965965
export import ContactAttachedCompanies = CompaniesAPI.ContactAttachedCompanies;
966-
export import CompanyCreateParams = CompaniesAPI.CompanyCreateParams;
967-
export import CompanyListParams = CompaniesAPI.CompanyListParams;
968966
export import CompanyDeleteParams = CompaniesAPI.CompanyDeleteParams;
969967
export import Notes = NotesAPI.Notes;
970968
export import NoteList = NotesAPI.NoteList;

src/resources/contacts/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ export {
1616
ContactUnarchiveParams,
1717
Contacts,
1818
} from './contacts';
19-
export {
20-
ContactAttachedCompanies,
21-
CompanyCreateParams,
22-
CompanyListParams,
23-
CompanyDeleteParams,
24-
Companies,
25-
} from './companies';
19+
export { ContactAttachedCompanies, CompanyDeleteParams, Companies } from './companies';
2620
export { ContactSegments, SegmentListParams, Segments } from './segments';
2721
export { NoteList, NoteCreateParams, NoteListParams, Notes } from './notes';
2822
export {

tests/api-resources/contacts/companies.test.ts

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,6 @@ const intercom = new Intercom({
99
});
1010

1111
describe('resource companies', () => {
12-
test('create: only required params', async () => {
13-
const responsePromise = intercom.contacts.companies.create('string', {
14-
company_id: '6657add46abd0167d9419cd2',
15-
});
16-
const rawResponse = await responsePromise.asResponse();
17-
expect(rawResponse).toBeInstanceOf(Response);
18-
const response = await responsePromise;
19-
expect(response).not.toBeInstanceOf(Response);
20-
const dataAndResponse = await responsePromise.withResponse();
21-
expect(dataAndResponse.data).toBe(response);
22-
expect(dataAndResponse.response).toBe(rawResponse);
23-
});
24-
25-
test('create: required and optional params', async () => {
26-
const response = await intercom.contacts.companies.create('string', {
27-
company_id: '6657add46abd0167d9419cd2',
28-
'Intercom-Version': '2.11',
29-
});
30-
});
31-
32-
test('list', async () => {
33-
const responsePromise = intercom.contacts.companies.list('63a07ddf05a32042dffac965');
34-
const rawResponse = await responsePromise.asResponse();
35-
expect(rawResponse).toBeInstanceOf(Response);
36-
const response = await responsePromise;
37-
expect(response).not.toBeInstanceOf(Response);
38-
const dataAndResponse = await responsePromise.withResponse();
39-
expect(dataAndResponse.data).toBe(response);
40-
expect(dataAndResponse.response).toBe(rawResponse);
41-
});
42-
43-
test('list: request options instead of params are passed correctly', async () => {
44-
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
45-
await expect(
46-
intercom.contacts.companies.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
47-
).rejects.toThrow(Intercom.NotFoundError);
48-
});
49-
50-
test('list: request options and params are passed correctly', async () => {
51-
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
52-
await expect(
53-
intercom.contacts.companies.list(
54-
'63a07ddf05a32042dffac965',
55-
{ 'Intercom-Version': '2.11' },
56-
{ path: '/_stainless_unknown_path' },
57-
),
58-
).rejects.toThrow(Intercom.NotFoundError);
59-
});
60-
6112
test('delete', async () => {
6213
const responsePromise = intercom.contacts.companies.delete(
6314
'58a430d35458202d41b1e65b',

0 commit comments

Comments
 (0)