export interface AsyncJob {
    /**
     * Job ID.
     * @format GUID
     * @readonly
     */
    id?: string;
    /** Optional job metadata, used to store any parameters used during job execution, user-defined statuses, etc. */
    metadata?: Record<string, any> | null;
    /** Current job execution status. */
    status?: Status;
    /**
     * Current counters.
     * @deprecated Current counters.
     * @replacedBy wix.infra.asyncjobs.v1.AsyncJob.counts
     * @targetRemovalDate 2024-12-12
     */
    counters?: Counters;
    /**
     * Date and time the job was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
     * @readonly
     */
    createdDate?: Date | null;
    /**
     * Date and time the job was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
     * @readonly
     */
    updatedDate?: Date | null;
    /**
     * Job owner.
     * @readonly
     * @deprecated Job owner.
     * @replacedBy wix.infra.asyncjobs.v1.AsyncJob.created_by
     * @targetRemovalDate 2024-12-12
     */
    owner?: Owner;
    /**
     * Job creator.
     * @readonly
     */
    createdBy?: CreatedBy;
    /** Current execution counts. */
    counts?: Counts;
}
export declare enum Type {
    UNKNOWN_TYPE = "UNKNOWN_TYPE",
    /** Job was created by a site visitor that was **not** logged in. */
    ANONYMOUS_VISITOR_ID = "ANONYMOUS_VISITOR_ID",
    /** Job was created by a **logged in** site visitor. */
    MEMBER_ID = "MEMBER_ID",
    /** Job was created by a  Wix user. */
    WIX_USER_ID = "WIX_USER_ID",
    /** Job was created by an external app or app by Wix. */
    APP_ID = "APP_ID"
}
export interface AnonymousVisitorIdOptions {
    /**
     * Visitor ID - When the job is owned by a site visitor that was **not** logged in.
     * @format GUID
     */
    anonymousVisitorId?: string;
}
export interface MemberIdOptions {
    /**
     * Member ID - When the job is owned by a by a **logged in** site visitor.
     * @format GUID
     */
    memberId?: string;
}
export interface WixUserIdOptions {
    /**
     * User ID - When the job is owned by a site owner or contributor.
     * @format GUID
     */
    wixUserId?: string;
}
export interface AppIdOptions {
    /**
     * App ID - When the job is owned by an external app. or app by Wix.
     * @format GUID
     */
    appId?: string;
}
export declare enum Status {
    UNKNOWN = "UNKNOWN",
    /** Job is created, but hasn't started yet. */
    INITIALIZED = "INITIALIZED",
    /** Job has started and is in progress. */
    PROCESSING = "PROCESSING",
    /** Job is finished. */
    FINISHED = "FINISHED",
    /** Job has failed. */
    FAILED = "FAILED"
}
export interface Counters {
    /** Optional count of the dataset size, as specified during job creation. Can be used for progress bars, etc. */
    itemsToProcess?: number | null;
    /** Amount of items that were successfully processed. */
    itemsSucceeded?: number;
    /** Amount of items whose processing failed. */
    itemsFailed?: number;
    /** Mapping between an error code and the number of failures associated with it. */
    errorCountByCode?: Record<string, number>;
}
export interface Owner extends OwnerIdOneOf {
    /**
     * Visitor ID - when the job is owned by a site visitor that was **not** logged in.
     * @format GUID
     */
    anonymousVisitorId?: string;
    /**
     * Member ID - When the job is owned by a by a **logged in** site visitor.
     * @format GUID
     */
    memberId?: string;
    /**
     * User ID - When the job is owned by a Wix user.
     * @format GUID
     */
    wixUserId?: string;
    /**
     * App ID - When the job is owned by an external app or app by Wix.
     * @format GUID
     */
    appId?: string;
    /**
     * Service ID.
     * @format GUID
     */
    serviceId?: string;
}
/** @oneof */
export interface OwnerIdOneOf {
    /**
     * Visitor ID - when the job is owned by a site visitor that was **not** logged in.
     * @format GUID
     */
    anonymousVisitorId?: string;
    /**
     * Member ID - When the job is owned by a by a **logged in** site visitor.
     * @format GUID
     */
    memberId?: string;
    /**
     * User ID - When the job is owned by a Wix user.
     * @format GUID
     */
    wixUserId?: string;
    /**
     * App ID - When the job is owned by an external app or app by Wix.
     * @format GUID
     */
    appId?: string;
    /**
     * Service ID.
     * @format GUID
     */
    serviceId?: string;
}
export interface CreatedBy extends CreatedByOptionsOneOf {
    /** Visitor ID - when the job is created by a site visitor that was **not** logged in. */
    anonymousVisitorIdOptions?: AnonymousVisitorIdOptions;
    /** Member ID - When the job is created by a by a **logged in** site visitor. */
    memberIdOptions?: MemberIdOptions;
    /** User ID - When the job is created by a Wix user. */
    wixUserIdOptions?: WixUserIdOptions;
    /** App ID - When the job is created by an external app or app by Wix. */
    appIdOptions?: AppIdOptions;
    /** The type of the creator. */
    type?: Type;
}
/** @oneof */
export interface CreatedByOptionsOneOf {
    /** Visitor ID - when the job is created by a site visitor that was **not** logged in. */
    anonymousVisitorIdOptions?: AnonymousVisitorIdOptions;
    /** Member ID - When the job is created by a by a **logged in** site visitor. */
    memberIdOptions?: MemberIdOptions;
    /** User ID - When the job is created by a Wix user. */
    wixUserIdOptions?: WixUserIdOptions;
    /** App ID - When the job is created by an external app or app by Wix. */
    appIdOptions?: AppIdOptions;
}
export interface Counts {
    /** Optional count of the dataset size, specified during job creation. Can be used for progress bars, etc. */
    total?: number | null;
    /** Amount of items that were successfully processed. */
    successCount?: number;
    /** Amount of items whose processing failed. */
    failCount?: number;
    /** Mapping between an error code and the number of failures associated with it. */
    errorByCodeCount?: Record<string, number>;
}
/** Events */
export interface AsyncJobFinishedEvent {
    /**
     * Job ID.
     * @format GUID
     */
    jobId?: string;
}
export interface AsyncJobFailedEvent {
    /**
     * Job ID.
     * @format GUID
     */
    jobId?: string;
}
export interface AsyncJobItemFailedEvent {
    /**
     * Job ID.
     * @format GUID
     */
    jobId?: string;
    /** Job items. */
    jobItem?: AsyncJobItem;
}
export interface AsyncJobItem {
    /**
     * Job item ID.
     * @format GUID
     * @readonly
     */
    id?: string;
    /** Job item data, as passed by the originating service. */
    data?: Record<string, any> | null;
    /**
     * ID of the entity being processed, as passed by the originating service.
     * @minLength 1
     * @maxLength 32
     * @immutable
     */
    entityId?: string | null;
    /**
     * Whether the job item was processed successfully.
     * @readonly
     */
    success?: boolean;
    /**
     * Error that prevented the item from being processed, if relevant.
     * @immutable
     */
    error?: ApplicationError;
}
export interface ApplicationError {
    /** Error code. */
    code?: string;
    /** Description of the error. */
    description?: string;
    /** Data related to the error. */
    data?: Record<string, any> | null;
}
export interface CreateAsyncJobRequest {
    /** Job to create. */
    job: AsyncJob;
}
export interface CreateAsyncJobResponse {
    /** Created job. */
    job?: AsyncJob;
}
export interface GetAsyncJobRequest {
    /**
     * Job ID.
     * @format GUID
     */
    jobId: string;
}
export interface GetAsyncJobResponse {
    /** Returned job. */
    job?: AsyncJob;
}
export interface UpdateAsyncJobRequest {
    /** Job to update. */
    job?: AsyncJob;
    /**
     * Field mask.
     * @internal
     */
    mask?: string[];
}
export interface UpdateAsyncJobResponse {
    /** Updated job. */
    job?: AsyncJob;
}
export interface DeleteAsyncJobRequest {
    /**
     * Job ID.
     * @format GUID
     */
    jobId: string;
}
export interface DeleteAsyncJobResponse {
}
export interface CompleteAsyncJobRequest {
    /**
     * Job ID.
     * @format GUID
     */
    jobId: string;
    /** Job status. */
    status?: CompleteStatus;
}
export declare enum CompleteStatus {
    /** Job is finished. */
    FINISHED = "FINISHED",
    /** Job has failed. */
    FAILED = "FAILED"
}
export interface CompleteAsyncJobResponse {
}
export interface ReportAsyncJobProgressRequest {
    /**
     * Job ID.
     * @format GUID
     */
    jobId: string;
    /**
     * Job items being reported.
     * @maxSize 1000
     */
    items?: AsyncJobItem[];
}
export interface ReportAsyncJobProgressResponse {
}
export interface AsyncJobItemAddedEvent {
    /**
     * Job ID.
     * @format GUID
     */
    jobId?: string;
    /** Job items. */
    jobItem?: AsyncJobItem;
}
export interface ListAsyncJobItemsRequest {
    /**
     * Job ID.
     * @format GUID
     */
    jobId: string;
    /** Pagination options. */
    paging?: CursorPaging;
    /**
     * Whether to return only failed items.
     * when false, only successful items will be returned.
     * when not set, all both failed and successful will be returned.
     * @internal
     * @deprecated
     * @replacedBy wix.infra.asyncjobs.v1.ListAsyncJobItemsRequest.status_filter
     * @targetRemovalDate 2024-12-12
     */
    hasError?: boolean | null;
    /** async job item status filter. */
    statusFilter?: StatusFilter;
}
export interface CursorPaging {
    /**
     * Maximum number of items to return in the results.
     * @max 100
     */
    limit?: number | null;
    /**
     * Pointer to the next or previous page in the list of results.
     *
     * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
     * Not relevant for the first request.
     * @maxLength 16000
     */
    cursor?: string | null;
}
export declare enum StatusFilter {
    /** Return all items. */
    ALL = "ALL",
    /** Return only failed items. */
    FAILED_ONLY = "FAILED_ONLY",
    /** Return only successful items. */
    SUCCESSFUL_ONLY = "SUCCESSFUL_ONLY"
}
export interface ListAsyncJobItemsResponse {
    /** Job items. */
    results?: AsyncJobItem[];
    /** Paging metadata. */
    pagingMetadata?: PagingMetadataV2;
}
export interface PagingMetadataV2 {
    /** Number of items returned in the response. */
    count?: number | null;
    /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
    cursors?: Cursors;
    /**
     * Indicates if there are more results after the current page.
     * If `true`, another page of results can be retrieved.
     * If `false`, this is the last page.
     * @internal
     */
    hasNext?: boolean | null;
}
export interface Cursors {
    /**
     * Cursor pointing to next page in the list of results.
     * @maxLength 16000
     */
    next?: string | null;
    /**
     * Cursor pointing to previous page in the list of results.
     * @maxLength 16000
     */
    prev?: string | null;
}
export interface DomainEvent extends DomainEventBodyOneOf {
    createdEvent?: EntityCreatedEvent;
    updatedEvent?: EntityUpdatedEvent;
    deletedEvent?: EntityDeletedEvent;
    actionEvent?: ActionEvent;
    /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
    id?: string;
    /**
     * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
     * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     */
    entityFqdn?: string;
    /**
     * Event action name, placed at the top level to make it easier for users to dispatch messages.
     * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     */
    slug?: string;
    /** ID of the entity associated with the event. */
    entityId?: string;
    /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
    eventTime?: Date | null;
    /**
     * Whether the event was triggered as a result of a privacy regulation application
     * (for example, GDPR).
     */
    triggeredByAnonymizeRequest?: boolean | null;
    /** If present, indicates the action that triggered the event. */
    originatedFrom?: string | null;
    /**
     * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
     * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
     */
    entityEventSequence?: string | null;
}
/** @oneof */
export interface DomainEventBodyOneOf {
    createdEvent?: EntityCreatedEvent;
    updatedEvent?: EntityUpdatedEvent;
    deletedEvent?: EntityDeletedEvent;
    actionEvent?: ActionEvent;
}
export interface EntityCreatedEvent {
    entityAsJson?: string;
    /**
     * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity
     * @internal
     */
    triggeredByUndelete?: boolean | null;
    /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
    restoreInfo?: RestoreInfo;
    /**
     * WIP
     * @internal
     */
    additionalMetadataAsJson?: string | null;
}
export interface RestoreInfo {
    deletedDate?: Date | null;
}
export interface EntityUpdatedEvent {
    /**
     * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
     * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
     * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
     */
    currentEntityAsJson?: string;
    /**
     * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard
     * wont populate it / have any reference to it in the API.
     * The main reason for it is that fetching the old entity from the DB will have a performance hit on an update operation so unless truly needed,
     * the developer should send only the new (current) entity.
     * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big
     * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message.
     * @internal
     * @deprecated
     */
    previousEntityAsJson?: string | null;
    /**
     * WIP - This property will hold both names and previous values of the updated fields of the entity.
     * For more details please see [adr](https://docs.google.com/document/d/1PdqsOM20Ph2HAkmx8zvUnzzk3Sekp3BR9h34wSvsRnI/edit#heading=h.phlw87mh2imx) or [issue](https://github.com/wix-private/nile-tracker/issues/363)
     * @internal
     */
    modifiedFields?: Record<string, any>;
    /**
     * WIP
     * @internal
     */
    additionalMetadataAsJson?: string | null;
}
export interface EntityDeletedEvent {
    /**
     * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled
     * @internal
     */
    movedToTrash?: boolean | null;
    /** Entity that was deleted. */
    deletedEntityAsJson?: string | null;
    /**
     * WIP
     * @internal
     */
    additionalMetadataAsJson?: string | null;
}
export interface ActionEvent {
    bodyAsJson?: string;
}
export interface MessageEnvelope {
    /**
     * App instance ID.
     * @format GUID
     */
    instanceId?: string | null;
    /**
     * Event type.
     * @maxLength 150
     */
    eventType?: string;
    /** The identification type and identity data. */
    identity?: IdentificationData;
    /** Stringify payload. */
    data?: string;
}
export interface IdentificationData extends IdentificationDataIdOneOf {
    /**
     * ID of a site visitor that has not logged in to the site.
     * @format GUID
     */
    anonymousVisitorId?: string;
    /**
     * ID of a site visitor that has logged in to the site.
     * @format GUID
     */
    memberId?: string;
    /**
     * ID of a Wix user (site owner, contributor, etc.).
     * @format GUID
     */
    wixUserId?: string;
    /**
     * ID of an app.
     * @format GUID
     */
    appId?: string;
    /** @readonly */
    identityType?: WebhookIdentityType;
}
/** @oneof */
export interface IdentificationDataIdOneOf {
    /**
     * ID of a site visitor that has not logged in to the site.
     * @format GUID
     */
    anonymousVisitorId?: string;
    /**
     * ID of a site visitor that has logged in to the site.
     * @format GUID
     */
    memberId?: string;
    /**
     * ID of a Wix user (site owner, contributor, etc.).
     * @format GUID
     */
    wixUserId?: string;
    /**
     * ID of an app.
     * @format GUID
     */
    appId?: string;
}
export declare enum WebhookIdentityType {
    UNKNOWN = "UNKNOWN",
    ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
    MEMBER = "MEMBER",
    WIX_USER = "WIX_USER",
    APP = "APP"
}
