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 { DidCommCredentialFormatSpec } from "../../../models/DidCommCredentialFormatSpec.mjs";
import "../../../models/index.mjs";
import { Expose, Type } from "class-transformer";
import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/credentials/protocol/v2/messages/DidCommIssueCredentialV2Message.ts
var DidCommIssueCredentialV2Message = class DidCommIssueCredentialV2Message extends DidCommMessage {
	constructor(options) {
		super();
		this.type = DidCommIssueCredentialV2Message.type.messageTypeUri;
		if (options) {
			this.id = options.id ?? this.generateId();
			this.comment = options.comment;
			this.goalCode = options.goalCode;
			this.goal = options.goal;
			this.formats = options.formats;
			this.credentialAttachments = options.credentialAttachments;
		}
	}
	getCredentialAttachmentById(id) {
		return this.credentialAttachments.find((attachment) => attachment.id === id);
	}
};
DidCommIssueCredentialV2Message.type = parseMessageType("https://didcomm.org/issue-credential/2.0/issue-credential");
__decorate([
	Type(() => DidCommCredentialFormatSpec),
	ValidateNested(),
	IsArray(),
	IsInstance(DidCommCredentialFormatSpec, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommIssueCredentialV2Message.prototype, "formats", void 0);
__decorate([IsValidMessageType(DidCommIssueCredentialV2Message.type), __decorateMetadata("design:type", Object)], DidCommIssueCredentialV2Message.prototype, "type", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommIssueCredentialV2Message.prototype, "comment", void 0);
__decorate([
	Expose({ name: "credentials~attach" }),
	Type(() => DidCommAttachment),
	IsArray(),
	ValidateNested({ each: true }),
	IsInstance(DidCommAttachment, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommIssueCredentialV2Message.prototype, "credentialAttachments", void 0);
__decorate([
	Expose({ name: "goal_code" }),
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommIssueCredentialV2Message.prototype, "goalCode", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommIssueCredentialV2Message.prototype, "goal", void 0);

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