Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 30, 2024
1 parent 0a41a59 commit 00dfaa7
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 55 deletions.
13 changes: 9 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Types:
- <code><a href="./src/resources/shared.ts">Message</a></code>
- <code><a href="./src/resources/shared.ts">MultipleFilterSearchRequest</a></code>
- <code><a href="./src/resources/shared.ts">Note</a></code>
- <code><a href="./src/resources/shared.ts">PaginatedResponse</a></code>
- <code><a href="./src/resources/shared.ts">PartAttachment</a></code>
- <code><a href="./src/resources/shared.ts">Reference</a></code>
- <code><a href="./src/resources/shared.ts">SearchRequest</a></code>
Expand Down Expand Up @@ -340,32 +339,38 @@ Methods:
Types:

- <code><a href="./src/resources/news/news-items.ts">NewsItem</a></code>
- <code><a href="./src/resources/news/news-items.ts">NewsItemListResponse</a></code>
- <code><a href="./src/resources/news/news-items.ts">NewsItemDeleteResponse</a></code>

Methods:

- <code title="post /news/news_items">client.news.newsItems.<a href="./src/resources/news/news-items.ts">create</a>({ ...params }) -> NewsItem</code>
- <code title="get /news/news_items/{id}">client.news.newsItems.<a href="./src/resources/news/news-items.ts">retrieve</a>(id, { ...params }) -> NewsItem</code>
- <code title="put /news/news_items/{id}">client.news.newsItems.<a href="./src/resources/news/news-items.ts">update</a>(id, { ...params }) -> NewsItem</code>
- <code title="get /news/news_items">client.news.newsItems.<a href="./src/resources/news/news-items.ts">list</a>({ ...params }) -> PaginatedResponse</code>
- <code title="get /news/news_items">client.news.newsItems.<a href="./src/resources/news/news-items.ts">list</a>({ ...params }) -> NewsItemListResponse</code>
- <code title="delete /news/news_items/{id}">client.news.newsItems.<a href="./src/resources/news/news-items.ts">delete</a>(id, { ...params }) -> NewsItemDeleteResponse</code>

## Newsfeeds

Types:

- <code><a href="./src/resources/news/newsfeeds/newsfeeds.ts">Newsfeed</a></code>
- <code><a href="./src/resources/news/newsfeeds/newsfeeds.ts">NewsfeedListResponse</a></code>

Methods:

- <code title="get /news/newsfeeds/{id}">client.news.newsfeeds.<a href="./src/resources/news/newsfeeds/newsfeeds.ts">retrieve</a>(id, { ...params }) -> Newsfeed</code>
- <code title="get /news/newsfeeds">client.news.newsfeeds.<a href="./src/resources/news/newsfeeds/newsfeeds.ts">list</a>({ ...params }) -> PaginatedResponse</code>
- <code title="get /news/newsfeeds">client.news.newsfeeds.<a href="./src/resources/news/newsfeeds/newsfeeds.ts">list</a>({ ...params }) -> NewsfeedListResponse</code>

### Items

Types:

- <code><a href="./src/resources/news/newsfeeds/items.ts">ItemListResponse</a></code>

Methods:

- <code title="get /news/newsfeeds/{id}/items">client.news.newsfeeds.items.<a href="./src/resources/news/newsfeeds/items.ts">list</a>(id, { ...params }) -> PaginatedResponse</code>
- <code title="get /news/newsfeeds/{id}/items">client.news.newsfeeds.items.<a href="./src/resources/news/newsfeeds/items.ts">list</a>(id, { ...params }) -> ItemListResponse</code>

# Notes

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export namespace Intercom {
export import Conversations = API.Conversations;
export import ConversationListResponse = API.ConversationListResponse;
export import ConversationSearchResponse = API.ConversationSearchResponse;
export import ConversationListResponsesCursorPagination = API.ConversationListResponsesCursorPagination;
export import ConversationCreateParams = API.ConversationCreateParams;
export import ConversationRetrieveParams = API.ConversationRetrieveParams;
export import ConversationUpdateParams = API.ConversationUpdateParams;
Expand Down Expand Up @@ -392,7 +393,6 @@ export namespace Intercom {
export import Message = API.Message;
export import MultipleFilterSearchRequest = API.MultipleFilterSearchRequest;
export import Note = API.Note;
export import PaginatedResponse = API.PaginatedResponse;
export import PartAttachment = API.PartAttachment;
export import Reference = API.Reference;
export import SearchRequest = API.SearchRequest;
Expand Down
8 changes: 4 additions & 4 deletions src/resources/conversations/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as ConversationsAPI from './conversations';
import * as Shared from '../shared';
import { ConversationListResponsesCursorPagination } from '../shared';
import * as CustomersAPI from './customers';
import * as PartsAPI from './parts';
import * as ReplyAPI from './reply';
import * as RunAssignmentRulesAPI from './run-assignment-rules';
import * as TagsAPI from './tags';
import * as NewsItemsAPI from '../news/news-items';
import * as NewsfeedsAPI from '../news/newsfeeds/newsfeeds';
import { type CursorPaginationParams } from '../../pagination';
import { CursorPagination, type CursorPaginationParams } from '../../pagination';

export class Conversations extends APIResource {
tags: TagsAPI.Tags = new TagsAPI.Tags(this._client);
Expand Down Expand Up @@ -342,6 +341,8 @@ export class Conversations extends APIResource {
}
}

export class ConversationListResponsesCursorPagination extends CursorPagination<ConversationListResponse> {}

/**
* A News Item is a content type in Intercom enabling you to announce product
* updates, company news, promotions, events and more with your customers.
Expand Down Expand Up @@ -730,6 +731,7 @@ export interface ConversationSearchParams {
export namespace Conversations {
export import ConversationListResponse = ConversationsAPI.ConversationListResponse;
export import ConversationSearchResponse = ConversationsAPI.ConversationSearchResponse;
export import ConversationListResponsesCursorPagination = ConversationsAPI.ConversationListResponsesCursorPagination;
export import ConversationCreateParams = ConversationsAPI.ConversationCreateParams;
export import ConversationRetrieveParams = ConversationsAPI.ConversationRetrieveParams;
export import ConversationUpdateParams = ConversationsAPI.ConversationUpdateParams;
Expand All @@ -750,5 +752,3 @@ export namespace Conversations {
export import CustomerCreateParams = CustomersAPI.CustomerCreateParams;
export import CustomerDeleteParams = CustomersAPI.CustomerDeleteParams;
}

export { ConversationListResponsesCursorPagination };
9 changes: 8 additions & 1 deletion src/resources/news/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export { News } from './news';
export {
NewsItem,
NewsItemListResponse,
NewsItemDeleteResponse,
NewsItemCreateParams,
NewsItemRetrieveParams,
Expand All @@ -11,4 +12,10 @@ export {
NewsItemDeleteParams,
NewsItems,
} from './news-items';
export { Newsfeed, NewsfeedRetrieveParams, NewsfeedListParams, Newsfeeds } from './newsfeeds/index';
export {
Newsfeed,
NewsfeedListResponse,
NewsfeedRetrieveParams,
NewsfeedListParams,
Newsfeeds,
} from './newsfeeds/index';
36 changes: 33 additions & 3 deletions src/resources/news/news-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as NewsItemsAPI from './news-items';
import * as Shared from '../shared';
import * as NewsfeedsAPI from './newsfeeds/newsfeeds';

export class NewsItems extends APIResource {
/**
Expand Down Expand Up @@ -73,12 +74,12 @@ export class NewsItems extends APIResource {
/**
* You can fetch a list of all news items
*/
list(params?: NewsItemListParams, options?: Core.RequestOptions): Core.APIPromise<Shared.PaginatedResponse>;
list(options?: Core.RequestOptions): Core.APIPromise<Shared.PaginatedResponse>;
list(params?: NewsItemListParams, options?: Core.RequestOptions): Core.APIPromise<NewsItemListResponse>;
list(options?: Core.RequestOptions): Core.APIPromise<NewsItemListResponse>;
list(
params: NewsItemListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<Shared.PaginatedResponse> {
): Core.APIPromise<NewsItemListResponse> {
if (isRequestOptions(params)) {
return this.list({}, params);
}
Expand Down Expand Up @@ -224,6 +225,34 @@ export namespace NewsItem {
}
}

/**
* Paginated Response
*/
export interface NewsItemListResponse {
/**
* An array of Objects
*/
data?: Array<NewsItem | NewsfeedsAPI.Newsfeed>;

/**
* Cursor-based pagination is a technique used in the Intercom API to navigate
* through large amounts of data. A "cursor" or pointer is used to keep track of
* the current position in the result set, allowing the API to return the data in
* small chunks or "pages" as needed.
*/
pages?: Shared.CursorPages | null;

/**
* A count of the total number of objects.
*/
total_count?: number;

/**
* The type of object
*/
type?: 'list' | 'conversation.list';
}

/**
* Response returned when an object is deleted
*/
Expand Down Expand Up @@ -506,6 +535,7 @@ export interface NewsItemDeleteParams {

export namespace NewsItems {
export import NewsItem = NewsItemsAPI.NewsItem;
export import NewsItemListResponse = NewsItemsAPI.NewsItemListResponse;
export import NewsItemDeleteResponse = NewsItemsAPI.NewsItemDeleteResponse;
export import NewsItemCreateParams = NewsItemsAPI.NewsItemCreateParams;
export import NewsItemRetrieveParams = NewsItemsAPI.NewsItemRetrieveParams;
Expand Down
2 changes: 2 additions & 0 deletions src/resources/news/news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class News extends APIResource {
export namespace News {
export import NewsItems = NewsItemsAPI.NewsItems;
export import NewsItem = NewsItemsAPI.NewsItem;
export import NewsItemListResponse = NewsItemsAPI.NewsItemListResponse;
export import NewsItemDeleteResponse = NewsItemsAPI.NewsItemDeleteResponse;
export import NewsItemCreateParams = NewsItemsAPI.NewsItemCreateParams;
export import NewsItemRetrieveParams = NewsItemsAPI.NewsItemRetrieveParams;
Expand All @@ -20,6 +21,7 @@ export namespace News {
export import NewsItemDeleteParams = NewsItemsAPI.NewsItemDeleteParams;
export import Newsfeeds = NewsfeedsAPI.Newsfeeds;
export import Newsfeed = NewsfeedsAPI.Newsfeed;
export import NewsfeedListResponse = NewsfeedsAPI.NewsfeedListResponse;
export import NewsfeedRetrieveParams = NewsfeedsAPI.NewsfeedRetrieveParams;
export import NewsfeedListParams = NewsfeedsAPI.NewsfeedListParams;
}
10 changes: 8 additions & 2 deletions src/resources/news/newsfeeds/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { ItemListParams, Items } from './items';
export { Newsfeed, NewsfeedRetrieveParams, NewsfeedListParams, Newsfeeds } from './newsfeeds';
export { ItemListResponse, ItemListParams, Items } from './items';
export {
Newsfeed,
NewsfeedListResponse,
NewsfeedRetrieveParams,
NewsfeedListParams,
Newsfeeds,
} from './newsfeeds';
41 changes: 34 additions & 7 deletions src/resources/news/newsfeeds/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ import { isRequestOptions } from '../../../core';
import * as Core from '../../../core';
import * as ItemsAPI from './items';
import * as Shared from '../../shared';
import * as NewsItemsAPI from '../news-items';
import * as NewsfeedsAPI from './newsfeeds';

export class Items extends APIResource {
/**
* You can fetch a list of all news items that are live on a given newsfeed
*/
list(
id: string,
params?: ItemListParams,
options?: Core.RequestOptions,
): Core.APIPromise<Shared.PaginatedResponse>;
list(id: string, options?: Core.RequestOptions): Core.APIPromise<Shared.PaginatedResponse>;
list(id: string, params?: ItemListParams, options?: Core.RequestOptions): Core.APIPromise<ItemListResponse>;
list(id: string, options?: Core.RequestOptions): Core.APIPromise<ItemListResponse>;
list(
id: string,
params: ItemListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<Shared.PaginatedResponse> {
): Core.APIPromise<ItemListResponse> {
if (isRequestOptions(params)) {
return this.list(id, {}, params);
}
Expand All @@ -37,6 +35,34 @@ export class Items extends APIResource {
}
}

/**
* Paginated Response
*/
export interface ItemListResponse {
/**
* An array of Objects
*/
data?: Array<NewsItemsAPI.NewsItem | NewsfeedsAPI.Newsfeed>;

/**
* Cursor-based pagination is a technique used in the Intercom API to navigate
* through large amounts of data. A "cursor" or pointer is used to keep track of
* the current position in the result set, allowing the API to return the data in
* small chunks or "pages" as needed.
*/
pages?: Shared.CursorPages | null;

/**
* A count of the total number of objects.
*/
total_count?: number;

/**
* The type of object
*/
type?: 'list' | 'conversation.list';
}

export interface ItemListParams {
/**
* Intercom API version.By default, it's equal to the version set in the app
Expand Down Expand Up @@ -64,5 +90,6 @@ export interface ItemListParams {
}

export namespace Items {
export import ItemListResponse = ItemsAPI.ItemListResponse;
export import ItemListParams = ItemsAPI.ItemListParams;
}
37 changes: 34 additions & 3 deletions src/resources/news/newsfeeds/newsfeeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { isRequestOptions } from '../../../core';
import * as Core from '../../../core';
import * as NewsfeedsAPI from './newsfeeds';
import * as Shared from '../../shared';
import * as NewsItemsAPI from '../news-items';
import * as ItemsAPI from './items';

export class Newsfeeds extends APIResource {
Expand Down Expand Up @@ -42,12 +43,12 @@ export class Newsfeeds extends APIResource {
/**
* You can fetch a list of all newsfeeds
*/
list(params?: NewsfeedListParams, options?: Core.RequestOptions): Core.APIPromise<Shared.PaginatedResponse>;
list(options?: Core.RequestOptions): Core.APIPromise<Shared.PaginatedResponse>;
list(params?: NewsfeedListParams, options?: Core.RequestOptions): Core.APIPromise<NewsfeedListResponse>;
list(options?: Core.RequestOptions): Core.APIPromise<NewsfeedListResponse>;
list(
params: NewsfeedListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<Shared.PaginatedResponse> {
): Core.APIPromise<NewsfeedListResponse> {
if (isRequestOptions(params)) {
return this.list({}, params);
}
Expand Down Expand Up @@ -98,6 +99,34 @@ export interface Newsfeed {
updated_at?: number;
}

/**
* Paginated Response
*/
export interface NewsfeedListResponse {
/**
* An array of Objects
*/
data?: Array<NewsItemsAPI.NewsItem | Newsfeed>;

/**
* Cursor-based pagination is a technique used in the Intercom API to navigate
* through large amounts of data. A "cursor" or pointer is used to keep track of
* the current position in the result set, allowing the API to return the data in
* small chunks or "pages" as needed.
*/
pages?: Shared.CursorPages | null;

/**
* A count of the total number of objects.
*/
total_count?: number;

/**
* The type of object
*/
type?: 'list' | 'conversation.list';
}

export interface NewsfeedRetrieveParams {
/**
* Intercom API version.By default, it's equal to the version set in the app
Expand Down Expand Up @@ -152,8 +181,10 @@ export interface NewsfeedListParams {

export namespace Newsfeeds {
export import Newsfeed = NewsfeedsAPI.Newsfeed;
export import NewsfeedListResponse = NewsfeedsAPI.NewsfeedListResponse;
export import NewsfeedRetrieveParams = NewsfeedsAPI.NewsfeedRetrieveParams;
export import NewsfeedListParams = NewsfeedsAPI.NewsfeedListParams;
export import Items = ItemsAPI.Items;
export import ItemListResponse = ItemsAPI.ItemListResponse;
export import ItemListParams = ItemsAPI.ItemListParams;
}
Loading

0 comments on commit 00dfaa7

Please sign in to comment.