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 { Expose, Type } from "class-transformer";
import { IsOptional, IsString, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/connections/messages/DidCommDidExchangeRequestMessage.ts
var _ref;
/**
* Message to communicate the DID document to the other agent when creating a connection
*
* @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0023-did-exchange/README.md#1-exchange-request
*/
var DidCommDidExchangeRequestMessage = class DidCommDidExchangeRequestMessage extends DidCommMessage {
	/**
	* Create new DidExchangeRequestMessage instance.
	* @param options
	*/
	constructor(options) {
		super();
		this.type = DidCommDidExchangeRequestMessage.type.messageTypeUri;
		if (options) {
			this.id = options.id || this.generateId();
			this.label = options.label;
			this.goalCode = options.goalCode;
			this.goal = options.goal;
			this.did = options.did;
			this.setThread({ parentThreadId: options.parentThreadId });
		}
	}
};
DidCommDidExchangeRequestMessage.type = parseMessageType("https://didcomm.org/didexchange/1.1/request");
__decorate([IsValidMessageType(DidCommDidExchangeRequestMessage.type), __decorateMetadata("design:type", Object)], DidCommDidExchangeRequestMessage.prototype, "type", void 0);
__decorate([IsString(), __decorateMetadata("design:type", String)], DidCommDidExchangeRequestMessage.prototype, "label", void 0);
__decorate([
	Expose({ name: "goal_code" }),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommDidExchangeRequestMessage.prototype, "goalCode", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommDidExchangeRequestMessage.prototype, "goal", void 0);
__decorate([IsString(), __decorateMetadata("design:type", String)], DidCommDidExchangeRequestMessage.prototype, "did", void 0);
__decorate([
	Expose({ name: "did_doc~attach" }),
	Type(() => DidCommAttachment),
	ValidateNested(),
	__decorateMetadata("design:type", typeof (_ref = typeof DidCommAttachment !== "undefined" && DidCommAttachment) === "function" ? _ref : Object)
], DidCommDidExchangeRequestMessage.prototype, "didDoc", void 0);

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