import { __decorateMetadata } from "../../../../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
import { __decorate } from "../../../../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
import { DidCommAttachment } from "../../../../../decorators/attachment/DidCommAttachment.mjs";
import { IsValidMessageType, parseMessageType } from "../../../../../util/messageType.mjs";
import { DidCommMessage } from "../../../../../DidCommMessage.mjs";
import { DidCommProofFormatSpec } from "../../../models/DidCommProofFormatSpec.mjs";
import { utils } from "@credo-ts/core";
import { Expose, Type } from "class-transformer";
import { IsArray, IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/proofs/protocol/v2/messages/DidCommRequestPresentationV2Message.ts
var DidCommRequestPresentationV2Message = class DidCommRequestPresentationV2Message extends DidCommMessage {
	constructor(options) {
		super();
		this.type = DidCommRequestPresentationV2Message.type.messageTypeUri;
		this.willConfirm = false;
		this.presentMultiple = false;
		if (options) {
			this.formats = [];
			this.requestAttachments = [];
			this.id = options.id ?? utils.uuid();
			this.comment = options.comment;
			this.goal = options.goal;
			this.goalCode = options.goalCode;
			this.willConfirm = options.willConfirm ?? true;
			this.presentMultiple = options.presentMultiple ?? false;
			this.requestAttachments = options.requestAttachments;
			this.formats = options.formats;
		}
	}
	getRequestAttachmentById(id) {
		return this.requestAttachments.find((attachment) => attachment.id === id);
	}
};
DidCommRequestPresentationV2Message.type = parseMessageType("https://didcomm.org/present-proof/2.0/request-presentation");
__decorate([IsValidMessageType(DidCommRequestPresentationV2Message.type), __decorateMetadata("design:type", Object)], DidCommRequestPresentationV2Message.prototype, "type", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommRequestPresentationV2Message.prototype, "comment", void 0);
__decorate([
	Expose({ name: "goal_code" }),
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommRequestPresentationV2Message.prototype, "goalCode", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommRequestPresentationV2Message.prototype, "goal", void 0);
__decorate([
	Expose({ name: "will_confirm" }),
	IsBoolean(),
	__decorateMetadata("design:type", Object)
], DidCommRequestPresentationV2Message.prototype, "willConfirm", void 0);
__decorate([
	Expose({ name: "present_multiple" }),
	IsBoolean(),
	__decorateMetadata("design:type", Object)
], DidCommRequestPresentationV2Message.prototype, "presentMultiple", void 0);
__decorate([
	Expose({ name: "formats" }),
	Type(() => DidCommProofFormatSpec),
	IsArray(),
	ValidateNested({ each: true }),
	IsInstance(DidCommProofFormatSpec, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommRequestPresentationV2Message.prototype, "formats", void 0);
__decorate([
	Expose({ name: "request_presentations~attach" }),
	Type(() => DidCommAttachment),
	IsArray(),
	ValidateNested({ each: true }),
	IsInstance(DidCommAttachment, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommRequestPresentationV2Message.prototype, "requestAttachments", void 0);

//#endregion
export { DidCommRequestPresentationV2Message };
//# sourceMappingURL=DidCommRequestPresentationV2Message.mjs.map