import { CommonClientOptions } from '@azure/core-client';
import { KeyCredential } from '@azure/core-auth';
import { OperationOptions } from '@azure/core-client';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
import { TokenCredential } from '@azure/core-auth';

/** An object representing the email address and its display name */
export declare interface EmailAddress {
    /** Email address. */
    address: string;
    /** Email display name. */
    displayName?: string;
}

/** Attachment to the email. */
export declare interface EmailAttachment {
    /** Name of the attachment */
    name: string;
    /** MIME type of the content being attached. */
    contentType: string;
    /** Base64 encoded contents of the attachment */
    contentInBase64: string;
}

/**
 *  The Email service client.
 */
export declare class EmailClient {
    private readonly generatedClient;
    /**
     * Initializes a new instance of the EmailClient class.
     * @param connectionString - Connection string to connect to an Azure Communication Service resource.
     *                         Example: "endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret";
     * @param options - Optional. Options to configure the HTTP pipeline.
     */
    constructor(connectionString: string, options?: EmailClientOptions);
    /**
     * Initializes a new instance of the EmailClient class using an Azure KeyCredential.
     * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).
     * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.
     * @param options - Optional. Options to configure the HTTP pipeline.
     */
    constructor(endpoint: string, credential: KeyCredential | TokenCredential, options?: EmailClientOptions);
    /**
     * Queues an email message to be sent to one or more recipients
     * @param message - Message payload for sending an email
     * @param options - The options parameters.
     */
    beginSend(message: EmailMessage, options?: EmailSendOptionalParams): Promise<PollerLike<PollOperationState<EmailSendResponse>, EmailSendResponse>>;
}

/**
 * Client options used to configure Email Client API requests.
 */
export declare interface EmailClientOptions extends CommonClientOptions {
}

/** Content of the email. */
export declare type EmailContent = HtmlEmailContent | PlainTextEmailContent;

/** Message payload for sending an email */
export declare interface EmailMessage {
    /** Custom email headers to be passed. */
    headers?: {
        [propertyName: string]: string;
    };
    /** Sender email address from a verified domain. */
    senderAddress: string;
    /** Email content to be sent. */
    content: EmailContent;
    /** Recipients for the email. */
    recipients: EmailRecipients;
    /** List of attachments. Please note that we limit the total size of an email request (which includes attachments) to 10MB. */
    attachments?: EmailAttachment[];
    /** Email addresses where recipients' replies will be sent to. */
    replyTo?: EmailAddress[];
    /** Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane. */
    disableUserEngagementTracking?: boolean;
}

/** Recipients of the email */
export declare interface EmailRecipients {
    /** Email To recipients */
    to?: EmailAddress[];
    /** Email CC recipients */
    cc?: EmailAddress[];
    /** Email BCC recipients */
    bcc?: EmailAddress[];
}

/** Defines headers for Email_send operation. */
export declare interface EmailSendHeaders {
    /** Location url of where to poll the status of this operation from. */
    operationLocation?: string;
    /** This header will only be present when the operation status is a non-terminal status. It indicates the minimum amount of time in seconds to wait before polling for operation status again. */
    retryAfter?: number;
}

/** Optional parameters for the beginSend method. */
export declare interface EmailSendOptionalParams extends OperationOptions {
    /** This is the ID used by the status monitor for this long running operation. */
    operationId?: string;
    /** Delay to wait until next poll, in milliseconds. */
    updateIntervalInMs?: number;
    /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
    resumeFrom?: string;
}

/** Contains response data for the send operation. */
export declare type EmailSendResponse = EmailSendHeaders & EmailSendResult;

/** Status of the long running operation */
export declare interface EmailSendResult {
    /** The unique id of the operation. Use a UUID. */
    id: string;
    /** Status of operation. */
    status: EmailSendStatus;
    /** Error details when status is a non-success terminal state. */
    error?: ErrorDetail;
}

/**
 * Defines values for EmailSendStatus. \
 * {@link KnownEmailSendStatus} can be used interchangeably with EmailSendStatus,
 *  this enum contains the known values that the service supports.
 * ### Known values supported by the service
 * **NotStarted** \
 * **Running** \
 * **Succeeded** \
 * **Failed** \
 * **Canceled**
 */
export declare type EmailSendStatus = string;

/** The resource management error additional info. */
export declare interface ErrorAdditionalInfo {
    /**
     * The additional info type.
     * NOTE: This property will not be serialized. It can only be populated by the server.
     */
    readonly type?: string;
    /**
     * The additional info.
     * NOTE: This property will not be serialized. It can only be populated by the server.
     */
    readonly info?: Record<string, unknown>;
}

/** The error detail. */
export declare interface ErrorDetail {
    /**
     * The error code.
     * NOTE: This property will not be serialized. It can only be populated by the server.
     */
    readonly code?: string;
    /**
     * The error message.
     * NOTE: This property will not be serialized. It can only be populated by the server.
     */
    readonly message?: string;
    /**
     * The error target.
     * NOTE: This property will not be serialized. It can only be populated by the server.
     */
    readonly target?: string;
    /**
     * The error details.
     * NOTE: This property will not be serialized. It can only be populated by the server.
     */
    readonly details?: ErrorDetail[];
    /**
     * The error additional info.
     * NOTE: This property will not be serialized. It can only be populated by the server.
     */
    readonly additionalInfo?: ErrorAdditionalInfo[];
}

/** Content of the email with a required html property. */
export declare interface HtmlEmailContent {
    /** Subject of the email message */
    subject: string;
    /** Plain text version of the email message. */
    plainText?: string;
    /** Html version of the email message. */
    html: string;
}

/** Known values of {@link EmailSendStatus} that the service accepts. */
export declare enum KnownEmailSendStatus {
    /** NotStarted */
    NotStarted = "NotStarted",
    /** Running */
    Running = "Running",
    /** Succeeded */
    Succeeded = "Succeeded",
    /** Failed */
    Failed = "Failed",
    /** Canceled */
    Canceled = "Canceled"
}

/** Content of the email with a required plainText property. */
export declare interface PlainTextEmailContent {
    /** Subject of the email message */
    subject: string;
    /** Plain text version of the email message. */
    plainText: string;
    /** Html version of the email message. */
    html?: string;
}

export { }
