From 38b03139f1caa97e46e230780a20df5ef57eef20 Mon Sep 17 00:00:00 2001 From: Tingluo Huang Date: Thu, 12 Dec 2019 15:04:38 -0500 Subject: [PATCH] c --- src/Sdk/CoreWebApi/Core/ProjectClasses.cs | 80 ------ .../CoreWebApi/Core/TeamProjectReference.cs | 105 -------- .../Contracts/AuthorizationHeader.cs | 16 -- .../Contracts/DataSourceBinding.cs | 149 ---------- .../Contracts/ProcessParameters.cs | 163 ----------- .../Contracts/TaskInputDefinition.cs | 254 ------------------ .../DTContracts/Contracts/TaskInputType.cs | 14 - .../Contracts/TaskInputValidation.cs | 59 ---- .../Contracts/TaskSourceDefinition.cs | 74 ----- 9 files changed, 914 deletions(-) delete mode 100644 src/Sdk/CoreWebApi/Core/ProjectClasses.cs delete mode 100644 src/Sdk/CoreWebApi/Core/TeamProjectReference.cs delete mode 100644 src/Sdk/DTContracts/Contracts/AuthorizationHeader.cs delete mode 100644 src/Sdk/DTContracts/Contracts/DataSourceBinding.cs delete mode 100644 src/Sdk/DTContracts/Contracts/ProcessParameters.cs delete mode 100644 src/Sdk/DTContracts/Contracts/TaskInputDefinition.cs delete mode 100644 src/Sdk/DTContracts/Contracts/TaskInputType.cs delete mode 100644 src/Sdk/DTContracts/Contracts/TaskInputValidation.cs delete mode 100644 src/Sdk/DTContracts/Contracts/TaskSourceDefinition.cs diff --git a/src/Sdk/CoreWebApi/Core/ProjectClasses.cs b/src/Sdk/CoreWebApi/Core/ProjectClasses.cs deleted file mode 100644 index 7b6de8516..000000000 --- a/src/Sdk/CoreWebApi/Core/ProjectClasses.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.Serialization; -using GitHub.Services.Common; -using GitHub.Services.Common.Internal; -using GitHub.Services.WebApi; -using GitHub.Services.WebApi.Patch; -using GitHub.Services.WebApi.Patch.Json; - -namespace GitHub.Core.WebApi -{ - [GenerateAllConstants] - public enum ProjectState - { - /// - /// Project is in the process of being deleted. - /// - [EnumMember] - Deleting = 2, - - /// - /// Project is in the process of being created. - /// - [EnumMember] - New = 0, - - /// - /// Project is completely created and ready to use. - /// - [EnumMember] - WellFormed = 1, - - /// - /// Project has been queued for creation, but the process has not yet started. - /// - [EnumMember] - CreatePending = 3, - - /// - /// All projects regardless of state. - /// - [EnumMember] - All = -1, // Used for filtering. - - /// - /// Project has not been changed. - /// - [EnumMember] - Unchanged = -2, // Used for updating projects. - - /// - /// Project has been deleted. - /// - [EnumMember] - Deleted = 4, // Used for the project history. - } - - public enum ProjectVisibility // Stored as a TINYINT - { - [ClientInternalUseOnly] - Unchanged = -1, // Used for updating projects. - /// - /// The project is only visible to users with explicit access. - /// - Private = 0, - /// - /// Enterprise level project visibility - /// - [ClientInternalUseOnly(omitFromTypeScriptDeclareFile: false)] - Organization = 1, - /// - /// The project is visible to all. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - Public = 2, - [ClientInternalUseOnly] - SystemPrivate = 3 // Soft-deleted projects - } -} diff --git a/src/Sdk/CoreWebApi/Core/TeamProjectReference.cs b/src/Sdk/CoreWebApi/Core/TeamProjectReference.cs deleted file mode 100644 index a46e880f7..000000000 --- a/src/Sdk/CoreWebApi/Core/TeamProjectReference.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Runtime.Serialization; -using GitHub.Services.Common; -using GitHub.Services.WebApi; - -namespace GitHub.Core.WebApi -{ - /// - /// Represents a shallow reference to a TeamProject. - /// - [DataContract] - public class TeamProjectReference : ISecuredObject - { - /// - /// Default constructor to ensure we set up the project state correctly for serialization. - /// - public TeamProjectReference() - { - State = ProjectState.Unchanged; - Visibility = ProjectVisibility.Unchanged; - } - - /// - /// Project identifier. - /// - [DataMember(Order = 0, EmitDefaultValue = false)] - public Guid Id { get; set; } - - /// - /// Project abbreviation. - /// - [DataMember(Order = 1, EmitDefaultValue = false)] - public string Abbreviation { get; set; } - - /// - /// Project name. - /// - [DataMember(Order = 2, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// The project's description (if any). - /// - [DataMember(Order = 3, EmitDefaultValue = false)] - public string Description { get; set; } - - /// - /// Url to the full version of the object. - /// - [DataMember(Order = 4, EmitDefaultValue = false)] - public string Url { get; set; } - - /// - /// Project state. - /// - [DataMember(Order = 5)] - public ProjectState State { get; set; } - - /// - /// Project revision. - /// - [DataMember(Order = 6, EmitDefaultValue = false)] - public Int64 Revision { get; set; } - - /// - /// Project visibility. - /// - [DataMember(Order = 7)] - public ProjectVisibility Visibility { get; set; } - - /// - /// Url to default team identity image. - /// - [DataMember(Order = 8, EmitDefaultValue = false)] - public String DefaultTeamImageUrl { get; set; } - - /// - /// Project last update time. - /// - [DataMember(Order = 9)] - public DateTime LastUpdateTime { get; set; } - - #region ISecuredObject - Guid ISecuredObject.NamespaceId => NamespaceId; - - int ISecuredObject.RequiredPermissions => RequiredPermissions; - - string ISecuredObject.GetToken() - { - return GetToken(); - } - - protected virtual Guid NamespaceId => TeamProjectSecurityConstants.NamespaceId; - - protected virtual int RequiredPermissions => TeamProjectSecurityConstants.GenericRead; - - protected virtual string GetToken() - { - // WE DON'T CARE THIS FOR NOW - return TeamProjectSecurityConstants.GetToken(Id.ToString("D")); - } - - #endregion - } -} diff --git a/src/Sdk/DTContracts/Contracts/AuthorizationHeader.cs b/src/Sdk/DTContracts/Contracts/AuthorizationHeader.cs deleted file mode 100644 index 088d919a5..000000000 --- a/src/Sdk/DTContracts/Contracts/AuthorizationHeader.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Runtime.Serialization; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.Common.Contracts -{ - [DataContract] - public class AuthorizationHeader : BaseSecuredObject - { - [DataMember(EmitDefaultValue = false)] - public String Name { get; set; } - - [DataMember(EmitDefaultValue = false)] - public String Value { get; set; } - } -} diff --git a/src/Sdk/DTContracts/Contracts/DataSourceBinding.cs b/src/Sdk/DTContracts/Contracts/DataSourceBinding.cs deleted file mode 100644 index b8e55c285..000000000 --- a/src/Sdk/DTContracts/Contracts/DataSourceBinding.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using GitHub.Services.Common; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.Common.Contracts -{ - /// - /// Represents binding of data source for the service endpoint request. - /// - [DataContract] - public class DataSourceBindingBase : BaseSecuredObject - { - public DataSourceBindingBase() - { - } - - protected DataSourceBindingBase(DataSourceBindingBase inputDefinitionToClone) - : this(inputDefinitionToClone, null) - { - } - - protected DataSourceBindingBase(DataSourceBindingBase inputDefinitionToClone, ISecuredObject securedObject) - : base(securedObject) - { - this.DataSourceName = inputDefinitionToClone.DataSourceName; - this.EndpointId = inputDefinitionToClone.EndpointId; - this.Target = inputDefinitionToClone.Target; - this.ResultTemplate = inputDefinitionToClone.ResultTemplate; - this.EndpointUrl = inputDefinitionToClone.EndpointUrl; - this.ResultSelector = inputDefinitionToClone.ResultSelector; - this.RequestVerb = inputDefinitionToClone.RequestVerb; - this.RequestContent = inputDefinitionToClone.RequestContent; - this.CallbackContextTemplate = inputDefinitionToClone.CallbackContextTemplate; - this.CallbackRequiredTemplate = inputDefinitionToClone.CallbackRequiredTemplate; - this.InitialContextTemplate = inputDefinitionToClone.InitialContextTemplate; - inputDefinitionToClone.Parameters.Copy(this.Parameters); - this.CloneHeaders(inputDefinitionToClone.Headers); - } - - /// - /// Gets or sets the name of the data source. - /// - [DataMember(EmitDefaultValue = false)] - public string DataSourceName { get; set; } - - /// - /// Gets or sets the parameters for the data source. - /// - [DataMember(EmitDefaultValue = false)] - public Dictionary Parameters - { - get - { - if (m_parameters == null) - { - m_parameters = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - - return m_parameters; - } - } - - public DataSourceBindingBase Clone(ISecuredObject securedObject) - { - return new DataSourceBindingBase(this, securedObject); - } - - private void CloneHeaders(List headers) - { - if (headers == null) - { - return; - } - - this.Headers = headers.Select(header => new AuthorizationHeader { Name = header.Name, Value = header.Value }).ToList(); - } - - /// - /// Gets or sets the endpoint Id. - /// - [DataMember(EmitDefaultValue = false)] - public String EndpointId { get; set; } - - /// - /// Gets or sets the target of the data source. - /// - [DataMember(EmitDefaultValue = false)] - public String Target { get; set; } - - /// - /// Gets or sets the result template. - /// - [DataMember(EmitDefaultValue = false)] - public String ResultTemplate { get; set; } - - /// - /// Gets or sets http request verb - /// - [DataMember(EmitDefaultValue = false)] - public String RequestVerb { get; set; } - - /// - /// Gets or sets http request body - /// - [DataMember(EmitDefaultValue = false)] - public String RequestContent { get; set; } - - /// - /// Gets or sets the url of the service endpoint. - /// - [DataMember(EmitDefaultValue = false)] - public String EndpointUrl { get; set; } - - /// - /// Gets or sets the result selector. - /// - [DataMember(EmitDefaultValue = false)] - public String ResultSelector { get; set; } - - /// - /// Pagination format supported by this data source(ContinuationToken/SkipTop). - /// - [DataMember(EmitDefaultValue = false)] - public String CallbackContextTemplate { get; set; } - - /// - /// Subsequent calls needed? - /// - [DataMember(EmitDefaultValue = false)] - public String CallbackRequiredTemplate { get; set; } - - /// - /// Defines the initial value of the query params - /// - [DataMember(EmitDefaultValue = false)] - public String InitialContextTemplate { get; set; } - - /// - /// Gets or sets the authorization headers. - /// - [DataMember(EmitDefaultValue = false)] - public List Headers { get; set; } - - private Dictionary m_parameters; - } -} diff --git a/src/Sdk/DTContracts/Contracts/ProcessParameters.cs b/src/Sdk/DTContracts/Contracts/ProcessParameters.cs deleted file mode 100644 index 7e7798701..000000000 --- a/src/Sdk/DTContracts/Contracts/ProcessParameters.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using GitHub.DistributedTask.WebApi; -using GitHub.Services.Common; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.Common.Contracts -{ - [DataContract] - public class ProcessParameters : BaseSecuredObject - { - public ProcessParameters() - : this(null) - { - } - - public ProcessParameters(ISecuredObject securedObject) - : this(null, securedObject) - { - } - - private ProcessParameters(ProcessParameters toClone, ISecuredObject securedObject) - : base(securedObject) - { - if (toClone != null) - { - if (toClone.Inputs.Count > 0) - { - Inputs.AddRange(toClone.Inputs.Select(i => i.Clone(securedObject))); - } - - if (toClone.SourceDefinitions.Count > 0) - { - SourceDefinitions.AddRange(toClone.SourceDefinitions.Select(sd => sd.Clone(securedObject))); - } - - if (toClone.DataSourceBindings.Count > 0) - { - DataSourceBindings.AddRange(toClone.DataSourceBindings.Select(dsb => dsb.Clone(securedObject))); - } - } - } - - public IList Inputs - { - get - { - if (m_inputs == null) - { - m_inputs = new List(); - } - return m_inputs; - } - } - - public IList SourceDefinitions - { - get - { - if (m_sourceDefinitions == null) - { - m_sourceDefinitions = new List(); - } - return m_sourceDefinitions; - } - } - - public IList DataSourceBindings - { - get - { - if (m_dataSourceBindings == null) - { - m_dataSourceBindings = new List(); - } - return m_dataSourceBindings; - } - } - - public override int GetHashCode() - { - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - var processParameters2 = obj as ProcessParameters; - if (processParameters2 == null) - { - return false; - } - - if (this.Inputs == null && processParameters2.Inputs == null) - { - return true; - } - - if ((this.Inputs != null && processParameters2.Inputs == null) - || (this.Inputs == null && processParameters2.Inputs != null)) - { - return false; - } - - if (this.Inputs.Count != processParameters2.Inputs.Count) - { - return false; - } - - var orderedProcessParameters1 = this.Inputs.Where(i => i != null).OrderBy(i => i.Name); - var orderedProcessParameters2 = processParameters2.Inputs.Where(i => i != null).OrderBy(i => i.Name); - - if (!orderedProcessParameters1.OrderBy(i => i.Name).SequenceEqual(orderedProcessParameters2)) - { - return false; - } - - return true; - } - - public ProcessParameters Clone(ISecuredObject securedObject = null) - { - return new ProcessParameters(this, securedObject); - } - - [OnDeserialized] - private void OnDeserialized(StreamingContext context) - { - SerializationHelper.Copy(ref m_serializedInputs, ref m_inputs, true); - SerializationHelper.Copy(ref m_serializedSourceDefinitions, ref m_sourceDefinitions, true); - SerializationHelper.Copy(ref m_serializedDataSourceBindings, ref m_dataSourceBindings, true); - } - - [OnSerializing] - private void OnSerializing(StreamingContext context) - { - SerializationHelper.Copy(ref m_inputs, ref m_serializedInputs); - SerializationHelper.Copy(ref m_sourceDefinitions, ref m_serializedSourceDefinitions); - SerializationHelper.Copy(ref m_dataSourceBindings, ref m_serializedDataSourceBindings); - } - - [OnSerialized] - private void OnSerialized(StreamingContext context) - { - m_serializedInputs = null; - m_serializedSourceDefinitions = null; - m_serializedDataSourceBindings = null; - } - - [DataMember(Name = "Inputs", EmitDefaultValue = false)] - private List m_serializedInputs; - - [DataMember(Name = "SourceDefinitions", EmitDefaultValue = false)] - private List m_serializedSourceDefinitions; - - [DataMember(Name = "DataSourceBindings", EmitDefaultValue = false)] - private List m_serializedDataSourceBindings; - - private List m_inputs; - private List m_sourceDefinitions; - private List m_dataSourceBindings; - } -} diff --git a/src/Sdk/DTContracts/Contracts/TaskInputDefinition.cs b/src/Sdk/DTContracts/Contracts/TaskInputDefinition.cs deleted file mode 100644 index 49e5091b6..000000000 --- a/src/Sdk/DTContracts/Contracts/TaskInputDefinition.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.Common.Contracts -{ - [DataContract] - public class TaskInputDefinitionBase : BaseSecuredObject - { - public TaskInputDefinitionBase() - { - InputType = TaskInputType.String; - DefaultValue = String.Empty; - Required = false; - HelpMarkDown = String.Empty; - } - - protected TaskInputDefinitionBase(TaskInputDefinitionBase inputDefinitionToClone) - : this(inputDefinitionToClone, null) - { - } - - protected TaskInputDefinitionBase(TaskInputDefinitionBase inputDefinitionToClone, ISecuredObject securedObject) - : base(securedObject) - { - this.DefaultValue = inputDefinitionToClone.DefaultValue; - this.InputType = inputDefinitionToClone.InputType; - this.Label = inputDefinitionToClone.Label; - this.Name = inputDefinitionToClone.Name; - this.Required = inputDefinitionToClone.Required; - this.HelpMarkDown = inputDefinitionToClone.HelpMarkDown; - this.VisibleRule = inputDefinitionToClone.VisibleRule; - this.GroupName = inputDefinitionToClone.GroupName; - - if (inputDefinitionToClone.Validation != null) - { - this.Validation = inputDefinitionToClone.Validation.Clone(securedObject); - } - - if (inputDefinitionToClone.m_aliases != null) - { - this.m_aliases = new List(inputDefinitionToClone.m_aliases); - } - - if (inputDefinitionToClone.m_options != null) - { - this.m_options = new Dictionary(inputDefinitionToClone.m_options); - } - if (inputDefinitionToClone.m_properties != null) - { - this.m_properties = new Dictionary(inputDefinitionToClone.m_properties); - } - } - - public IList Aliases - { - get - { - if (m_aliases == null) - { - m_aliases = new List(); - } - return m_aliases; - } - } - - [DataMember(EmitDefaultValue = false)] - public String Name - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public String Label - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public String DefaultValue - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public Boolean Required - { - get; - set; - } - - [DataMember(Name = "Type")] - public String InputType - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public String HelpMarkDown - { - get; - set; - } - - // VisibleRule should specify the condition at which this input is to be shown/displayed - // Typical format is "NAME OF THE DEPENDENT INPUT = VALUE TOBE BOUND" - [DataMember(EmitDefaultValue = false)] - public string VisibleRule - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public string GroupName - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public TaskInputValidation Validation - { - get; - set; - } - - public Dictionary Options - { - get - { - if (m_options == null) - { - m_options = new Dictionary(); - } - return m_options; - } - } - - public Dictionary Properties - { - get - { - if (m_properties == null) - { - m_properties = new Dictionary(); - } - return m_properties; - } - } - - public virtual TaskInputDefinitionBase Clone( - ISecuredObject securedObject) - { - return new TaskInputDefinitionBase(this, securedObject); - } - - public override int GetHashCode() - { - return this.Name.GetHashCode() ^ this.DefaultValue.GetHashCode() ^ this.Label.GetHashCode(); - } - - public override bool Equals(object obj) - { - var taskInput2 = obj as TaskInputDefinitionBase; - if (taskInput2 == null - || !string.Equals(InputType, taskInput2.InputType, StringComparison.OrdinalIgnoreCase) - || !string.Equals(Label, taskInput2.Label, StringComparison.OrdinalIgnoreCase) - || !string.Equals(Name, taskInput2.Name, StringComparison.OrdinalIgnoreCase) - || !string.Equals(GroupName, taskInput2.GroupName, StringComparison.OrdinalIgnoreCase) - || !string.Equals(DefaultValue, taskInput2.DefaultValue, StringComparison.OrdinalIgnoreCase) - || !string.Equals(HelpMarkDown, taskInput2.HelpMarkDown, StringComparison.OrdinalIgnoreCase) - || !string.Equals(VisibleRule, taskInput2.VisibleRule, StringComparison.OrdinalIgnoreCase) - || !this.Required.Equals(taskInput2.Required)) - { - return false; - } - - if (!AreListsEqual(Aliases, taskInput2.Aliases) - || !AreDictionariesEqual(Properties, taskInput2.Properties) - || !AreDictionariesEqual(Options, taskInput2.Options)) - { - return false; - } - - if ((Validation != null && taskInput2.Validation == null) - || (Validation == null && taskInput2.Validation != null) - || ((Validation != null && taskInput2.Validation != null) - && !Validation.Equals(taskInput2.Validation))) - { - return false; - } - - return true; - } - - private bool AreDictionariesEqual(Dictionary input1, Dictionary input2) - { - if (input1 == null && input2 == null) - { - return true; - } - - if ((input1 == null && input2 != null) - || (input1 != null && input2 == null) - || (input1.Count != input2.Count)) - { - return false; - } - - foreach (var key in input1.Keys) - { - if (!(input2.ContainsKey(key) && String.Equals(input1[key], input2[key], StringComparison.OrdinalIgnoreCase))) - { - return false; - } - } - - return true; - } - - private Boolean AreListsEqual(IList list1, IList list2) - { - if (list1.Count != list2.Count) - { - return false; - } - - for (Int32 i = 0; i < list1.Count; i++) - { - if (!String.Equals(list1[i], list2[i], StringComparison.OrdinalIgnoreCase)) - { - return false; - } - } - - return true; - } - - [DataMember(Name = "Aliases", EmitDefaultValue = false)] - private List m_aliases; - - [DataMember(Name = "Options", EmitDefaultValue = false)] - private Dictionary m_options; - - [DataMember(Name = "Properties", EmitDefaultValue = false)] - private Dictionary m_properties; - } -} diff --git a/src/Sdk/DTContracts/Contracts/TaskInputType.cs b/src/Sdk/DTContracts/Contracts/TaskInputType.cs deleted file mode 100644 index 44f73df39..000000000 --- a/src/Sdk/DTContracts/Contracts/TaskInputType.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.Serialization; -using System; - -namespace GitHub.DistributedTask.Common.Contracts -{ - public static class TaskInputType - { - public const String String = "string"; - public const String Repository = "repository"; - public const String Boolean = "boolean"; - public const String KeyValue = "keyvalue"; - public const String FilePath = "filepath"; - } -} diff --git a/src/Sdk/DTContracts/Contracts/TaskInputValidation.cs b/src/Sdk/DTContracts/Contracts/TaskInputValidation.cs deleted file mode 100644 index 839e7bf02..000000000 --- a/src/Sdk/DTContracts/Contracts/TaskInputValidation.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Runtime.Serialization; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.Common.Contracts -{ - [DataContract] - public class TaskInputValidation : BaseSecuredObject - { - public TaskInputValidation() - { - } - - private TaskInputValidation(TaskInputValidation toClone, ISecuredObject securedObject) - : base(securedObject) - { - if (toClone != null) - { - this.Expression = toClone.Expression; - this.Message = toClone.Message; - } - } - - /// - /// Conditional expression - /// - [DataMember(EmitDefaultValue = false)] - public String Expression - { - get; - set; - } - - /// - /// Message explaining how user can correct if validation fails - /// - [DataMember(EmitDefaultValue = false)] - public String Message - { - get; - set; - } - - public override int GetHashCode() - { - return Expression.GetHashCode() ^ Message.GetHashCode(); - } - - public TaskInputValidation Clone() - { - return this.Clone(null); - } - - public TaskInputValidation Clone(ISecuredObject securedObject) - { - return new TaskInputValidation(this, securedObject); - } - } -} diff --git a/src/Sdk/DTContracts/Contracts/TaskSourceDefinition.cs b/src/Sdk/DTContracts/Contracts/TaskSourceDefinition.cs deleted file mode 100644 index 20407f51d..000000000 --- a/src/Sdk/DTContracts/Contracts/TaskSourceDefinition.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Runtime.Serialization; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.Common.Contracts -{ - [DataContract] - public class TaskSourceDefinitionBase : BaseSecuredObject - { - public TaskSourceDefinitionBase() - { - AuthKey = String.Empty; - Endpoint = String.Empty; - Selector = String.Empty; - Target = String.Empty; - KeySelector = String.Empty; - } - - protected TaskSourceDefinitionBase(TaskSourceDefinitionBase inputDefinitionToClone) - : this(inputDefinitionToClone, null) - { - } - - protected TaskSourceDefinitionBase(TaskSourceDefinitionBase inputDefinitionToClone, ISecuredObject securedObject) - : base(securedObject) - { - this.Endpoint = inputDefinitionToClone.Endpoint; - this.Target = inputDefinitionToClone.Target; - this.AuthKey = inputDefinitionToClone.AuthKey; - this.Selector = inputDefinitionToClone.Selector; - this.KeySelector = inputDefinitionToClone.KeySelector; - } - - public virtual TaskSourceDefinitionBase Clone(ISecuredObject securedObject) - { - return new TaskSourceDefinitionBase(this, securedObject); - } - - [DataMember(EmitDefaultValue = false)] - public String Endpoint - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public String Target - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public String AuthKey - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public String Selector - { - get; - set; - } - - [DataMember(EmitDefaultValue = false)] - public String KeySelector - { - get; - set; - } - } -}