const codeGenerationImportedApisController = new CodeGenerationImportedApisController(client);
CodeGenerationImportedApisController
Generate an SDK for an API Version.
This endpoint generates and then uploads the generated SDK to APIMatic's cloud storage. An ID for the generation performed is returned as part of the response.
async generateSDK(
apiEntityId: string,
template: Platforms,
requestOptions?: RequestOptions
): Promise<ApiResponse<APIEntityCodeGeneration>>
Parameter | Type | Tags | Description |
---|---|---|---|
apiEntityId |
string |
Template, Required | The ID of the API Entity to generate the SDK for. |
template |
Platforms |
Form, Required | The structure contains platforms that APIMatic CodeGen can generate SDKs and Docs in. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const apiEntityId = 'api_entity_id4';
const contentType = null;
const template = 'PHP_GENERIC_LIB';
try {
const { result, ...httpResponse } = await codeGenerationImportedApisController.generateSDK(apiEntityId, template);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Download the SDK generated via the Generate SDK endpoint.
async downloadSDK(
apiEntityId: string,
codegenId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<NodeJS.ReadableStream | Blob>>
Parameter | Type | Tags | Description |
---|---|---|---|
apiEntityId |
string |
Template, Required | The ID of the API Entity for which the SDK was generated. |
codegenId |
string |
Template, Required | The ID of code generation received in the response of the SDK generation call. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
NodeJS.ReadableStream | Blob
const apiEntityId = 'api_entity_id4';
const codegenId = 'codegen_id6';
try {
const { result, ...httpResponse } = await codeGenerationImportedApisController.downloadSDK(apiEntityId, codegenId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Get a list of all SDK generations done against an API Version via the Generate SDK endpoint.
async listAllCodeGenerations(
apiEntityId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<APIEntityCodeGeneration[]>>
Parameter | Type | Tags | Description |
---|---|---|---|
apiEntityId |
string |
Template, Required | The ID of the API Entity for which to list code generations. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const apiEntityId = 'api_entity_id4';
try {
const { result, ...httpResponse } = await codeGenerationImportedApisController.listAllCodeGenerations(apiEntityId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Get details on an SDK generation performed via the Generate SDK endpoint.
async getACodeGeneration(
apiEntityId: string,
codegenId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<APIEntityCodeGeneration>>
Parameter | Type | Tags | Description |
---|---|---|---|
apiEntityId |
string |
Template, Required | The ID of the API Entity to fetch the code generation for. |
codegenId |
string |
Template, Required | The ID of the code generation to fetch. The code generation ID is received in the response of the SDK generation call. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const apiEntityId = 'api_entity_id4';
const codegenId = 'codegen_id6';
try {
const { result, ...httpResponse } = await codeGenerationImportedApisController.getACodeGeneration(apiEntityId, codegenId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Delete an SDK generation performed for an API Version via the Generate SDK endpoint.
async deleteCodeGeneration(
apiEntityId: string,
codegenId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<void>>
Parameter | Type | Tags | Description |
---|---|---|---|
apiEntityId |
string |
Template, Required | The ID of the API Entity to delete the code generation for. |
codegenId |
string |
Template, Required | The ID of the code generation to delete. The code generation ID is received in the response of the SDK generation call. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
void
const apiEntityId = 'api_entity_id4';
const codegenId = 'codegen_id6';
try {
const { result, ...httpResponse } = await codeGenerationImportedApisController.deleteCodeGeneration(apiEntityId, codegenId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}