export type ErrorDetails = {errorCode?: string | undefined, message?: string | undefined}; export type NameValue = {errorDetails?: ErrorDetails | undefined, name?: string | undefined, originalValue?: string | undefined, value?: string | undefined}; export type BrandEmailContent = {content?: string | undefined, emailContentType?: string | undefined, emailToLink?: string | undefined, linkText?: string | undefined}; export type BrandLink = {linkText?: string | undefined, linkType?: string | undefined, showLink?: string | undefined, urlOrMailTo?: string | undefined}; export type BrandLogoIds = {emailLogoId?: string | undefined, primaryLogoId?: string | undefined, secondaryLogoId?: string | undefined}; export type BrandLogos = {email?: string | undefined, primary?: string | undefined, secondary?: string | undefined}; export type BrandResourceUrls = {email?: string | undefined, sending?: string | undefined, signing?: string | undefined, signingCaptive?: string | undefined}; export type Brand = {brandCompany?: string | undefined, brandId?: string | undefined, brandLanguages?: Array | undefined, brandName?: string | undefined, colors?: Array | undefined, defaultBrandLanguage?: string | undefined, emailContent?: Array | undefined, errorDetails?: ErrorDetails | undefined, isOrganizationBrand?: string | undefined, isOverridingCompanyName?: boolean | undefined, isSendingDefault?: boolean | undefined, isSigningDefault?: boolean | undefined, landingPages?: Array | undefined, links?: Array | undefined, logoIds?: BrandLogoIds | undefined, logos?: BrandLogos | undefined, organizationBrandLogo?: string | undefined, resources?: BrandResourceUrls | undefined}; export type CreateApiV21AccountsAccountIdBrandsArgs = {accountId: string, body: Brand}; export type CreateApiV21AccountsAccountIdBrandsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates one or more brand profiles for an account. * * POST /v2.1/accounts/{accountId}/brands */ export const createApiV21AccountsAccountIdBrands = async (args: CreateApiV21AccountsAccountIdBrandsArgs, options?: CreateApiV21AccountsAccountIdBrandsOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/brands${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };