using System; using System.Runtime.Serialization; namespace GitHub.DistributedTask.WebApi { /// /// Represents a session for performing message exchanges from an agent. /// [DataContract] public class TaskAgentSession { public TaskAgentSession() { } /// /// Initializes a new TaskAgentSession instance with the specified owner name and agent. /// /// The name of the owner for this session. This should typically be the agent machine /// The target agent for the session public TaskAgentSession( String ownerName, TaskAgentReference agent) { this.Agent = agent; this.OwnerName = ownerName; } /// /// Gets the unique identifier for this session. /// [DataMember] public Guid SessionId { get; internal set; } /// /// Gets the key used to encrypt message traffic for this session. /// [DataMember(EmitDefaultValue = false)] public TaskAgentSessionKey EncryptionKey { get; internal set; } /// /// Gets or sets the owner name of this session. Generally this will be the machine of origination. /// [DataMember] public String OwnerName { get; set; } /// /// Gets or sets the agent which is the target of the session. /// [DataMember] public TaskAgentReference Agent { get; set; } /// /// Gets or sets whether to use FIPS compliant encryption scheme for job message key /// [DataMember] public bool UseFipsEncryption { get; set; } } }