// Copyright © WireMock.Net using System; using Stef.Validation; using WireMock.Models; namespace WireMock.ResponseBuilders; /// /// Implementation of IWebSocketMessage /// public class WebSocketMessage : IWebSocketMessage { private string? _bodyAsString; private byte[]? _bodyAsBytes; /// public int DelayMs { get; set; } /// public string? BodyAsString { get => _bodyAsString; set { _bodyAsString = value; _bodyAsBytes = null; } } /// public byte[]? BodyAsBytes { get => _bodyAsBytes; set { _bodyAsBytes = value; _bodyAsString = null; } } /// public bool IsText => _bodyAsBytes == null; /// public string Id { get; set; } = Guid.NewGuid().ToString(); /// public string? CorrelationId { get; set; } }