Skip to content

feat(js): avoid wrapping bodyParams #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ module.exports = {
'max-classes-per-file': 0,
'no-continue': 0,
'@typescript-eslint/prefer-enum-initializers': 0,
// there's a conflict when declaring `type` and `namespaces`, even with `ignoreDeclarationMerge`
'no-redeclare': 0,
'@typescript-eslint/no-redeclare': 0,

'@typescript-eslint/no-unused-vars': 2,
'unused-imports/no-unused-imports-ts': 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public BatchResponse taskID(Integer taskID) {
}

/**
* taskID of the indexing task to wait for.
* taskID of the task to wait for.
*
* @return taskID
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public DeletedAtResponse taskID(Integer taskID) {
}

/**
* taskID of the indexing task to wait for.
* taskID of the task to wait for.
*
* @return taskID
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public SaveObjectResponse taskID(Integer taskID) {
}

/**
* taskID of the indexing task to wait for.
* taskID of the task to wait for.
*
* @return taskID
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public SaveSynonymResponse taskID(Integer taskID) {
}

/**
* taskID of the indexing task to wait for.
* taskID of the task to wait for.
*
* @return taskID
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public UpdatedAtResponse taskID(Integer taskID) {
}

/**
* taskID of the indexing task to wait for.
* taskID of the task to wait for.
*
* @return taskID
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public UpdatedAtWithObjectIdResponse taskID(Integer taskID) {
}

/**
* taskID of the indexing task to wait for.
* taskID of the task to wait for.
*
* @return taskID
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public UpdatedRuleResponse taskID(Integer taskID) {
}

/**
* taskID of the indexing task to wait for.
* taskID of the task to wait for.
*
* @return taskID
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,8 @@ public Call getLogsAsync(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param attributesToRetrieve (optional)
* @param attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable
* attributes are returned. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand Down Expand Up @@ -2546,7 +2547,8 @@ private Call getObjectValidateBeforeCall(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param attributesToRetrieve (optional)
* @param attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable
* attributes are returned. (optional)
* @return Map<String, String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
Expand All @@ -2572,7 +2574,8 @@ public Map<String, String> getObject(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param attributesToRetrieve (optional)
* @param attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable
* attributes are returned. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
Expand Down Expand Up @@ -3297,7 +3300,7 @@ public Call getUserIdAsync(
/**
* Build call for hasPendingMappings
*
* @param getClusters (optional)
* @param getClusters Whether to get clusters or not. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand Down Expand Up @@ -3346,7 +3349,7 @@ private Call hasPendingMappingsValidateBeforeCall(
* response is 200 OK. A successful response indicates that the operation has been taken into
* account, and the userIDs are directly usable.
*
* @param getClusters (optional)
* @param getClusters Whether to get clusters or not. (optional)
* @return CreatedAtResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
Expand All @@ -3366,7 +3369,7 @@ public CreatedAtResponse hasPendingMappings(Boolean getClusters)
* done. Upon success, the response is 200 OK. A successful response indicates that the operation
* has been taken into account, and the userIDs are directly usable.
*
* @param getClusters (optional)
* @param getClusters Whether to get clusters or not. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
Expand Down Expand Up @@ -3985,7 +3988,7 @@ public Call operationIndexAsync(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param buildInOperation The Algolia object. (required)
* @param buildInOperation List of attributes to update. (required)
* @param createIfNotExists Creates the record if it does not exist yet. (optional, default to
* true)
* @param _callback Callback for upload/download progress
Expand Down Expand Up @@ -4081,7 +4084,7 @@ private Call partialUpdateObjectValidateBeforeCall(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param buildInOperation The Algolia object. (required)
* @param buildInOperation List of attributes to update. (required)
* @param createIfNotExists Creates the record if it does not exist yet. (optional, default to
* true)
* @return UpdatedAtWithObjectIdResponse
Expand Down Expand Up @@ -4117,7 +4120,7 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param buildInOperation The Algolia object. (required)
* @param buildInOperation List of attributes to update. (required)
* @param createIfNotExists Creates the record if it does not exist yet. (optional, default to
* true)
* @param _callback The callback to be executed when the API call finishes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export * from './errorBase';
export * from './listABTestsResponse';
export * from './searchParamABTestsVariant';
export * from './searchParamABTestsVariantAllOf';
export * from './stopABTestRequest';
export * from './variant';

export interface Authentication {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { AddABTestsRequest } from '../model/addABTestsRequest';
import type { AddABTestsResponse } from '../model/addABTestsResponse';
import type { ListABTestsResponse } from '../model/listABTestsResponse';
import { ApiKeyAuth } from '../model/models';
import type { StopABTestRequest } from '../model/stopABTestRequest';
import { Transporter } from '../utils/Transporter';
import type { Requester } from '../utils/requester/Requester';
import type { Headers, Host, Request, RequestOptions } from '../utils/types';
Expand Down Expand Up @@ -86,12 +85,11 @@ export class AbtestingApi {
* Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.
*
* @summary Creates a new A/B test with provided configuration.
* @param addABTests - The addABTests parameters.
* @param addABTests.addABTestsRequest - The addABTestsRequest.
* @param addABTestsRequest - The addABTestsRequest object.
*/
addABTests({
addABTestsRequest,
}: AddABTestsProps): Promise<AddABTestsResponse> {
addABTests(
addABTestsRequest: AddABTestsRequest
): Promise<AddABTestsResponse> {
const path = '/2/abtests';
const headers: Headers = { Accept: 'application/json' };
const queryParameters: Record<string, string> = {};
Expand Down Expand Up @@ -144,7 +142,7 @@ export class AbtestingApi {
* Deletes the A/B Test and removes all associated metadata & metrics.
*
* @summary Deletes the A/B Test.
* @param deleteABTest - The deleteABTest parameters.
* @param deleteABTest - The deleteABTest object.
* @param deleteABTest.id - The A/B test ID.
*/
deleteABTest({ id }: DeleteABTestProps): Promise<Record<string, any>> {
Expand Down Expand Up @@ -177,7 +175,7 @@ export class AbtestingApi {
* Returns metadata and metrics for A/B test id. Behaves in the same way as GET /2/abtests however the endpoint will return 403.
*
* @summary Returns metadata and metrics for A/B test id.
* @param getABTest - The getABTest parameters.
* @param getABTest - The getABTest object.
* @param getABTest.id - The A/B test ID.
*/
getABTest({ id }: GetABTestProps): Promise<ABTest> {
Expand Down Expand Up @@ -210,7 +208,7 @@ export class AbtestingApi {
* Fetch all existing A/B tests for App that are available for the current API Key. Returns an array of metadata and metrics. When no data has been processed, the metrics will be returned as null.
*
* @summary Fetch all existing A/B tests for App that are available for the current API Key.
* @param listABTests - The listABTests parameters.
* @param listABTests - The listABTests object.
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
* @param listABTests.limit - Number of records to return. Limit is the size of the page.
*/
Expand Down Expand Up @@ -246,32 +244,26 @@ export class AbtestingApi {
* Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a result, your application is back to normal: index A will perform as usual, receiving 100% of all search requests. Associated metadata and metrics are still stored.
*
* @summary Marks the A/B test as stopped.
* @param stopABTest - The stopABTest parameters.
* @param stopABTest.stopABTestRequest - The stopABTestRequest.
* @param stopABTest - The stopABTest object.
* @param stopABTest.id - The A/B test ID.
*/
stopABTest({
stopABTestRequest,
}: StopABTestProps): Promise<Record<string, any>> {
const path = '/2/abtests/{id}/stop';
stopABTest({ id }: StopABTestProps): Promise<Record<string, any>> {
const path = '/2/abtests/{id}/stop'.replace(
'{id}',
encodeURIComponent(String(id))
);
const headers: Headers = { Accept: 'application/json' };
const queryParameters: Record<string, string> = {};

if (stopABTestRequest === null || stopABTestRequest === undefined) {
throw new Error(
'Required parameter stopABTestRequest was null or undefined when calling stopABTest.'
);
}

if (stopABTestRequest.id === null || stopABTestRequest.id === undefined) {
if (id === null || id === undefined) {
throw new Error(
'Required parameter stopABTestRequest.id was null or undefined when calling stopABTest.'
'Required parameter id was null or undefined when calling stopABTest.'
);
}

const request: Request = {
method: 'POST',
path,
data: stopABTestRequest,
};

const requestOptions: RequestOptions = {
Expand All @@ -283,13 +275,6 @@ export class AbtestingApi {
}
}

export type AddABTestsProps = {
/**
* The addABTestsRequest.
*/
addABTestsRequest: AddABTestsRequest;
};

export type DeleteABTestProps = {
/**
* The A/B test ID.
Expand Down Expand Up @@ -317,7 +302,7 @@ export type ListABTestsProps = {

export type StopABTestProps = {
/**
* The stopABTestRequest.
* The A/B test ID.
*/
stopABTestRequest: StopABTestRequest;
id: number;
};
Loading