diff --git a/codegen/crm/lists/apis/ListsApi.ts b/codegen/crm/lists/apis/ListsApi.ts index dc50b6afd..dd9229526 100644 --- a/codegen/crm/lists/apis/ListsApi.ts +++ b/codegen/crm/lists/apis/ListsApi.ts @@ -22,44 +22,6 @@ import { ListsByIdResponse } from '../models/ListsByIdResponse'; */ export class ListsApiRequestFactory extends BaseAPIRequestFactory { - /** - * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. - * Delete a List - * @param listId The **ILS ID** of the list to delete. - */ - public async _delete(listId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new RequiredError("ListsApi", "_delete", "listId"); - } - - - // Path Params - const localVarPath = '/crm/v3/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - - // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); - requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - - - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default - if (defaultAuth?.applySecurityAuthentication) { - await defaultAuth?.applySecurityAuthentication(requestContext); - } - - return requestContext; - } - /** * Create a new list with the provided object list definition. * Create List @@ -298,6 +260,44 @@ export class ListsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. + * Delete a List + * @param listId The **ILS ID** of the list to delete. + */ + public async remove(listId: number, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new RequiredError("ListsApi", "remove", "listId"); + } + + + // Path Params + const localVarPath = '/crm/v3/lists/{listId}' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + /** * Restore a previously deleted list by **ILS list ID**. Deleted lists are eligible to be restored up-to 90-days after the list has been deleted. * Restore a List @@ -455,38 +455,6 @@ export class ListsApiRequestFactory extends BaseAPIRequestFactory { export class ListsApiResponseProcessor { - /** - * Unwraps the actual response sent by the server from the response context and deserializes the response content - * to the expected objects - * - * @params response Response returned by the server for a request to _delete - * @throws ApiException if the response code was not in [200, 299] - */ - public async _delete(response: ResponseContext): Promise { - const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("204", response.httpStatusCode)) { - return; - } - if (isCodeInRange("0", response.httpStatusCode)) { - const body: Error = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "Error", "" - ) as Error; - throw new ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); - } - - // Work around for missing responses in specification, e.g. for petstore.yaml - if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: void = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "void", "" - ) as void; - return body; - } - - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); - } - /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -667,6 +635,38 @@ export class ListsApiResponseProcessor { throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to remove + * @throws ApiException if the response code was not in [200, 299] + */ + public async remove(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return; + } + if (isCodeInRange("0", response.httpStatusCode)) { + const body: Error = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Error", "" + ) as Error; + throw new ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return body; + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects diff --git a/codegen/crm/lists/apis/MembershipsApi.ts b/codegen/crm/lists/apis/MembershipsApi.ts index 10c2ca0ca..1aa8b3f41 100644 --- a/codegen/crm/lists/apis/MembershipsApi.ts +++ b/codegen/crm/lists/apis/MembershipsApi.ts @@ -175,44 +175,6 @@ export class MembershipsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } - /** - * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. - * Delete All Records from a List - * @param listId The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. - */ - public async deleteAll(listId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new RequiredError("MembershipsApi", "deleteAll", "listId"); - } - - - // Path Params - const localVarPath = '/crm/v3/lists/{listId}/memberships' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - - // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); - requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - - - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default - if (defaultAuth?.applySecurityAuthentication) { - await defaultAuth?.applySecurityAuthentication(requestContext); - } - - return requestContext; - } - /** * Fetch the memberships of a list in order sorted by the `recordId` of the records in the list. The `recordId`s are sorted in *ascending* order if an `after` offset or no offset is provided. If only a `before` offset is provided, then the records are sorted in *descending* order. The `after` offset parameter will take precedence over the `before` offset in a case where both are provided. * Fetch List Memberships Ordered by ID @@ -328,6 +290,44 @@ export class MembershipsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. + * Delete All Records from a List + * @param listId The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. + */ + public async removeAll(listId: number, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new RequiredError("MembershipsApi", "removeAll", "listId"); + } + + + // Path Params + const localVarPath = '/crm/v3/lists/{listId}/memberships' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + } export class MembershipsApiResponseProcessor { @@ -440,13 +440,17 @@ export class MembershipsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteAll + * @params response Response returned by the server for a request to getPage * @throws ApiException if the response code was not in [200, 299] */ - public async deleteAll(response: ResponseContext): Promise { + public async getPage(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("204", response.httpStatusCode)) { - return; + if (isCodeInRange("200", response.httpStatusCode)) { + const body: CollectionResponseLong = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CollectionResponseLong", "" + ) as CollectionResponseLong; + return body; } if (isCodeInRange("0", response.httpStatusCode)) { const body: Error = ObjectSerializer.deserialize( @@ -458,10 +462,10 @@ export class MembershipsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: void = ObjectSerializer.deserialize( + const body: CollectionResponseLong = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "void", "" - ) as void; + "CollectionResponseLong", "" + ) as CollectionResponseLong; return body; } @@ -472,16 +476,16 @@ export class MembershipsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getPage + * @params response Response returned by the server for a request to remove * @throws ApiException if the response code was not in [200, 299] */ - public async getPage(response: ResponseContext): Promise { + public async remove(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { - const body: CollectionResponseLong = ObjectSerializer.deserialize( + const body: MembershipsUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CollectionResponseLong", "" - ) as CollectionResponseLong; + "MembershipsUpdateResponse", "" + ) as MembershipsUpdateResponse; return body; } if (isCodeInRange("0", response.httpStatusCode)) { @@ -494,10 +498,10 @@ export class MembershipsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: CollectionResponseLong = ObjectSerializer.deserialize( + const body: MembershipsUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CollectionResponseLong", "" - ) as CollectionResponseLong; + "MembershipsUpdateResponse", "" + ) as MembershipsUpdateResponse; return body; } @@ -508,17 +512,13 @@ export class MembershipsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to remove + * @params response Response returned by the server for a request to removeAll * @throws ApiException if the response code was not in [200, 299] */ - public async remove(response: ResponseContext): Promise { + public async removeAll(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("200", response.httpStatusCode)) { - const body: MembershipsUpdateResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "MembershipsUpdateResponse", "" - ) as MembershipsUpdateResponse; - return body; + if (isCodeInRange("204", response.httpStatusCode)) { + return; } if (isCodeInRange("0", response.httpStatusCode)) { const body: Error = ObjectSerializer.deserialize( @@ -530,10 +530,10 @@ export class MembershipsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: MembershipsUpdateResponse = ObjectSerializer.deserialize( + const body: void = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MembershipsUpdateResponse", "" - ) as MembershipsUpdateResponse; + "void", "" + ) as void; return body; } diff --git a/codegen/crm/lists/types/ObjectParamAPI.ts b/codegen/crm/lists/types/ObjectParamAPI.ts index 6d36ccfcc..955695783 100644 --- a/codegen/crm/lists/types/ObjectParamAPI.ts +++ b/codegen/crm/lists/types/ObjectParamAPI.ts @@ -15,15 +15,6 @@ import { MembershipsUpdateResponse } from '../models/MembershipsUpdateResponse'; import { ObservableListsApi } from "./ObservableAPI"; import { ListsApiRequestFactory, ListsApiResponseProcessor} from "../apis/ListsApi"; -export interface ListsApiDeleteRequest { - /** - * The **ILS ID** of the list to delete. - * @type number - * @memberof ListsApi_delete - */ - listId: number -} - export interface ListsApiCreateRequest { /** * @@ -93,6 +84,15 @@ export interface ListsApiGetByNameRequest { includeFilters?: boolean } +export interface ListsApiRemoveRequest { + /** + * The **ILS ID** of the list to delete. + * @type number + * @memberof ListsApiremove + */ + listId: number +} + export interface ListsApiRestoreRequest { /** * The **ILS ID** of the list to restore. @@ -151,15 +151,6 @@ export class ObjectListsApi { this.api = new ObservableListsApi(configuration, requestFactory, responseProcessor); } - /** - * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. - * Delete a List - * @param param the request object - */ - public _delete(param: ListsApiDeleteRequest, options?: Configuration): Promise { - return this.api._delete(param.listId, options).toPromise(); - } - /** * Create a new list with the provided object list definition. * Create List @@ -205,6 +196,15 @@ export class ObjectListsApi { return this.api.getByName(param.listName, param.objectTypeId, param.includeFilters, options).toPromise(); } + /** + * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. + * Delete a List + * @param param the request object + */ + public remove(param: ListsApiRemoveRequest, options?: Configuration): Promise { + return this.api.remove(param.listId, options).toPromise(); + } + /** * Restore a previously deleted list by **ILS list ID**. Deleted lists are eligible to be restored up-to 90-days after the list has been deleted. * Restore a List @@ -282,15 +282,6 @@ export interface MembershipsApiAddAndRemoveRequest { membershipChangeRequest: MembershipChangeRequest } -export interface MembershipsApiDeleteAllRequest { - /** - * The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. - * @type number - * @memberof MembershipsApideleteAll - */ - listId: number -} - export interface MembershipsApiGetPageRequest { /** * The **ILS ID** of the list. @@ -333,6 +324,15 @@ export interface MembershipsApiRemoveRequest { requestBody: Array } +export interface MembershipsApiRemoveAllRequest { + /** + * The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. + * @type number + * @memberof MembershipsApiremoveAll + */ + listId: number +} + export class ObjectMembershipsApi { private api: ObservableMembershipsApi @@ -367,15 +367,6 @@ export class ObjectMembershipsApi { return this.api.addAndRemove(param.listId, param.membershipChangeRequest, options).toPromise(); } - /** - * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. - * Delete All Records from a List - * @param param the request object - */ - public deleteAll(param: MembershipsApiDeleteAllRequest, options?: Configuration): Promise { - return this.api.deleteAll(param.listId, options).toPromise(); - } - /** * Fetch the memberships of a list in order sorted by the `recordId` of the records in the list. The `recordId`s are sorted in *ascending* order if an `after` offset or no offset is provided. If only a `before` offset is provided, then the records are sorted in *descending* order. The `after` offset parameter will take precedence over the `before` offset in a case where both are provided. * Fetch List Memberships Ordered by ID @@ -394,4 +385,13 @@ export class ObjectMembershipsApi { return this.api.remove(param.listId, param.requestBody, options).toPromise(); } + /** + * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. + * Delete All Records from a List + * @param param the request object + */ + public removeAll(param: MembershipsApiRemoveAllRequest, options?: Configuration): Promise { + return this.api.removeAll(param.listId, options).toPromise(); + } + } diff --git a/codegen/crm/lists/types/ObservableAPI.ts b/codegen/crm/lists/types/ObservableAPI.ts index b06b76c88..9f3aa8444 100644 --- a/codegen/crm/lists/types/ObservableAPI.ts +++ b/codegen/crm/lists/types/ObservableAPI.ts @@ -30,30 +30,6 @@ export class ObservableListsApi { this.responseProcessor = responseProcessor || new ListsApiResponseProcessor(); } - /** - * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. - * Delete a List - * @param listId The **ILS ID** of the list to delete. - */ - public _delete(listId: number, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory._delete(listId, _options); - - // build promise chain - let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { - middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); - } - - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). - pipe(mergeMap((response: ResponseContext) => { - let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { - middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); - } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor._delete(rsp))); - })); - } - /** * Create a new list with the provided object list definition. * Create List @@ -178,6 +154,30 @@ export class ObservableListsApi { })); } + /** + * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. + * Delete a List + * @param listId The **ILS ID** of the list to delete. + */ + public remove(listId: number, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.remove(listId, _options); + + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (let middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (let middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.remove(rsp))); + })); + } + /** * Restore a previously deleted list by **ILS list ID**. Deleted lists are eligible to be restored up-to 90-days after the list has been deleted. * Restore a List @@ -348,12 +348,15 @@ export class ObservableMembershipsApi { } /** - * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. - * Delete All Records from a List - * @param listId The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. + * Fetch the memberships of a list in order sorted by the `recordId` of the records in the list. The `recordId`s are sorted in *ascending* order if an `after` offset or no offset is provided. If only a `before` offset is provided, then the records are sorted in *descending* order. The `after` offset parameter will take precedence over the `before` offset in a case where both are provided. + * Fetch List Memberships Ordered by ID + * @param listId The **ILS ID** of the list. + * @param after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. + * @param before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. + * @param limit The number of records to return in the response. The maximum `limit` is 250. */ - public deleteAll(listId: number, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteAll(listId, _options); + public getPage(listId: number, after?: string, before?: string, limit?: number, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.getPage(listId, after, before, limit, _options); // build promise chain let middlewarePreObservable = from(requestContextPromise); @@ -367,20 +370,18 @@ export class ObservableMembershipsApi { for (let middleware of this.configuration.middleware) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteAll(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPage(rsp))); })); } /** - * Fetch the memberships of a list in order sorted by the `recordId` of the records in the list. The `recordId`s are sorted in *ascending* order if an `after` offset or no offset is provided. If only a `before` offset is provided, then the records are sorted in *descending* order. The `after` offset parameter will take precedence over the `before` offset in a case where both are provided. - * Fetch List Memberships Ordered by ID - * @param listId The **ILS ID** of the list. - * @param after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. - * @param before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. - * @param limit The number of records to return in the response. The maximum `limit` is 250. + * Remove the records provided from the list. Records that do not exist or that are not members of the list are ignored. This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. + * Remove Records from a List + * @param listId The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. + * @param requestBody The IDs of the records to remove from the list. */ - public getPage(listId: number, after?: string, before?: string, limit?: number, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.getPage(listId, after, before, limit, _options); + public remove(listId: number, requestBody: Array, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.remove(listId, requestBody, _options); // build promise chain let middlewarePreObservable = from(requestContextPromise); @@ -394,18 +395,17 @@ export class ObservableMembershipsApi { for (let middleware of this.configuration.middleware) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPage(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.remove(rsp))); })); } /** - * Remove the records provided from the list. Records that do not exist or that are not members of the list are ignored. This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. - * Remove Records from a List + * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. + * Delete All Records from a List * @param listId The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. - * @param requestBody The IDs of the records to remove from the list. */ - public remove(listId: number, requestBody: Array, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.remove(listId, requestBody, _options); + public removeAll(listId: number, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.removeAll(listId, _options); // build promise chain let middlewarePreObservable = from(requestContextPromise); @@ -419,7 +419,7 @@ export class ObservableMembershipsApi { for (let middleware of this.configuration.middleware) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.remove(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.removeAll(rsp))); })); } diff --git a/codegen/crm/lists/types/PromiseAPI.ts b/codegen/crm/lists/types/PromiseAPI.ts index 990ec60f9..bce151e76 100644 --- a/codegen/crm/lists/types/PromiseAPI.ts +++ b/codegen/crm/lists/types/PromiseAPI.ts @@ -25,16 +25,6 @@ export class PromiseListsApi { this.api = new ObservableListsApi(configuration, requestFactory, responseProcessor); } - /** - * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. - * Delete a List - * @param listId The **ILS ID** of the list to delete. - */ - public _delete(listId: number, _options?: Configuration): Promise { - const result = this.api._delete(listId, _options); - return result.toPromise(); - } - /** * Create a new list with the provided object list definition. * Create List @@ -89,6 +79,16 @@ export class PromiseListsApi { return result.toPromise(); } + /** + * Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored. + * Delete a List + * @param listId The **ILS ID** of the list to delete. + */ + public remove(listId: number, _options?: Configuration): Promise { + const result = this.api.remove(listId, _options); + return result.toPromise(); + } + /** * Restore a previously deleted list by **ILS list ID**. Deleted lists are eligible to be restored up-to 90-days after the list has been deleted. * Restore a List @@ -175,16 +175,6 @@ export class PromiseMembershipsApi { return result.toPromise(); } - /** - * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. - * Delete All Records from a List - * @param listId The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. - */ - public deleteAll(listId: number, _options?: Configuration): Promise { - const result = this.api.deleteAll(listId, _options); - return result.toPromise(); - } - /** * Fetch the memberships of a list in order sorted by the `recordId` of the records in the list. The `recordId`s are sorted in *ascending* order if an `after` offset or no offset is provided. If only a `before` offset is provided, then the records are sorted in *descending* order. The `after` offset parameter will take precedence over the `before` offset in a case where both are provided. * Fetch List Memberships Ordered by ID @@ -209,6 +199,16 @@ export class PromiseMembershipsApi { return result.toPromise(); } + /** + * Remove **all** of the records from a list. ***Note:*** *The list is not deleted.* This endpoint only works for lists that have a `processingType` of `MANUAL` or `SNAPSHOT`. + * Delete All Records from a List + * @param listId The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. + */ + public removeAll(listId: number, _options?: Configuration): Promise { + const result = this.api.removeAll(listId, _options); + return result.toPromise(); + } + }