Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 10, 2024
1 parent b2b723d commit 5bf09b4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 42 deletions.
10 changes: 5 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3619,17 +3619,17 @@ Methods:
Types:

- <code><a href="./src/resources/rules/lists/lists.ts">Hostname</a></code>
- <code><a href="./src/resources/rules/lists/lists.ts">ListsList</a></code>
- <code><a href="./src/resources/rules/lists/lists.ts">Redirect</a></code>
- <code><a href="./src/resources/rules/lists/lists.ts">RuleList</a></code>
- <code><a href="./src/resources/rules/lists/lists.ts">ListDeleteResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">create</a>({ ...params }) -> RuleList | null</code>
- <code title="put /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">update</a>(listId, { ...params }) -> RuleList | null</code>
- <code title="get /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">list</a>({ ...params }) -> RuleListsSinglePage</code>
- <code title="post /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">create</a>({ ...params }) -> ListsList | null</code>
- <code title="put /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">update</a>(listId, { ...params }) -> ListsList | null</code>
- <code title="get /accounts/{account_id}/rules/lists">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">list</a>({ ...params }) -> ListsListsSinglePage</code>
- <code title="delete /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">delete</a>(listId, { ...params }) -> ListDeleteResponse | null</code>
- <code title="get /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">get</a>(listId, { ...params }) -> RuleList | null</code>
- <code title="get /accounts/{account_id}/rules/lists/{list_id}">client.rules.lists.<a href="./src/resources/rules/lists/lists.ts">get</a>(listId, { ...params }) -> ListsList | null</code>

### BulkOperations

Expand Down
4 changes: 2 additions & 2 deletions src/resources/rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

export {
Hostname,
ListsList,
Redirect,
RuleList,
ListDeleteResponse,
ListCreateParams,
ListUpdateParams,
ListListParams,
ListDeleteParams,
ListGetParams,
RuleListsSinglePage,
ListsListsSinglePage,
Lists,
} from './lists/index';
export { Rules } from './rules';
4 changes: 2 additions & 2 deletions src/resources/rules/lists/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

export {
Hostname,
ListsList,
Redirect,
RuleList,
ListDeleteResponse,
ListCreateParams,
ListUpdateParams,
ListListParams,
ListDeleteParams,
ListGetParams,
RuleListsSinglePage,
ListsListsSinglePage,
Lists,
} from './lists';
export {
Expand Down
62 changes: 31 additions & 31 deletions src/resources/rules/lists/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export class Lists extends APIResource {
/**
* Creates a new list of the specified type.
*/
create(params: ListCreateParams, options?: Core.RequestOptions): Core.APIPromise<RuleList | null> {
create(params: ListCreateParams, options?: Core.RequestOptions): Core.APIPromise<ListsList | null> {
const { account_id, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/rules/lists`, { body, ...options }) as Core.APIPromise<{
result: RuleList | null;
result: ListsList | null;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand All @@ -30,13 +30,13 @@ export class Lists extends APIResource {
listId: string,
params: ListUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<RuleList | null> {
): Core.APIPromise<ListsList | null> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}/rules/lists/${listId}`, {
body,
...options,
}) as Core.APIPromise<{ result: RuleList | null }>
}) as Core.APIPromise<{ result: ListsList | null }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -46,9 +46,9 @@ export class Lists extends APIResource {
list(
params: ListListParams,
options?: Core.RequestOptions,
): Core.PagePromise<RuleListsSinglePage, RuleList> {
): Core.PagePromise<ListsListsSinglePage, ListsList> {
const { account_id } = params;
return this._client.getAPIList(`/accounts/${account_id}/rules/lists`, RuleListsSinglePage, options);
return this._client.getAPIList(`/accounts/${account_id}/rules/lists`, ListsListsSinglePage, options);
}

/**
Expand All @@ -75,17 +75,17 @@ export class Lists extends APIResource {
listId: string,
params: ListGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<RuleList | null> {
): Core.APIPromise<ListsList | null> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/rules/lists/${listId}`, options) as Core.APIPromise<{
result: RuleList | null;
result: ListsList | null;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export class RuleListsSinglePage extends SinglePage<RuleList> {}
export class ListsListsSinglePage extends SinglePage<ListsList> {}

/**
* Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
Expand All @@ -95,26 +95,7 @@ export interface Hostname {
url_hostname: string;
}

/**
* The definition of the redirect.
*/
export interface Redirect {
source_url: string;

target_url: string;

include_subdomains?: boolean;

preserve_path_suffix?: boolean;

preserve_query_string?: boolean;

status_code?: 301 | 302 | 307 | 308;

subpath_matching?: boolean;
}

export interface RuleList {
export interface ListsList {
/**
* The unique ID of the list.
*/
Expand Down Expand Up @@ -157,6 +138,25 @@ export interface RuleList {
num_referencing_filters?: number;
}

/**
* The definition of the redirect.
*/
export interface Redirect {
source_url: string;

target_url: string;

include_subdomains?: boolean;

preserve_path_suffix?: boolean;

preserve_query_string?: boolean;

status_code?: 301 | 302 | 307 | 308;

subpath_matching?: boolean;
}

export interface ListDeleteResponse {
/**
* The unique ID of the item in the List.
Expand Down Expand Up @@ -228,10 +228,10 @@ export interface ListGetParams {

export namespace Lists {
export import Hostname = ListsAPI.Hostname;
export import ListsList = ListsAPI.ListsList;
export import Redirect = ListsAPI.Redirect;
export import RuleList = ListsAPI.RuleList;
export import ListDeleteResponse = ListsAPI.ListDeleteResponse;
export import RuleListsSinglePage = ListsAPI.RuleListsSinglePage;
export import ListsListsSinglePage = ListsAPI.ListsListsSinglePage;
export import ListCreateParams = ListsAPI.ListCreateParams;
export import ListUpdateParams = ListsAPI.ListUpdateParams;
export import ListListParams = ListsAPI.ListListParams;
Expand Down
4 changes: 2 additions & 2 deletions src/resources/rules/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export class Rules extends APIResource {
export namespace Rules {
export import Lists = ListsAPI.Lists;
export import Hostname = ListsAPI.Hostname;
export import ListsList = ListsAPI.ListsList;
export import Redirect = ListsAPI.Redirect;
export import RuleList = ListsAPI.RuleList;
export import ListDeleteResponse = ListsAPI.ListDeleteResponse;
export import RuleListsSinglePage = ListsAPI.RuleListsSinglePage;
export import ListsListsSinglePage = ListsAPI.ListsListsSinglePage;
export import ListCreateParams = ListsAPI.ListCreateParams;
export import ListUpdateParams = ListsAPI.ListUpdateParams;
export import ListListParams = ListsAPI.ListListParams;
Expand Down

0 comments on commit 5bf09b4

Please sign in to comment.