Skip to content

Commit

Permalink
Regenrate frontend client to include teams endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgDangl committed Apr 30, 2024
1 parent 72f6f68 commit 47ec62d
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions src/ipa-bcfier-ui/src/app/generated-client/generated-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,78 @@ export class SettingsClient implements ISettingsClient {
}
}

export interface ITeamsMessagesClient {
announceNewCommentInProjectTopic(projectId: string, topicId: string, model: TeamsMessagePost): Observable<void>;
}

@Injectable({
providedIn: 'root'
})
export class TeamsMessagesClient implements ITeamsMessagesClient {
private http: HttpClient;
private baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;

constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) {
this.http = http;
this.baseUrl = baseUrl ?? "";
}

announceNewCommentInProjectTopic(projectId: string, topicId: string, model: TeamsMessagePost): Observable<void> {
let url_ = this.baseUrl + "/api/teams-messages/projects/{projectId}/topics/{topicId}/comments";
if (projectId === undefined || projectId === null)
throw new Error("The parameter 'projectId' must be defined.");
url_ = url_.replace("{projectId}", encodeURIComponent("" + projectId));
if (topicId === undefined || topicId === null)
throw new Error("The parameter 'topicId' must be defined.");
url_ = url_.replace("{topicId}", encodeURIComponent("" + topicId));
url_ = url_.replace(/[?&]$/, "");

const content_ = JSON.stringify(model);

let options_ : any = {
body: content_,
observe: "response",
responseType: "blob",
headers: new HttpHeaders({
"Content-Type": "application/json",
})
};

return this.http.request("post", url_, options_).pipe(_observableMergeMap((response_ : any) => {
return this.processAnnounceNewCommentInProjectTopic(response_);
})).pipe(_observableCatch((response_: any) => {
if (response_ instanceof HttpResponseBase) {
try {
return this.processAnnounceNewCommentInProjectTopic(response_ as any);
} catch (e) {
return _observableThrow(e) as any as Observable<void>;
}
} else
return _observableThrow(response_) as any as Observable<void>;
}));
}

protected processAnnounceNewCommentInProjectTopic(response: HttpResponseBase): Observable<void> {
const status = response.status;
const responseBlob =
response instanceof HttpResponse ? response.body :
(response as any).error instanceof Blob ? (response as any).error : undefined;

let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }}
if (status === 204) {
return blobToText(responseBlob).pipe(_observableMergeMap((_responseText: string) => {
return _observableOf(null as any);
}));
} else if (status !== 200 && status !== 204) {
return blobToText(responseBlob).pipe(_observableMergeMap((_responseText: string) => {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
}));
}
return _observableOf(null as any);
}
}

export interface IViewpointsClient {
showViewpoint(viewpoint: BcfViewpoint): Observable<void>;
createViewpoint(): Observable<BcfViewpoint>;
Expand Down Expand Up @@ -1383,6 +1455,13 @@ export interface Settings {
mainDatabaseLocation?: string | null;
}

export interface TeamsMessagePost {
topicTitle?: string | null;
comment?: string | null;
viewpointBase64?: string | null;
username: string;
}

export interface FileResponse {
data: Blob;
status: number;
Expand Down

0 comments on commit 47ec62d

Please sign in to comment.