Exemplo n.º 1
0
        public IBrokeredMessage SerializePackageValidationMessageData(PackageValidationMessageData message)
        {
            switch (message.Type)
            {
            case PackageValidationMessageType.StartValidation:
                return(_startValidationSerializer.Serialize(new StartValidationData1
                {
                    ValidationTrackingId = message.StartValidation.ValidationTrackingId,
                    ContentType = message.StartValidation.ContentType,
                    ContentUrl = message.StartValidation.ContentUrl,
                    Properties = message.StartValidation.Properties,
                }));

            case PackageValidationMessageType.ProcessValidationSet:
                return(_processValidationSetSerializer.Serialize(new ProcessValidationSetData1
                {
                    PackageId = message.ProcessValidationSet.PackageId,
                    PackageVersion = message.ProcessValidationSet.PackageVersion,
                    PackageNormalizedVersion = message.ProcessValidationSet.PackageNormalizedVersion,
                    ValidationTrackingId = message.ProcessValidationSet.ValidationTrackingId,
                    ValidatingType = message.ProcessValidationSet.ValidatingType,
                    EntityKey = message.ProcessValidationSet.EntityKey,
                }));

            case PackageValidationMessageType.CheckValidationSet:
                return(_checkValidationSetSerializer.Serialize(new CheckValidationSetData1
                {
                    ValidationTrackingId = message.CheckValidationSet.ValidationTrackingId,
                    ExtendExpiration = message.CheckValidationSet.ExtendExpiration,
                }));

            case PackageValidationMessageType.CheckValidator:
                return(_checkValidatorSerializer.Serialize(new CheckValidatorData1
                {
                    ValidationId = message.CheckValidator.ValidationId,
                }));

            default:
                throw new NotSupportedException($"The package validation message type '{message.Type}' is not supported.");
            }
        }
 public async Task SendMessageAsync(PackageValidationMessageData message)
 {
     await SendMessageAsync(message, DateTimeOffset.MinValue);
 }