import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import type { CallContext, CallOptions } from "nice-grpc-common";
import type { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors";
import { Any } from "../../google/protobuf/any";
import { ShippingAddress } from "./address";
import { Amount } from "./amount";
import { Subject } from "./auth";
import { File } from "./file";
import { InvoiceListResponse } from "./invoice";
import { Meta } from "./meta";
import { Price } from "./price";
import { Package } from "./product";
import { Reference } from "./reference";
import { DeleteRequest, DeleteResponse, ReadRequest } from "./resource_base";
import { OperationStatus, Status, StatusListResponse } from "./status";
export declare const protobufPackage = "io.restorecommerce.fulfillment";
export declare enum FulfillmentState {
    PENDING = "PENDING",
    SUBMITTED = "SUBMITTED",
    IN_TRANSIT = "IN_TRANSIT",
    COMPLETE = "COMPLETE",
    CANCELLED = "CANCELLED",
    WITHDRAWN = "WITHDRAWN",
    RETOURE = "RETOURE",
    RETOURE_COMPLETE = "RETOURE_COMPLETE",
    FAILED = "FAILED",
    INVALID = "INVALID",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function fulfillmentStateFromJSON(object: any): FulfillmentState;
export declare function fulfillmentStateToJSON(object: FulfillmentState): string;
export declare function fulfillmentStateToNumber(object: FulfillmentState): number;
export declare enum ExportType {
    OTHER = "OTHER",
    PRESENT = "PRESENT",
    COMMERCIAL_SAMPLE = "COMMERCIAL_SAMPLE",
    DOCUMENT = "DOCUMENT",
    RETURN_OF_GOODS = "RETURN_OF_GOODS",
    COMMERCIAL_GOODS = "COMMERCIAL_GOODS",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function exportTypeFromJSON(object: any): ExportType;
export declare function exportTypeToJSON(object: ExportType): string;
export declare function exportTypeToNumber(object: ExportType): number;
export declare enum ShippingCondition {
    DDU = "DDU",
    DPA = "DPA",
    DAP = "DAP",
    DDP = "DDP",
    DDX = "DDX",
    DXV = "DXV",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function shippingConditionFromJSON(object: any): ShippingCondition;
export declare function shippingConditionToJSON(object: ShippingCondition): string;
export declare function shippingConditionToNumber(object: ShippingCondition): number;
export interface Item {
    productId?: string | undefined;
    variantId?: string | undefined;
    quantity?: number | undefined;
    name?: string | undefined;
    description?: string | undefined;
    taricCode?: string | undefined;
    hsCode?: string | undefined;
    originCountryId?: string | undefined;
    value?: Amount | undefined;
    package?: Package | undefined;
}
export interface Parcel {
    id?: string | undefined;
    productId?: string | undefined;
    variantId?: string | undefined;
    items?: Item[] | undefined;
    price?: Price | undefined;
    amount?: Amount | undefined;
    package?: Package | undefined;
}
export interface Label {
    id?: string | undefined;
    parcelId?: string | undefined;
    file?: File | undefined;
    /** filled on Order */
    shipmentNumber?: string | undefined;
    /** update by Track */
    state?: FulfillmentState | undefined;
    /** API status */
    status?: Status | undefined;
}
export interface Charge {
    description?: string | undefined;
    charge?: Amount | undefined;
}
export interface CustomsDeclaration {
    /** should be ExportType (but unconstrained) */
    exportType?: string | undefined;
    exportDescription?: string | undefined;
    invoiceNumber?: string | undefined;
    consigneeRef?: string | undefined;
    shipperRef?: string | undefined;
    MRN?: string | undefined;
    /** for e.g. rare goods */
    permitNumber?: string | undefined;
    /** for e.g. medical goods */
    attestation?: string | undefined;
    /** should be ShippingCondition (unconstrained) */
    shippingCondition?: string | undefined;
    charges?: Charge[] | undefined;
    notify?: boolean | undefined;
}
export interface Packaging {
    parcels?: Parcel[] | undefined;
    sender?: ShippingAddress | undefined;
    recipient?: ShippingAddress | undefined;
    notify?: string | undefined;
    customsDeclaration?: CustomsDeclaration | undefined;
}
export interface Event {
    timestamp?: Date | undefined;
    location?: string | undefined;
    details?: Any | undefined;
    status?: Status | undefined;
}
export interface Tracking {
    shipmentNumber?: string | undefined;
    events?: Event[] | undefined;
    details?: Any | undefined;
    status?: Status | undefined;
}
/** This is the message of how it get stored to the database */
export interface Fulfillment {
    id?: string | undefined;
    meta?: Meta | undefined;
    userId?: string | undefined;
    customerId?: string | undefined;
    shopId?: string | undefined;
    references?: Reference[] | undefined;
    packaging?: Packaging | undefined;
    /** set by service */
    labels?: Label[] | undefined;
    /** set by service */
    trackings?: Tracking[] | undefined;
    /** set by service */
    totalAmounts?: Amount[] | undefined;
    /** set by service */
    fulfillmentState?: FulfillmentState | undefined;
    /** url to rendered PDFs */
    documents?: File[] | undefined;
}
export interface FulfillmentList {
    items?: Fulfillment[] | undefined;
    totalCount?: number | undefined;
    subject?: Subject | undefined;
}
export interface FulfillmentResponse {
    payload?: Fulfillment | undefined;
    status?: Status | undefined;
}
export interface FulfillmentListResponse {
    items?: FulfillmentResponse[] | undefined;
    totalCount?: number | undefined;
    operationStatus?: OperationStatus | undefined;
}
export interface FulfillmentId {
    id?: string | undefined;
    /** optional */
    shipmentNumbers?: string[] | undefined;
    options?: Any | undefined;
}
export interface FulfillmentIdList {
    items?: FulfillmentId[] | undefined;
    totalCount?: number | undefined;
    subject?: Subject | undefined;
}
export interface FulfillmentInvoiceSection {
    fulfillmentId?: string | undefined;
    /** selects all on empty */
    selectedParcels?: string[] | undefined;
}
export interface FulfillmentInvoiceRequest {
    /** if given */
    invoiceNumber?: string | undefined;
    paymentHints?: string[] | undefined;
    sections?: FulfillmentInvoiceSection[] | undefined;
}
export interface FulfillmentInvoiceRequestList {
    items?: FulfillmentInvoiceRequest[] | undefined;
    totalCount?: number | undefined;
    subject?: Subject | undefined;
}
export declare const Item: MessageFns<Item>;
export declare const Parcel: MessageFns<Parcel>;
export declare const Label: MessageFns<Label>;
export declare const Charge: MessageFns<Charge>;
export declare const CustomsDeclaration: MessageFns<CustomsDeclaration>;
export declare const Packaging: MessageFns<Packaging>;
export declare const Event: MessageFns<Event>;
export declare const Tracking: MessageFns<Tracking>;
export declare const Fulfillment: MessageFns<Fulfillment>;
export declare const FulfillmentList: MessageFns<FulfillmentList>;
export declare const FulfillmentResponse: MessageFns<FulfillmentResponse>;
export declare const FulfillmentListResponse: MessageFns<FulfillmentListResponse>;
export declare const FulfillmentId: MessageFns<FulfillmentId>;
export declare const FulfillmentIdList: MessageFns<FulfillmentIdList>;
export declare const FulfillmentInvoiceSection: MessageFns<FulfillmentInvoiceSection>;
export declare const FulfillmentInvoiceRequest: MessageFns<FulfillmentInvoiceRequest>;
export declare const FulfillmentInvoiceRequestList: MessageFns<FulfillmentInvoiceRequestList>;
/** Microservice definition. */
export type FulfillmentServiceDefinition = typeof FulfillmentServiceDefinition;
export declare const FulfillmentServiceDefinition: {
    readonly name: "FulfillmentService";
    readonly fullName: "io.restorecommerce.fulfillment.FulfillmentService";
    readonly methods: {
        /** Returns a list of shipment IDs. */
        readonly read: {
            readonly name: "Read";
            readonly requestType: typeof ReadRequest;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {
                readonly _unknownFields: {
                    readonly 248008: readonly [Buffer<ArrayBufferLike>];
                };
            };
        };
        /** Creates fulfillment orders */
        readonly create: {
            readonly name: "Create";
            readonly requestType: typeof FulfillmentList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Updates fulfillment orders unless Status is beyond Submit */
        readonly update: {
            readonly name: "Update";
            readonly requestType: typeof FulfillmentList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Creates or Updates fulfillment orders unless Status is beyond Submit */
        readonly upsert: {
            readonly name: "Upsert";
            readonly requestType: typeof FulfillmentList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Evaluate fulfillment for correctness */
        readonly evaluate: {
            readonly name: "Evaluate";
            readonly requestType: typeof FulfillmentList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Creates, Submits and Updates fulfillment orders against API */
        readonly submit: {
            readonly name: "Submit";
            readonly requestType: typeof FulfillmentList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Track a batch of fulfillments */
        readonly track: {
            readonly name: "Track";
            readonly requestType: typeof FulfillmentIdList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Withdraw a batch of fulfillments and request for cancelation */
        readonly withdraw: {
            readonly name: "Withdraw";
            readonly requestType: typeof FulfillmentIdList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Cancel a batch of fulfillments */
        readonly cancel: {
            readonly name: "Cancel";
            readonly requestType: typeof FulfillmentIdList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Delete a batch of fulfillments from the database */
        readonly delete: {
            readonly name: "Delete";
            readonly requestType: typeof DeleteRequest;
            readonly requestStream: false;
            readonly responseType: typeof DeleteResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Evaluate and (re-)Render fulfillments as PDF to ostorage. (creates if not exist, updates if id is given) */
        readonly render: {
            readonly name: "Render";
            readonly requestType: typeof FulfillmentList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Requires Invoice Service */
        readonly createInvoice: {
            readonly name: "CreateInvoice";
            readonly requestType: typeof FulfillmentInvoiceRequestList;
            readonly requestStream: false;
            readonly responseType: typeof InvoiceListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Requires Invoice Service */
        readonly triggerInvoice: {
            readonly name: "TriggerInvoice";
            readonly requestType: typeof FulfillmentInvoiceRequestList;
            readonly requestStream: false;
            readonly responseType: typeof StatusListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
    };
};
export interface FulfillmentServiceImplementation<CallContextExt = {}> {
    /** Returns a list of shipment IDs. */
    read(request: ReadRequest, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Creates fulfillment orders */
    create(request: FulfillmentList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Updates fulfillment orders unless Status is beyond Submit */
    update(request: FulfillmentList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Creates or Updates fulfillment orders unless Status is beyond Submit */
    upsert(request: FulfillmentList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Evaluate fulfillment for correctness */
    evaluate(request: FulfillmentList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Creates, Submits and Updates fulfillment orders against API */
    submit(request: FulfillmentList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Track a batch of fulfillments */
    track(request: FulfillmentIdList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Withdraw a batch of fulfillments and request for cancelation */
    withdraw(request: FulfillmentIdList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Cancel a batch of fulfillments */
    cancel(request: FulfillmentIdList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Delete a batch of fulfillments from the database */
    delete(request: DeleteRequest, context: CallContext & CallContextExt): Promise<DeepPartial<DeleteResponse>>;
    /** Evaluate and (re-)Render fulfillments as PDF to ostorage. (creates if not exist, updates if id is given) */
    render(request: FulfillmentList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Requires Invoice Service */
    createInvoice(request: FulfillmentInvoiceRequestList, context: CallContext & CallContextExt): Promise<DeepPartial<InvoiceListResponse>>;
    /** Requires Invoice Service */
    triggerInvoice(request: FulfillmentInvoiceRequestList, context: CallContext & CallContextExt): Promise<DeepPartial<StatusListResponse>>;
}
export interface FulfillmentServiceClient<CallOptionsExt = {}> {
    /** Returns a list of shipment IDs. */
    read(request: DeepPartial<ReadRequest>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Creates fulfillment orders */
    create(request: DeepPartial<FulfillmentList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Updates fulfillment orders unless Status is beyond Submit */
    update(request: DeepPartial<FulfillmentList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Creates or Updates fulfillment orders unless Status is beyond Submit */
    upsert(request: DeepPartial<FulfillmentList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Evaluate fulfillment for correctness */
    evaluate(request: DeepPartial<FulfillmentList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Creates, Submits and Updates fulfillment orders against API */
    submit(request: DeepPartial<FulfillmentList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Track a batch of fulfillments */
    track(request: DeepPartial<FulfillmentIdList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Withdraw a batch of fulfillments and request for cancelation */
    withdraw(request: DeepPartial<FulfillmentIdList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Cancel a batch of fulfillments */
    cancel(request: DeepPartial<FulfillmentIdList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Delete a batch of fulfillments from the database */
    delete(request: DeepPartial<DeleteRequest>, options?: CallOptions & CallOptionsExt): Promise<DeleteResponse>;
    /** Evaluate and (re-)Render fulfillments as PDF to ostorage. (creates if not exist, updates if id is given) */
    render(request: DeepPartial<FulfillmentList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Requires Invoice Service */
    createInvoice(request: DeepPartial<FulfillmentInvoiceRequestList>, options?: CallOptions & CallOptionsExt): Promise<InvoiceListResponse>;
    /** Requires Invoice Service */
    triggerInvoice(request: DeepPartial<FulfillmentInvoiceRequestList>, options?: CallOptions & CallOptionsExt): Promise<StatusListResponse>;
}
type ProtoMetaMessageOptions = {
    options?: {
        [key: string]: any;
    };
    fields?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    oneof?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    nested?: {
        [key: string]: ProtoMetaMessageOptions;
    };
};
export interface ProtoMetadata {
    fileDescriptor: FileDescriptorProto1;
    references: {
        [key: string]: any;
    };
    dependencies?: ProtoMetadata[];
    options?: {
        options?: {
            [key: string]: any;
        };
        services?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                methods?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
        messages?: {
            [key: string]: ProtoMetaMessageOptions;
        };
        enums?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                values?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
    };
}
export declare const protoMetadata: ProtoMetadata;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
    [K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T> {
    encode(message: T, writer?: BinaryWriter): BinaryWriter;
    decode(input: BinaryReader | Uint8Array, length?: number): T;
    fromJSON(object: any): T;
    toJSON(message: T): unknown;
    create(base?: DeepPartial<T>): T;
    fromPartial(object: DeepPartial<T>): T;
}
export {};
//# sourceMappingURL=fulfillment.d.ts.map