Skip to content

Commit

Permalink
adapt token handling for multiple provider
Browse files Browse the repository at this point in the history
  • Loading branch information
salmma committed Nov 23, 2023
1 parent ed55182 commit b725861
Show file tree
Hide file tree
Showing 16 changed files with 218 additions and 312 deletions.
2 changes: 1 addition & 1 deletion generated/api-nisq/models/compiler-selection-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export type CompilerSelectionDto = {
circuitName?: string;
circuitUrl?: string;
qasmCode?: string;
token?: string;
tokens?: Map<string, string>;
refreshToken?: string;
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
export type ExecuteAnalysisResultRequestDto = {
refreshToken?: string;
token?: string;
tokens?: Map<string, Map<string, string>>;
};
2 changes: 1 addition & 1 deletion generated/api-nisq/models/qpu-selection-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type QpuSelectionDto = {
circuitLanguage?: string;
circuitUrl?: string;
qasmCode?: string;
tokens?: {};
tokens?: Map<string, Map<string, string>>;
refreshToken?: string;
circuitName?: string;
preciseResultsPreference?: boolean;
Expand Down
10 changes: 6 additions & 4 deletions generated/api-nisq/services/compiler-analysis-result.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export class CompilerAnalysisResultService extends BaseService {
*
* This method doesn't expect any request body.
*/
getCompilerAnalysisResults(params?: {}): Observable<CompilerAnalysisResultListDto> {
getCompilerAnalysisResults(params?: {}): Observable<
CompilerAnalysisResultListDto
> {
return this.getCompilerAnalysisResults$Response(params).pipe(
map(
(r: StrictHttpResponse<CompilerAnalysisResultListDto>) =>
Expand Down Expand Up @@ -264,7 +266,7 @@ export class CompilerAnalysisResultService extends BaseService {
*/
executeCompilationResult$Response(params: {
resId: string;
token: string;
tokens: Map<string, string>;
}): Observable<StrictHttpResponse<ExecutionResultDto>> {
const rb = new RequestBuilder(
this.rootUrl,
Expand All @@ -273,7 +275,7 @@ export class CompilerAnalysisResultService extends BaseService {
);
if (params) {
rb.path('resId', params.resId, {});
rb.query('token', params.token, {});
rb.query('tokens', params.tokens, {});
}
return this.http
.request(
Expand All @@ -300,7 +302,7 @@ export class CompilerAnalysisResultService extends BaseService {
*/
executeCompilationResult(params: {
resId: string;
token: string;
tokens: Map<string, string>;
}): Observable<ExecutionResultDto> {
return this.executeCompilationResult$Response(params).pipe(
map(
Expand Down
12 changes: 7 additions & 5 deletions generated/api-nisq/services/qpu-selection-result.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { RequestBuilder } from '../request-builder';
import { Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';

import { ExecuteAnalysisResultRequestDto } from '../models/execute-analysis-result-request-dto';
import { ExecutionResultDto } from '../models/execution-result-dto';
import { QpuSelectionJobDto } from '../models/qpu-selection-job-dto';
import { QpuSelectionJobListDto } from '../models/qpu-selection-job-list-dto';
Expand Down Expand Up @@ -273,11 +274,11 @@ export class QpuSelectionResultService extends BaseService {
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `executeQpuSelectionResult()` instead.
*
* This method doesn't expect any request body.
* This method sends `application/json` and handles request body of type `application/json`.
*/
executeQpuSelectionResult$Response(params: {
resId: string;
token: string;
body: ExecuteAnalysisResultRequestDto;
}): Observable<StrictHttpResponse<ExecutionResultDto>> {
const rb = new RequestBuilder(
this.rootUrl,
Expand All @@ -286,7 +287,8 @@ export class QpuSelectionResultService extends BaseService {
);
if (params) {
rb.path('resId', params.resId, {});
rb.query('token', params.token, {});

rb.body(params.body, 'application/json');
}
return this.http
.request(
Expand All @@ -309,11 +311,11 @@ export class QpuSelectionResultService extends BaseService {
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `executeQpuSelectionResult$Response()` instead.
*
* This method doesn't expect any request body.
* This method sends `application/json` and handles request body of type `application/json`.
*/
executeQpuSelectionResult(params: {
resId: string;
token: string;
body: ExecuteAnalysisResultRequestDto;
}): Observable<ExecutionResultDto> {
return this.executeQpuSelectionResult$Response(params).pipe(
map(
Expand Down
Loading

0 comments on commit b725861

Please sign in to comment.