import * as request from "superagent" ; type CallbackHandler = ( err : any , res ? : request . Response ) => void ; export type Alignment = { 'alignmentId' : number ; 'bitscore' : number ; 'chain' : string ; 'evalue' : string ; 'identity' : number ; 'identityPositive' : number ; 'midlineAlign' : string ; 'pdbAlign' : string ; 'pdbFrom' : number ; 'pdbId' : string ; 'pdbNo' : string ; 'pdbSeg' : string ; 'pdbTo' : number ; 'residueMapping' : Array < ResidueMapping > ; 'segStart' : string ; 'seqAlign' : string ; 'seqFrom' : number ; 'seqId' : string ; 'seqTo' : number ; 'updateDate' : string ; } ; export type ResidueMapping = { 'pdbAminoAcid' : string ; 'pdbPosition' : number ; 'queryAminoAcid' : string ; 'queryPosition' : number ; } ; class param { ( string ) } domainOrOptions export default class Genome2StructureAPI { private domain : string = "" ; private errorHandlers : CallbackHandler [ ] = [ ] ; constructor ( domain ? ) { if ( domain ) { this . domain = domain ; } } getDomain ( ) { return this . domain ; } addErrorHandler ( handler ) { this . errorHandlers . push ( handler ) ; } private request ( method , url , body , headers , queryParameters , form , reject , resolve , errorHandlers ) { let req = ( new ( request as any ) . Request ( method , url ) as request . Request ) . query ( queryParameters ) ; Object . keys ( headers ) . forEach ( key => { req . set ( key , headers [ key ] ) ; } ) ; if ( body ) { req . send ( body ) ; } if ( typeof ( body ) === 'object' && ! ( body . constructor . name === 'Buffer' ) ) { req . set ( 'Content-Type' , 'application/json' ) ; } if ( Object . keys ( form ) . length > 0 ) { req . type ( 'form' ) ; req . send ( form ) ; } req . end ( ( error , response ) => { if ( error || ! response . ok ) { reject ( error ) ; errorHandlers . forEach ( handler => handler ( error ) ) ; } else { resolve ( response ) ; } } ) ; } getPdbAlignmentBySequenceUsingGETURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } sequence param { array } paramList getPdbAlignmentBySequenceUsingGET ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'sequence' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: sequence' ) ) ; return ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'GET' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; getPdbAlignmentBySequenceUsingPOSTURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } sequence param { array } paramList getPdbAlignmentBySequenceUsingPOST ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'sequence' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: sequence' ) ) ; return ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'POST' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; getPdbAlignmentReisudeBySequenceUsingGETURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/residueMapping' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } sequence param { array } positionList param { array } paramList getPdbAlignmentReisudeBySequenceUsingGET ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/residueMapping' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'sequence' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: sequence' ) ) ; return ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'GET' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; getPdbAlignmentReisudeBySequenceUsingPOSTURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/residueMapping' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } sequence param { array } positionList param { array } paramList getPdbAlignmentReisudeBySequenceUsingPOST ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/residueMapping' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; if ( parameters [ 'sequence' ] !== undefined ) { queryParameters [ 'sequence' ] = parameters [ 'sequence' ] ; } if ( parameters [ 'sequence' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: sequence' ) ) ; return ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters [ 'paramList' ] !== undefined ) { queryParameters [ 'paramList' ] = parameters [ 'paramList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'POST' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; getAlignmentUsingGETURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/{id_type}/{id}' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } idType param { string } id getAlignmentUsingGET ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/{id_type}/{id}' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; if ( parameters [ 'idType' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: idType' ) ) ; return ; } path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'id' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: id' ) ) ; return ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'GET' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; getAlignmentByPDBUsingGETURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/{id_type}/{id}/pdb/{pdb_id}_{chain_id}' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; path = path . replace ( '{pdb_id}' , parameters [ 'pdbId' ] + '' ) ; path = path . replace ( '{chain_id}' , parameters [ 'chainId' ] + '' ) ; if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } idType param { string } id param { string } pdbId param { string } chainId getAlignmentByPDBUsingGET ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/{id_type}/{id}/pdb/{pdb_id}_{chain_id}' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; if ( parameters [ 'idType' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: idType' ) ) ; return ; } path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'id' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: id' ) ) ; return ; } path = path . replace ( '{pdb_id}' , parameters [ 'pdbId' ] + '' ) ; if ( parameters [ 'pdbId' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: pdbId' ) ) ; return ; } path = path . replace ( '{chain_id}' , parameters [ 'chainId' ] + '' ) ; if ( parameters [ 'chainId' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: chainId' ) ) ; return ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'GET' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; postResidueMappingByPDBUsingGETURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/{id_type}/{id}/pdb/{pdb_id}_{chain_id}/residueMapping' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; path = path . replace ( '{pdb_id}' , parameters [ 'pdbId' ] + '' ) ; path = path . replace ( '{chain_id}' , parameters [ 'chainId' ] + '' ) ; if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } idType param { string } id param { string } pdbId param { string } chainId param { array } positionList postResidueMappingByPDBUsingGET ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/{id_type}/{id}/pdb/{pdb_id}_{chain_id}/residueMapping' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; if ( parameters [ 'idType' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: idType' ) ) ; return ; } path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'id' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: id' ) ) ; return ; } path = path . replace ( '{pdb_id}' , parameters [ 'pdbId' ] + '' ) ; if ( parameters [ 'pdbId' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: pdbId' ) ) ; return ; } path = path . replace ( '{chain_id}' , parameters [ 'chainId' ] + '' ) ; if ( parameters [ 'chainId' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: chainId' ) ) ; return ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'GET' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; postResidueMappingByPDBUsingPOSTURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/{id_type}/{id}/pdb/{pdb_id}_{chain_id}/residueMapping' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; path = path . replace ( '{pdb_id}' , parameters [ 'pdbId' ] + '' ) ; path = path . replace ( '{chain_id}' , parameters [ 'chainId' ] + '' ) ; if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } idType param { string } id param { string } pdbId param { string } chainId param { array } positionList postResidueMappingByPDBUsingPOST ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/{id_type}/{id}/pdb/{pdb_id}_{chain_id}/residueMapping' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; if ( parameters [ 'idType' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: idType' ) ) ; return ; } path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'id' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: id' ) ) ; return ; } path = path . replace ( '{pdb_id}' , parameters [ 'pdbId' ] + '' ) ; if ( parameters [ 'pdbId' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: pdbId' ) ) ; return ; } path = path . replace ( '{chain_id}' , parameters [ 'chainId' ] + '' ) ; if ( parameters [ 'chainId' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: chainId' ) ) ; return ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'POST' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; postResidueMappingUsingGETURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/{id_type}/{id}/residueMapping' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } idType param { string } id param { array } positionList postResidueMappingUsingGET ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/{id_type}/{id}/residueMapping' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; if ( parameters [ 'idType' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: idType' ) ) ; return ; } path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'id' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: id' ) ) ; return ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'GET' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; postResidueMappingUsingPOSTURL ( parameters ) { let queryParameters = { } ; let path = '/api/alignments/{id_type}/{id}/residueMapping' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } let keys = Object . keys ( queryParameters ) ; return this . domain + path + ( keys . length > 0 ? '?' + ( keys . map ( key => key + '=' + encodeURIComponent ( queryParameters [ key ] ) ) . join ( '&' ) ) : '' ) ; } ; method name param { string } idType param { string } id param { array } positionList postResidueMappingUsingPOST ( parameters ) { const domain = parameters . $domain ? parameters . $domain : this . domain ; const errorHandlers = this . errorHandlers ; const request = this . request ; let path = '/api/alignments/{id_type}/{id}/residueMapping' ; let body ; let queryParameters = { } ; let headers = { } ; let form = { } ; return new Promise ( function ( resolve , reject ) { headers [ 'Accept' ] = 'application/json' ; headers [ 'Content-Type' ] = 'application/json' ; path = path . replace ( '{id_type}' , parameters [ 'idType' ] + '' ) ; if ( parameters [ 'idType' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: idType' ) ) ; return ; } path = path . replace ( '{id}' , parameters [ 'id' ] + '' ) ; if ( parameters [ 'id' ] === undefined ) { reject ( new Error ( 'Missing required  parameter: id' ) ) ; return ; } if ( parameters [ 'positionList' ] !== undefined ) { queryParameters [ 'positionList' ] = parameters [ 'positionList' ] ; } if ( parameters . $queryParameters ) { Object . keys ( parameters . $queryParameters ) . forEach ( function ( parameterName ) { var parameter = parameters . $queryParameters [ parameterName ] ; queryParameters [ parameterName ] = parameter ; } ) ; } request ( 'POST' , domain + path , body , headers , queryParameters , form , reject , resolve , errorHandlers ) ; } ) . then ( function ( response ) { return response . body ; } ) ; } ; }