diff --git a/eng/CodeGeneration.targets b/eng/CodeGeneration.targets
index d0b2857a979f..2b01d61a5836 100644
--- a/eng/CodeGeneration.targets
+++ b/eng/CodeGeneration.targets
@@ -3,7 +3,7 @@
<_AutoRestVersion>https://github.com/Azure/autorest/releases/download/autorest-3.0.6236/autorest-3.0.6236.tgz
<_AutoRestCoreVersion>3.0.6306
- <_AutoRestCSharpVersion>https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200911.1/autorest-csharp-v3-3.0.0-dev.20200911.1.tgz
+ <_AutoRestCSharpVersion>https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200811.1/autorest-csharp-v3-3.0.0-dev.20200811.1.tgz
<_SupportsCodeGeneration Condition="'$(IsClientLibrary)' == 'true'">true
<_DefaultInputName Condition="Exists('$(MSBuildProjectDirectory)/autorest.md')">$(MSBuildProjectDirectory)/autorest.md
$(_DefaultInputName)
@@ -12,16 +12,11 @@
use the following command line (remove the space between minus minus): dotnet msbuild /t:GenerateCode /p:AutoRestAdditionalParameters="- -interactive"
-->
- <_SharedCodeDirectory>$(MSBuildThisFileDirectory)../sdk/core/Azure.Core/src/Shared/
- <_AutoRestSharedCodeDirectory>$(_SharedCodeDirectory)AutoRest/
<_GenerateCode Condition="'$(_SupportsCodeGeneration)' == 'true' AND '$(AutoRestInput)' != ''">true
- <_AutoRestVersion Condition="'$(TemporaryUsePreviousGeneratorVersion)' == 'true'">https://github.com/Azure/autorest/releases/download/autorest-3.0.6236/autorest-3.0.6236.tgz
- <_AutoRestCoreVersion Condition="'$(TemporaryUsePreviousGeneratorVersion)' == 'true'">3.0.6306
- <_AutoRestCSharpVersion Condition="'$(TemporaryUsePreviousGeneratorVersion)' == 'true'">https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200811.1/autorest-csharp-v3-3.0.0-dev.20200811.1.tgz
@@ -38,17 +33,9 @@
-
+
-
- $(NoWarn);CA1812
-
-
-
-
-
-
diff --git a/eng/Directory.Build.Data.props b/eng/Directory.Build.Data.props
index beac9ee03593..4c8aa548c2af 100644
--- a/eng/Directory.Build.Data.props
+++ b/eng/Directory.Build.Data.props
@@ -152,4 +152,12 @@
+
+
+
+
+ $(AzureCoreSharedSources)
+
+ false
+
diff --git a/eng/Directory.Build.Data.targets b/eng/Directory.Build.Data.targets
index 38e61536e99b..80dc8df79ed1 100644
--- a/eng/Directory.Build.Data.targets
+++ b/eng/Directory.Build.Data.targets
@@ -50,8 +50,10 @@
-
+
+
+
@@ -103,7 +105,7 @@
-
+
diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props
index 9656920f9bb2..273b7ce67d5b 100644
--- a/eng/Packages.Data.props
+++ b/eng/Packages.Data.props
@@ -9,6 +9,7 @@
+
diff --git a/eng/scripts/CodeChecks.ps1 b/eng/scripts/CodeChecks.ps1
index 6484a926bc44..15f16e61759b 100644
--- a/eng/scripts/CodeChecks.ps1
+++ b/eng/scripts/CodeChecks.ps1
@@ -72,7 +72,7 @@ try {
Write-Host "Re-generating clients"
Invoke-Block {
- & dotnet msbuild $PSScriptRoot\..\service.proj /t:GenerateCode /p:ServiceDirectory=$ServiceDirectory
+ & dotnet msbuild $PSScriptRoot\..\service.proj /restore /t:GenerateCode /p:ServiceDirectory=$ServiceDirectory
# https://github.com/Azure/azure-sdk-for-net/issues/8584
# & $repoRoot\storage\generate.ps1
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/ArmOperationHelpers.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/ArmOperationHelpers.cs
deleted file mode 100644
index 8298a74099f4..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/ArmOperationHelpers.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#nullable enable
-
-using System;
-using System.Linq;
-using System.Text.Json;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure.Core.Pipeline;
-
-namespace Azure.Core
-{
- ///
- /// This implements the ARM scenarios for LROs. It is highly recommended to read the ARM spec prior to modifying this code:
- /// https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#asynchronous-operations
- /// Other reference documents include:
- /// https://github.com/Azure/autorest/blob/master/docs/extensions/readme.md#x-ms-long-running-operation
- /// https://github.com/Azure/adx-documentation-pr/blob/master/sdks/LRO/LRO_AzureSDK.md
- ///
- /// The final result of the LRO.
- internal class ArmOperationHelpers
- {
- public static TimeSpan DefaultPollingInterval { get; } = TimeSpan.FromSeconds(1);
-
- private static readonly string[] s_failureStates = {"failed", "canceled"};
- private static readonly string[] s_terminalStates = {"succeeded", "failed", "canceled"};
-
- private readonly HttpPipeline _pipeline;
- private readonly ClientDiagnostics _clientDiagnostics;
- private readonly string _scopeName;
- private readonly RequestMethod _requestMethod;
- private readonly string _originalUri;
- private readonly OperationFinalStateVia _finalStateVia;
- private HeaderFrom _headerFrom;
- private string _pollUri = default!;
- private bool _originalHasLocation;
- private string? _lastKnownLocation;
-
- private readonly IOperationSource _source;
- private Response _rawResponse;
- private T _value = default!;
- private bool _hasValue;
- private bool _hasCompleted;
- private bool _shouldPoll;
-
- public ArmOperationHelpers(
- IOperationSource source,
- ClientDiagnostics clientDiagnostics,
- HttpPipeline pipeline,
- Request originalRequest,
- Response originalResponse,
- OperationFinalStateVia finalStateVia,
- string scopeName)
- {
- _source = source;
- _rawResponse = originalResponse;
- _requestMethod = originalRequest.Method;
- _originalUri = originalRequest.Uri.ToString();
- _finalStateVia = finalStateVia;
- InitializeScenarioInfo();
-
- _pipeline = pipeline;
- _clientDiagnostics = clientDiagnostics;
- _scopeName = scopeName;
- // When the original response has no headers, we do not start polling immediately.
- _shouldPoll = _headerFrom != HeaderFrom.None;
- }
-
- public Response GetRawResponse() => _rawResponse;
-
- public ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default)
- {
- return WaitForCompletionAsync(DefaultPollingInterval, cancellationToken);
- }
-
- public async ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken)
- {
- while (true)
- {
- await UpdateStatusAsync(cancellationToken).ConfigureAwait(false);
- if (HasCompleted)
- {
- return Response.FromValue(Value, GetRawResponse());
- }
-
- await Task.Delay(pollingInterval, cancellationToken).ConfigureAwait(false);
- }
- }
-
- private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken)
- {
- if (_hasCompleted)
- {
- return GetRawResponse();
- }
-
- if (_shouldPoll)
- {
- UpdatePollUri();
- _rawResponse = async
- ? await GetResponseAsync(_pollUri, cancellationToken).ConfigureAwait(false)
- : GetResponse(_pollUri, cancellationToken);
- }
-
- _shouldPoll = true;
- _hasCompleted = IsTerminalState(out string state);
- if (_hasCompleted)
- {
- Response finalResponse = GetRawResponse();
- if (s_failureStates.Contains(state))
- {
- throw _clientDiagnostics.CreateRequestFailedException(finalResponse);
- }
-
- string? finalUri = GetFinalUri();
- if (finalUri != null)
- {
- finalResponse = async
- ? await GetResponseAsync(finalUri, cancellationToken).ConfigureAwait(false)
- : GetResponse(finalUri, cancellationToken);
- }
-
- switch (finalResponse.Status)
- {
- case 200:
- case 201 when _requestMethod == RequestMethod.Put:
- case 204 when !(_requestMethod == RequestMethod.Put || _requestMethod == RequestMethod.Patch):
- {
- _value = async
- ? await _source.CreateResultAsync(finalResponse, cancellationToken).ConfigureAwait(false)
- : _source.CreateResult(finalResponse, cancellationToken);
- _rawResponse = finalResponse;
- _hasValue = true;
- break;
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(finalResponse);
- }
- }
-
- return GetRawResponse();
- }
-
- public async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await UpdateStatusAsync(async: true, cancellationToken).ConfigureAwait(false);
-
- public Response UpdateStatus(CancellationToken cancellationToken = default) => UpdateStatusAsync(async: false, cancellationToken).EnsureCompleted();
-
-#pragma warning disable CA1822
- //TODO: This is currently unused.
- public string Id => throw new NotImplementedException();
-#pragma warning restore CA1822
-
- public T Value
- {
- get
- {
- if (!HasValue)
- {
- throw new InvalidOperationException("The operation has not completed yet.");
- }
-
- return _value;
- }
- }
-
- public bool HasCompleted => _hasCompleted;
- public bool HasValue => _hasValue;
-
- private HttpMessage CreateRequest(string link)
- {
- HttpMessage message = _pipeline.CreateMessage();
- Request request = message.Request;
- request.Method = RequestMethod.Get;
- request.Uri.Reset(new Uri(link));
- return message;
- }
-
- private async ValueTask GetResponseAsync(string link, CancellationToken cancellationToken = default)
- {
- if (link == null)
- {
- throw new ArgumentNullException(nameof(link));
- }
-
- using DiagnosticScope scope = _clientDiagnostics.CreateScope(_scopeName);
- scope.Start();
- try
- {
- using HttpMessage message = CreateRequest(link);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- return message.Response;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- private Response GetResponse(string link, CancellationToken cancellationToken = default)
- {
- if (link == null)
- {
- throw new ArgumentNullException(nameof(link));
- }
-
- using DiagnosticScope scope = _clientDiagnostics.CreateScope(_scopeName);
- scope.Start();
- try
- {
- using HttpMessage message = CreateRequest(link);
- _pipeline.Send(message, cancellationToken);
- return message.Response;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- private bool IsTerminalState(out string state)
- {
- Response response = GetRawResponse();
- state = string.Empty;
- if (_headerFrom == HeaderFrom.Location)
- {
- return response.Status != 202;
- }
-
- if (response.Status >= 200 && response.Status <= 204)
- {
- if (response.ContentStream?.Length > 0)
- {
- try
- {
- using JsonDocument document = JsonDocument.Parse(response.ContentStream);
- foreach (JsonProperty property in document.RootElement.EnumerateObject())
- {
- if ((_headerFrom == HeaderFrom.OperationLocation ||
- _headerFrom == HeaderFrom.AzureAsyncOperation) &&
- property.NameEquals("status"))
- {
- state = property.Value.GetString().ToLowerInvariant();
- return s_terminalStates.Contains(state);
- }
-
- if (_headerFrom == HeaderFrom.None && property.NameEquals("properties"))
- {
- foreach (JsonProperty innerProperty in property.Value.EnumerateObject())
- {
- if (innerProperty.NameEquals("provisioningState"))
- {
- state = innerProperty.Value.GetString().ToLowerInvariant();
- return s_terminalStates.Contains(state);
- }
- }
- }
- }
- }
- finally
- {
- // It is required to reset the position of the content after reading as this response may be used for deserialization.
- response.ContentStream.Position = 0;
- }
- }
-
- // If provisioningState was not found, it defaults to Succeeded.
- if (_headerFrom == HeaderFrom.None)
- {
- return true;
- }
- }
-
- throw _clientDiagnostics.CreateRequestFailedException(response);
- }
-
- private enum HeaderFrom
- {
- None,
- OperationLocation,
- AzureAsyncOperation,
- Location
- }
-
- private void InitializeScenarioInfo()
- {
- _originalHasLocation = _rawResponse.Headers.Contains("Location");
-
- if (_rawResponse.Headers.Contains("Operation-Location"))
- {
- _headerFrom = HeaderFrom.OperationLocation;
- return;
- }
-
- if (_rawResponse.Headers.Contains("Azure-AsyncOperation"))
- {
- _headerFrom = HeaderFrom.AzureAsyncOperation;
- return;
- }
-
- if (_originalHasLocation)
- {
- _headerFrom = HeaderFrom.Location;
- return;
- }
-
- _pollUri = _originalUri;
- _headerFrom = HeaderFrom.None;
- }
-
- private void UpdatePollUri()
- {
- var hasLocation = _rawResponse.Headers.TryGetValue("Location", out string? location);
- if (hasLocation)
- {
- _lastKnownLocation = location;
- }
-
- switch (_headerFrom)
- {
- case HeaderFrom.OperationLocation when _rawResponse.Headers.TryGetValue("Operation-Location", out string? operationLocation):
- _pollUri = operationLocation;
- return;
- case HeaderFrom.AzureAsyncOperation when _rawResponse.Headers.TryGetValue("Azure-AsyncOperation", out string? azureAsyncOperation):
- _pollUri = azureAsyncOperation;
- return;
- case HeaderFrom.Location when hasLocation:
- _pollUri = location!;
- return;
- }
- }
-
- private string? GetFinalUri()
- {
- if (_headerFrom == HeaderFrom.OperationLocation || _headerFrom == HeaderFrom.AzureAsyncOperation)
- {
- if (_requestMethod == RequestMethod.Delete)
- {
- return null;
- }
-
- if (_requestMethod == RequestMethod.Put || (_originalHasLocation && _finalStateVia == OperationFinalStateVia.OriginalUri))
- {
- return _originalUri;
- }
-
- if (_originalHasLocation && _finalStateVia == OperationFinalStateVia.Location)
- {
- return _lastKnownLocation;
- }
- }
-
- return null;
- }
- }
-}
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/ChangeTrackingDictionary.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/ChangeTrackingDictionary.cs
deleted file mode 100644
index 909b30872232..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/ChangeTrackingDictionary.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-#nullable enable
-
-namespace Azure.Core
-{
- internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey: notnull
- {
- private IDictionary? _innerDictionary;
-
- public ChangeTrackingDictionary()
- {
- }
-
- public ChangeTrackingDictionary(Optional> optionalDictionary) : this(optionalDictionary.Value)
- {
- }
-
- public ChangeTrackingDictionary(Optional> optionalDictionary) : this(optionalDictionary.Value)
- {
- }
-
- private ChangeTrackingDictionary(IDictionary dictionary)
- {
- if (dictionary == null) return;
-
- _innerDictionary = new Dictionary(dictionary);
- }
-
- private ChangeTrackingDictionary(IReadOnlyDictionary dictionary)
- {
- if (dictionary == null) return;
-
- _innerDictionary = new Dictionary();
- foreach (KeyValuePair pair in dictionary)
- {
- _innerDictionary.Add(pair);
- }
- }
-
- public bool IsUndefined => _innerDictionary == null;
-
- public IEnumerator> GetEnumerator()
- {
- if (IsUndefined)
- {
- IEnumerator> GetEmptyEnumerator()
- {
- yield break;
- }
- return GetEmptyEnumerator();
- }
- return EnsureDictionary().GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- public void Add(KeyValuePair item)
- {
- EnsureDictionary().Add(item);
- }
-
- public void Clear()
- {
- EnsureDictionary().Clear();
- }
-
- public bool Contains(KeyValuePair item)
- {
- if (IsUndefined)
- {
- return false;
- }
-
- return EnsureDictionary().Contains(item);
- }
-
- public void CopyTo(KeyValuePair[] array, int arrayIndex)
- {
- if (IsUndefined)
- {
- return;
- }
-
- EnsureDictionary().CopyTo(array, arrayIndex);
- }
-
- public bool Remove(KeyValuePair item)
- {
- if (IsUndefined)
- {
- return false;
- }
-
- return EnsureDictionary().Remove(item);
- }
-
- public int Count
- {
- get
- {
- if (IsUndefined)
- {
- return 0;
- }
-
- return EnsureDictionary().Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- if (IsUndefined)
- {
- return false;
- }
- return EnsureDictionary().IsReadOnly;
- }
- }
-
- public void Add(TKey key, TValue value)
- {
- EnsureDictionary().Add(key, value);
- }
-
- public bool ContainsKey(TKey key)
- {
- if (IsUndefined)
- {
- return false;
- }
-
- return EnsureDictionary().ContainsKey(key);
- }
-
- public bool Remove(TKey key)
- {
- if (IsUndefined)
- {
- return false;
- }
-
- return EnsureDictionary().Remove(key);
- }
-
- public bool TryGetValue(TKey key, out TValue value)
- {
- if (IsUndefined)
- {
- value = default!;
- return false;
- }
- return EnsureDictionary().TryGetValue(key, out value);
- }
-
- public TValue this[TKey key]
- {
- get
- {
- if (IsUndefined)
- {
- throw new KeyNotFoundException(nameof(key));
- }
-
- return EnsureDictionary()[key];
- }
- set => EnsureDictionary()[key] = value;
- }
-
- IEnumerable IReadOnlyDictionary.Keys => Keys;
-
- IEnumerable IReadOnlyDictionary.Values => Values;
-
- public ICollection Keys
- {
- get
- {
- if (IsUndefined)
- {
- return Array.Empty();
- }
-
- return EnsureDictionary().Keys;
- }
- }
-
- public ICollection Values
- {
- get
- {
- if (IsUndefined)
- {
- return Array.Empty();
- }
-
- return EnsureDictionary().Values;
- }
- }
-
- private IDictionary EnsureDictionary()
- {
- return _innerDictionary ??= new Dictionary();
- }
- }
-}
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/ChangeTrackingList.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/ChangeTrackingList.cs
deleted file mode 100644
index d39f21d305db..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/ChangeTrackingList.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-
-#nullable enable
-
-namespace Azure.Core
-{
- internal class ChangeTrackingList: IList, IReadOnlyList
- {
- private IList? _innerList;
-
- public ChangeTrackingList()
- {
- }
-
- public ChangeTrackingList(Optional> optionalList) : this(optionalList.Value)
- {
- }
-
- public ChangeTrackingList(Optional> optionalList) : this(optionalList.Value)
- {
- }
-
- private ChangeTrackingList(IEnumerable innerList)
- {
- if (innerList == null)
- {
- return;
- }
-
- _innerList = innerList.ToList();
- }
-
- private ChangeTrackingList(IList innerList)
- {
- if (innerList == null)
- {
- return;
- }
-
- _innerList = innerList;
- }
-
- public bool IsUndefined => _innerList == null;
-
- public void Reset()
- {
- _innerList = null;
- }
-
- public IEnumerator GetEnumerator()
- {
- if (IsUndefined)
- {
- IEnumerator EnumerateEmpty()
- {
- yield break;
- }
-
- return EnumerateEmpty();
- }
- return EnsureList().GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- public void Add(T item)
- {
- EnsureList().Add(item);
- }
-
- public void Clear()
- {
- EnsureList().Clear();
- }
-
- public bool Contains(T item)
- {
- if (IsUndefined)
- {
- return false;
- }
-
- return EnsureList().Contains(item);
- }
-
- public void CopyTo(T[] array, int arrayIndex)
- {
- if (IsUndefined)
- {
- return;
- }
-
- EnsureList().CopyTo(array, arrayIndex);
- }
-
- public bool Remove(T item)
- {
- if (IsUndefined)
- {
- return false;
- }
-
- return EnsureList().Remove(item);
- }
-
- public int Count
- {
- get
- {
- if (IsUndefined)
- {
- return 0;
- }
- return EnsureList().Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- if (IsUndefined)
- {
- return false;
- }
-
- return EnsureList().IsReadOnly;
- }
- }
-
- public int IndexOf(T item)
- {
- if (IsUndefined)
- {
- return -1;
- }
-
- return EnsureList().IndexOf(item);
- }
-
- public void Insert(int index, T item)
- {
- EnsureList().Insert(index, item);
- }
-
- public void RemoveAt(int index)
- {
- if (IsUndefined)
- {
- throw new ArgumentOutOfRangeException(nameof(index));
- }
-
- EnsureList().RemoveAt(index);
- }
-
- public T this[int index]
- {
- get
- {
- if (IsUndefined)
- {
- throw new ArgumentOutOfRangeException(nameof(index));
- }
-
- return EnsureList()[index];
- }
- set
- {
- if (IsUndefined)
- {
- throw new ArgumentOutOfRangeException(nameof(index));
- }
-
- EnsureList()[index] = value;
- }
- }
-
- private IList EnsureList()
- {
- return _innerList ??= new List();
- }
- }
-}
\ No newline at end of file
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenClientAttribute.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenClientAttribute.cs
deleted file mode 100644
index 522ee46691d4..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenClientAttribute.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-
-namespace Azure.Core
-{
- [AttributeUsage(AttributeTargets.Class)]
- internal class CodeGenClientAttribute : CodeGenTypeAttribute
- {
- public CodeGenClientAttribute(string originalName) : base(originalName)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenMemberAttribute.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenMemberAttribute.cs
deleted file mode 100644
index 50c57d56ca42..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenMemberAttribute.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#nullable enable
-
-using System;
-
-namespace Azure.Core
-{
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
- internal class CodeGenMemberAttribute : CodeGenTypeAttribute
- {
- public CodeGenMemberAttribute() : base(null)
- {
- }
-
- public CodeGenMemberAttribute(string originalName) : base(originalName)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenModelAttribute.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenModelAttribute.cs
deleted file mode 100644
index 4b04d68bb8a8..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenModelAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#nullable enable
-
-using System;
-
-namespace Azure.Core
-{
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct)]
- internal class CodeGenModelAttribute : CodeGenTypeAttribute
- {
- ///
- /// Gets or sets a coma separated list of additional model usage modes. Allowed values: model, error, intput, output.
- ///
- public string[]? Usage { get; set; }
-
- ///
- /// Gets or sets a coma separated list of additional model serialization formats.
- ///
- public string[]? Formats { get; set; }
-
- public CodeGenModelAttribute() : base(null)
- {
- }
-
- public CodeGenModelAttribute(string originalName): base(originalName)
- {
- }
- }
-}
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenSuppressAttribute.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenSuppressAttribute.cs
deleted file mode 100644
index efb2c82f864e..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenSuppressAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-
-namespace Azure.Core
-{
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = true)]
- internal class CodeGenSuppressAttribute : Attribute
- {
- public string Member { get; }
- public Type[] Parameters { get; }
-
- public CodeGenSuppressAttribute(string member, params Type[] parameters)
- {
- Member = member;
- Parameters = parameters;
- }
- }
-}
\ No newline at end of file
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenTypeAttribute.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenTypeAttribute.cs
deleted file mode 100644
index 08095da55db6..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/CodeGenTypeAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#nullable enable
-
-using System;
-
-namespace Azure.Core
-{
- [AttributeUsage(AttributeTargets.Class)]
- internal class CodeGenTypeAttribute : Attribute
- {
- public string? OriginalName { get; }
-
- public CodeGenTypeAttribute(string? originalName)
- {
- OriginalName = originalName;
- }
- }
-}
\ No newline at end of file
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/IOperationSource.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/IOperationSource.cs
deleted file mode 100644
index a7b779100063..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/IOperationSource.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Azure.Core
-{
- internal interface IOperationSource
- {
- T CreateResult(Response response, CancellationToken cancellationToken);
- ValueTask CreateResultAsync(Response response, CancellationToken cancellationToken);
- }
-}
\ No newline at end of file
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/IUtf8JsonSerializable.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/IUtf8JsonSerializable.cs
deleted file mode 100644
index 5653e4609313..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/IUtf8JsonSerializable.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#nullable enable
-
-using System.Text.Json;
-
-namespace Azure.Core
-{
- internal interface IUtf8JsonSerializable
- {
- void Write(Utf8JsonWriter writer);
- }
-}
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/IXmlSerializable.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/IXmlSerializable.cs
deleted file mode 100644
index 343b127384d2..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/IXmlSerializable.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#nullable enable
-
-using System.Xml;
-
-namespace Azure.Core
-{
- internal interface IXmlSerializable
- {
- void Write(XmlWriter writer, string? nameHint);
- }
-}
diff --git a/sdk/core/Azure.Core/src/Shared/AutoRest/JsonElementExtensions.cs b/sdk/core/Azure.Core/src/Shared/AutoRest/JsonElementExtensions.cs
deleted file mode 100644
index 9b5efa3e00c0..000000000000
--- a/sdk/core/Azure.Core/src/Shared/AutoRest/JsonElementExtensions.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#nullable enable
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Text.Json;
-using System.Xml;
-
-namespace Azure.Core
-{
- internal static class JsonElementExtensions
- {
- public static object? GetObject(in this JsonElement element)
- {
- switch (element.ValueKind)
- {
- case JsonValueKind.String:
- return element.GetString();
- case JsonValueKind.Number:
- if (element.TryGetInt32(out int intValue))
- {
- return intValue;
- }
- if (element.TryGetInt64(out long longValue))
- {
- return longValue;
- }
- return element.GetDouble();
- case JsonValueKind.True:
- return true;
- case JsonValueKind.False:
- return false;
- case JsonValueKind.Undefined:
- case JsonValueKind.Null:
- return null;
- case JsonValueKind.Object:
- var dictionary = new Dictionary();
- foreach (JsonProperty jsonProperty in element.EnumerateObject())
- {
- dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject());
- }
- return dictionary;
- case JsonValueKind.Array:
- var list = new List
+
+
+
+
+
+
@@ -39,19 +45,7 @@
-
-
-
-
-
-
-
-
-
-
-
-