export type GetApiApiPkiRestapiGetCertificateKeyStoreArgs = {orgName?: string | undefined, common_name?: string | undefined, serial_number?: string | undefined}; export type GetApiApiPkiRestapiGetCertificateKeyStoreOptions = {baseUrl?: string | undefined, AuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Fetch SSL certificate keystore file * * GET /api/pki/restapi/getCertificateKeyStore */ export const getApiApiPkiRestapiGetCertificateKeyStore = async (args: GetApiApiPkiRestapiGetCertificateKeyStoreArgs, options?: GetApiApiPkiRestapiGetCertificateKeyStoreOptions) => { const {baseUrl = "https://Hostname:Port", fetch: fetchFn = fetch, AuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (args.orgName != null) headers.set("orgName", String(args.orgName)) if (args.common_name != null) query.append("common_name", String(args.common_name)) if (args.serial_number != null) query.append("serial_number", String(args.serial_number)) if (AuthToken !== undefined) headers.set("AUTHTOKEN", AuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/pki/restapi/getCertificateKeyStore${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };