Skip to content

Commit

Permalink
sh run.sh gen_api
Browse files Browse the repository at this point in the history
  • Loading branch information
xnought committed Dec 2, 2023
1 parent 89c1357 commit af4e942
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 20 deletions.
3 changes: 3 additions & 0 deletions frontend/src/openapi/models/EditBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
export type EditBody = {
oldName: string;
newName: string;
oldSpeciesName: string;
newSpeciesName: string;
newContent?: (string | null);
newRefs?: (string | null);
};

1 change: 1 addition & 0 deletions frontend/src/openapi/models/HTTPValidationError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ import type { ValidationError } from './ValidationError';
export type HTTPValidationError = {
detail?: Array<ValidationError>;
};

2 changes: 2 additions & 0 deletions frontend/src/openapi/models/ProteinEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export type ProteinEntry = {
name: string;
length: number;
mass: number;
speciesName: string;
content?: (string | null);
refs?: (string | null);
};

2 changes: 2 additions & 0 deletions frontend/src/openapi/models/UploadBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

export type UploadBody = {
name: string;
speciesName: string;
content: string;
refs: string;
pdbFileStr: string;
};

1 change: 1 addition & 0 deletions frontend/src/openapi/models/ValidationError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export type ValidationError = {
msg: string;
type: string;
};

94 changes: 74 additions & 20 deletions frontend/src/openapi/services/DefaultService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,52 @@ import { request as __request } from '../core/request';

export class DefaultService {

/**
* Get Pdb File
* @param proteinName
* @returns any Successful Response
* @throws ApiError
*/
public static getPdbFile(
proteinName: string,
): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'GET',
url: '/pdb/{protein_name}',
path: {
'protein_name': proteinName,
},
errors: {
422: `Validation Error`,
},
});
}

/**
* Get Fasta File
* @param proteinName
* @returns any Successful Response
* @throws ApiError
*/
public static getFastaFile(
proteinName: string,
): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'GET',
url: '/fasta/{protein_name}',
path: {
'protein_name': proteinName,
},
errors: {
422: `Validation Error`,
},
});
}

/**
* Get All Entries
* Gets all protein entries from the database
* Returns: list[ProteinEntry] if found | None if not found
* Returns: list[ProteinEntry] if found | None if not found
* @returns any Successful Response
* @throws ApiError
*/
Expand All @@ -30,19 +72,19 @@ export class DefaultService {
/**
* Search Entries
* Gets a list of protein entries by a search string
* Returns: list[ProteinEntry] if found | None if not found
* @param query
* Returns: list[ProteinEntry] if found | None if not found
* @param proteinName
* @returns any Successful Response
* @throws ApiError
*/
public static searchEntries(
query: string,
): CancelablePromise<(Array<ProteinEntry> | null)> {
proteinName: string,
): CancelablePromise<(Array<ProteinEntry> | null)> {
return __request(OpenAPI, {
method: 'GET',
url: '/search-entries/{query}',
url: '/search-entries/{protein_name}',
path: {
'query': query,
'protein_name': proteinName,
},
errors: {
422: `Validation Error`,
Expand All @@ -53,14 +95,14 @@ query: string,
/**
* Get Protein Entry
* Get a single protein entry by its id
* Returns: ProteinEntry if found | None if not found
* @param proteinName
* Returns: ProteinEntry if found | None if not found
* @param proteinName
* @returns any Successful Response
* @throws ApiError
*/
public static getProteinEntry(
proteinName: string,
): CancelablePromise<(ProteinEntry | null)> {
proteinName: string,
): CancelablePromise<(ProteinEntry | null)> {
return __request(OpenAPI, {
method: 'GET',
url: '/protein-entry/{protein_name}',
Expand All @@ -75,13 +117,13 @@ proteinName: string,

/**
* Delete Protein Entry
* @param proteinName
* @param proteinName
* @returns any Successful Response
* @throws ApiError
*/
public static deleteProteinEntry(
proteinName: string,
): CancelablePromise<any> {
proteinName: string,
): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/protein-entry/{protein_name}',
Expand All @@ -96,13 +138,13 @@ proteinName: string,

/**
* Upload Protein Entry
* @param requestBody
* @param requestBody
* @returns any Successful Response
* @throws ApiError
*/
public static uploadProteinEntry(
requestBody: UploadBody,
): CancelablePromise<(UploadError | null)> {
requestBody: UploadBody,
): CancelablePromise<(UploadError | null)> {
return __request(OpenAPI, {
method: 'POST',
url: '/protein-upload',
Expand All @@ -116,13 +158,13 @@ requestBody: UploadBody,

/**
* Edit Protein Entry
* @param requestBody
* @param requestBody
* @returns any Successful Response
* @throws ApiError
*/
public static editProteinEntry(
requestBody: EditBody,
): CancelablePromise<(UploadError | null)> {
requestBody: EditBody,
): CancelablePromise<(UploadError | null)> {
return __request(OpenAPI, {
method: 'PUT',
url: '/protein-edit',
Expand All @@ -134,4 +176,16 @@ requestBody: EditBody,
});
}

/**
* Get All Species
* @returns any Successful Response
* @throws ApiError
*/
public static getAllSpecies(): CancelablePromise<(Array<string> | null)> {
return __request(OpenAPI, {
method: 'GET',
url: '/all-species',
});
}

}

0 comments on commit af4e942

Please sign in to comment.