// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as AipAPI from './aip';
import { Aip, AipListParams, AipListResponse, AipRetrieveParams, AipRetrieveResponse } from './aip';
import * as ThirdPartyAPI from './third-party';
import { ThirdParty, ThirdPartyRetrieveParams, ThirdPartyRetrieveResponse } from './third-party';
import { APIPromise } from '../../core/api-promise';
import { buildHeaders } from '../../internal/headers';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Media extends APIResource {
aip: AipAPI.Aip = new AipAPI.Aip(this._client);
thirdParty: ThirdPartyAPI.ThirdParty = new ThirdPartyAPI.ThirdParty(this._client);
/**
* Public, permanent URL of a Digital Employee's profile photo. Redirects to a
* freshly presigned object-storage URL, so the URL stored in GL Runner never
* expires. The route is public on purpose (an `
` tag cannot send
* credentials); the organization and Digital Employee ids are random UUIDs.
*/
retrieve(filename: string, params: MediaRetrieveParams, options?: RequestOptions): APIPromise {
const {
organization_id,
digital_employee_id,
'Accept-Language': acceptLanguage,
'X-Error-Format': xErrorFormat,
} = params;
return this._client.get(
path`/media/digital-employee/${organization_id}/${digital_employee_id}/${filename}`,
{
...options,
headers: buildHeaders([
{
...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined),
...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined),
},
options?.headers,
]),
},
);
}
}
export type MediaRetrieveResponse = unknown;
export interface MediaRetrieveParams {
/**
* Path param
*/
organization_id: string;
/**
* Path param
*/
digital_employee_id: string;
/**
* Header param
*/
'Accept-Language'?: string;
/**
* Header param: Set to `structured` to receive errors in the structured envelope.
* Omit it to keep the legacy error body.
*/
'X-Error-Format'?: string;
}
Media.Aip = Aip;
Media.ThirdParty = ThirdParty;
export declare namespace Media {
export {
type MediaRetrieveResponse as MediaRetrieveResponse,
type MediaRetrieveParams as MediaRetrieveParams,
};
export {
Aip as Aip,
type AipRetrieveResponse as AipRetrieveResponse,
type AipListResponse as AipListResponse,
type AipRetrieveParams as AipRetrieveParams,
type AipListParams as AipListParams,
};
export {
ThirdParty as ThirdParty,
type ThirdPartyRetrieveResponse as ThirdPartyRetrieveResponse,
type ThirdPartyRetrieveParams as ThirdPartyRetrieveParams,
};
}