diff --git a/src/Sdk/DTGenerated/Generated/TaskAgentHttpClientBase.cs b/src/Sdk/DTGenerated/Generated/TaskAgentHttpClientBase.cs index c2d321c318a..cc92e4ff25c 100644 --- a/src/Sdk/DTGenerated/Generated/TaskAgentHttpClientBase.cs +++ b/src/Sdk/DTGenerated/Generated/TaskAgentHttpClientBase.cs @@ -33,7 +33,7 @@ namespace GitHub.DistributedTask.WebApi { [ResourceArea(TaskResourceIds.AreaId)] - public abstract class TaskAgentHttpClientBase : TaskAgentHttpClientCompatBase + public abstract class TaskAgentHttpClientBase : VssHttpClientBase { public TaskAgentHttpClientBase(Uri baseUrl, VssCredentials credentials) : base(baseUrl, credentials) @@ -659,7 +659,6 @@ public virtual Task> GetAgentPoolsAsync( string poolName = null, IEnumerable properties = null, TaskAgentPoolType? poolType = null, - TaskAgentPoolActionFilter? actionFilter = null, object userState = null, CancellationToken cancellationToken = default) { @@ -679,10 +678,6 @@ public virtual Task> GetAgentPoolsAsync( { queryParams.Add("poolType", poolType.Value.ToString()); } - if (actionFilter != null) - { - queryParams.Add("actionFilter", actionFilter.Value.ToString()); - } return SendAsync>( httpMethod, diff --git a/src/Sdk/DTWebApi/WebApi/EnableAccessTokenType.cs b/src/Sdk/DTWebApi/WebApi/EnableAccessTokenType.cs deleted file mode 100644 index e1a8f691386..00000000000 --- a/src/Sdk/DTWebApi/WebApi/EnableAccessTokenType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace GitHub.DistributedTask.WebApi -{ - public enum EnableAccessTokenType - { - None, - Variable, - True = Variable, - SecretVariable, - } -} diff --git a/src/Sdk/DTWebApi/WebApi/ExpressionValidationItem.cs b/src/Sdk/DTWebApi/WebApi/ExpressionValidationItem.cs deleted file mode 100644 index 0a294e23bb9..00000000000 --- a/src/Sdk/DTWebApi/WebApi/ExpressionValidationItem.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class ExpressionValidationItem : ValidationItem - { - public ExpressionValidationItem() - : base(InputValidationTypes.Expression) - { - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/InputBindingContext.cs b/src/Sdk/DTWebApi/WebApi/InputBindingContext.cs deleted file mode 100644 index 694b6cdf763..00000000000 --- a/src/Sdk/DTWebApi/WebApi/InputBindingContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class InputBindingContext - { - /// - /// Value of the input - /// - [DataMember(EmitDefaultValue = false)] - public String Value - { - get; - set; - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/InputValidationItem.cs b/src/Sdk/DTWebApi/WebApi/InputValidationItem.cs deleted file mode 100644 index acb5a72bf39..00000000000 --- a/src/Sdk/DTWebApi/WebApi/InputValidationItem.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class InputValidationItem : ValidationItem - { - public InputValidationItem() - : base(InputValidationTypes.Input) - { - } - - /// - /// Provides binding context for the expression to evaluate - /// - [DataMember(EmitDefaultValue = false)] - public InputBindingContext Context - { - get; - set; - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/JobExecutionModeTypes.cs b/src/Sdk/DTWebApi/WebApi/JobExecutionModeTypes.cs deleted file mode 100644 index 911da471acd..00000000000 --- a/src/Sdk/DTWebApi/WebApi/JobExecutionModeTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace GitHub.DistributedTask.WebApi -{ - public class JobExecutionModeTypes - { - public const string Server = "Server"; - - public const string Agent = "Agent"; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/JobOption.cs b/src/Sdk/DTWebApi/WebApi/JobOption.cs deleted file mode 100644 index 36c7b4276ba..00000000000 --- a/src/Sdk/DTWebApi/WebApi/JobOption.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - /// - /// Represents an option that may affect the way an agent runs the job. - /// - [DataContract] - public class JobOption : ICloneable - { - /// - /// Initializes a new JobOption with an empty collection of data. - /// - public JobOption() - { - } - - private JobOption(JobOption optionToClone) - { - this.Id = optionToClone.Id; - - if (optionToClone.m_data != null) - { - m_data = new Dictionary(optionToClone.m_data, StringComparer.OrdinalIgnoreCase); - } - } - - /// - /// Gets the id of the option. - /// - [DataMember] - public Guid Id { get; set; } - - /// - /// Gets the data associated with the option. - /// - public IDictionary Data - { - get - { - if (m_data == null) - { - m_data = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - return m_data; - } - } - - [OnDeserialized] - private void OnDeserialized(StreamingContext context) - { - if (m_serializedData != null && m_serializedData.Count > 0) - { - m_data = new Dictionary(m_serializedData, StringComparer.OrdinalIgnoreCase); - } - - m_serializedData = null; - } - - [OnSerializing] - private void OnSerializing(StreamingContext context) - { - m_serializedData = this.Data.Count > 0 ? this.Data : null; - } - - Object ICloneable.Clone() - { - return this.Clone(); - } - - /// - /// Creates a deep copy of the job option. - /// - /// A deep copy of the job option - public JobOption Clone() - { - return new JobOption(this); - } - - private Dictionary m_data; - - [DataMember(Name = "Data", EmitDefaultValue = false)] - private IDictionary m_serializedData; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/JobRequestMessageTypes.cs b/src/Sdk/DTWebApi/WebApi/JobRequestMessageTypes.cs index 2edc57e4c52..32647375043 100644 --- a/src/Sdk/DTWebApi/WebApi/JobRequestMessageTypes.cs +++ b/src/Sdk/DTWebApi/WebApi/JobRequestMessageTypes.cs @@ -4,12 +4,6 @@ namespace GitHub.DistributedTask.WebApi { public static class JobRequestMessageTypes { - public const String AgentJobRequest = "JobRequest"; - - public const String ServerJobRequest = "ServerJobRequest"; - - public const String ServerTaskRequest = "ServerTaskRequest"; - public const String PipelineAgentJobRequest = "PipelineAgentJobRequest"; } } diff --git a/src/Sdk/DTWebApi/WebApi/MetricsColumn.cs b/src/Sdk/DTWebApi/WebApi/MetricsColumn.cs deleted file mode 100644 index 2ba192d7314..00000000000 --- a/src/Sdk/DTWebApi/WebApi/MetricsColumn.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - /// - /// Metrics columns header - /// - [DataContract] - public sealed class MetricsColumnsHeader - { - /// - /// Properties of deployment group for which metrics are provided. - /// E.g. 1: LastJobStatus - /// E.g. 2: TargetState - /// - public IList Dimensions - { - get - { - if (m_dimensions == null) - { - m_dimensions = new List(); - } - - return m_dimensions; - } - internal set - { - m_dimensions = value; - } - } - - /// - /// The types of metrics. - /// E.g. 1: total count of deployment targets. - /// E.g. 2: Average time of deployment to the deployment targets. - /// - public IList Metrics - { - get - { - if (m_metrics == null) - { - m_metrics = new List(); - } - - return m_metrics; - } - internal set - { - m_metrics = value; - } - } - - /// - /// Properties of deployment group for which metrics are provided. - /// E.g. 1: LastJobStatus - /// E.g. 2: TargetState - /// - [DataMember(Name = "Dimensions")] - private IList m_dimensions; - - /// - /// The types of metrics. - /// E.g. 1: total count of deployment targets. - /// E.g. 2: Average time of deployment to the deployment targets. - /// - [DataMember(Name = "Metrics")] - private IList m_metrics; - } - - /// - /// Meta data for a metrics column. - /// - [DataContract] - public sealed class MetricsColumnMetaData - { - /// - /// Name. - /// - [DataMember] - public String ColumnName - { - get; - internal set; - } - - /// - /// Data type. - /// - [DataMember] - public String ColumnValueType - { - get; - internal set; - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/MetricsRow.cs b/src/Sdk/DTWebApi/WebApi/MetricsRow.cs deleted file mode 100644 index 5ae35278234..00000000000 --- a/src/Sdk/DTWebApi/WebApi/MetricsRow.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - /// - /// Metrics row. - /// - [DataContract] - public sealed class MetricsRow - { - /// - /// The values of the properties mentioned as 'Dimensions' in column header. - /// E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. - /// E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets. - /// - public IList Dimensions - { - get - { - if (m_dimensions == null) - { - m_dimensions = new List(); - } - - return m_dimensions; - } - internal set - { - m_dimensions = value; - } - } - - /// - /// Metrics in serialized format. - /// Should be deserialized based on the data type provided in header. - /// - public IList Metrics - { - get - { - if (m_metrics == null) - { - m_metrics = new List(); - } - - return m_metrics; - } - internal set - { - m_metrics = value; - } - } - - /// - /// The values of the properties mentioned as 'Dimensions' in column header. - /// E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. - /// E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets. - /// - [DataMember(Name = "Dimensions")] - private IList m_dimensions; - - /// - /// Metrics in serialized format. - /// Should be deserialized based on the data type provided in header. - /// - [DataMember(Name = "Metrics")] - private IList m_metrics; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/PlanGroupStatus.cs b/src/Sdk/DTWebApi/WebApi/PlanGroupStatus.cs deleted file mode 100644 index 3ec90c1f315..00000000000 --- a/src/Sdk/DTWebApi/WebApi/PlanGroupStatus.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [Flags] - [DataContract] - public enum PlanGroupStatus - { - [EnumMember] - Running = 1, - - [EnumMember] - Queued = 2, - - [EnumMember] - All = Running | Queued - } -} diff --git a/src/Sdk/DTWebApi/WebApi/PlanTemplateType.cs b/src/Sdk/DTWebApi/WebApi/PlanTemplateType.cs deleted file mode 100644 index 96f5c4c35e0..00000000000 --- a/src/Sdk/DTWebApi/WebApi/PlanTemplateType.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - public enum PlanTemplateType - { - [DataMember] - None = 0, - - [DataMember] - Designer = 1, - - [DataMember] - System = 2, - - [DataMember] - Yaml = 3, - } -} diff --git a/src/Sdk/DTWebApi/WebApi/ProjectReference.cs b/src/Sdk/DTWebApi/WebApi/ProjectReference.cs deleted file mode 100644 index cb379ebb20f..00000000000 --- a/src/Sdk/DTWebApi/WebApi/ProjectReference.cs +++ /dev/null @@ -1,21 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// 2012-2023, All rights reserved. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class ProjectReference - { - [DataMember] - public Guid Id { get; set; } - - [DataMember] - public string Name { get; set; } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/EndpointAuthorization.cs b/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/EndpointAuthorization.cs index dff449c353b..8b7c4cc3abe 100644 --- a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/EndpointAuthorization.cs +++ b/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/EndpointAuthorization.cs @@ -6,46 +6,12 @@ namespace GitHub.DistributedTask.WebApi { public sealed class EndpointAuthorizationSchemes { - public const String AzureStorage = "AzureStorage"; public const String OAuth = "OAuth"; - public const String OAuth2 = "OAuth2"; - public const String OAuthWrap = "OAuthWrap"; - public const String Certificate = "Certificate"; - public const String UsernamePassword = "UsernamePassword"; - public const String Token = "Token"; - public const String PersonalAccessToken = "PersonalAccessToken"; - public const String ServicePrincipal = "ServicePrincipal"; - public const String None = "None"; - public const String Jwt = "JWT"; - public const String InstallationToken = "InstallationToken"; } public sealed class EndpointAuthorizationParameters { - public const String Username = "Username"; - public const String Password = "Password"; - public const String Certificate = "Certificate"; public const String AccessToken = "AccessToken"; - public const String ApiToken = "ApiToken"; - public const String RefreshToken = "RefreshToken"; - public const String ServicePrincipalId = "ServicePrincipalId"; - public const String ServicePrincipalKey = "ServicePrincipalKey"; - public const String TenantId = "TenantId"; - public const String RealmName = "RealmName"; - public const String IdToken = "IdToken"; - public const String Nonce = "nonce"; - public const String Scope = "Scope"; - public const String Role = "Role"; - public const String ServerCertThumbprint = "ServerCertThumbprint"; - public const String CompleteCallbackPayload = "CompleteCallbackPayload"; - public const String ClientMail = "ClientMail"; - public const String PrivateKey = "PrivateKey"; - public const String Issuer = "Issuer"; - public const String Audience = "Audience"; - public const String StorageAccountName = "StorageAccountName"; - public const String StorageAccessKey = "StorageAccessKey"; - public const String AccessTokenType = "AccessTokenType"; - public const String Signature = "Signature"; } [DataContract] diff --git a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/SerializationHelper.cs b/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/SerializationHelper.cs index ecf94c9968f..1340db4bf04 100644 --- a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/SerializationHelper.cs +++ b/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/SerializationHelper.cs @@ -21,47 +21,6 @@ public static void Copy( } } - public static void Copy( - ref IList source, - ref ISet target, - IEqualityComparer comparer, - Boolean clearSource = false) - { - if (source != null && source.Count > 0) - { - target = new HashSet(source, comparer); - } - - if (clearSource) - { - source = null; - } - } - - public static void Copy( - ref ISet source, - ref IList target, - Boolean clearSource = false) - { - if (source != null && source.Count > 0) - { - target = new List(source); - } - - if (clearSource) - { - source = null; - } - } - - public static void Copy( - ref Dictionary source, - ref Dictionary target, - Boolean clearSource = false) - { - Copy(ref source, ref target, EqualityComparer.Default, clearSource); - } - public static void Copy( ref IDictionary source, ref IDictionary target, @@ -70,23 +29,6 @@ public static void Copy( Copy(ref source, ref target, EqualityComparer.Default, clearSource); } - public static void Copy( - ref Dictionary source, - ref Dictionary target, - IEqualityComparer comparer, - Boolean clearSource = false) - { - if (source != null && source.Count > 0) - { - target = new Dictionary(source, comparer); - } - - if (clearSource) - { - source = null; - } - } - public static void Copy( ref IDictionary source, ref IDictionary target, diff --git a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/ServiceEndpoint.cs b/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/ServiceEndpoint.cs index 3eeca3525d5..97406d7b8e6 100644 --- a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/ServiceEndpoint.cs +++ b/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/ServiceEndpoint.cs @@ -45,47 +45,6 @@ private ServiceEndpoint(ServiceEndpoint endpointToClone) } } - public static bool ValidateServiceEndpoint(ServiceEndpoint endpoint, ref string message) - { - if (endpoint == null) - { - message = "endpoint: null"; - return false; - } - - if (endpoint.Id == Guid.Empty) - { - message = CommonResources.EmptyGuidNotAllowed("endpoint.Id"); - return false; - } - - if (string.IsNullOrEmpty(endpoint.Name)) - { - message = string.Format("{0}:{1}", CommonResources.EmptyStringNotAllowed(), "endpoint.Name"); - return false; - } - - if (endpoint.Url == null) - { - message = "endpoint.Url: null"; - return false; - } - - if (string.IsNullOrEmpty(endpoint.Type)) - { - message = string.Format("{0}:{1}", CommonResources.EmptyStringNotAllowed(), "endpoint.Type"); - return false; - } - - if (endpoint.Authorization == null) - { - message = "endpoint.Authorization: null"; - return false; - } - - return true; - } - /// /// Gets or sets the identifier of this endpoint. /// diff --git a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/ServiceEndpointTypes.cs b/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/ServiceEndpointTypes.cs deleted file mode 100644 index 4fcf8f97bd8..00000000000 --- a/src/Sdk/DTWebApi/WebApi/ServiceEndpointLegacy/ServiceEndpointTypes.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; - -namespace GitHub.DistributedTask.WebApi -{ - public static class ServiceEndpointTypes - { - /// - /// Azure endpoint - /// - public const String Azure = "Azure"; - - /// - /// Chef endpoint - /// - public const String Chef = "Chef"; - - /// Chef endpoint - /// - public const String ExternalTfs = "ExternalTfs"; - - /// - /// Generic endpoint - /// - public const String Generic = "Generic"; - - /// - /// GitHub endpoint - /// - public const String GitHub = "GitHub"; - - /// - /// GitHub Enterprise endpoint - /// - public const String GitHubEnterprise = "GitHubEnterprise"; - - /// - /// Bitbucket endpoint - /// - public const String Bitbucket = "Bitbucket"; - - /// - /// SSH endpoint - /// - public const String SSH = "SSH"; - - /// - /// Subversion endpoint - /// - public const String Subversion = "Subversion"; - - /// - ///Gcp endpoint - /// - public const String Gcp = "google-cloud"; - - /// - /// Subversion endpoint - /// - public const String Jenkins = "Jenkins"; - - /// - /// External Git repository - /// - public const String ExternalGit = "Git"; - - /// - /// Azure RM endpoint - /// - public const String AzureRM = "AzureRM"; - - /// - /// Azure Deployment Manager - /// - public const String AzureDeploymentManager = "AzureDeploymentManager"; - - /// - /// Azure Service Fabric - /// - public const String AzureServiceFabric = "ServiceFabric"; - - /// - /// Azure Service Fabric - /// - public const String Docker = "dockerregistry"; - - /// - /// Jira - /// - public const String Jira = "Jira"; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentCloudType.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentCloudType.cs deleted file mode 100644 index b397cb73e92..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentCloudType.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; -using GitHub.Services.FormInput; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class TaskAgentCloudType - { - - public TaskAgentCloudType() - { - } - - /// - /// Gets or sets the name of agent cloud type. - /// - [DataMember] - public String Name - { - get; - set; - } - - /// - /// Gets or sets the display name of agnet cloud type. - /// - [DataMember(EmitDefaultValue = false)] - public String DisplayName { get; set; } - - public List InputDescriptors - { - get - { - return m_inputDescriptors ?? (m_inputDescriptors = new List()); - } - - set - { - m_inputDescriptors = value; - } - } - - /// - /// Gets or sets the input descriptors - /// - [DataMember(EmitDefaultValue = false, Name = "InputDescriptors")] - private List m_inputDescriptors; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentHttpClientCompatBase.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentHttpClientCompatBase.cs deleted file mode 100644 index 94d156735d1..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentHttpClientCompatBase.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using GitHub.Services.Common; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.WebApi -{ - [ResourceArea(TaskResourceIds.AreaId)] - public abstract class TaskAgentHttpClientCompatBase : VssHttpClientBase - { - public TaskAgentHttpClientCompatBase( - Uri baseUrl, - VssCredentials credentials) - : base(baseUrl, credentials) - { - } - - public TaskAgentHttpClientCompatBase( - Uri baseUrl, - VssCredentials credentials, - VssHttpRequestSettings settings) - : base(baseUrl, credentials, settings) - { - } - - public TaskAgentHttpClientCompatBase( - Uri baseUrl, - VssCredentials credentials, - params DelegatingHandler[] handlers) - : base(baseUrl, credentials, handlers) - { - } - - public TaskAgentHttpClientCompatBase( - Uri baseUrl, - VssCredentials credentials, - VssHttpRequestSettings settings, - params DelegatingHandler[] handlers) - : base(baseUrl, credentials, settings, handlers) - { - } - - public TaskAgentHttpClientCompatBase( - Uri baseUrl, - HttpMessageHandler pipeline, - Boolean disposeHandler) - : base(baseUrl, pipeline, disposeHandler) - { - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentJob.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentJob.cs deleted file mode 100644 index 1a2089846c8..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentJob.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class TaskAgentJob - { - public TaskAgentJob( - Guid id, - String name, - String container, - IList steps, - IDictionary sidecarContainers, - IList variables) - { - this.Id = id; - this.Name = name; - this.Container = container; - - m_variables = new List(variables); - m_steps = new List(steps); - - if (sidecarContainers?.Count > 0) - { - m_sidecarContainers = new Dictionary(sidecarContainers, StringComparer.OrdinalIgnoreCase); - } - } - - [DataMember] - public Guid Id - { - get; - } - - [DataMember] - public String Name - { - get; - } - - [DataMember(EmitDefaultValue = false)] - public String Container - { - get; - } - - public IList Steps - { - get - { - if (m_steps == null) - { - m_steps = new List(); - } - return m_steps; - } - } - - public IDictionary SidecarContainers - { - get - { - if (m_sidecarContainers == null) - { - m_sidecarContainers = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - return m_sidecarContainers; - } - } - - public IList Variables - { - get - { - if (m_variables == null) - { - m_variables = new List(); - } - return m_variables; - } - } - - [OnSerializing] - private void OnSerializing(StreamingContext context) - { - if (m_sidecarContainers?.Count == 0) - { - m_sidecarContainers = null; - } - } - - [DataMember(Name = "Steps", EmitDefaultValue = false)] - private List m_steps; - - [DataMember(Name = "SidecarContainers", EmitDefaultValue = false)] - private IDictionary m_sidecarContainers; - - [DataMember(Name = "Variables", EmitDefaultValue = false)] - private List m_variables; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentJobResultFilter.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentJobResultFilter.cs deleted file mode 100644 index eed282b4f28..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentJobResultFilter.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - /// - /// This is useful in getting a list of deployment targets, filtered by the result of their last job. - /// - [Flags] - [DataContract] - public enum TaskAgentJobResultFilter - { - /// - /// Only those deployment targets on which last job failed (**Abandoned**, **Canceled**, **Failed**, **Skipped**). - /// - [EnumMember] - Failed = 1, - - /// - /// Only those deployment targets on which last job Passed (**Succeeded**, **Succeeded with issues**). - /// - [EnumMember] - Passed = 2, - - /// - /// Only those deployment targets that never executed a job. - /// - [EnumMember] - NeverDeployed = 4, - - /// - /// All deployment targets. - /// - [EnumMember] - All = Failed | Passed | NeverDeployed - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentJobStep.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentJobStep.cs deleted file mode 100644 index d585ce90c9e..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentJobStep.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class TaskAgentJobStep - { - [DataContract] - public enum TaskAgentJobStepType - { - [DataMember] - Task = 1, - - [DataMember] - Action = 2 - } - - [DataMember(EmitDefaultValue = false)] - public TaskAgentJobStepType Type - { - get; - set; - } - - [DataMember] - public Guid Id - { - get; - set; - } - - [DataMember] - public String Name - { - get; - set; - } - - [DataMember] - public Boolean Enabled - { - get; - set; - } - - [DataMember] - public String Condition - { - get; - set; - } - - [DataMember] - public Boolean ContinueOnError - { - get; - set; - } - - [DataMember] - public Int32 TimeoutInMinutes - { - get; - set; - } - - [DataMember] - public TaskAgentJobTask Task - { - get; - set; - } - - [DataMember] - public IDictionary Env - { - get; - set; - } - - [DataMember] - public IDictionary Inputs - { - get; - set; - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentJobTask.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentJobTask.cs deleted file mode 100644 index 9266101e06a..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentJobTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class TaskAgentJobTask - { - [DataMember] - public Guid Id - { - get; - set; - } - - [DataMember] - public String Name - { - get; - set; - } - - [DataMember] - public String Version - { - get; - set; - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentJobVariable.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentJobVariable.cs deleted file mode 100644 index 54d1eb8e1f8..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentJobVariable.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class TaskAgentJobVariable - { - [DataMember] - public String Name - { - get; - set; - } - - [DataMember] - public String Value - { - get; - set; - } - - [DataMember] - public Boolean Secret - { - get; - set; - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentPoolActionFilter.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentPoolActionFilter.cs deleted file mode 100644 index 83c5472e902..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentPoolActionFilter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - /// - /// Filters pools based on whether the calling user has permission to use or manage the pool. - /// - [Flags] - [DataContract] - public enum TaskAgentPoolActionFilter - { - [EnumMember] - None = 0, - - [EnumMember] - Manage = 2, - - [EnumMember] - Use = 16, - } -} diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentPoolType.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentPoolType.cs index d69fc2092f5..91afb1cbbc3 100644 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentPoolType.cs +++ b/src/Sdk/DTWebApi/WebApi/TaskAgentPoolType.cs @@ -12,12 +12,6 @@ public enum TaskAgentPoolType /// A typical pool of task agents /// [EnumMember] - Automation = 1, - - /// - /// A deployment pool - /// - [EnumMember] - Deployment = 2 + Automation = 1 } } diff --git a/src/Sdk/DTWebApi/WebApi/TaskAgentStatusFilter.cs b/src/Sdk/DTWebApi/WebApi/TaskAgentStatusFilter.cs deleted file mode 100644 index ed531c13ef0..00000000000 --- a/src/Sdk/DTWebApi/WebApi/TaskAgentStatusFilter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - /// - /// This is useful in getting a list of deployment targets, filtered by the deployment agent status. - /// - [Flags] - [DataContract] - public enum TaskAgentStatusFilter - { - /// - /// Only deployment targets that are offline. - /// - [EnumMember] - Offline = 1, - - /// - /// Only deployment targets that are online. - /// - [EnumMember] - Online = 2, - - /// - /// All deployment targets. - /// - [EnumMember] - All = Offline | Online - } -} diff --git a/src/Sdk/DTWebApi/WebApi/ValidationItem.cs b/src/Sdk/DTWebApi/WebApi/ValidationItem.cs deleted file mode 100644 index c5c45341b39..00000000000 --- a/src/Sdk/DTWebApi/WebApi/ValidationItem.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - [KnownType(typeof(ExpressionValidationItem))] - [KnownType(typeof(InputValidationItem))] - [JsonConverter(typeof(ValidationItemJsonConverter))] - public class ValidationItem - { - protected ValidationItem(String type) - { - this.Type = type; - } - - /// - /// Type of validation item - /// - [DataMember(EmitDefaultValue = false)] - public String Type - { - get; - private set; - } - - /// - /// Value to validate. - /// The conditional expression to validate for the input for "expression" type - /// Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master') - /// - [DataMember(EmitDefaultValue = false)] - public String Value - { - get; - set; - } - - /// - /// Tells whether the current input is valid or not - /// - [DataMember(EmitDefaultValue = false)] - public Boolean? IsValid - { - get; - set; - } - - /// - /// Reason for input validation failure - /// - [DataMember(EmitDefaultValue = false)] - public String Reason - { - get; - set; - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/ValidationItemJsonConverter.cs b/src/Sdk/DTWebApi/WebApi/ValidationItemJsonConverter.cs deleted file mode 100644 index c3ee45c7680..00000000000 --- a/src/Sdk/DTWebApi/WebApi/ValidationItemJsonConverter.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Reflection; -using GitHub.Services.WebApi; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - internal sealed class ValidationItemJsonConverter : VssSecureJsonConverter - { - public override Boolean CanConvert(Type objectType) - { - return typeof(ValidationItem).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); - } - - public override Boolean CanWrite - { - get - { - return false; - } - } - - public override Object ReadJson( - JsonReader reader, - Type objectType, - Object existingValue, - JsonSerializer serializer) - { - if (reader.TokenType != JsonToken.StartObject) - { - return null; - } - - Object newValue = null; - - if (objectType == typeof(ExpressionValidationItem)) - { - newValue = new ExpressionValidationItem(); - } - else if (objectType == typeof(InputValidationItem)) - { - newValue = new InputValidationItem(); - } - - JObject value = JObject.Load(reader); - - if (newValue == null) - { - var contract = serializer.ContractResolver.ResolveContract(objectType) as JsonObjectContract; - if (contract == null) - { - return existingValue; - } - - JsonProperty property = contract.Properties.GetClosestMatchProperty("Type"); - if (property == null) - { - return existingValue; - } - - JToken itemTypeValue; - String itemType = InputValidationTypes.Expression; - if (value.TryGetValue(property.PropertyName, out itemTypeValue) - && itemTypeValue.Type == JTokenType.String) - { - itemType = (String)itemTypeValue; - } - - switch (itemType) - { - case InputValidationTypes.Expression: - newValue = new ExpressionValidationItem(); - break; - case InputValidationTypes.Input: - newValue = new InputValidationItem(); - break; - } - } - - if (value != null) - { - using (JsonReader objectReader = value.CreateReader()) - { - serializer.Populate(objectReader, newValue); - } - } - - return newValue; - } - - public override void WriteJson( - JsonWriter writer, - Object value, - JsonSerializer serializer) - { - // The virtual method returns false for CanWrite so this should never be invoked - throw new NotSupportedException(); - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/ValidationRequest.cs b/src/Sdk/DTWebApi/WebApi/ValidationRequest.cs deleted file mode 100644 index d50009aac38..00000000000 --- a/src/Sdk/DTWebApi/WebApi/ValidationRequest.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace GitHub.DistributedTask.WebApi -{ - [DataContract] - public class InputValidationRequest - { - public IDictionary Inputs - { - get - { - if (m_inputs == null) - { - m_inputs = new Dictionary(StringComparer.Ordinal); - } - - return m_inputs; - } - } - - [DataMember(Name = "Inputs")] - private Dictionary m_inputs; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/ValidationTypes.cs b/src/Sdk/DTWebApi/WebApi/ValidationTypes.cs deleted file mode 100644 index 7c6391b185e..00000000000 --- a/src/Sdk/DTWebApi/WebApi/ValidationTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using GitHub.Services.Common; - -namespace GitHub.DistributedTask.WebApi -{ - [GenerateAllConstants] - public static class InputValidationTypes - { - public const String Expression = "expression"; - public const String Input = "input"; - } -} diff --git a/src/Sdk/DTWebApi/WebApi/VariableGroupUtility.cs b/src/Sdk/DTWebApi/WebApi/VariableGroupUtility.cs deleted file mode 100644 index 78e195145e4..00000000000 --- a/src/Sdk/DTWebApi/WebApi/VariableGroupUtility.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using GitHub.Services.WebApi; - -namespace GitHub.DistributedTask.WebApi -{ - /// - /// Utility class to perform operations on Variable groups. - /// - public static class VariableGroupUtility - { - public static VariableValue Clone(this VariableValue value) - { - return new VariableValue(value); - } - } -} diff --git a/src/Sdk/DTWebApi/WebApi/VariableUtility.cs b/src/Sdk/DTWebApi/WebApi/VariableUtility.cs index ae537b47ce4..0c9162854ae 100644 --- a/src/Sdk/DTWebApi/WebApi/VariableUtility.cs +++ b/src/Sdk/DTWebApi/WebApi/VariableUtility.cs @@ -13,21 +13,9 @@ namespace GitHub.DistributedTask.WebApi { public static class VariableUtility { - public static EnableAccessTokenType GetEnableAccessTokenType(IDictionary variables) + public static VariableValue Clone(this VariableValue value) { - EnableAccessTokenType type; - if (variables != null && - variables.TryGetValue(WellKnownDistributedTaskVariables.EnableAccessToken, out VariableValue enableVariable) && - enableVariable != null) - { - Enum.TryParse(enableVariable.Value, true, out type); - } - else - { - type = EnableAccessTokenType.None; - } - - return type; + return new VariableValue(value); } public static Boolean IsVariable(String value) diff --git a/src/Sdk/DTWebApi/WebApi/WellKnownDistributedTaskVariables.cs b/src/Sdk/DTWebApi/WebApi/WellKnownDistributedTaskVariables.cs index d0c80f868d6..a5495bc036e 100644 --- a/src/Sdk/DTWebApi/WebApi/WellKnownDistributedTaskVariables.cs +++ b/src/Sdk/DTWebApi/WebApi/WellKnownDistributedTaskVariables.cs @@ -4,50 +4,6 @@ namespace GitHub.DistributedTask.WebApi { public static class WellKnownDistributedTaskVariables { - public static readonly String AccessToken = "system.accessToken"; - public static readonly String AccessTokenScope = "system.connection.accessTokenScope"; - public static readonly String AzureUserAgent = "AZURE_HTTP_USER_AGENT"; - public static readonly String CollectionId = "system.collectionId"; - public static readonly String CollectionUrl = "system.collectionUri"; - public static readonly String Culture = "system.culture"; - public static readonly String DefinitionId = "system.definitionId"; - public static readonly String DefinitionName = "system.definitionName"; - public static readonly String EnableAccessToken = "system.enableAccessToken"; - public static readonly String HostType = "system.hosttype"; - public static readonly String HubVersion = "system.hubversion"; - public static readonly String IsScheduled = "system.isScheduled"; - public static readonly String JobAttempt = "system.jobAttempt"; - public static readonly String JobDisplayName = "system.jobDisplayName"; public static readonly String JobId = "system.jobId"; - public static readonly String JobIdentifier = "system.jobIdentifier"; - public static readonly String JobName = "system.jobName"; - public static readonly String JobParallelismTag = "system.jobParallelismTag"; - public static readonly String JobPositionInPhase = "System.JobPositionInPhase"; - public static readonly String JobStatus = "system.jobStatus"; - public static readonly String MsDeployUserAgent = "MSDEPLOY_HTTP_USER_AGENT"; - public static readonly String ParallelExecutionType = "System.ParallelExecutionType"; - public static readonly String PhaseAttempt = "system.phaseAttempt"; - public static readonly String PhaseDisplayName = "system.phaseDisplayName"; - public static readonly String PhaseId = "system.phaseId"; - public static readonly String PhaseName = "system.phaseName"; - public static readonly String PipelineStartTime = "system.pipelineStartTime"; - public static readonly String PlanId = "system.planId"; - public static readonly String RestrictSecrets = "system.restrictSecrets"; - public static readonly String RetainDefaultEncoding = "agent.retainDefaultEncoding"; - public static readonly String ServerType = "system.servertype"; - public static readonly String StageAttempt = "system.stageAttempt"; - public static readonly String StageDisplayName = "system.stageDisplayName"; - public static readonly String StageId = "system.stageId"; - public static readonly String StageName = "system.stageName"; - public static readonly String System = "system"; - public static readonly String TFCollectionUrl = "system.teamFoundationCollectionUri"; - public static readonly String TaskDefinitionsUrl = "system.taskDefinitionsUri"; - public static readonly String TaskDisplayName = "system.taskDisplayName"; - public static readonly String TaskInstanceId = "system.taskInstanceId"; - public static readonly String TaskInstanceName = "system.taskInstanceName"; - public static readonly String TeamProject = "system.teamProject"; - public static readonly String TeamProjectId = "system.teamProjectId"; - public static readonly String TimelineId = "system.timelineId"; - public static readonly String TotalJobsInPhase = "System.TotalJobsInPhase"; } } diff --git a/src/Sdk/DTWebApi/WebApi/WellKnownPackageTypes.cs b/src/Sdk/DTWebApi/WebApi/WellKnownPackageTypes.cs deleted file mode 100644 index 3b088c7b07e..00000000000 --- a/src/Sdk/DTWebApi/WebApi/WellKnownPackageTypes.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace GitHub.DistributedTask.WebApi -{ - public static class WellKnownPackageTypes - { - public static readonly String Agent = "agent"; - } -} diff --git a/src/Test/L0/Listener/MessageListenerL0.cs b/src/Test/L0/Listener/MessageListenerL0.cs index 626d924a0a6..e6da526cd2f 100644 --- a/src/Test/L0/Listener/MessageListenerL0.cs +++ b/src/Test/L0/Listener/MessageListenerL0.cs @@ -160,7 +160,7 @@ public async void GetNextMessage() { Body = "somebody1", MessageId = 4234, - MessageType = JobRequestMessageTypes.AgentJobRequest + MessageType = JobRequestMessageTypes.PipelineAgentJobRequest }, new TaskAgentMessage { @@ -174,7 +174,7 @@ public async void GetNextMessage() { Body = "somebody3", MessageId = 4236, - MessageType = JobRequestMessageTypes.AgentJobRequest + MessageType = JobRequestMessageTypes.PipelineAgentJobRequest } }; var messages = new Queue(arMessages);