From fb618f66de4478502e919f8ab9dbf14a1be6da7c Mon Sep 17 00:00:00 2001 From: m-nash Date: Tue, 5 Sep 2023 12:43:18 -0700 Subject: [PATCH 01/45] Revert "update api" This reverts commit ae54d7db2b11c0f645ca8116b813fc8c166127f7. --- sdk/core/Azure.Core/api/Azure.Core.net461.cs | 66 ++++++++++++++++++ sdk/core/Azure.Core/api/Azure.Core.net472.cs | 66 ++++++++++++++++++ sdk/core/Azure.Core/api/Azure.Core.net5.0.cs | 67 ++++++++++++++++++ sdk/core/Azure.Core/api/Azure.Core.net6.0.cs | 68 +++++++++++++++++++ .../api/Azure.Core.netcoreapp2.1.cs | 66 ++++++++++++++++++ .../api/Azure.Core.netstandard2.0.cs | 66 ++++++++++++++++++ 6 files changed, 399 insertions(+) diff --git a/sdk/core/Azure.Core/api/Azure.Core.net461.cs b/sdk/core/Azure.Core/api/Azure.Core.net461.cs index 3f774979daad..c4bc82dc2a57 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net461.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net461.cs @@ -539,6 +539,8 @@ public abstract partial class RequestContent : System.IDisposable { protected RequestContent() { } public static Azure.Core.RequestContent Create(Azure.Core.Serialization.DynamicData content) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } public static Azure.Core.RequestContent Create(System.BinaryData content) { throw null; } public static Azure.Core.RequestContent Create(System.Buffers.ReadOnlySequence bytes) { throw null; } public static Azure.Core.RequestContent Create(byte[] bytes) { throw null; } @@ -1075,6 +1077,12 @@ public ServerCertificateCustomValidationArgs(System.Security.Cryptography.X509Ce } namespace Azure.Core.Serialization { + [System.AttributeUsageAttribute(System.AttributeTargets.Class)] + public sealed partial class DeserializationProxyAttribute : System.Attribute + { + public DeserializationProxyAttribute(System.Type proxyType) { } + public System.Type ProxyType { get { throw null; } } + } [System.Diagnostics.DebuggerDisplayAttribute("{DebuggerDisplay,nq}")] public sealed partial class DynamicData : System.Dynamic.IDynamicMetaObjectProvider, System.IDisposable { @@ -1109,6 +1117,16 @@ public partial interface IMemberNameConverter { string? ConvertMemberName(System.Reflection.MemberInfo member); } + public partial interface IModelJsonSerializable : Azure.Core.Serialization.IModelSerializable + { + T Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options); + void Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options); + } + public partial interface IModelSerializable + { + T Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options); + System.BinaryData Serialize(Azure.Core.Serialization.ModelSerializerOptions options); + } public partial class JsonObjectSerializer : Azure.Core.Serialization.ObjectSerializer, Azure.Core.Serialization.IMemberNameConverter { public JsonObjectSerializer() { } @@ -1127,6 +1145,54 @@ public enum JsonPropertyNames UseExact = 0, CamelCase = 1, } + public partial class ModelJsonConverter : System.Text.Json.Serialization.JsonConverter> + { + public ModelJsonConverter() { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerFormat format) { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerOptions options) { } + public Azure.Core.Serialization.ModelSerializerOptions ModelSerializerOptions { get { throw null; } } + public override bool CanConvert(System.Type typeToConvert) { throw null; } + public override Azure.Core.Serialization.IModelJsonSerializable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } + public override void Write(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.IModelJsonSerializable value, System.Text.Json.JsonSerializerOptions options) { } + } + public static partial class ModelSerializer + { + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static System.BinaryData SerializeCore(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelSerializerFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Json; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Wire; + public ModelSerializerFormat(string value) { throw null; } + public bool Equals(Azure.Core.Serialization.ModelSerializerFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public static implicit operator Azure.Core.Serialization.ModelSerializerFormat (string value) { throw null; } + public static bool operator !=(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ModelSerializerOptions + { + public static readonly Azure.Core.Serialization.ModelSerializerOptions DefaultWireOptions; + public ModelSerializerOptions() { } + public ModelSerializerOptions(Azure.Core.Serialization.ModelSerializerFormat format) { } + public Azure.Core.Serialization.ModelSerializerFormat Format { get { throw null; } } + public System.Func? ObjectSerializerResolver { get { throw null; } set { } } + } public abstract partial class ObjectSerializer { protected ObjectSerializer() { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net472.cs b/sdk/core/Azure.Core/api/Azure.Core.net472.cs index 3f774979daad..c4bc82dc2a57 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net472.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net472.cs @@ -539,6 +539,8 @@ public abstract partial class RequestContent : System.IDisposable { protected RequestContent() { } public static Azure.Core.RequestContent Create(Azure.Core.Serialization.DynamicData content) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } public static Azure.Core.RequestContent Create(System.BinaryData content) { throw null; } public static Azure.Core.RequestContent Create(System.Buffers.ReadOnlySequence bytes) { throw null; } public static Azure.Core.RequestContent Create(byte[] bytes) { throw null; } @@ -1075,6 +1077,12 @@ public ServerCertificateCustomValidationArgs(System.Security.Cryptography.X509Ce } namespace Azure.Core.Serialization { + [System.AttributeUsageAttribute(System.AttributeTargets.Class)] + public sealed partial class DeserializationProxyAttribute : System.Attribute + { + public DeserializationProxyAttribute(System.Type proxyType) { } + public System.Type ProxyType { get { throw null; } } + } [System.Diagnostics.DebuggerDisplayAttribute("{DebuggerDisplay,nq}")] public sealed partial class DynamicData : System.Dynamic.IDynamicMetaObjectProvider, System.IDisposable { @@ -1109,6 +1117,16 @@ public partial interface IMemberNameConverter { string? ConvertMemberName(System.Reflection.MemberInfo member); } + public partial interface IModelJsonSerializable : Azure.Core.Serialization.IModelSerializable + { + T Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options); + void Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options); + } + public partial interface IModelSerializable + { + T Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options); + System.BinaryData Serialize(Azure.Core.Serialization.ModelSerializerOptions options); + } public partial class JsonObjectSerializer : Azure.Core.Serialization.ObjectSerializer, Azure.Core.Serialization.IMemberNameConverter { public JsonObjectSerializer() { } @@ -1127,6 +1145,54 @@ public enum JsonPropertyNames UseExact = 0, CamelCase = 1, } + public partial class ModelJsonConverter : System.Text.Json.Serialization.JsonConverter> + { + public ModelJsonConverter() { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerFormat format) { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerOptions options) { } + public Azure.Core.Serialization.ModelSerializerOptions ModelSerializerOptions { get { throw null; } } + public override bool CanConvert(System.Type typeToConvert) { throw null; } + public override Azure.Core.Serialization.IModelJsonSerializable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } + public override void Write(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.IModelJsonSerializable value, System.Text.Json.JsonSerializerOptions options) { } + } + public static partial class ModelSerializer + { + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static System.BinaryData SerializeCore(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelSerializerFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Json; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Wire; + public ModelSerializerFormat(string value) { throw null; } + public bool Equals(Azure.Core.Serialization.ModelSerializerFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public static implicit operator Azure.Core.Serialization.ModelSerializerFormat (string value) { throw null; } + public static bool operator !=(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ModelSerializerOptions + { + public static readonly Azure.Core.Serialization.ModelSerializerOptions DefaultWireOptions; + public ModelSerializerOptions() { } + public ModelSerializerOptions(Azure.Core.Serialization.ModelSerializerFormat format) { } + public Azure.Core.Serialization.ModelSerializerFormat Format { get { throw null; } } + public System.Func? ObjectSerializerResolver { get { throw null; } set { } } + } public abstract partial class ObjectSerializer { protected ObjectSerializer() { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs index c10168bea2ae..b0c3e986a62b 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs @@ -539,6 +539,8 @@ public abstract partial class RequestContent : System.IDisposable { protected RequestContent() { } public static Azure.Core.RequestContent Create(Azure.Core.Serialization.DynamicData content) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } public static Azure.Core.RequestContent Create(System.BinaryData content) { throw null; } public static Azure.Core.RequestContent Create(System.Buffers.ReadOnlySequence bytes) { throw null; } public static Azure.Core.RequestContent Create(byte[] bytes) { throw null; } @@ -1075,6 +1077,13 @@ public ServerCertificateCustomValidationArgs(System.Security.Cryptography.X509Ce } namespace Azure.Core.Serialization { + [System.AttributeUsageAttribute(System.AttributeTargets.Class)] + public sealed partial class DeserializationProxyAttribute : System.Attribute + { + public DeserializationProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type proxyType) { } + [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] + public System.Type ProxyType { get { throw null; } } + } [System.Diagnostics.DebuggerDisplayAttribute("{DebuggerDisplay,nq}")] public sealed partial class DynamicData : System.Dynamic.IDynamicMetaObjectProvider, System.IDisposable { @@ -1109,6 +1118,16 @@ public partial interface IMemberNameConverter { string? ConvertMemberName(System.Reflection.MemberInfo member); } + public partial interface IModelJsonSerializable : Azure.Core.Serialization.IModelSerializable + { + T Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options); + void Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options); + } + public partial interface IModelSerializable + { + T Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options); + System.BinaryData Serialize(Azure.Core.Serialization.ModelSerializerOptions options); + } public partial class JsonObjectSerializer : Azure.Core.Serialization.ObjectSerializer, Azure.Core.Serialization.IMemberNameConverter { public JsonObjectSerializer() { } @@ -1127,6 +1146,54 @@ public enum JsonPropertyNames UseExact = 0, CamelCase = 1, } + public partial class ModelJsonConverter : System.Text.Json.Serialization.JsonConverter> + { + public ModelJsonConverter() { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerFormat format) { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerOptions options) { } + public Azure.Core.Serialization.ModelSerializerOptions ModelSerializerOptions { get { throw null; } } + public override bool CanConvert(System.Type typeToConvert) { throw null; } + public override Azure.Core.Serialization.IModelJsonSerializable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } + public override void Write(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.IModelJsonSerializable value, System.Text.Json.JsonSerializerOptions options) { } + } + public static partial class ModelSerializer + { + public static object? Deserialize(System.BinaryData data, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type returnType, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static object? Deserialize(System.BinaryData data, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type returnType, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static System.BinaryData SerializeCore(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelSerializerFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Json; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Wire; + public ModelSerializerFormat(string value) { throw null; } + public bool Equals(Azure.Core.Serialization.ModelSerializerFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals([System.Diagnostics.CodeAnalysis.AllowNullAttribute] object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public static implicit operator Azure.Core.Serialization.ModelSerializerFormat (string value) { throw null; } + public static bool operator !=(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ModelSerializerOptions + { + public static readonly Azure.Core.Serialization.ModelSerializerOptions DefaultWireOptions; + public ModelSerializerOptions() { } + public ModelSerializerOptions(Azure.Core.Serialization.ModelSerializerFormat format) { } + public Azure.Core.Serialization.ModelSerializerFormat Format { get { throw null; } } + public System.Func? ObjectSerializerResolver { get { throw null; } set { } } + } public abstract partial class ObjectSerializer { protected ObjectSerializer() { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs index c10168bea2ae..963e738e5c4a 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs @@ -539,6 +539,8 @@ public abstract partial class RequestContent : System.IDisposable { protected RequestContent() { } public static Azure.Core.RequestContent Create(Azure.Core.Serialization.DynamicData content) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } public static Azure.Core.RequestContent Create(System.BinaryData content) { throw null; } public static Azure.Core.RequestContent Create(System.Buffers.ReadOnlySequence bytes) { throw null; } public static Azure.Core.RequestContent Create(byte[] bytes) { throw null; } @@ -1075,6 +1077,13 @@ public ServerCertificateCustomValidationArgs(System.Security.Cryptography.X509Ce } namespace Azure.Core.Serialization { + [System.AttributeUsageAttribute(System.AttributeTargets.Class)] + public sealed partial class DeserializationProxyAttribute : System.Attribute + { + public DeserializationProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type proxyType) { } + [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] + public System.Type ProxyType { get { throw null; } } + } [System.Diagnostics.DebuggerDisplayAttribute("{DebuggerDisplay,nq}")] public sealed partial class DynamicData : System.Dynamic.IDynamicMetaObjectProvider, System.IDisposable { @@ -1109,6 +1118,16 @@ public partial interface IMemberNameConverter { string? ConvertMemberName(System.Reflection.MemberInfo member); } + public partial interface IModelJsonSerializable : Azure.Core.Serialization.IModelSerializable + { + T Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options); + void Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options); + } + public partial interface IModelSerializable + { + T Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options); + System.BinaryData Serialize(Azure.Core.Serialization.ModelSerializerOptions options); + } public partial class JsonObjectSerializer : Azure.Core.Serialization.ObjectSerializer, Azure.Core.Serialization.IMemberNameConverter { public JsonObjectSerializer() { } @@ -1127,6 +1146,55 @@ public enum JsonPropertyNames UseExact = 0, CamelCase = 1, } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The constructors of the type being deserialized are dynamically accessed and may be trimmed.")] + public partial class ModelJsonConverter : System.Text.Json.Serialization.JsonConverter> + { + public ModelJsonConverter() { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerFormat format) { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerOptions options) { } + public Azure.Core.Serialization.ModelSerializerOptions ModelSerializerOptions { get { throw null; } } + public override bool CanConvert(System.Type typeToConvert) { throw null; } + public override Azure.Core.Serialization.IModelJsonSerializable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } + public override void Write(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.IModelJsonSerializable value, System.Text.Json.JsonSerializerOptions options) { } + } + public static partial class ModelSerializer + { + public static object? Deserialize(System.BinaryData data, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type returnType, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static object? Deserialize(System.BinaryData data, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type returnType, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static System.BinaryData SerializeCore(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelSerializerFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Json; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Wire; + public ModelSerializerFormat(string value) { throw null; } + public bool Equals(Azure.Core.Serialization.ModelSerializerFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals([System.Diagnostics.CodeAnalysis.AllowNullAttribute] object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public static implicit operator Azure.Core.Serialization.ModelSerializerFormat (string value) { throw null; } + public static bool operator !=(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ModelSerializerOptions + { + public static readonly Azure.Core.Serialization.ModelSerializerOptions DefaultWireOptions; + public ModelSerializerOptions() { } + public ModelSerializerOptions(Azure.Core.Serialization.ModelSerializerFormat format) { } + public Azure.Core.Serialization.ModelSerializerFormat Format { get { throw null; } } + public System.Func? ObjectSerializerResolver { get { throw null; } set { } } + } public abstract partial class ObjectSerializer { protected ObjectSerializer() { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs b/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs index 3f774979daad..c4bc82dc2a57 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs @@ -539,6 +539,8 @@ public abstract partial class RequestContent : System.IDisposable { protected RequestContent() { } public static Azure.Core.RequestContent Create(Azure.Core.Serialization.DynamicData content) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } public static Azure.Core.RequestContent Create(System.BinaryData content) { throw null; } public static Azure.Core.RequestContent Create(System.Buffers.ReadOnlySequence bytes) { throw null; } public static Azure.Core.RequestContent Create(byte[] bytes) { throw null; } @@ -1075,6 +1077,12 @@ public ServerCertificateCustomValidationArgs(System.Security.Cryptography.X509Ce } namespace Azure.Core.Serialization { + [System.AttributeUsageAttribute(System.AttributeTargets.Class)] + public sealed partial class DeserializationProxyAttribute : System.Attribute + { + public DeserializationProxyAttribute(System.Type proxyType) { } + public System.Type ProxyType { get { throw null; } } + } [System.Diagnostics.DebuggerDisplayAttribute("{DebuggerDisplay,nq}")] public sealed partial class DynamicData : System.Dynamic.IDynamicMetaObjectProvider, System.IDisposable { @@ -1109,6 +1117,16 @@ public partial interface IMemberNameConverter { string? ConvertMemberName(System.Reflection.MemberInfo member); } + public partial interface IModelJsonSerializable : Azure.Core.Serialization.IModelSerializable + { + T Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options); + void Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options); + } + public partial interface IModelSerializable + { + T Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options); + System.BinaryData Serialize(Azure.Core.Serialization.ModelSerializerOptions options); + } public partial class JsonObjectSerializer : Azure.Core.Serialization.ObjectSerializer, Azure.Core.Serialization.IMemberNameConverter { public JsonObjectSerializer() { } @@ -1127,6 +1145,54 @@ public enum JsonPropertyNames UseExact = 0, CamelCase = 1, } + public partial class ModelJsonConverter : System.Text.Json.Serialization.JsonConverter> + { + public ModelJsonConverter() { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerFormat format) { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerOptions options) { } + public Azure.Core.Serialization.ModelSerializerOptions ModelSerializerOptions { get { throw null; } } + public override bool CanConvert(System.Type typeToConvert) { throw null; } + public override Azure.Core.Serialization.IModelJsonSerializable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } + public override void Write(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.IModelJsonSerializable value, System.Text.Json.JsonSerializerOptions options) { } + } + public static partial class ModelSerializer + { + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static System.BinaryData SerializeCore(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelSerializerFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Json; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Wire; + public ModelSerializerFormat(string value) { throw null; } + public bool Equals(Azure.Core.Serialization.ModelSerializerFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public static implicit operator Azure.Core.Serialization.ModelSerializerFormat (string value) { throw null; } + public static bool operator !=(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ModelSerializerOptions + { + public static readonly Azure.Core.Serialization.ModelSerializerOptions DefaultWireOptions; + public ModelSerializerOptions() { } + public ModelSerializerOptions(Azure.Core.Serialization.ModelSerializerFormat format) { } + public Azure.Core.Serialization.ModelSerializerFormat Format { get { throw null; } } + public System.Func? ObjectSerializerResolver { get { throw null; } set { } } + } public abstract partial class ObjectSerializer { protected ObjectSerializer() { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs index 3f774979daad..c4bc82dc2a57 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs @@ -539,6 +539,8 @@ public abstract partial class RequestContent : System.IDisposable { protected RequestContent() { } public static Azure.Core.RequestContent Create(Azure.Core.Serialization.DynamicData content) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static Azure.Core.RequestContent Create(Azure.Core.Serialization.IModelSerializable model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } public static Azure.Core.RequestContent Create(System.BinaryData content) { throw null; } public static Azure.Core.RequestContent Create(System.Buffers.ReadOnlySequence bytes) { throw null; } public static Azure.Core.RequestContent Create(byte[] bytes) { throw null; } @@ -1075,6 +1077,12 @@ public ServerCertificateCustomValidationArgs(System.Security.Cryptography.X509Ce } namespace Azure.Core.Serialization { + [System.AttributeUsageAttribute(System.AttributeTargets.Class)] + public sealed partial class DeserializationProxyAttribute : System.Attribute + { + public DeserializationProxyAttribute(System.Type proxyType) { } + public System.Type ProxyType { get { throw null; } } + } [System.Diagnostics.DebuggerDisplayAttribute("{DebuggerDisplay,nq}")] public sealed partial class DynamicData : System.Dynamic.IDynamicMetaObjectProvider, System.IDisposable { @@ -1109,6 +1117,16 @@ public partial interface IMemberNameConverter { string? ConvertMemberName(System.Reflection.MemberInfo member); } + public partial interface IModelJsonSerializable : Azure.Core.Serialization.IModelSerializable + { + T Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options); + void Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options); + } + public partial interface IModelSerializable + { + T Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options); + System.BinaryData Serialize(Azure.Core.Serialization.ModelSerializerOptions options); + } public partial class JsonObjectSerializer : Azure.Core.Serialization.ObjectSerializer, Azure.Core.Serialization.IMemberNameConverter { public JsonObjectSerializer() { } @@ -1127,6 +1145,54 @@ public enum JsonPropertyNames UseExact = 0, CamelCase = 1, } + public partial class ModelJsonConverter : System.Text.Json.Serialization.JsonConverter> + { + public ModelJsonConverter() { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerFormat format) { } + public ModelJsonConverter(Azure.Core.Serialization.ModelSerializerOptions options) { } + public Azure.Core.Serialization.ModelSerializerOptions ModelSerializerOptions { get { throw null; } } + public override bool CanConvert(System.Type typeToConvert) { throw null; } + public override Azure.Core.Serialization.IModelJsonSerializable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } + public override void Write(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.IModelJsonSerializable value, System.Text.Json.JsonSerializerOptions options) { } + } + public static partial class ModelSerializer + { + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static object? Deserialize(System.BinaryData data, System.Type returnType, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static T? Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerFormat format) { throw null; } + public static System.BinaryData Serialize(object model, Azure.Core.Serialization.ModelSerializerOptions? options = null) { throw null; } + public static System.BinaryData SerializeCore(Azure.Core.Serialization.IModelJsonSerializable model, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerFormat format) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + public static System.BinaryData Serialize(T model, Azure.Core.Serialization.ModelSerializerOptions? options = null) where T : Azure.Core.Serialization.IModelSerializable { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelSerializerFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Json; + public static readonly Azure.Core.Serialization.ModelSerializerFormat Wire; + public ModelSerializerFormat(string value) { throw null; } + public bool Equals(Azure.Core.Serialization.ModelSerializerFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public static implicit operator Azure.Core.Serialization.ModelSerializerFormat (string value) { throw null; } + public static bool operator !=(Azure.Core.Serialization.ModelSerializerFormat left, Azure.Core.Serialization.ModelSerializerFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ModelSerializerOptions + { + public static readonly Azure.Core.Serialization.ModelSerializerOptions DefaultWireOptions; + public ModelSerializerOptions() { } + public ModelSerializerOptions(Azure.Core.Serialization.ModelSerializerFormat format) { } + public Azure.Core.Serialization.ModelSerializerFormat Format { get { throw null; } } + public System.Func? ObjectSerializerResolver { get { throw null; } set { } } + } public abstract partial class ObjectSerializer { protected ObjectSerializer() { } From d62f58d9a113d0120e626ff9ea0faff700605b81 Mon Sep 17 00:00:00 2001 From: m-nash Date: Tue, 5 Sep 2023 12:43:40 -0700 Subject: [PATCH 02/45] Revert "remove serialization" This reverts commit 748872b3a64f609d733074ee8b928b5751cb4446. --- .../ModelContent/LargeModel.cs | 12 + .../ModelContent/ModelContentBenchmark.cs | 15 + .../ModelContent/SmallModel.cs | 12 + .../ModelJsonContent/LargeModel.cs | 12 + .../ModelJsonContentBenchmark.cs | 15 + .../ModelJsonContent/SmallModel.cs | 12 + .../RequestContentBenchmark.cs | 60 + .../AvailabilitySetDataModel.cs | 33 + .../perf/Serializations/BenchmarkConfig.cs | 20 + .../perf/Serializations/JsonBenchmark.cs | 193 + .../perf/Serializations/ModelXmlModel.cs | 34 + .../ResourceProviderDataModel.cs | 35 + .../perf/Serializations/XmlBenchmark.cs | 135 + sdk/core/Azure.Core/src/RequestContent.cs | 73 + .../DeserializationProxyAttribute.cs | 37 + .../Serialization/IModelJsonSerializable.cs | 38 + .../src/Serialization/IModelSerializable.cs | 32 + .../src/Serialization/ModelJsonConverter.cs | 71 + .../src/Serialization/ModelSerializer.cs | 201 + .../Serialization/ModelSerializerFormat.cs | 79 + .../Serialization/ModelSerializerOptions.cs | 74 + .../ModelWriter.SequenceBuilder.cs | 169 + .../src/Serialization/ModelWriter.cs | 197 + .../src/Shared/ModelSerializerHelper.cs | 26 + .../Azure.Core/tests/Azure.Core.Tests.csproj | 1 + .../ModelJsonConverterTests.cs | 51 + .../ModelSerializationContentTests.cs | 57 + .../ModelSerializerOptionsTests.cs | 66 + .../ModelSerializerTests.cs | 186 + .../ModelSerialization/ModelWriterTests.cs | 346 + .../SerializationTestSource.cs | 35 + .../common/Azure.Core.Tests.Common.csproj | 34 + .../Models/ChildModelXml.cs | 169 + .../Models/DiscriminatorSet/BaseModel.cs | 151 + .../Models/DiscriminatorSet/ModelX.cs | 211 + .../Models/DiscriminatorSet/ModelY.cs | 111 + .../DiscriminatorSet/UnknownBaseModel.cs | 76 + .../Models/ModelAsStruct.cs | 141 + .../Models/ModelXDeserializationProxy.cs | 12 + .../Models/ModelXml.cs | 229 + .../ServiceModels/ApiProfile.Serialization.cs | 106 + .../ServiceModels/ApiProfile.cs | 32 + .../AvailabilitySetData.Serialization.cs | 283 + .../ServiceModels/AvailabilitySetData.cs | 99 + .../ServiceModels/ComputeSku.Serialization.cs | 130 + .../ServiceModels/ComputeSku.cs | 36 + .../ComputeStatusLevelType.Serialization.cs | 30 + .../ServiceModels/ComputeStatusLevelType.cs | 20 + .../ServiceModels/CreatedByType.cs | 57 + .../InstanceViewStatus.Serialization.cs | 172 + .../ServiceModels/InstanceViewStatus.cs | 46 + .../ProviderAuthorizationConsentState.cs | 57 + .../ProviderExtendedLocation.Serialization.cs | 118 + .../ServiceModels/ProviderExtendedLocation.cs | 39 + .../ProviderResourceType.Serialization.cs | 283 + .../ServiceModels/ProviderResourceType.cs | 73 + .../ServiceModels/ResourceData.cs | 38 + .../ResourceProviderData.Serialization.cs | 171 + .../ServiceModels/ResourceProviderData.cs | 75 + .../ResourceTypeAlias.Serialization.cs | 162 + .../ServiceModels/ResourceTypeAlias.cs | 51 + .../ResourceTypeAliasPath.Serialization.cs | 134 + .../ServiceModels/ResourceTypeAliasPath.cs | 43 + .../ResourceTypeAliasPathAttributes.cs | 51 + ...urceTypeAliasPathMetadata.Serialization.cs | 114 + .../ResourceTypeAliasPathMetadata.cs | 32 + .../ResourceTypeAliasPathTokenType.cs | 69 + .../ResourceTypeAliasPattern.Serialization.cs | 129 + .../ServiceModels/ResourceTypeAliasPattern.cs | 36 + ...ourceTypeAliasPatternType.Serialization.cs | 28 + .../ResourceTypeAliasPatternType.cs | 18 + .../ResourceTypeAliasType.Serialization.cs | 30 + .../ServiceModels/ResourceTypeAliasType.cs | 20 + .../ServiceModels/SystemData.Serialization.cs | 184 + .../ServiceModels/SystemData.cs | 50 + .../ServiceModels/TrackedResourceData.cs | 41 + .../WritableSubResource.Serialization.cs | 115 + .../ServiceModels/WritableSubResource.cs | 33 + .../ZoneMapping.Serialization.cs | 106 + .../ServiceModels/ZoneMapping.cs | 35 + .../AvailabilitySetData.json | 16 + .../AvailabilitySetDataWireFormat.json | 18 + .../AvailabilitySetDataWithVMs.json | 24 + .../AvailabilitySetDataWithVMsWireFormat.json | 24 + .../tests/common/TestData/ModelX/ModelX.json | 13 + .../TestData/ModelX/ModelXWireFormat.json | 13 + .../tests/common/TestData/ModelXml.xml | 9 + .../tests/common/TestData/ModelXmlX.xml | 9 + .../ResourceProviderData-Collapsed.json | 1 + .../ResourceProviderData.json | 11392 ++++++++++++++++ .../public/Azure.Core.Tests.Public.csproj | 1 + .../AvailabilitySetDataTests.cs | 66 + .../AvailabilitySetDataTestsWithVMs.cs | 73 + .../ModelSerializationTests/BaseModelTests.cs | 66 + .../ModelSerializationTests/EnvelopeTests.cs | 126 + .../ModelAsStructTests.cs | 50 + .../ModelSerializationTests/ModelJsonTests.cs | 36 + .../ModelSerializationTests/ModelTests.cs | 228 + .../ModelXDeserializationProxyTests.cs | 34 + .../ModelSerializationTests/ModelXTests.cs | 77 + .../ModelXmlCrossLibraryTests.cs | 88 + .../ModelXmlOnlyTests.cs | 58 + .../ModelSerializationTests/ModelXmlTests.cs | 89 + .../ModelSerializationTests/Models/Animal.cs | 147 + .../Models/CatReadOnlyProperty.cs | 138 + .../Models/ChildModelXmlOnly.cs | 97 + .../Models/DogListProperty.cs | 186 + .../Models/DogListPropertyBlankConverter.cs | 23 + .../Models/Envelope.cs | 183 + .../Models/JsonModelForCombinedInterface.cs | 130 + .../Models/ModelXmlCrossLibrary.cs | 240 + .../Models/ModelXmlOnly.cs | 139 + .../Models/XmlModelForCombinedInterface.cs | 214 + .../ResourceProviderDataTests.cs | 36 + .../RoundTripStrategy.cs | 262 + .../UnknownBaseModelTests.cs | 69 + .../UsingJsonSerializerTests.cs | 68 + .../ModelSerializationTests/VerifyModels.cs | 64 + .../XmlModelForCombinedInterfaceTests.cs | 63 + 119 files changed, 21377 insertions(+) create mode 100644 sdk/core/Azure.Core/perf/RequestContents/ModelContent/LargeModel.cs create mode 100644 sdk/core/Azure.Core/perf/RequestContents/ModelContent/ModelContentBenchmark.cs create mode 100644 sdk/core/Azure.Core/perf/RequestContents/ModelContent/SmallModel.cs create mode 100644 sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/LargeModel.cs create mode 100644 sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/ModelJsonContentBenchmark.cs create mode 100644 sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/SmallModel.cs create mode 100644 sdk/core/Azure.Core/perf/RequestContents/RequestContentBenchmark.cs create mode 100644 sdk/core/Azure.Core/perf/Serializations/AvailabilitySetDataModel.cs create mode 100644 sdk/core/Azure.Core/perf/Serializations/BenchmarkConfig.cs create mode 100644 sdk/core/Azure.Core/perf/Serializations/JsonBenchmark.cs create mode 100644 sdk/core/Azure.Core/perf/Serializations/ModelXmlModel.cs create mode 100644 sdk/core/Azure.Core/perf/Serializations/ResourceProviderDataModel.cs create mode 100644 sdk/core/Azure.Core/perf/Serializations/XmlBenchmark.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/DeserializationProxyAttribute.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/IModelJsonSerializable.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/IModelSerializable.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/ModelJsonConverter.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/ModelSerializer.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/ModelSerializerFormat.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/ModelSerializerOptions.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/ModelWriter.SequenceBuilder.cs create mode 100644 sdk/core/Azure.Core/src/Serialization/ModelWriter.cs create mode 100644 sdk/core/Azure.Core/src/Shared/ModelSerializerHelper.cs create mode 100644 sdk/core/Azure.Core/tests/ModelSerialization/ModelJsonConverterTests.cs create mode 100644 sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializationContentTests.cs create mode 100644 sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerOptionsTests.cs create mode 100644 sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerTests.cs create mode 100644 sdk/core/Azure.Core/tests/ModelSerialization/ModelWriterTests.cs create mode 100644 sdk/core/Azure.Core/tests/ModelSerialization/SerializationTestSource.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ChildModelXml.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/BaseModel.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelX.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelY.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/UnknownBaseModel.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelAsStruct.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXDeserializationProxy.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXml.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/CreatedByType.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderAuthorizationConsentState.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceData.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathAttributes.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathTokenType.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/TrackedResourceData.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.Serialization.cs create mode 100644 sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.cs create mode 100644 sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetData.json create mode 100644 sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWireFormat.json create mode 100644 sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMs.json create mode 100644 sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMsWireFormat.json create mode 100644 sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelX.json create mode 100644 sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelXWireFormat.json create mode 100644 sdk/core/Azure.Core/tests/common/TestData/ModelXml.xml create mode 100644 sdk/core/Azure.Core/tests/common/TestData/ModelXmlX.xml create mode 100644 sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData-Collapsed.json create mode 100644 sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData.json create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTestsWithVMs.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/BaseModelTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/EnvelopeTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelAsStructTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelJsonTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXDeserializationProxyTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlCrossLibraryTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlOnlyTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Animal.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/CatReadOnlyProperty.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ChildModelXmlOnly.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListProperty.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListPropertyBlankConverter.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Envelope.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/JsonModelForCombinedInterface.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlCrossLibrary.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlOnly.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/XmlModelForCombinedInterface.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/ResourceProviderDataTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/RoundTripStrategy.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/UnknownBaseModelTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/UsingJsonSerializerTests.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/VerifyModels.cs create mode 100644 sdk/core/Azure.Core/tests/public/ModelSerializationTests/XmlModelForCombinedInterfaceTests.cs diff --git a/sdk/core/Azure.Core/perf/RequestContents/ModelContent/LargeModel.cs b/sdk/core/Azure.Core/perf/RequestContents/ModelContent/LargeModel.cs new file mode 100644 index 000000000000..bec72f6746d2 --- /dev/null +++ b/sdk/core/Azure.Core/perf/RequestContents/ModelContent/LargeModel.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Tests.ResourceManager.Resources; + +namespace Azure.Core.Perf.RequestContents.ModelContent +{ + public class LargeModel : ModelContentBenchmark + { + protected override string JsonFileName => "ResourceProviderData.json"; + } +} diff --git a/sdk/core/Azure.Core/perf/RequestContents/ModelContent/ModelContentBenchmark.cs b/sdk/core/Azure.Core/perf/RequestContents/ModelContent/ModelContentBenchmark.cs new file mode 100644 index 000000000000..ac3a6acc3819 --- /dev/null +++ b/sdk/core/Azure.Core/perf/RequestContents/ModelContent/ModelContentBenchmark.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Serialization; + +namespace Azure.Core.Perf.RequestContents.ModelContent +{ + public abstract class ModelContentBenchmark : RequestContentBenchmark> where T : class, IModelSerializable + { + protected override RequestContent CreateRequestContent() + { + return RequestContent.Create(_model); + } + } +} diff --git a/sdk/core/Azure.Core/perf/RequestContents/ModelContent/SmallModel.cs b/sdk/core/Azure.Core/perf/RequestContents/ModelContent/SmallModel.cs new file mode 100644 index 000000000000..c485debc8ff8 --- /dev/null +++ b/sdk/core/Azure.Core/perf/RequestContents/ModelContent/SmallModel.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Tests.ResourceManager.Compute; + +namespace Azure.Core.Perf.RequestContents.ModelContent +{ + public class SmallModel : ModelContentBenchmark + { + protected override string JsonFileName => "AvailabilitySetData.json"; + } +} diff --git a/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/LargeModel.cs b/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/LargeModel.cs new file mode 100644 index 000000000000..059688835f5a --- /dev/null +++ b/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/LargeModel.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Tests.ResourceManager.Resources; + +namespace Azure.Core.Perf.RequestContents.ModelJsonContent +{ + public class LargeModel : ModelJsonContentBenchmark + { + protected override string JsonFileName => "ResourceProviderData.json"; + } +} diff --git a/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/ModelJsonContentBenchmark.cs b/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/ModelJsonContentBenchmark.cs new file mode 100644 index 000000000000..c44d7fb23a22 --- /dev/null +++ b/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/ModelJsonContentBenchmark.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Serialization; + +namespace Azure.Core.Perf.RequestContents.ModelJsonContent +{ + public abstract class ModelJsonContentBenchmark : RequestContentBenchmark> where T : class, IModelJsonSerializable + { + protected override RequestContent CreateRequestContent() + { + return RequestContent.Create(_model); + } + } +} diff --git a/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/SmallModel.cs b/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/SmallModel.cs new file mode 100644 index 000000000000..50c640a6c102 --- /dev/null +++ b/sdk/core/Azure.Core/perf/RequestContents/ModelJsonContent/SmallModel.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Tests.ResourceManager.Compute; + +namespace Azure.Core.Perf.RequestContents.ModelJsonContent +{ + public class SmallModel : ModelJsonContentBenchmark + { + protected override string JsonFileName => "AvailabilitySetData.json"; + } +} diff --git a/sdk/core/Azure.Core/perf/RequestContents/RequestContentBenchmark.cs b/sdk/core/Azure.Core/perf/RequestContents/RequestContentBenchmark.cs new file mode 100644 index 000000000000..38f2b2f43a00 --- /dev/null +++ b/sdk/core/Azure.Core/perf/RequestContents/RequestContentBenchmark.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Reflection; +using Azure.Core.Serialization; +using BenchmarkDotNet.Attributes; + +namespace Azure.Core.Perf.RequestContents +{ + public abstract class RequestContentBenchmark where T : class + { + protected abstract string JsonFileName { get; } + protected abstract RequestContent CreateRequestContent(); + + protected T _model; + private RequestContent _serializedContent; + private MemoryStream _stream; + + [GlobalSetup] + public void GlobalSetup() + { + string json = File.ReadAllText(Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, "TestData", JsonFileName)); + Type modelType = typeof(T).GetGenericArguments()[0]; + _model = ModelSerializer.Deserialize(BinaryData.FromString(json), modelType) as T; + _serializedContent = CreateRequestContent(); + _serializedContent.TryComputeLength(out long length); + _stream = new MemoryStream((int)length); + } + + [GlobalCleanup] + public void GlobalCleanup() + { + _serializedContent.Dispose(); + _serializedContent = null; + } + + [Benchmark] + public void Construct() + { + using RequestContent content = CreateRequestContent(); + } + + [Benchmark] + public long TryComputeLength() + { + using RequestContent content = CreateRequestContent(); + content.TryComputeLength(out long length); + return length; + } + + [Benchmark] + public void WriteTo() + { + _serializedContent.WriteTo(_stream, default); + _stream.Position = 0; + } + } +} diff --git a/sdk/core/Azure.Core/perf/Serializations/AvailabilitySetDataModel.cs b/sdk/core/Azure.Core/perf/Serializations/AvailabilitySetDataModel.cs new file mode 100644 index 000000000000..5bb785e4dcd7 --- /dev/null +++ b/sdk/core/Azure.Core/perf/Serializations/AvailabilitySetDataModel.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core.Tests.ResourceManager.Compute; + +namespace Azure.Core.Perf.Serializations +{ + public class AvailabilitySetDataModel : JsonBenchmark + { + protected override AvailabilitySetData Deserialize(JsonElement jsonElement) + { + return AvailabilitySetData.DeserializeAvailabilitySetData(jsonElement, _options); + } + + protected override void Serialize(Utf8JsonWriter writer) + { + _model.Serialize(writer); + } + + protected override RequestContent CastToRequestContent() + { + return _model; + } + + protected override AvailabilitySetData CastFromResponse() + { + return (AvailabilitySetData)_response; + } + + protected override string JsonFileName => "AvailabilitySetData.json"; + } +} diff --git a/sdk/core/Azure.Core/perf/Serializations/BenchmarkConfig.cs b/sdk/core/Azure.Core/perf/Serializations/BenchmarkConfig.cs new file mode 100644 index 000000000000..4468174c3df3 --- /dev/null +++ b/sdk/core/Azure.Core/perf/Serializations/BenchmarkConfig.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Reports; +using Perfolizer.Horology; + +namespace Azure.Core.Perf.Serializations +{ + internal class BenchmarkConfig : ManualConfig + { + public BenchmarkConfig() + { + SummaryStyle = SummaryStyle.Default + .WithTimeUnit(TimeUnit.Microsecond) + .WithSizeUnit(SizeUnit.KB); + } + } +} diff --git a/sdk/core/Azure.Core/perf/Serializations/JsonBenchmark.cs b/sdk/core/Azure.Core/perf/Serializations/JsonBenchmark.cs new file mode 100644 index 000000000000..3bf0044b1ae2 --- /dev/null +++ b/sdk/core/Azure.Core/perf/Serializations/JsonBenchmark.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Reflection; +using System.Text; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.TestFramework; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; + +namespace Azure.Core.Perf.Serializations +{ + [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] + public abstract class JsonBenchmark where T : class, IModelJsonSerializable + { + private string _json; + protected T _model; + protected Response _response; + protected ModelSerializerOptions _options; + private BinaryData _data; + private JsonDocument _jsonDocument; + + protected abstract T Deserialize(JsonElement jsonElement); + + protected abstract void Serialize(Utf8JsonWriter writer); + + protected abstract RequestContent CastToRequestContent(); + + protected abstract T CastFromResponse(); + + protected abstract string JsonFileName { get; } + + [GlobalSetup] + public void SetUp() + { + _json = File.ReadAllText(Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, "TestData", JsonFileName)); + _data = BinaryData.FromString(_json); + _model = ModelSerializer.Deserialize(_data); + _response = new MockResponse(200); + _response.ContentStream = new MemoryStream(Encoding.UTF8.GetBytes(_json)); + _options = ModelSerializerOptions.DefaultWireOptions; + _jsonDocument = JsonDocument.Parse(_json); + } + + [Benchmark] + [BenchmarkCategory("Internal")] + public void Serialize_Internal() + { + using var stream = new MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + Serialize(writer); + writer.Flush(); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public void Serialize_ImplicitCast() + { + using var x = CastToRequestContent(); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public bool Serialize_ImplicitCastWithSerialize() + { + using var x = CastToRequestContent(); + return x.TryComputeLength(out var length); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public void Serialize_ImplicitCastWithUsage() + { + using var x = CastToRequestContent(); + x.TryComputeLength(out var length); + using var stream = new MemoryStream((int)length); + x.WriteTo(stream, default); + } + + [Benchmark] + [BenchmarkCategory("ModelJsonConverter")] + public string Serialize_ModelJsonConverter() + { + JsonSerializerOptions options = new JsonSerializerOptions(); + options.Converters.Add(new ModelJsonConverter(ModelSerializerFormat.Wire)); + return JsonSerializer.Serialize(_model, options); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public BinaryData Serialize_ModelSerializer() + { + return ModelSerializer.Serialize(_model, _options); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public BinaryData Serialize_ModelWriter() + { + using var writer = new ModelWriter(_model, _options); + return writer.ToBinaryData(); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public BinaryData Serialize_ModelSerializerNonGeneric() + { + return ModelSerializer.Serialize((object)_model, _options); + } + + [Benchmark] + [BenchmarkCategory("PublicInterface")] + public void Serialize_PublicInterface() + { + using var stream = new MemoryStream(_data.ToMemory().Length); + using var writer = new Utf8JsonWriter(stream); + _model.Serialize(writer, _options); + writer.Flush(); + } + + [Benchmark] + [BenchmarkCategory("Internal")] + public T Deserialize_Internal() + { + return Deserialize(_jsonDocument.RootElement); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public T Deserialize_ExplicitCast() + { + T result = CastFromResponse(); + _response.ContentStream.Position = 0; //reset for reuse + return result; + } + + [Benchmark] + [BenchmarkCategory("ModelJsonConverter")] + public T Deserialize_ModelJsonConverter() + { + JsonSerializerOptions options = new JsonSerializerOptions(); + options.Converters.Add(new ModelJsonConverter(ModelSerializerFormat.Wire)); + return JsonSerializer.Deserialize(_json, options); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public T Deserialize_ModelSerializerFromBinaryData() + { + return ModelSerializer.Deserialize(_data, _options); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public object Deserialize_ModelSerializerFromBinaryDataNonGeneric() + { + return ModelSerializer.Deserialize(_data, typeof(T), _options); + } + + [Benchmark] + [BenchmarkCategory("PublicInterface")] + public T Deserialize_PublicInterfaceFromBinaryData() + { + return _model.Deserialize(_data, _options); + } + + [Benchmark] + [BenchmarkCategory("PublicInterface")] + public T Deserialize_Utf8JsonReaderFromBinaryData() + { + Utf8JsonReader reader = new Utf8JsonReader(_data); + return _model.Deserialize(ref reader, _options); + } + + [Benchmark] + [BenchmarkCategory("JsonDocument")] + public void JsonDocumentFromReader() + { + Utf8JsonReader reader = new Utf8JsonReader(_data); + using var doc = JsonDocument.ParseValue(ref reader); + } + + [Benchmark] + [BenchmarkCategory("JsonDocument")] + public void JsonDocumentFromBinaryData() + { + using var doc = JsonDocument.Parse(_data); + } + } +} diff --git a/sdk/core/Azure.Core/perf/Serializations/ModelXmlModel.cs b/sdk/core/Azure.Core/perf/Serializations/ModelXmlModel.cs new file mode 100644 index 000000000000..c6beb83843b6 --- /dev/null +++ b/sdk/core/Azure.Core/perf/Serializations/ModelXmlModel.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Xml; +using System.Xml.Linq; +using Azure.Core.Tests.ModelSerializationTests.Models; + +namespace Azure.Core.Perf.Serializations +{ + public class ModelXmlModel : XmlBenchmark + { + protected override string XmlFileName => "ModelXml.xml"; + + protected override ModelXml CastFromResponse() + { + return (ModelXml)_response; + } + + protected override RequestContent CastToRequestContent() + { + return _model; + } + + protected override ModelXml Deserialize(XElement xmlElement) + { + return ModelXml.DeserializeModelXml(xmlElement, _options); + } + + protected override void Serialize(XmlWriter writer) + { + _model.Serialize(writer, null); + } + } +} diff --git a/sdk/core/Azure.Core/perf/Serializations/ResourceProviderDataModel.cs b/sdk/core/Azure.Core/perf/Serializations/ResourceProviderDataModel.cs new file mode 100644 index 000000000000..43ba6583edee --- /dev/null +++ b/sdk/core/Azure.Core/perf/Serializations/ResourceProviderDataModel.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core.Tests.ResourceManager.Resources; +using BenchmarkDotNet.Attributes; + +namespace Azure.Core.Perf.Serializations +{ + [Config(typeof(BenchmarkConfig))] + public class ResourceProviderDataModel : JsonBenchmark + { + protected override string JsonFileName => "ResourceProviderData.json"; + + protected override ResourceProviderData CastFromResponse() + { + return (ResourceProviderData)_response; + } + + protected override RequestContent CastToRequestContent() + { + return _model; + } + + protected override ResourceProviderData Deserialize(JsonElement jsonElement) + { + return ResourceProviderData.DeserializeResourceProviderData(jsonElement, _options); + } + + protected override void Serialize(Utf8JsonWriter writer) + { + _model.Serialize(writer); + } + } +} diff --git a/sdk/core/Azure.Core/perf/Serializations/XmlBenchmark.cs b/sdk/core/Azure.Core/perf/Serializations/XmlBenchmark.cs new file mode 100644 index 000000000000..5b0803983119 --- /dev/null +++ b/sdk/core/Azure.Core/perf/Serializations/XmlBenchmark.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Reflection; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using Azure.Core.Serialization; +using Azure.Core.TestFramework; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; + +namespace Azure.Core.Perf.Serializations +{ + [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] + public abstract class XmlBenchmark where T : class, IModelSerializable + { + private string _xml; + protected T _model; + protected Response _response; + protected ModelSerializerOptions _options; + private BinaryData _data; + private XElement _element; + + protected abstract T Deserialize(XElement xmlElement); + + protected abstract void Serialize(XmlWriter writer); + + protected abstract RequestContent CastToRequestContent(); + + protected abstract T CastFromResponse(); + + protected abstract string XmlFileName { get; } + + [GlobalSetup] + public void SetUp() + { + _xml = File.ReadAllText(Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, "TestData", XmlFileName)); + _data = BinaryData.FromString(_xml); + _model = ModelSerializer.Deserialize(_data); + _response = new MockResponse(200); + _response.ContentStream = new MemoryStream(Encoding.UTF8.GetBytes(_xml)); + _options = ModelSerializerOptions.DefaultWireOptions; + _element = XElement.Parse(_xml); + } + + [Benchmark] + [BenchmarkCategory("Internal")] + public void Serialize_Internal() + { + using var stream = new MemoryStream(); + using var writer = XmlWriter.Create(stream); + Serialize(writer); + writer.Flush(); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public void Serialize_ImplicitCast() + { + using var x = CastToRequestContent(); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public bool Serialize_ImplicitCastWithSerialize() + { + using var x = CastToRequestContent(); + return x.TryComputeLength(out var length); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public void Serialize_ImplicitCastWithUsage() + { + using var x = CastToRequestContent(); + x.TryComputeLength(out var length); + using var stream = new MemoryStream((int)length); + x.WriteTo(stream, default); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public BinaryData Serialize_ModelSerializer() + { + return ModelSerializer.Serialize(_model, _options); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public BinaryData Serialize_ModelSerializerNonGeneric() + { + return ModelSerializer.Serialize((object)_model, _options); + } + + [Benchmark] + [BenchmarkCategory("Internal")] + public T Deserialize_Internal() + { + return Deserialize(_element); + } + + [Benchmark] + [BenchmarkCategory("Cast")] + public T Deserialize_ExplicitCast() + { + T result = CastFromResponse(); + _response.ContentStream.Position = 0; //reset for reuse + return result; + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public T Deserialize_ModelSerializerFromBinaryData() + { + return ModelSerializer.Deserialize(_data, _options); + } + + [Benchmark] + [BenchmarkCategory("ModelSerializer")] + public object Deserialize_ModelSerializerFromBinaryDataNonGeneric() + { + return ModelSerializer.Deserialize(_data, typeof(T), _options); + } + + [Benchmark] + [BenchmarkCategory("PublicInterface")] + public T Deserialize_PublicInterfaceFromBinaryData() + { + return _model.Deserialize(_data, _options); + } + } +} diff --git a/sdk/core/Azure.Core/src/RequestContent.cs b/sdk/core/Azure.Core/src/RequestContent.cs index fe19517dd70c..f9b4d60cd233 100644 --- a/sdk/core/Azure.Core/src/RequestContent.cs +++ b/sdk/core/Azure.Core/src/RequestContent.cs @@ -86,6 +86,22 @@ public abstract class RequestContent : IDisposable /// An instance of that wraps a serialized version of the object. public static RequestContent Create(object serializable) => Create(serializable, JsonObjectSerializer.Default); + /// + /// Creates an instance of that wraps a serialized version of an object. + /// + /// The to serialize. + /// The to use. + /// An instance of that wraps a serialized version of the object. + public static RequestContent Create(IModelSerializable model, ModelSerializerOptions? options = default) => new ModelSerializableContent(model, options ?? ModelSerializerOptions.DefaultWireOptions); + + /// + /// Creates an instance of that wraps a serialized version of an object. + /// + /// The to serialize. + /// The to use. + /// An instance of that wraps a serialized version of the object. + public static RequestContent Create(IModelJsonSerializable model, ModelSerializerOptions? options = default) => new ModelJsonSerializableContent(model, options ?? ModelSerializerOptions.DefaultWireOptions); + /// /// Creates an instance of that wraps a serialized version of an object. /// @@ -220,6 +236,63 @@ public override void Dispose() } } + private sealed class ModelJsonSerializableContent : RequestContent + { + private readonly IModelJsonSerializable _model; + private readonly ModelSerializerOptions _options; + + public ModelJsonSerializableContent(IModelJsonSerializable model, ModelSerializerOptions options) + { + _model = model; + _options = options; + } + + private ModelWriter? _writer; + private ModelWriter Writer => _writer ??= new ModelWriter(_model, _options); + + public override void Dispose() => _writer?.Dispose(); + + public override void WriteTo(Stream stream, CancellationToken cancellation) => Writer.CopyTo(stream, cancellation); + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellation) => await Writer.CopyToAsync(stream, cancellation).ConfigureAwait(false); + + public override bool TryComputeLength(out long length) => Writer.TryComputeLength(out length); + } + + private sealed class ModelSerializableContent : RequestContent + { + private readonly IModelSerializable _model; + private readonly ModelSerializerOptions _options; + + public ModelSerializableContent(IModelSerializable model, ModelSerializerOptions options) + { + _model = model; + _options = options; + } + + public override void Dispose() { } + + private BinaryData? _data; + private BinaryData Data => _data ??= _model.Serialize(_options); + +#if NETFRAMEWORK || NETSTANDARD2_0 + private byte[]? _bytes; + private byte[] Bytes => _bytes ??= Data.ToArray(); + + public override void WriteTo(Stream stream, CancellationToken cancellation) => stream.Write(Bytes, 0, Bytes.Length); +#else + public override void WriteTo(Stream stream, CancellationToken cancellation) => stream.Write(Data.ToMemory().Span); +#endif + + public override bool TryComputeLength(out long length) + { + length = Data.ToMemory().Length; + return true; + } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellation) => await stream.WriteAsync(Data.ToMemory(), cancellation).ConfigureAwait(false); + } + private sealed class ArrayContent : RequestContent { private readonly byte[] _bytes; diff --git a/sdk/core/Azure.Core/src/Serialization/DeserializationProxyAttribute.cs b/sdk/core/Azure.Core/src/Serialization/DeserializationProxyAttribute.cs new file mode 100644 index 000000000000..db9d3d75d879 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/DeserializationProxyAttribute.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics.CodeAnalysis; + +namespace Azure.Core.Serialization +{ + /// + /// Attribute class that indicates a proxy to use for deserialization. + /// The proxy must implement and have a public or non-public parameterless constructor. + /// + [AttributeUsage(AttributeTargets.Class)] + public sealed class DeserializationProxyAttribute : Attribute + { + /// + /// Instantiates a new instance of the class. + /// + /// + /// The to create and call deserialize on. + /// The must have a public or non-public parameterless constructor. + /// The must implement where T is the type of the abstract class. + /// + public DeserializationProxyAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type proxyType) + { + ProxyType = proxyType; + } + + /// + /// Gets the to create and call deserialize on. + /// The must have a public or non-public parameterless constructor. + /// The must implement where T is the type of the abstract class. + /// + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] + public Type ProxyType { get; } + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/IModelJsonSerializable.cs b/sdk/core/Azure.Core/src/Serialization/IModelJsonSerializable.cs new file mode 100644 index 000000000000..6659988e6bd3 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/IModelJsonSerializable.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; + +namespace Azure.Core.Serialization +{ + /// + /// Allows an object to control its own JSON serialization and deserialization. + /// + /// The type to deserialize the JSON value into. + public interface IModelJsonSerializable : IModelSerializable + { + /// + /// Serializes the model to the provided . + /// + /// The to serialize into. + /// The to use. + /// If the model does not support the requested . + /// If format is passed in and the model does not use JSON for its wire format. +#pragma warning disable AZC0014 // Avoid using banned types in public API + void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options); +#pragma warning restore AZC0014 // Avoid using banned types in public API + + /// + /// Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model. + /// + /// The to read. + /// The to use. + /// A representation of the JSON value. + /// If the model does not support the requested . + /// If format is passed in and the model does not use JSON for its wire format. +#pragma warning disable AZC0014 // Avoid using banned types in public API + T Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options); +#pragma warning restore AZC0014 // Avoid using banned types in public API + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/IModelSerializable.cs b/sdk/core/Azure.Core/src/Serialization/IModelSerializable.cs new file mode 100644 index 000000000000..91657484a2e0 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/IModelSerializable.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Core.Serialization +{ + /// + /// Allows an object to control its own serialization and deserialization. + /// The format of the serialization is determined by the implementer. + /// + /// The type the serialized value can be deserialized to. + public interface IModelSerializable + { + /// + /// Serializes the model into a . + /// + /// The to use. + /// A binary representation of the serialized model. + /// If the model does not support the requested . + BinaryData Serialize(ModelSerializerOptions options); + + /// + /// Converts the provided into a model. + /// + /// The to parse. + /// The to use. + /// A representation of the data. + /// If the model does not support the requested . + T Deserialize(BinaryData data, ModelSerializerOptions options); + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/ModelJsonConverter.cs b/sdk/core/Azure.Core/src/Serialization/ModelJsonConverter.cs new file mode 100644 index 000000000000..ab4d29f84162 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/ModelJsonConverter.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Azure.Core.Serialization +{ + /// + /// A generic converter which allows to be able to serialize and deserialize any models that implement . + /// +#pragma warning disable AZC0014 // Avoid using banned types in public API +#if !NET5_0 // RequiresUnreferencedCode in net5.0 doesn't have AttributeTargets.Class as a target, but it was added in net6.0 + [RequiresUnreferencedCode("The constructors of the type being deserialized are dynamically accessed and may be trimmed.")] +#endif + public class ModelJsonConverter : JsonConverter> +#pragma warning restore AZC0014 // Avoid using banned types in public API + { + /// + /// Gets the used to serialize and deserialize models. + /// + public ModelSerializerOptions ModelSerializerOptions { get; } + + /// + /// Initializes a new instance of with a default format of . + /// + public ModelJsonConverter() + : this(ModelSerializerFormat.Json) { } + + /// + /// Initializes a new instance of . + /// + /// The format to serialize to and deserialize from. + public ModelJsonConverter(ModelSerializerFormat format) + : this(ModelSerializerOptions.GetOptions(format)) { } + + /// + /// Initializes a new instance of . + /// + /// The to use. + public ModelJsonConverter(ModelSerializerOptions options) + { + ModelSerializerOptions = options; + } + + /// + public override bool CanConvert(Type typeToConvert) + { + return !Attribute.IsDefined(typeToConvert, typeof(JsonConverterAttribute)); + } + + /// +#pragma warning disable AZC0014 // Avoid using banned types in public API + public override IModelJsonSerializable Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) +#pragma warning restore AZC0014 // Avoid using banned types in public API + { + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return (IModelJsonSerializable)ModelSerializer.Deserialize(BinaryData.FromString(document.RootElement.GetRawText()), typeToConvert, ModelSerializerOptions)!; + } + + /// +#pragma warning disable AZC0014 // Avoid using banned types in public API + public override void Write(Utf8JsonWriter writer, IModelJsonSerializable value, JsonSerializerOptions options) +#pragma warning restore AZC0014 // Avoid using banned types in public API + { + value.Serialize(writer, ModelSerializerOptions); + } + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/ModelSerializer.cs b/sdk/core/Azure.Core/src/Serialization/ModelSerializer.cs new file mode 100644 index 000000000000..4ecec3855930 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/ModelSerializer.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics.CodeAnalysis; + +namespace Azure.Core.Serialization +{ + /// + /// Provides functionality to serialize and deserialize Azure models. + /// + public static class ModelSerializer + { + /// + /// Converts the value of a model into a . + /// + /// The type of the value to serialize. + /// The model to convert. + /// The to use. + /// A representation of the model in the specified by the . + /// If the model does not support the requested . + /// If is null. + public static BinaryData Serialize(T model, ModelSerializerOptions? options = default) where T : IModelSerializable + { + Argument.AssertNotNull(model, nameof(model)); + + options ??= ModelSerializerOptions.DefaultWireOptions; + + return model.Serialize(options); + } + + /// + /// Converts the value of a model into a . + /// + /// The type of the value to serialize. + /// The model to convert. + /// The to use. + /// A representation of the model in the specified by the . + /// If the model does not support the requested . + /// If is null. + public static BinaryData Serialize(T model, ModelSerializerFormat format) + where T : IModelSerializable + => Serialize(model, ModelSerializerOptions.GetOptions(format)); + + /// + /// Converts the value of a model into a . + /// + /// The model to convert. + /// The to use. + /// A representation of the model in the specified by the . + /// Throws if does not implement . + /// If the model does not support the requested . + /// If is null. + public static BinaryData Serialize(object model, ModelSerializerOptions? options = default) + { + Argument.AssertNotNull(model, nameof(model)); + + options ??= ModelSerializerOptions.DefaultWireOptions; + + var iModel = model as IModelSerializable; + if (iModel is null) + { + throw new InvalidOperationException($"{model.GetType().Name} does not implement {nameof(IModelSerializable)}"); + } + + return iModel.Serialize(options); + } + + /// + /// Converts the value of a model into a . + /// + /// The model to convert. + /// The to use. + /// A representation of the model in the specified by the . + /// Throws if does not implement . + /// If the model does not support the requested . + /// If is null. + public static BinaryData Serialize(object model, ModelSerializerFormat format) + => Serialize(model, ModelSerializerOptions.GetOptions(format)); + + /// + /// Converts the into a . + /// + /// The to convert. + /// The to use. + /// A representation of the . + /// Throws if does not have a public or internal parameterless constructor. + /// If the model does not support the requested . + /// If is null. + public static T? Deserialize<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(BinaryData data, ModelSerializerOptions? options = default) where T : IModelSerializable + { + Argument.AssertNotNull(data, nameof(data)); + + options ??= ModelSerializerOptions.DefaultWireOptions; + + return GetInstance().Deserialize(data, options); + } + + /// + /// Converts the into a . + /// + /// The to convert. + /// The to use. + /// A representation of the . + /// Throws if does not have a public or internal parameterless constructor. + /// If the model does not support the requested . + /// If is null. + public static T? Deserialize<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(BinaryData data, ModelSerializerFormat format) + where T : IModelSerializable + => Deserialize(data, ModelSerializerOptions.GetOptions(format)); + + /// + /// Converts the into a . + /// + /// The to convert. + /// The type of the objec to convert and return. + /// The to use. + /// A representation of the . + /// Throws if does not implement . + /// Throws if does not have a public or internal parameterless constructor. + /// If the model does not support the requested . + /// If or are null. + public static object? Deserialize(BinaryData data, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type returnType, ModelSerializerOptions? options = default) + { + Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(returnType, nameof(returnType)); + + options ??= ModelSerializerOptions.DefaultWireOptions; + + return GetInstance(returnType).Deserialize(data, options); + } + + /// + /// Converts the into a . + /// + /// The to convert. + /// The type of the objec to convert and return. + /// The to use. + /// A representation of the . + /// Throws if does not implement . + /// Throws if does not have a public or internal parameterless constructor. + /// If the model does not support the requested . + /// If or are null. + public static object? Deserialize(BinaryData data, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type returnType, ModelSerializerFormat format) + => Deserialize(data, returnType, ModelSerializerOptions.GetOptions(format)); + + /// + /// Converts the value of a model into a . + /// + /// The model to convert. + /// The to use. + /// A representation of the model in the specified by the . + /// If or are null. + public static BinaryData SerializeCore(IModelJsonSerializable model, ModelSerializerOptions options) + { + Argument.AssertNotNull(model, nameof(model)); + Argument.AssertNotNull(options, nameof(options)); + + using ModelWriter writer = new ModelWriter(model, options); + return writer.ToBinaryData(); + } + + private static IModelSerializable GetInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type returnType) + { + var model = GetObjectInstance(returnType) as IModelSerializable; + if (model is null) + { + throw new InvalidOperationException($"{returnType.Name} does not implement {nameof(IModelSerializable)}"); + } + return model; + } + + private static IModelSerializable GetInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>() where T : IModelSerializable + { + var model = GetObjectInstance(typeof(T)) as IModelSerializable; + if (model is null) + { + throw new InvalidOperationException($"{typeof(T).Name} does not implement {nameof(IModelSerializable)}"); + } + return model; + } + + private static object GetObjectInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type returnType) + { + DeserializationProxyAttribute? attribute = Attribute.GetCustomAttribute(returnType, typeof(DeserializationProxyAttribute), false) as DeserializationProxyAttribute; + Type typeToActivate = attribute is null ? returnType : attribute.ProxyType; + + if (returnType.IsAbstract && attribute is null) + { + throw new InvalidOperationException($"{returnType.Name} must be decorated with {nameof(DeserializationProxyAttribute)} to be used with {nameof(ModelSerializer)}"); + } + + var obj = Activator.CreateInstance(typeToActivate, true); + if (obj is null) + { + throw new InvalidOperationException($"Unable to create instance of {typeToActivate.Name}."); + } + return obj; + } + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/ModelSerializerFormat.cs b/sdk/core/Azure.Core/src/Serialization/ModelSerializerFormat.cs new file mode 100644 index 000000000000..7a4b8a7ce7f8 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/ModelSerializerFormat.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ComponentModel; + +namespace Azure.Core.Serialization +{ + /// + /// A format used to specify how a model should be serialized and deserialized. + /// + public readonly partial struct ModelSerializerFormat : IEquatable + { + internal const string JsonValue = "J"; + internal const string WireValue = "W"; + + /// + /// Default format which will serialize all properties including read-only and additional properties. + /// The format will always be JSON. + /// + public static readonly ModelSerializerFormat Json = new ModelSerializerFormat(JsonValue); + + /// + /// Format used to serialize this model when sending as a request to an Azure service. + /// It may not serialize read-only properties or additional properties. + /// The content-type will vary between JSON, XML, etc., depending on the service. + /// + /// Most use cases should prefer a more complete format like that includes + /// read-only and additional properties. + /// + public static readonly ModelSerializerFormat Wire = new ModelSerializerFormat(WireValue); + + private readonly string _value; + + /// + /// Instantiate a new . + /// + public ModelSerializerFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + /// + /// Determines if two values are the same. + /// + /// The first to compare. + /// The second to compare. + /// True if and are the same; otherwise, false. + public static bool operator ==(ModelSerializerFormat left, ModelSerializerFormat right) => left.Equals(right); + + /// + /// Determines if two values are different. + /// + /// The first to compare. + /// The second to compare. + /// True if and are different; otherwise, false. + public static bool operator !=(ModelSerializerFormat left, ModelSerializerFormat right) => !left.Equals(right); + + /// + /// Converts a string to a . + /// + /// The string value to convert. + public static implicit operator ModelSerializerFormat(string value) => new ModelSerializerFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals([System.Diagnostics.CodeAnalysis.AllowNull] object obj) => obj is ModelSerializerFormat other && Equals(other); + + /// + public bool Equals(ModelSerializerFormat other) => string.Equals(_value, other._value, StringComparison.Ordinal); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + + /// + public override string ToString() => _value; + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/ModelSerializerOptions.cs b/sdk/core/Azure.Core/src/Serialization/ModelSerializerOptions.cs new file mode 100644 index 000000000000..610f5f34c22d --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/ModelSerializerOptions.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; + +namespace Azure.Core.Serialization +{ + /// + /// Provides the client options for serializing models. + /// + public class ModelSerializerOptions + { + private static readonly IReadOnlyDictionary _singletonMap = new Dictionary() + { + { ModelSerializerFormat.Json, new ModelSerializerOptions(ModelSerializerFormat.Json, true) }, + { ModelSerializerFormat.Wire, new ModelSerializerOptions(ModelSerializerFormat.Wire, true) } + }; + + /// + /// Default options for serializing models into the format the Azure serivce is expecting. + /// + public static readonly ModelSerializerOptions DefaultWireOptions = _singletonMap[ModelSerializerFormat.Wire]; + + internal static ModelSerializerOptions GetOptions(ModelSerializerFormat format) + => _singletonMap.TryGetValue(format, out ModelSerializerOptions? options) ? options! : new ModelSerializerOptions(format); + + private bool _isFrozen; + private Func? _genericTypeSerializerCreator; + + /// + /// Initializes a new instance of the class. Defaults to format . + /// + public ModelSerializerOptions() : this(ModelSerializerFormat.Json, false) { } + + /// + /// Initializes a new instance of the class. + /// + /// String that determines of serialized model.. + public ModelSerializerOptions(ModelSerializerFormat format) : this(format, false) { } + + private ModelSerializerOptions(ModelSerializerFormat format, bool isFrozen) + { + Format = format; + _isFrozen = isFrozen; + } + + /// + /// Gets the that determines format of serialized model. + /// + public ModelSerializerFormat Format { get; } + + /// + /// Gets or sets a factory method that returns an based on the provided . + /// Should return null if the type is not supported. + /// + public Func? ObjectSerializerResolver + { + get + { + return _genericTypeSerializerCreator; + } + set + { + if (_isFrozen) + { + throw new InvalidOperationException("Cannot modify static options reference."); + } + + _genericTypeSerializerCreator = value; + } + } + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/ModelWriter.SequenceBuilder.cs b/sdk/core/Azure.Core/src/Serialization/ModelWriter.SequenceBuilder.cs new file mode 100644 index 000000000000..ec311ccd0d45 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/ModelWriter.SequenceBuilder.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Buffers; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Azure.Core.Serialization +{ + internal sealed partial class ModelWriter : IDisposable + { + private sealed class SequenceBuilder : IBufferWriter, IDisposable + { + private struct Buffer + { + public byte[] Array; + public int Written; + } + + private volatile Buffer[] _buffers; // this is an array so items can be accessed by ref + private volatile int _count; + private readonly int _segmentSize; + + /// + /// Initializes a new instance of . + /// + /// The size of each buffer segment. + public SequenceBuilder(int segmentSize = 16384) + { + // we perf tested a very large and a small model and found that the performance + // for 4k, 8k, 16k, 32k, was neglible for the small model but had a 30% alloc improvment + // from 4k to 16k on the very large model. + _segmentSize = segmentSize; + _buffers = Array.Empty(); + } + + /// + /// Notifies the that bytes bytes were written to the output or . + /// You must request a new buffer after calling to continue writing more data; you cannot write to a previously acquired buffer. + /// + /// The number of bytes written to the or . + /// + public void Advance(int bytesWritten) + { + ref Buffer last = ref _buffers[_count - 1]; + last.Written += bytesWritten; + if (last.Written > last.Array.Length) + { + throw new ArgumentOutOfRangeException(nameof(bytesWritten)); + } + } + + /// + /// Returns a to write to that is at least the requested size, as specified by the parameter. + /// + /// The minimum length of the returned . If less than 256, a buffer of size 256 will be returned. + /// A memory buffer of at least bytes. If is less than 256, a buffer of size 256 will be returned. + public Memory GetMemory(int sizeHint = 0) + { + if (sizeHint < 256) + { + sizeHint = 256; + } + + int sizeToRent = sizeHint > _segmentSize ? sizeHint : _segmentSize; + + if (_buffers.Length == 0) + { + ExpandBuffers(sizeToRent); + } + + ref Buffer last = ref _buffers[_count - 1]; + Memory free = last.Array.AsMemory(last.Written); + if (free.Length >= sizeHint) + { + return free; + } + + // else allocate a new buffer: + ExpandBuffers(sizeToRent); + + return _buffers[_count - 1].Array; + } + + private readonly object _lock = new object(); + private void ExpandBuffers(int sizeToRent) + { + lock (_lock) + { + int bufferCount = _count == 0 ? 1 : _count * 2; + + Buffer[] resized = new Buffer[bufferCount]; + if (_count > 0) + { + _buffers.CopyTo(resized, 0); + } + _buffers = resized; + _buffers[_count].Array = ArrayPool.Shared.Rent(sizeToRent); + _count = bufferCount == 1 ? bufferCount : _count + 1; + } + } + + /// + /// Returns a to write to that is at least the requested size, as specified by the parameter. + /// + /// The minimum length of the returned . If less than 256, a buffer of size 256 will be returned. + /// A buffer of at least bytes. If is less than 256, a buffer of size 256 will be returned. + public Span GetSpan(int sizeHint = 0) + { + Memory memory = GetMemory(sizeHint); + return memory.Span; + } + + /// + /// Disposes the SequenceWriter and returns the underlying buffers to the pool. + /// + public void Dispose() + { + int bufferCountToFree; + Buffer[] buffersToFree; + lock (_lock) + { + bufferCountToFree = _count; + buffersToFree = _buffers; + _count = 0; + _buffers = Array.Empty(); + } + + for (int i = 0; i < bufferCountToFree; i++) + { + ArrayPool.Shared.Return(buffersToFree[i].Array); + } + } + + /// + public bool TryComputeLength(out long length) + { + length = 0; + for (int i = 0; i < _count; i++) + { + length += _buffers[i].Written; + } + return true; + } + + /// + public void CopyTo(Stream stream, CancellationToken cancellation) + { + for (int i = 0; i < _count; i++) + { + Buffer buffer = _buffers[i]; + stream.Write(buffer.Array, 0, buffer.Written); + } + } + + /// + public async Task CopyToAsync(Stream stream, CancellationToken cancellation) + { + for (int i = 0; i < _count; i++) + { + Buffer buffer = _buffers[i]; + await stream.WriteAsync(buffer.Array, 0, buffer.Written).ConfigureAwait(false); + } + } + } + } +} diff --git a/sdk/core/Azure.Core/src/Serialization/ModelWriter.cs b/sdk/core/Azure.Core/src/Serialization/ModelWriter.cs new file mode 100644 index 000000000000..0b5cae45eb75 --- /dev/null +++ b/sdk/core/Azure.Core/src/Serialization/ModelWriter.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics; +using System.IO; +using System.Runtime.CompilerServices; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace Azure.Core.Serialization +{ + /// + /// Provides an efficient way to serialize into a using multiple pooled buffers. + /// + internal sealed partial class ModelWriter : IDisposable + { + private readonly IModelJsonSerializable _model; + private readonly ModelSerializerOptions _options; + + private readonly object _writeLock = new object(); + private readonly object _readLock = new object(); + + private volatile SequenceBuilder? _sequenceBuilder; + private volatile bool _isDisposed; + + private volatile int _readCount; + + private ManualResetEvent? _readersFinished; + private ManualResetEvent ReadersFinished => _readersFinished ??= new ManualResetEvent(true); + + /// + /// Initializes a new instance of . + /// + /// The model to serialize. + /// The to use. + /// If the model does not support the requested . + /// If format is passed in and the model does not use JSON for its wire format. + public ModelWriter(IModelJsonSerializable model, ModelSerializerOptions options) + { + _model = model; + _options = options; + } + + private SequenceBuilder GetSequenceBuilder() + { + if (_sequenceBuilder is null) + { + lock (_writeLock) + { + if (_isDisposed) + { + throw new ObjectDisposedException(nameof(ModelWriter)); + } + + if (_sequenceBuilder is null) + { + SequenceBuilder sequenceBuilder = new SequenceBuilder(); + using var jsonWriter = new Utf8JsonWriter(sequenceBuilder); + _model.Serialize(jsonWriter, _options); + jsonWriter.Flush(); + _sequenceBuilder = sequenceBuilder; + } + } + } + return _sequenceBuilder; + } + + internal void CopyTo(Stream stream, CancellationToken cancellation) + { + SequenceBuilder builder = GetSequenceBuilder(); + IncrementRead(); + try + { + builder.CopyTo(stream, cancellation); + } + finally + { + DecrementRead(); + } + } + + internal bool TryComputeLength(out long length) + { + SequenceBuilder builder = GetSequenceBuilder(); + IncrementRead(); + try + { + return builder.TryComputeLength(out length); + } + finally + { + DecrementRead(); + } + } + + internal async Task CopyToAsync(Stream stream, CancellationToken cancellation) + { + SequenceBuilder builder = GetSequenceBuilder(); + IncrementRead(); + try + { + await builder.CopyToAsync(stream, cancellation).ConfigureAwait(false); + } + finally + { + DecrementRead(); + } + } + + /// + /// Converts the to a . + /// + /// A representation of the serialized in JSON format. + public BinaryData ToBinaryData() + { + SequenceBuilder builder = GetSequenceBuilder(); + IncrementRead(); + try + { + bool gotLength = builder.TryComputeLength(out long length); + if (length > int.MaxValue) + { + throw new InvalidOperationException($"Length of serialized model is too long. Value was {length} max is {int.MaxValue}"); + } + Debug.Assert(gotLength); + using var stream = new MemoryStream((int)length); + builder.CopyTo(stream, default); + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + finally + { + DecrementRead(); + } + } + + /// + public void Dispose() + { + if (!_isDisposed) + { + lock (_writeLock) + { + if (!_isDisposed) + { + _isDisposed = true; + + if (_readersFinished is null || _readersFinished.WaitOne()) + { + //only dispose if no readers ever happened or if all readers are done + _sequenceBuilder?.Dispose(); + } + + _sequenceBuilder = null; + _readersFinished?.Dispose(); + _readersFinished = null; + } + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void IncrementRead() + { + if (_isDisposed) + { + throw new ObjectDisposedException(nameof(ModelWriter)); + } + + lock (_readLock) + { + Interlocked.Increment(ref _readCount); + ReadersFinished.Reset(); + } + + if (_isDisposed) + { + DecrementRead(); + throw new ObjectDisposedException(nameof(ModelWriter)); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void DecrementRead() + { + lock (_readLock) + { + if (Interlocked.Decrement(ref _readCount) == 0) + { + // notify we reached zero readers in case dispose is waiting + ReadersFinished.Set(); + } + } + } + } +} diff --git a/sdk/core/Azure.Core/src/Shared/ModelSerializerHelper.cs b/sdk/core/Azure.Core/src/Shared/ModelSerializerHelper.cs new file mode 100644 index 000000000000..45481db3c91a --- /dev/null +++ b/sdk/core/Azure.Core/src/Shared/ModelSerializerHelper.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Runtime.CompilerServices; +using Azure.Core.Serialization; + +namespace Azure.Core +{ + internal static class ModelSerializerHelper + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ValidateFormat(IModelSerializable model, ModelSerializerFormat format) + { + bool implementsJson = model is IModelJsonSerializable; + bool isValid = (format == ModelSerializerFormat.Json && implementsJson) || format == ModelSerializerFormat.Wire; + if (!isValid) + { + throw new FormatException($"The model {model.GetType().Name} does not support '{format}' format."); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ValidateFormat(IModelSerializable model, ModelSerializerFormat format) => ValidateFormat(model, format); + } +} diff --git a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj index 6a2f79523607..cb65d08229e8 100644 --- a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj +++ b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj @@ -52,6 +52,7 @@ + diff --git a/sdk/core/Azure.Core/tests/ModelSerialization/ModelJsonConverterTests.cs b/sdk/core/Azure.Core/tests/ModelSerialization/ModelJsonConverterTests.cs new file mode 100644 index 000000000000..458fef6c32e2 --- /dev/null +++ b/sdk/core/Azure.Core/tests/ModelSerialization/ModelJsonConverterTests.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.ModelSerialization +{ + public class ModelJsonConverterTests + { + private readonly JsonSerializerOptions _options; + + public ModelJsonConverterTests() + { + _options = new JsonSerializerOptions(); + _options.Converters.Add(new ModelJsonConverter()); + } + + [TestCaseSource(typeof(SerializationTestSource), "NullBinaryData")] + public void ValidateNullBinaryData(BinaryData data) + { + Assert.IsNull(JsonSerializer.Deserialize(data, _options)); + Assert.IsNull(JsonSerializer.Deserialize(data, typeof(ModelX), _options)); + } + + [TestCaseSource(typeof(SerializationTestSource), "InvalidOperationBinaryData")] + public void ValidateInvalidOperationBinaryData(BinaryData data) => ValidateJsonExceptionBinaryData(data); + + [TestCaseSource(typeof(SerializationTestSource), "JsonExceptionBinaryData")] + public void ValidateJsonExceptionBinaryData(BinaryData data) + { + Assert.Throws(() => JsonSerializer.Deserialize(data, _options)); + Assert.Throws(() => JsonSerializer.Deserialize(data, typeof(ModelX), _options)); + } + + [TestCaseSource(typeof(SerializationTestSource), "EmptyObjectBinaryData")] + public void ValidateEmptyObjectBinaryData(BinaryData data) + { + ModelX x = JsonSerializer.Deserialize(data, _options); + Assert.IsNotNull(x); + Assert.IsNull(x.Kind); + + object obj = JsonSerializer.Deserialize(data, typeof(ModelX), _options); + Assert.IsNotNull(obj); + Assert.IsNull(((ModelX)obj).Kind); + } + } +} diff --git a/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializationContentTests.cs b/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializationContentTests.cs new file mode 100644 index 000000000000..458fbdc875b6 --- /dev/null +++ b/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializationContentTests.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.ModelSerialization +{ + public class ModelSerializationContentTests + { + private const string json = "{\"kind\":\"X\",\"name\":\"Name\",\"xProperty\":100}"; + private ModelX _modelX; + + [OneTimeSetUp] + public void OneTimeSetUp() + { + _modelX = ModelSerializer.Deserialize(BinaryData.FromString(json)); + } + + [Test] + public void CanCalculateLength() + { + //use IModelSerializable + var content = RequestContent.Create((IModelSerializable)_modelX); + Assert.AreEqual("ModelSerializableContent", content.GetType().Name); + content.TryComputeLength(out long lengthNonJson); + Assert.Greater(lengthNonJson, 0); + + //use IModelJsonSerializable + var jsonContent = RequestContent.Create((IModelJsonSerializable)_modelX); + Assert.AreEqual("ModelJsonSerializableContent", jsonContent.GetType().Name); + content.TryComputeLength(out long lengthJson); + Assert.Greater(lengthJson, 0); + + Assert.AreEqual(lengthNonJson, lengthJson); + + //use default + jsonContent = RequestContent.Create(_modelX); + Assert.AreEqual("ModelJsonSerializableContent", jsonContent.GetType().Name); + content.TryComputeLength(out lengthJson); + Assert.Greater(lengthJson, 0); + + Assert.AreEqual(lengthNonJson, lengthJson); + } + + [Test] + public void ValidatePrivateClassType() + { + IModelSerializable modelX = _modelX; + + RequestContent content = RequestContent.Create(modelX); + Assert.AreEqual("ModelSerializableContent", content.GetType().Name); + } + } +} diff --git a/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerOptionsTests.cs b/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerOptionsTests.cs new file mode 100644 index 000000000000..f6b287ba45f0 --- /dev/null +++ b/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerOptionsTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Reflection; +using Azure.Core.Serialization; +using NUnit.Framework; + +namespace Azure.Core.Tests.ModelSerialization +{ + internal class ModelSerializerOptionsTests + { + [Test] + public void ValidatePropertyIsFrozen() => ValidateFrozenInstance(ModelSerializerOptions.DefaultWireOptions); + + [Test] + public void AllInstancesInMapShouldBeFrozen() + { + Dictionary optionsDictionary = typeof(ModelSerializerOptions) + .GetField("_singletonMap", BindingFlags.NonPublic | BindingFlags.Static) + .GetValue(null) as Dictionary; + foreach (var frozen in optionsDictionary.Values) + { + ValidateFrozenInstance(frozen); + } + } + + public void ValidateFrozenInstance(ModelSerializerOptions frozen) + { + Assert.Throws(() => frozen.ObjectSerializerResolver = type => null); + } + + [Test] + public void NewInstanceShouldNotBeFrozen() + { + ModelSerializerOptions nonFrozen = new ModelSerializerOptions(); + Assert.DoesNotThrow(() => nonFrozen.ObjectSerializerResolver = type => null); + } + + [Test] + public void MapAndStaticPropertySameObject() + { + Assert.IsTrue(ReferenceEquals(ModelSerializerOptions.DefaultWireOptions, ModelSerializerOptions.GetOptions(ModelSerializerFormat.Wire))); + } + + [Test] + public void MapShouldReturnSingletons() + { + Assert.IsTrue(ReferenceEquals(ModelSerializerOptions.GetOptions(ModelSerializerFormat.Wire), ModelSerializerOptions.GetOptions(ModelSerializerFormat.Wire))); + Assert.IsTrue(ReferenceEquals(ModelSerializerOptions.GetOptions(ModelSerializerFormat.Json), ModelSerializerOptions.GetOptions(ModelSerializerFormat.Json))); + } + + [Test] + public void MapShouldHaveRightValues() + { + var options = ModelSerializerOptions.GetOptions(ModelSerializerFormat.Wire); + Assert.AreEqual(ModelSerializerFormat.Wire, options.Format); + Assert.IsNull(options.ObjectSerializerResolver); + + options = ModelSerializerOptions.GetOptions(ModelSerializerFormat.Json); + Assert.AreEqual(ModelSerializerFormat.Json, options.Format); + Assert.IsNull(options.ObjectSerializerResolver); + } + } +} diff --git a/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerTests.cs b/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerTests.cs new file mode 100644 index 000000000000..fbf234bf4054 --- /dev/null +++ b/sdk/core/Azure.Core/tests/ModelSerialization/ModelSerializerTests.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.ModelSerialization +{ + public class ModelSerializerTests + { + [Test] + public void ArgumentExceptions() + { + Assert.Throws(() => ModelSerializer.Deserialize(null)); + Assert.Throws(() => ModelSerializer.Deserialize(null, typeof(BaseWithNoUnknown))); + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(new byte[] { }), null)); + Assert.Throws(() => ModelSerializer.Serialize(null)); + Assert.Throws(() => ModelSerializer.Serialize(null)); + + Assert.Throws(() => ModelSerializer.Deserialize(null, ModelSerializerFormat.Wire)); + Assert.Throws(() => ModelSerializer.Deserialize(null, typeof(BaseWithNoUnknown), ModelSerializerFormat.Wire)); + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(new byte[] { }), null, ModelSerializerFormat.Wire)); + Assert.Throws(() => ModelSerializer.Serialize(null, ModelSerializerFormat.Wire)); + Assert.Throws(() => ModelSerializer.Serialize(null, ModelSerializerFormat.Wire)); + + Assert.Throws(() => ModelSerializer.SerializeCore(null, new ModelSerializerOptions())); + Assert.Throws(() => ModelSerializer.SerializeCore(new ModelX(), null)); + } + + [TestCaseSource(typeof(SerializationTestSource), "InvalidOperationBinaryData")] + public void ValidateInvalidOperationBinaryData(BinaryData data) + { + Assert.Throws(() => ModelSerializer.Deserialize(data)); + Assert.Throws(() => ModelSerializer.Deserialize(data, typeof(ModelX))); + } + + [TestCaseSource(typeof(SerializationTestSource), "JsonExceptionBinaryData")] + public void ValidateJsonExceptionBinaryData(BinaryData data) + { + bool gotException = false; + try + { + ModelX x = ModelSerializer.Deserialize(data); + } + catch (Exception ex) + { + Assert.IsTrue(ex.GetType().IsSubclassOf(typeof(JsonException)), $"Expected a subclass of {nameof(JsonException)} but got {ex.GetType().Name}"); + gotException = true; + } + + Assert.IsTrue(gotException, "Did not recieve exception"); + + gotException = false; + try + { + object x = ModelSerializer.Deserialize(data, typeof(ModelX)); + } + catch (Exception ex) + { + Assert.IsTrue(ex.GetType().IsSubclassOf(typeof(JsonException)), $"Expected a subclass of {nameof(JsonException)} but got {ex.GetType().Name}"); + gotException = true; + } + + Assert.IsTrue(gotException, "Did not recieve exception"); + } + + [TestCaseSource(typeof(SerializationTestSource), "NullBinaryData")] + public void ValidateNullBinaryData(BinaryData data) + { + Assert.IsNull(ModelSerializer.Deserialize(data)); + Assert.IsNull(ModelSerializer.Deserialize(data, typeof(ModelX))); + } + + [TestCaseSource(typeof(SerializationTestSource), "EmptyObjectBinaryData")] + public void ValidateEmptyObjectBinaryData(BinaryData data) + { + ModelX x = ModelSerializer.Deserialize(data); + Assert.IsNotNull(x); + Assert.IsNull(x.Kind); + + object obj = ModelSerializer.Deserialize(data, typeof(ModelX)); + Assert.IsNotNull(obj); + Assert.IsNull(((ModelX)obj).Kind); + } + + [Test] + public void ValidateErrorIfUnknownDoesntExist() + { + BaseWithNoUnknown baseInstance = new SubType(); + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(Array.Empty()))); + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(Array.Empty()), typeof(BaseWithNoUnknown))); + } + + [Test] + public void ValidateErrorIfNoDefaultCtor() + { + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(Array.Empty()))); + } + + [Test] + public void ValidateErrorIfNotImplementInterface() + { + var ex = Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(Array.Empty()), typeof(DoesntImplementInterface))); + Assert.IsTrue(ex.Message.Contains("does not implement")); + ex = Assert.Throws(() => ModelSerializer.Serialize(new DoesntImplementInterface())); + Assert.IsTrue(ex.Message.Contains("does not implement")); + } + + public class DoesntImplementInterface { } + + private class SubType : BaseWithNoUnknown, IModelJsonSerializable + { + SubType IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + return new SubType(); + } + + SubType IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return new SubType(); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + return; + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + return new BinaryData(Array.Empty()); + } + } + + private abstract class BaseWithNoUnknown : IModelJsonSerializable + { + BaseWithNoUnknown IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + return new SubType(); + } + + BaseWithNoUnknown IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return new SubType(); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + return; + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + return new BinaryData(Array.Empty()); + } + } + + public class ModelWithNoDefaultCtor : IModelJsonSerializable + { + public ModelWithNoDefaultCtor(int x) { } + + ModelWithNoDefaultCtor IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + return new ModelWithNoDefaultCtor(1); + } + + ModelWithNoDefaultCtor IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return new ModelWithNoDefaultCtor(1); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + return; + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + return new BinaryData(Array.Empty()); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/ModelSerialization/ModelWriterTests.cs b/sdk/core/Azure.Core/tests/ModelSerialization/ModelWriterTests.cs new file mode 100644 index 000000000000..d4bbc80f9a07 --- /dev/null +++ b/sdk/core/Azure.Core/tests/ModelSerialization/ModelWriterTests.cs @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Reflection; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.ModelSerializationTests.Models; +using Azure.Core.Tests.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.Core.Tests.ModelSerialization +{ + /// + /// Happy path tests are in the public test project in the ModelTests class using the JsonInterfaceStrategy. + /// This class is used for testing the internal properties of ModelWriter. + /// + public class ModelWriterTests + { + private const int _modelSize = 156000; + private static readonly string _json = File.ReadAllText(TestData.GetLocation("ResourceProviderData/ResourceProviderData.json")); + private static readonly ResourceProviderData _resourceProviderData = ModelSerializer.Deserialize(BinaryData.FromString(_json)); + + [Test] + public void ThrowsIfUnsupportedFormat() + { + ModelXml model = ModelSerializer.Deserialize(BinaryData.FromString(File.ReadAllText(TestData.GetLocation("ModelXml.xml")))); + ModelWriter writer = new ModelWriter(model, new ModelSerializerOptions("x")); + Assert.Throws(() => writer.ToBinaryData()); + } + + [Test] + public void ThrowsIfMismatch() + { + ModelXml model = ModelSerializer.Deserialize(BinaryData.FromString(File.ReadAllText(TestData.GetLocation("ModelXml.xml")))); + ModelWriter writer = new ModelWriter(model, ModelSerializerOptions.DefaultWireOptions); + Assert.Throws(() => writer.ToBinaryData()); + } + + [Test] + public async Task HappyPath() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + Assert.IsTrue(writer.TryComputeLength(out var length)); + Assert.AreEqual(_modelSize, length); + + MemoryStream stream1 = new MemoryStream((int)length); + writer.CopyTo(stream1, default); + Assert.AreEqual(_modelSize, stream1.Length); + + MemoryStream stream2 = new MemoryStream((int)length); + await writer.CopyToAsync(stream2, default); + Assert.AreEqual(_modelSize, stream2.Length); + + CollectionAssert.AreEqual(stream1.ToArray(), stream2.ToArray()); + } + + [Test] + public async Task DisposeWhileConvertToBinaryData() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + FieldInfo sequenceField = writer.GetType().GetField("_sequenceBuilder", BindingFlags.NonPublic | BindingFlags.Instance); + object sequenceBuilder = sequenceField.GetValue(writer); + Assert.IsNull(sequenceBuilder); + + bool taskStarted = false; + Task result = Task.Factory.StartNew(() => + { + Parallel.For(0, 100000, i => + { + taskStarted = true; + BinaryData data = null; + try + { + data = writer.ToBinaryData(); + Assert.AreEqual(_modelSize, data.ToMemory().Length); + } + catch (ObjectDisposedException) + { + Assert.IsNull(data); + } + }); + }); + + while (!taskStarted) + { + Thread.Sleep(1); + } + + await DisposeAfterStart(writer, sequenceField, result); + } + + [Test] + public async Task DisposeWhileCopyAsync() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + FieldInfo sequenceField = writer.GetType().GetField("_sequenceBuilder", BindingFlags.NonPublic | BindingFlags.Instance); + object sequenceBuilder = sequenceField.GetValue(writer); + Assert.IsNull(sequenceBuilder); + + bool taskStarted = false; + Task result = Task.Factory.StartNew(() => + { + Parallel.For(0, 100000, async i => + { + taskStarted = true; + using MemoryStream stream = new MemoryStream(); + try + { + await writer.CopyToAsync(stream, default); + Assert.AreEqual(_modelSize, stream.Length); + } + catch (ObjectDisposedException) + { + Assert.AreEqual(0, stream.Length); + } + }); + }); + + while (!taskStarted) + { + Thread.Sleep(1); + } + + await DisposeAfterStart(writer, sequenceField, result); + } + + private static async Task DisposeAfterStart(ModelWriter writer, FieldInfo sequenceField, Task result) + { + writer.Dispose(); + object sequenceBuilder = sequenceField.GetValue(writer); + Assert.IsNull(sequenceBuilder); + + await result; + + sequenceBuilder = sequenceField.GetValue(writer); + Assert.IsNull(sequenceBuilder); + } + + [Test] + public async Task DisposeWhileCopy() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + FieldInfo sequenceField = writer.GetType().GetField("_sequenceBuilder", BindingFlags.NonPublic | BindingFlags.Instance); + object sequenceBuilder = sequenceField.GetValue(writer); + Assert.IsNull(sequenceBuilder); + + bool taskStarted = false; + Task result = Task.Factory.StartNew(() => + { + Parallel.For(0, 100000, i => + { + taskStarted = true; + using MemoryStream stream = new MemoryStream(); + try + { + writer.CopyTo(stream, default); + Assert.AreEqual(_modelSize, stream.Length); + } + catch (ObjectDisposedException) + { + Assert.AreEqual(0, stream.Length); + } + }); + }); + + while (!taskStarted) + { + Thread.Sleep(1); + } + + await DisposeAfterStart(writer, sequenceField, result); + } + + [Test] + public async Task DisposeWhileGettingLength() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + FieldInfo sequenceField = writer.GetType().GetField("_sequenceBuilder", BindingFlags.NonPublic | BindingFlags.Instance); + object sequenceBuilder = sequenceField.GetValue(writer); + Assert.IsNull(sequenceBuilder); + + long length = 0; + bool taskStarted = false; + Task result = Task.Factory.StartNew(() => + { + Parallel.For(0, 100000, i => + { + taskStarted = true; + try + { + Assert.IsTrue(writer.TryComputeLength(out var length)); + Assert.AreEqual(_modelSize, length); + } + catch (ObjectDisposedException) + { + Assert.AreEqual(0, length); + } + }); + }); + + while (!taskStarted) + { + Thread.Sleep(1); + } + + await DisposeAfterStart(writer, sequenceField, result); + } + + private static void Validate(ModelWriter writer, FieldInfo sequenceField, bool exceptionThrown, long length) + { + // sequenceBuilder should be null because the writer was disposed + object sequenceBuilder = sequenceField.GetValue(writer); + Assert.IsNull(sequenceBuilder); + + // The dispose should wait for the serialization to finish + // because of thread timing the dispose might happen before the readCount is incremented + // In this case the length of the stream will be 0 otherwise the length will be the size of the model + // Both cases are expected and valid the idea being that the dispose should wait for the serialization to finish if it starts second + // and if it starts first then the original thread should get an ObjectDisposedException + Assert.AreEqual(exceptionThrown ? 0 : _modelSize, length); + } + + [Test] + public void UseAfterDispose() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + writer.Dispose(); + + Assert.Throws(() => writer.TryComputeLength(out var length)); + Assert.Throws(() => writer.CopyTo(new MemoryStream(), default)); + Assert.ThrowsAsync(async () => await writer.CopyToAsync(new MemoryStream(), default)); + Assert.Throws(() => writer.ToBinaryData()); + Assert.DoesNotThrow(() => writer.Dispose()); + } + + [Test] + public void DisposeWithLoad() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + writer.TryComputeLength(out var length); + Assert.AreEqual(_modelSize, length); + + object sequenceBuilder = writer.GetType().GetField("_sequenceBuilder", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(writer); + Assert.IsNotNull(sequenceBuilder); + + writer.Dispose(); + + // sequenceBuilder should be null because the writer was disposed + sequenceBuilder = writer.GetType().GetField("_sequenceBuilder", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(writer); + Assert.IsNull(sequenceBuilder); + } + + [Test] + public void DisposeWithoutLoad() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + + writer.Dispose(); + + // sequenceBuilder should be null because the writer was disposed + object sequenceBuilder = writer.GetType().GetField("_sequenceBuilder", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(writer); + Assert.IsNull(sequenceBuilder); + } + + [TestCase("J")] + [TestCase("W")] + public void ExceptionsAreBubbledUp(string format) + { + ExplodingModel model = new ExplodingModel(); + ModelSerializerOptions options = new ModelSerializerOptions(format); + MemoryStream stream = new MemoryStream(); + + using ModelWriter writer = new ModelWriter(model, options); + Assert.Throws(() => writer.TryComputeLength(out var length)); + Assert.Throws(() => writer.CopyTo(stream, default)); + Assert.ThrowsAsync(async () => await writer.CopyToAsync(stream, default)); + Assert.Throws(() => writer.ToBinaryData()); + } + + [Test] + public void ParallelComputLength() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + + Parallel.For(0, 1000000, i => + { + Assert.IsTrue(writer.TryComputeLength(out var length)); + Assert.AreEqual(_modelSize, length); + }); + } + + [Test] + public void ParallelCopy() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + + Parallel.For(0, 10000, i => + { + using MemoryStream stream = new MemoryStream(_modelSize); + writer.CopyTo(stream, default); + Assert.AreEqual(_modelSize, stream.Length); + }); + } + + [Test] + public void ParallelCopyAsync() + { + ModelWriter writer = new ModelWriter(_resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + + Parallel.For(0, 10000, async i => + { + using MemoryStream stream = new MemoryStream(_modelSize); + await writer.CopyToAsync(stream, default); + Assert.AreEqual(_modelSize, stream.Length); + }); + } + + private class ExplodingModel : IModelJsonSerializable + { + ExplodingModel IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + throw new NotImplementedException(); + } + + ExplodingModel IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + throw new NotImplementedException(); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + throw new NotImplementedException(); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + throw new NotImplementedException(); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/ModelSerialization/SerializationTestSource.cs b/sdk/core/Azure.Core/tests/ModelSerialization/SerializationTestSource.cs new file mode 100644 index 000000000000..1206c63c10e7 --- /dev/null +++ b/sdk/core/Azure.Core/tests/ModelSerialization/SerializationTestSource.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Azure.Core.Tests.ModelSerialization +{ + internal static class SerializationTestSource + { + private static List InvalidOperationBinaryData = new List + { + new BinaryData("\"\""u8.ToArray()), + new BinaryData("[]"u8.ToArray()), + }; + + private static List JsonExceptionBinaryData = new List + { + new BinaryData(new byte[] { }), + }; + + private static List NullBinaryData = new List + { + new BinaryData("null"u8.ToArray()), + }; + + private static List EmptyObjectBinaryData = new List + { + new BinaryData("{}"u8.ToArray()), + }; + } +} diff --git a/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj b/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj index 690f02d08227..5c254ab6f580 100644 --- a/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj +++ b/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj @@ -14,6 +14,40 @@ + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ChildModelXml.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ChildModelXml.cs new file mode 100644 index 000000000000..fd65e8e10cd1 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ChildModelXml.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + [XmlRoot("ChildTag")] + public class ChildModelXml : IXmlSerializable, IModelSerializable, IModelJsonSerializable, IUtf8JsonSerializable + { + internal ChildModelXml() { } + + /// Initializes a new instance of ModelXml for testing. + /// + /// is null. + public ChildModelXml(string value, string readonlyProperty) + { + Argument.AssertNotNull(value, nameof(value)); + + ChildValue = value; + ChildReadOnlyProperty = readonlyProperty; + } + + /// Gets or sets the value. + [XmlElement("ChildValue")] + public string ChildValue { get; set; } + /// Gets or sets the value. + [XmlElement("ChildReadOnlyProperty")] + public string ChildReadOnlyProperty { get; } + + void IXmlSerializable.Write(XmlWriter writer, string nameHint) => + Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + private void Serialize(XmlWriter writer, ModelSerializerOptions options, string nameHint) + { + writer.WriteStartElement(nameHint ?? "ChildTag"); + writer.WriteStartElement("ChildValue"); + writer.WriteValue(ChildValue); + writer.WriteEndElement(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WriteStartElement("ChildReadOnlyProperty"); + writer.WriteValue(ChildReadOnlyProperty); + writer.WriteEndElement(); + } + writer.WriteEndElement(); + } + + internal static ChildModelXml DeserializeChildModelXml(XElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string value = default; + string readonlyProperty = default; + if (element.Element("ChildValue") is XElement valueElement) + { + value = (string)valueElement; + } + if (element.Element("ChildReadOnlyProperty") is XElement readonlyPropertyElement) + { + readonlyProperty = (string)readonlyPropertyElement; + } + return new ChildModelXml(value, readonlyProperty); + } + + internal static ChildModelXml DeserializeChildModelXml(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string childValue = default; + string childReadOnlyProperty = default; + + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("childValue"u8)) + { + childValue = property.Value.GetString(); + continue; + } + if (property.NameEquals("childReadOnlyProperty"u8)) + { + childReadOnlyProperty = property.Value.GetString(); + continue; + } + } + return new ChildModelXml(childValue, childReadOnlyProperty); + } + + ChildModelXml IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + using var doc = JsonDocument.Parse(data); + return DeserializeChildModelXml(doc.RootElement, options); + } + else + { + return DeserializeChildModelXml(XElement.Load(data.ToStream()), options); + } + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + return ModelSerializer.SerializeCore(this, options); + } + else + { + options ??= ModelSerializerOptions.DefaultWireOptions; + using MemoryStream stream = new MemoryStream(); + using XmlWriter writer = XmlWriter.Create(stream); + Serialize(writer, options, null); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("childValue"u8); + writer.WriteStringValue(ChildValue); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("childReadOnlyProperty"u8); + writer.WriteStringValue(ChildReadOnlyProperty); + } + writer.WriteEndObject(); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + Serialize(writer, options); + } + + ChildModelXml IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeChildModelXml(doc.RootElement, options); + } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => + Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/BaseModel.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/BaseModel.cs new file mode 100644 index 000000000000..ed5e7860c2bd --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/BaseModel.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + [DeserializationProxy(typeof(UnknownBaseModel))] + public abstract class BaseModel : IUtf8JsonSerializable, IModelJsonSerializable + { + private Dictionary _rawData; + + public static implicit operator RequestContent(BaseModel baseModel) + { + if (baseModel == null) + { + return null; + } + + return RequestContent.Create(baseModel, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator BaseModel(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + using JsonDocument jsonDocument = JsonDocument.Parse(response.ContentStream); + return DeserializeBaseModel(jsonDocument.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + + protected internal BaseModel(Dictionary rawData) + { + _rawData = rawData ?? new Dictionary(); + } + + public string Kind { get; internal set; } + public string Name { get; set; } + + protected internal void SerializeRawData(Utf8JsonWriter writer) + { + //write out the raw data + foreach (var property in _rawData) + { + writer.WritePropertyName(property.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(property.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(property.Value.ToString()).RootElement); +#endif + } + } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + Serialize(writer, options); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format == ModelSerializerFormat.Json) + { + SerializeRawData(writer); + } + writer.WriteEndObject(); + } + + internal static BaseModel DeserializeBaseModel(BinaryData data, ModelSerializerOptions options) + => DeserializeBaseModel(JsonDocument.Parse(data.ToString()).RootElement, options); + + internal static BaseModel DeserializeBaseModel(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "X": + return ModelX.DeserializeModelX(element, options); + case "Y": + return ModelY.DeserializeModelY(element, options); + } + } + + //Deserialize unknown subtype + string kind = default; + Optional name = default; + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format == ModelSerializerFormat.Json) + { + //this means it's an unknown property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new UnknownBaseModel(kind, name, rawData); + } + + BaseModel IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return DeserializeBaseModel(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + BaseModel IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeBaseModel(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelX.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelX.cs new file mode 100644 index 000000000000..8d854c6818b6 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelX.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + public class ModelX : BaseModel, IUtf8JsonSerializable, IModelJsonSerializable + { + public ModelX() + : base(null) + { + Kind = "X"; + } + + internal ModelX(string kind, string name, int xProperty, int? nullProperty, IList fields, IDictionary keyValuePairs, Dictionary rawData) + : base(rawData) + { + Kind = kind; + Name = name; + XProperty = xProperty; + NullProperty = nullProperty; + Fields = fields; + KeyValuePairs = keyValuePairs; + } + + public int XProperty { get; } + public IList Fields { get; } + public int? NullProperty = null; + public IDictionary KeyValuePairs { get; } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + public static implicit operator RequestContent(ModelX modelX) + { + if (modelX == null) + { + return null; + } + + return RequestContent.Create(modelX, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator ModelX(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + using JsonDocument jsonDocument = JsonDocument.Parse(response.ContentStream); + return DeserializeModelX(jsonDocument.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + Serialize(writer, options); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Fields)) + { + writer.WritePropertyName("fields"u8); + writer.WriteStartArray(); + foreach (string field in Fields) + { + writer.WriteStringValue(field); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NullProperty)) + { + writer.WritePropertyName("nullProperty"u8); + writer.WriteNumberValue(NullProperty.Value); + } + if (Optional.IsCollectionDefined(KeyValuePairs)) + { + writer.WritePropertyName("keyValuePairs"u8); + writer.WriteStartObject(); + foreach (var item in KeyValuePairs) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("xProperty"u8); + writer.WriteNumberValue(XProperty); + } + if (options.Format == ModelSerializerFormat.Json) + { + SerializeRawData(writer); + } + writer.WriteEndObject(); + } + + internal static ModelX DeserializeModelX(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string kind = default; + Optional name = default; + int xProperty = default; + Optional nullProperty = default; + Optional> fields = default; + Optional> keyValuePairs = default; + Dictionary rawData = new Dictionary(); + + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("fields"u8)) + { + fields = property.Value.EnumerateArray().Select(element => element.GetString()).ToList(); + continue; + } + if (property.NameEquals("nullProperty"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nullProperty = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("keyValuePairs"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + keyValuePairs = dictionary; + continue; + } + if (property.NameEquals("xProperty"u8)) + { + xProperty = property.Value.GetInt32(); + continue; + } + if (options.Format == ModelSerializerFormat.Json) + { + //this means it's an unknown property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new ModelX(kind, name, xProperty, Optional.ToNullable(nullProperty), Optional.ToList(fields), Optional.ToDictionary(keyValuePairs), rawData); + } + + ModelX IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return DeserializeModelX(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + //public method to serialize with internal interface + public void Serialize(Utf8JsonWriter writer) + { + ((IUtf8JsonSerializable)this).Write(writer); + } + + ModelX IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeModelX(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelY.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelY.cs new file mode 100644 index 000000000000..6dcfb722b852 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/ModelY.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + public class ModelY : BaseModel, IUtf8JsonSerializable, IModelJsonSerializable + { + public ModelY() + : base(null) + { + Kind = "Y"; + } + + internal ModelY(string kind, string name, string yProperty, Dictionary rawData) + : base(rawData) + { + Kind = kind; + Name = name; + YProperty = yProperty; + } + + public string YProperty { get; private set; } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("yProperty"u8); + writer.WriteStringValue(YProperty); + } + if (options.Format == ModelSerializerFormat.Json) + { + SerializeRawData(writer); + } + writer.WriteEndObject(); + } + + internal static ModelY DeserializeModelY(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string kind = default; + Optional name = default; + Optional yProperty = default; + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("yProperty"u8)) + { + yProperty = property.Value.GetString(); + continue; + } + if (options.Format == ModelSerializerFormat.Json) + { + //this means it's an unknown property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new ModelY(kind, name, yProperty, rawData); + } + + ModelY IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return DeserializeModelY(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + ModelY IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeModelY(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/UnknownBaseModel.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/UnknownBaseModel.cs new file mode 100644 index 000000000000..0d9ac6ce152e --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/DiscriminatorSet/UnknownBaseModel.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + internal class UnknownBaseModel : BaseModel, IUtf8JsonSerializable, IModelJsonSerializable + { + public UnknownBaseModel() + : base(null) + { + Kind = "Unknown"; + } + + internal UnknownBaseModel(string kind, string name, Dictionary rawData) + : base(rawData) + { + Kind = kind; + Name = name; + } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + Serialize(writer, options); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format == ModelSerializerFormat.Json) + { + SerializeRawData(writer); + } + writer.WriteEndObject(); + } + + internal static BaseModel DeserializeUnknownBaseModel(JsonElement element, ModelSerializerOptions options = default) => DeserializeBaseModel(element, options); + + BaseModel IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return DeserializeUnknownBaseModel(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + BaseModel IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeUnknownBaseModel(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelAsStruct.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelAsStruct.cs new file mode 100644 index 000000000000..6eeb5b8bddf3 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelAsStruct.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + /// The InputAdditionalPropertiesModelStruct. + public readonly partial struct ModelAsStruct : IUtf8JsonSerializable, IModelJsonSerializable, IModelJsonSerializable + { + private readonly Dictionary _rawData; + + /// Initializes a new instance of InputAdditionalPropertiesModelStruct. + /// + /// Additional Properties. + /// + /// is null. + public ModelAsStruct(int id, Dictionary rawData) + { + Id = id; + _rawData = rawData; + } + + /// Gets the id. + public int Id { get; } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteNumberValue(Id); + if (_rawData is not null && options.Format == ModelSerializerFormat.Json) + { + foreach (var property in _rawData) + { + writer.WritePropertyName(property.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(property.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(property.Value.ToString()).RootElement); +#endif + } + } + writer.WriteEndObject(); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + + public static implicit operator RequestContent(ModelAsStruct model) + { + return RequestContent.Create(model, ModelSerializerOptions.DefaultWireOptions); + } + + ModelAsStruct IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.Parse(data); + return DeserializeInputAdditionalPropertiesModelStruct(doc.RootElement, options); + } + + internal static ModelAsStruct DeserializeInputAdditionalPropertiesModelStruct(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + int id = default; + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetInt32(); + continue; + } + if (options.Format == ModelSerializerFormat.Json) + { + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + continue; + } + } + return new ModelAsStruct(id, rawData); + } + + ModelAsStruct IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeInputAdditionalPropertiesModelStruct(doc.RootElement, options); + } + + public static explicit operator ModelAsStruct(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + using JsonDocument doc = JsonDocument.Parse(response.ContentStream); + return DeserializeInputAdditionalPropertiesModelStruct(doc.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + object IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeInputAdditionalPropertiesModelStruct(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + + object IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.Parse(data); + return DeserializeInputAdditionalPropertiesModelStruct(doc.RootElement, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXDeserializationProxy.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXDeserializationProxy.cs new file mode 100644 index 000000000000..9c0c24e0c8a8 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXDeserializationProxy.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + [DeserializationProxy(typeof(ModelX))] + public class ModelXDeserializationProxy + { + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXml.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXml.cs new file mode 100644 index 000000000000..cd5e08b1496d --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/Models/ModelXml.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ModelSerializationTests.Models +{ + [XmlRoot("Tag")] + public class ModelXml : IXmlSerializable, IModelSerializable, IModelJsonSerializable, IUtf8JsonSerializable + { + internal ModelXml() { } + + /// Initializes a new instance of ModelXml for testing. + /// + /// + /// or is null. + public ModelXml(string key, string value, string readonlyProperty, ChildModelXml childModel) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + ReadOnlyProperty = readonlyProperty; + RenamedChildModelXml = childModel; + } + + /// Gets or sets the key. + [XmlElement("Key")] + public string Key { get; set; } + /// Gets or sets the value. + [XmlElement("Value")] + public string Value { get; set; } + /// Gets or sets the value. + [XmlElement("ReadOnlyProperty")] + public string ReadOnlyProperty { get; } + [XmlElement("RenamedChildModelXml")] + public ChildModelXml RenamedChildModelXml { get; set; } + + public static implicit operator RequestContent(ModelXml modelXml) + { + if (modelXml == null) + { + return null; + } + + return RequestContent.Create((IModelSerializable)modelXml, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator ModelXml(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + return DeserializeModelXml(XElement.Load(response.ContentStream), ModelSerializerOptions.DefaultWireOptions); + } + + public void Serialize(XmlWriter writer, string nameHint) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + void IXmlSerializable.Write(XmlWriter writer, string nameHint) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + private void Serialize(XmlWriter writer, ModelSerializerOptions options, string nameHint) + { + writer.WriteStartElement(nameHint ?? "Tag"); + writer.WriteStartElement("Key"); + writer.WriteValue(Key); + writer.WriteEndElement(); + writer.WriteStartElement("Value"); + writer.WriteValue(Value); + writer.WriteEndElement(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WriteStartElement("ReadOnlyProperty"); + writer.WriteValue(ReadOnlyProperty); + writer.WriteEndElement(); + } + writer.WriteObjectValue(RenamedChildModelXml, "RenamedChildModelXml"); + writer.WriteEndElement(); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("readOnlyProperty"u8); + writer.WriteStringValue(ReadOnlyProperty); + } + writer.WritePropertyName("renamedChildModelXml"u8); + writer.WriteObjectValue(RenamedChildModelXml); + writer.WriteEndObject(); + } + + public static ModelXml DeserializeModelXml(XElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readonlyProperty = default; + ChildModelXml childModelXml = default; + if (element.Element("Key") is XElement keyElement) + { + key = (string)keyElement; + } + if (element.Element("Value") is XElement valueElement) + { + value = (string)valueElement; + } + if (element.Element("ReadOnlyProperty") is XElement readonlyPropertyElement) + { + readonlyProperty = (string)readonlyPropertyElement; + } + if (element.Element("RenamedChildModelXml") is XElement renamedChildModelXmlElement) + { + childModelXml = ChildModelXml.DeserializeChildModelXml(renamedChildModelXmlElement, options); + } + return new ModelXml(key, value, readonlyProperty, childModelXml); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + return ModelSerializer.SerializeCore(this, options); + } + else + { + options ??= ModelSerializerOptions.DefaultWireOptions; + using MemoryStream stream = new MemoryStream(); + using XmlWriter writer = XmlWriter.Create(stream); + Serialize(writer, options, null); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + } + + internal static ModelXml DeserializeModelXml(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readOnlyProperty = default; + ChildModelXml childModelXml = default; + + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("readOnlyProperty"u8)) + { + readOnlyProperty = property.Value.GetString(); + continue; + } + if (property.NameEquals("renamedChildModelXml"u8)) + { + childModelXml = ChildModelXml.DeserializeChildModelXml(property.Value, options); + continue; + } + } + return new ModelXml(key, value, readOnlyProperty, childModelXml); + } + + ModelXml IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + using var doc = JsonDocument.Parse(data); + return DeserializeModelXml(doc.RootElement, options); + } + else + { + return DeserializeModelXml(XElement.Load(data.ToStream()), options); + } + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format != ModelSerializerFormat.Json) + throw new InvalidOperationException($"Must use '{ModelSerializerFormat.Json}' format when calling the {nameof(IModelJsonSerializable)} interface"); + Serialize(writer, options); + } + + ModelXml IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format != ModelSerializerFormat.Json) + throw new InvalidOperationException($"Must use '{ModelSerializerFormat.Json}' format when calling the {nameof(IModelJsonSerializable)} interface"); + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeModelXml(doc.RootElement, options); + } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.Serialization.cs new file mode 100644 index 000000000000..e67ec83536e8 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ApiProfile : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ApiProfile DeserializeApiProfile(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional profileVersion = default; + Optional apiVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("profileVersion"u8)) + { + profileVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiVersion"u8)) + { + apiVersion = property.Value.GetString(); + continue; + } + } + return new ApiProfile(profileVersion.Value, apiVersion.Value); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ProfileVersion)) + { + writer.WritePropertyName("profileVersion"u8); + writer.WriteStringValue(ProfileVersion); + } + if (Optional.IsDefined(ApiVersion)) + { + writer.WritePropertyName("apiVersion"u8); + writer.WriteStringValue(ApiVersion); + } + writer.WriteEndObject(); + } + + private struct ApiProfileProperties + { + public Optional ProfileVersion { get; set; } + public Optional ApiVersion { get; set; } + } + + ApiProfile IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeApiProfile(doc.RootElement, options); + } + + private static void SetProperty(ReadOnlySpan propertyName, ref ApiProfileProperties properties, ref Utf8JsonReader reader, ModelSerializerOptions options) + { + if (propertyName.SequenceEqual("profileVersion"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.ProfileVersion = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("apiVersion"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.ApiVersion = reader.GetString(); + return; + } + reader.Skip(); + } + + ApiProfile IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeApiProfile(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.cs new file mode 100644 index 000000000000..2b5e44d73549 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ApiProfile.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The ApiProfile. + public partial class ApiProfile + { + /// Initializes a new instance of ApiProfile. + internal ApiProfile() + { + } + + /// Initializes a new instance of ApiProfile. + /// The profile version. + /// The API version. + internal ApiProfile(string profileVersion, string apiVersion) + { + ProfileVersion = profileVersion; + ApiVersion = apiVersion; + } + + /// The profile version. + public string ProfileVersion { get; } + /// The API version. + public string ApiVersion { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.Serialization.cs new file mode 100644 index 000000000000..2a99336619a0 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.Serialization.cs @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.Tests.ResourceManager.Compute.Models; +using Azure.Core.Tests.ResourceManager.Models; +using Azure.Core.Tests.ResourceManager.Resources.Models; + +namespace Azure.Core.Tests.ResourceManager.Compute +{ + public partial class AvailabilitySetData : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + Serialize(writer, options); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id.ToString()); + } + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType.ToString()); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PlatformUpdateDomainCount)) + { + writer.WritePropertyName("platformUpdateDomainCount"u8); + writer.WriteNumberValue(PlatformUpdateDomainCount.Value); + } + if (Optional.IsDefined(PlatformFaultDomainCount)) + { + writer.WritePropertyName("platformFaultDomainCount"u8); + writer.WriteNumberValue(PlatformFaultDomainCount.Value); + } + if (Optional.IsCollectionDefined(VirtualMachines)) + { + writer.WritePropertyName("virtualMachines"u8); + writer.WriteStartArray(); + foreach (var item in VirtualMachines) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ProximityPlacementGroup)) + { + writer.WritePropertyName("proximityPlacementGroup"u8); + JsonSerializer.Serialize(writer, ProximityPlacementGroup); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + public static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional sku = default; + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional platformUpdateDomainCount = default; + Optional platformFaultDomainCount = default; + Optional> virtualMachines = default; + Optional proximityPlacementGroup = default; + Optional> statuses = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = ComputeSku.DeserializeComputeSku(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("platformUpdateDomainCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + platformUpdateDomainCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("platformFaultDomainCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + platformFaultDomainCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("virtualMachines"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + virtualMachines = array; + continue; + } + if (property0.NameEquals("proximityPlacementGroup"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + proximityPlacementGroup = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("statuses"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item, options)); + } + statuses = array; + continue; + } + } + continue; + } + } + return new AvailabilitySetData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, Optional.ToNullable(platformUpdateDomainCount), Optional.ToNullable(platformFaultDomainCount), Optional.ToList(virtualMachines), proximityPlacementGroup, Optional.ToList(statuses)); + } + + AvailabilitySetData IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.Parse(data); + return DeserializeAvailabilitySetData(doc.RootElement, options); + } + + // only used for public access to internal serialize + public void Serialize(Utf8JsonWriter writer) => ((IUtf8JsonSerializable)this).Write(writer); + + private struct AvailabilitySetDataProperties + { + public Optional Sku { get; set; } + public Optional> Tags { get; set; } + public AzureLocation Location { get; set; } + public ResourceIdentifier Id { get; set; } + public string Name { get; set; } + public ResourceType ResourceType { get; set; } + public Optional SystemData { get; set; } + public Optional PlatformUpdateDomainCount { get; set; } + public Optional PlatformFaultDomainCount { get; set; } + public Optional> VirtualMachines { get; set; } + public Optional ProximityPlacementGroup { get; set; } + public Optional> Statuses { get; set; } + } + + AvailabilitySetData IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeAvailabilitySetData(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.cs new file mode 100644 index 000000000000..df38269f1da1 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/AvailabilitySetData.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.Tests.ResourceManager.Compute.Models; +using Azure.Core.Tests.ResourceManager.Models; +using Azure.Core.Tests.ResourceManager.Resources.Models; + +namespace Azure.Core.Tests.ResourceManager.Compute +{ + /// + /// A class representing the AvailabilitySet data model. + /// Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability set. + /// + public partial class AvailabilitySetData : TrackedResourceData + { + internal AvailabilitySetData() { } + + public static implicit operator RequestContent(AvailabilitySetData availabilitySetData) + { + if (availabilitySetData is null) + { + return null; + } + + return RequestContent.Create(availabilitySetData, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator AvailabilitySetData(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + using JsonDocument jsonDocument = JsonDocument.Parse(response.ContentStream); + return DeserializeAvailabilitySetData(jsonDocument.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + + /// Initializes a new instance of AvailabilitySetData. + /// The location. + public AvailabilitySetData(AzureLocation location) : base(location) + { + VirtualMachines = new ChangeTrackingList(); + Statuses = new ChangeTrackingList(); + } + + /// Initializes a new instance of AvailabilitySetData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. + /// Update Domain count. + /// Fault Domain count. + /// A list of references to all virtual machines in the availability set. + /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. + /// The resource status information. + internal AvailabilitySetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses) : base(id, name, resourceType, systemData, tags, location) + { + Sku = sku; + PlatformUpdateDomainCount = platformUpdateDomainCount; + PlatformFaultDomainCount = platformFaultDomainCount; + VirtualMachines = virtualMachines; + ProximityPlacementGroup = proximityPlacementGroup; + Statuses = statuses; + } + + /// Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. + public ComputeSku Sku { get; set; } + /// Update Domain count. + public int? PlatformUpdateDomainCount { get; set; } + /// Fault Domain count. + public int? PlatformFaultDomainCount { get; set; } + /// A list of references to all virtual machines in the availability set. + public IList VirtualMachines { get; } + /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. + internal WritableSubResource ProximityPlacementGroup { get; set; } + /// Gets or sets Id. + public ResourceIdentifier ProximityPlacementGroupId + { + get => ProximityPlacementGroup is null ? default : ProximityPlacementGroup.Id; + set + { + if (ProximityPlacementGroup is null) + ProximityPlacementGroup = new WritableSubResource(); + ProximityPlacementGroup.Id = value; + } + } + + /// The resource status information. + public IReadOnlyList Statuses { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.Serialization.cs new file mode 100644 index 000000000000..483232080d92 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.Serialization.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Linq; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Compute.Models +{ + public partial class ComputeSku : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + writer.WriteEndObject(); + } + + internal static ComputeSku DeserializeComputeSku(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional tier = default; + Optional capacity = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("tier"u8)) + { + tier = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt64(); + continue; + } + } + return new ComputeSku(name.Value, tier.Value, Optional.ToNullable(capacity)); + } + + private struct ComputeSkuProperties + { + public Optional Name { get; set; } + public Optional Tier { get; set; } + public Optional Capacity { get; set; } + } + + ComputeSku IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeComputeSku(doc.RootElement, options); + } + + private static void SetProperty(ReadOnlySpan propertyName, ref ComputeSkuProperties properties, ref Utf8JsonReader reader, ModelSerializerOptions options) + { + if (propertyName.SequenceEqual("name"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Name = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("tier"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Tier = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("capacity"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Capacity = reader.GetInt64(); + return; + } + reader.Skip(); + } + + ComputeSku IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeComputeSku(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.cs new file mode 100644 index 000000000000..ae8ec908b7e1 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeSku.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Compute.Models +{ + /// Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. + public partial class ComputeSku + { + /// Initializes a new instance of ComputeSku. + public ComputeSku() + { + } + + /// Initializes a new instance of ComputeSku. + /// The sku name. + /// Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**. + /// Specifies the number of virtual machines in the scale set. + internal ComputeSku(string name, string tier, long? capacity) + { + Name = name; + Tier = tier; + Capacity = capacity; + } + + /// The sku name. + public string Name { get; set; } + /// Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**. + public string Tier { get; set; } + /// Specifies the number of virtual machines in the scale set. + public long? Capacity { get; set; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.Serialization.cs new file mode 100644 index 000000000000..879117da9755 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Core.Tests.ResourceManager.Compute.Models +{ + internal static partial class ComputeStatusLevelTypeExtensions + { + public static string ToSerialString(this ComputeStatusLevelType value) => value switch + { + ComputeStatusLevelType.Info => "Info", + ComputeStatusLevelType.Warning => "Warning", + ComputeStatusLevelType.Error => "Error", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeStatusLevelType value.") + }; + + public static ComputeStatusLevelType ToComputeStatusLevelType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Info")) return ComputeStatusLevelType.Info; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Warning")) return ComputeStatusLevelType.Warning; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Error")) return ComputeStatusLevelType.Error; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeStatusLevelType value."); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.cs new file mode 100644 index 000000000000..196fb7183671 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ComputeStatusLevelType.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Compute.Models +{ + /// The level code. + public enum ComputeStatusLevelType + { + /// Info. + Info, + /// Warning. + Warning, + /// Error. + Error + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/CreatedByType.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/CreatedByType.cs new file mode 100644 index 000000000000..ce682d85bea6 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/CreatedByType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Core.Tests.ResourceManager.Models +{ + /// The type of identity that created the resource. + public readonly partial struct CreatedByType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CreatedByType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserValue = "User"; + private const string ApplicationValue = "Application"; + private const string ManagedIdentityValue = "ManagedIdentity"; + private const string KeyValue = "Key"; + + /// User. + public static CreatedByType User { get; } = new CreatedByType(UserValue); + /// Application. + public static CreatedByType Application { get; } = new CreatedByType(ApplicationValue); + /// ManagedIdentity. + public static CreatedByType ManagedIdentity { get; } = new CreatedByType(ManagedIdentityValue); + /// Key. + public static CreatedByType Key { get; } = new CreatedByType(KeyValue); + /// Determines if two values are the same. + public static bool operator ==(CreatedByType left, CreatedByType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CreatedByType left, CreatedByType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CreatedByType(string value) => new CreatedByType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CreatedByType other && Equals(other); + /// + public bool Equals(CreatedByType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.Serialization.cs new file mode 100644 index 000000000000..472083e903b8 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Compute.Models +{ + public partial class InstanceViewStatus : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"u8); + writer.WriteStringValue(Level.Value.ToSerialString()); + } + if (Optional.IsDefined(DisplayStatus)) + { + writer.WritePropertyName("displayStatus"u8); + writer.WriteStringValue(DisplayStatus); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } + writer.WriteEndObject(); + } + + internal static InstanceViewStatus DeserializeInstanceViewStatus(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional level = default; + Optional displayStatus = default; + Optional message = default; + Optional time = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("level"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + level = property.Value.GetString().ToComputeStatusLevelType(); + continue; + } + if (property.NameEquals("displayStatus"u8)) + { + displayStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new InstanceViewStatus(code.Value, Optional.ToNullable(level), displayStatus.Value, message.Value, Optional.ToNullable(time)); + } + + private struct InstanceViewStatusProperties + { + public Optional Code { get; set; } + public Optional Level { get; set; } + public Optional DisplayStatus { get; set; } + public Optional Message { get; set; } + public Optional Time { get; set; } + } + + InstanceViewStatus IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeInstanceViewStatus(doc.RootElement, options); + } + + private static void SetProperty(ReadOnlySpan propertyName, ref InstanceViewStatusProperties properties, ref Utf8JsonReader reader, ModelSerializerOptions options) + { + if (propertyName.SequenceEqual("code"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Code = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("level"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Level = reader.GetString().ToComputeStatusLevelType(); + return; + } + if (propertyName.SequenceEqual("displayStatus"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.DisplayStatus = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("message"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Message = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("time"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Time = DateTimeOffset.Parse(reader.GetString(), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal); + return; + } + reader.Skip(); + } + + InstanceViewStatus IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeInstanceViewStatus(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.cs new file mode 100644 index 000000000000..66891bc6032b --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/InstanceViewStatus.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Core.Tests.ResourceManager.Compute.Models +{ + /// Instance view status. + public partial class InstanceViewStatus + { + /// Initializes a new instance of InstanceViewStatus. + public InstanceViewStatus() + { + } + + /// Initializes a new instance of InstanceViewStatus. + /// The status code. + /// The level code. + /// The short localizable label for the status. + /// The detailed status message, including for alerts and error messages. + /// The time of the status. + internal InstanceViewStatus(string code, ComputeStatusLevelType? level, string displayStatus, string message, DateTimeOffset? time) + { + Code = code; + Level = level; + DisplayStatus = displayStatus; + Message = message; + Time = time; + } + + /// The status code. + public string Code { get; set; } + /// The level code. + public ComputeStatusLevelType? Level { get; set; } + /// The short localizable label for the status. + public string DisplayStatus { get; set; } + /// The detailed status message, including for alerts and error messages. + public string Message { get; set; } + /// The time of the status. + public DateTimeOffset? Time { get; set; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderAuthorizationConsentState.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderAuthorizationConsentState.cs new file mode 100644 index 000000000000..6268124cb3f6 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderAuthorizationConsentState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The provider authorization consent state. + public readonly partial struct ProviderAuthorizationConsentState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProviderAuthorizationConsentState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSpecifiedValue = "NotSpecified"; + private const string RequiredValue = "Required"; + private const string NotRequiredValue = "NotRequired"; + private const string ConsentedValue = "Consented"; + + /// NotSpecified. + public static ProviderAuthorizationConsentState NotSpecified { get; } = new ProviderAuthorizationConsentState(NotSpecifiedValue); + /// Required. + public static ProviderAuthorizationConsentState Required { get; } = new ProviderAuthorizationConsentState(RequiredValue); + /// NotRequired. + public static ProviderAuthorizationConsentState NotRequired { get; } = new ProviderAuthorizationConsentState(NotRequiredValue); + /// Consented. + public static ProviderAuthorizationConsentState Consented { get; } = new ProviderAuthorizationConsentState(ConsentedValue); + /// Determines if two values are the same. + public static bool operator ==(ProviderAuthorizationConsentState left, ProviderAuthorizationConsentState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProviderAuthorizationConsentState left, ProviderAuthorizationConsentState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProviderAuthorizationConsentState(string value) => new ProviderAuthorizationConsentState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProviderAuthorizationConsentState other && Equals(other); + /// + public bool Equals(ProviderAuthorizationConsentState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.Serialization.cs new file mode 100644 index 000000000000..790a860f1a99 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ProviderExtendedLocation : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ProviderExtendedLocation DeserializeProviderExtendedLocation(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional location = default; + Optional type = default; + Optional> extendedLocations = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("extendedLocations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + extendedLocations = array; + continue; + } + } + return new ProviderExtendedLocation(Optional.ToNullable(location), type.Value, Optional.ToList(extendedLocations)); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value.DisplayName); + } + if (Optional.IsDefined(ProviderExtendedLocationType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ProviderExtendedLocationType); + } + if (Optional.IsCollectionDefined(ExtendedLocations)) + { + writer.WritePropertyName("extendedLocations"u8); + writer.WriteStartArray(); + foreach (var item in ExtendedLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + private struct ProviderExtendedLocationProperties + { + public Optional Location { get; set; } + public Optional ProviderExtendedLocationType { get; set; } + public Optional> ExtendedLocations { get; set; } + } + + ProviderExtendedLocation IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeProviderExtendedLocation(doc.RootElement, options); + } + + ProviderExtendedLocation IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeProviderExtendedLocation(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.cs new file mode 100644 index 000000000000..bcbb99a520d3 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderExtendedLocation.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The provider extended location. + public partial class ProviderExtendedLocation + { + /// Initializes a new instance of ProviderExtendedLocation. + internal ProviderExtendedLocation() + { + ExtendedLocations = new ChangeTrackingList(); + } + + /// Initializes a new instance of ProviderExtendedLocation. + /// The azure location. + /// The extended location type. + /// The extended locations for the azure location. + internal ProviderExtendedLocation(AzureLocation? location, string providerExtendedLocationType, IReadOnlyList extendedLocations) + { + Location = location; + ProviderExtendedLocationType = providerExtendedLocationType; + ExtendedLocations = extendedLocations; + } + + /// The azure location. + public AzureLocation? Location { get; } + /// The extended location type. + public string ProviderExtendedLocationType { get; } + /// The extended locations for the azure location. + public IReadOnlyList ExtendedLocations { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.Serialization.cs new file mode 100644 index 000000000000..cd9cff632635 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.Serialization.cs @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ProviderResourceType : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ProviderResourceType DeserializeProviderResourceType(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional resourceType = default; + Optional> locations = default; + Optional> locationMappings = default; + Optional> aliases = default; + Optional> apiVersions = default; + Optional defaultApiVersion = default; + Optional> zoneMappings = default; + Optional> apiProfiles = default; + Optional capabilities = default; + Optional> properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("locations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locations = array; + continue; + } + if (property.NameEquals("locationMappings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProviderExtendedLocation.DeserializeProviderExtendedLocation(item, options)); + } + locationMappings = array; + continue; + } + if (property.NameEquals("aliases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceTypeAlias.DeserializeResourceTypeAlias(item, options)); + } + aliases = array; + continue; + } + if (property.NameEquals("apiVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + apiVersions = array; + continue; + } + if (property.NameEquals("defaultApiVersion"u8)) + { + defaultApiVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("zoneMappings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ZoneMapping.DeserializeZoneMapping(item, options)); + } + zoneMappings = array; + continue; + } + if (property.NameEquals("apiProfiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApiProfile.DeserializeApiProfile(item, options)); + } + apiProfiles = array; + continue; + } + if (property.NameEquals("capabilities"u8)) + { + capabilities = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + properties = dictionary; + continue; + } + } + return new ProviderResourceType(resourceType.Value, Optional.ToList(locations), Optional.ToList(locationMappings), Optional.ToList(aliases), Optional.ToList(apiVersions), defaultApiVersion.Value, Optional.ToList(zoneMappings), Optional.ToList(apiProfiles), capabilities.Value, Optional.ToDictionary(properties)); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if(Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + } + if (Optional.IsCollectionDefined(Locations)) + { + writer.WritePropertyName("locations"u8); + writer.WriteStartArray(); + foreach (var item in Locations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApiVersions)) + { + writer.WritePropertyName("apiVersions"u8); + writer.WriteStartArray(); + foreach (var item in ApiVersions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DefaultApiVersion)) + { + writer.WritePropertyName("defaultApiVersion"u8); + writer.WriteStringValue(DefaultApiVersion); + } + if (Optional.IsCollectionDefined(ApiProfiles)) + { + writer.WritePropertyName("apiProfiles"u8); + writer.WriteStartArray(); + foreach (var item in ApiProfiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ZoneMappings)) + { + writer.WritePropertyName("zoneMappings"u8); + writer.WriteStartArray(); + foreach (var item in ZoneMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(LocationMappings)) + { + writer.WritePropertyName("locationMappings"u8); + writer.WriteStartArray(); + foreach (var item in LocationMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Capabilities)) + { + writer.WritePropertyName("capabilities"u8); + writer.WriteStringValue(Capabilities); + } + if (Optional.IsCollectionDefined(Aliases)) + { + writer.WritePropertyName("aliases"u8); + writer.WriteStartArray(); + foreach (var item in Aliases) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + foreach (var item in Properties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + private struct ProviderResourceTypeProperties + { + public Optional ResourceType { get; set; } + public Optional> Locations { get; set; } + public Optional> LocationMappings { get; set; } + public Optional> Aliases { get; set; } + public Optional> ApiVersions { get; set; } + public Optional DefaultApiVersion { get; set; } + public Optional> ZoneMappings { get; set; } + public Optional> ApiProfiles { get; set; } + public Optional Capabilities { get; set; } + public Optional> Properties { get; set; } + } + + ProviderResourceType IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeProviderResourceType(doc.RootElement, options); + } + + ProviderResourceType IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeProviderResourceType(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.cs new file mode 100644 index 000000000000..af95577c5916 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ProviderResourceType.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// Resource type managed by the resource provider. + public partial class ProviderResourceType + { + /// Initializes a new instance of ProviderResourceType. + internal ProviderResourceType() + { + Locations = new ChangeTrackingList(); + LocationMappings = new ChangeTrackingList(); + Aliases = new ChangeTrackingList(); + ApiVersions = new ChangeTrackingList(); + ZoneMappings = new ChangeTrackingList(); + ApiProfiles = new ChangeTrackingList(); + Properties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of ProviderResourceType. + /// The resource type. + /// The collection of locations where this resource type can be created. + /// The location mappings that are supported by this resource type. + /// The aliases that are supported by this resource type. + /// The API version. + /// The default API version. + /// + /// The API profiles for the resource provider. + /// The additional capabilities offered by this resource type. + /// The properties. + internal ProviderResourceType(string resourceType, IReadOnlyList locations, IReadOnlyList locationMappings, IReadOnlyList aliases, IReadOnlyList apiVersions, string defaultApiVersion, IReadOnlyList zoneMappings, IReadOnlyList apiProfiles, string capabilities, IReadOnlyDictionary properties) + { + ResourceType = resourceType; + Locations = locations; + LocationMappings = locationMappings; + Aliases = aliases; + ApiVersions = apiVersions; + DefaultApiVersion = defaultApiVersion; + ZoneMappings = zoneMappings; + ApiProfiles = apiProfiles; + Capabilities = capabilities; + Properties = properties; + } + + /// The resource type. + public string ResourceType { get; } + /// The collection of locations where this resource type can be created. + public IReadOnlyList Locations { get; } + /// The location mappings that are supported by this resource type. + public IReadOnlyList LocationMappings { get; } + /// The aliases that are supported by this resource type. + public IReadOnlyList Aliases { get; } + /// The API version. + public IReadOnlyList ApiVersions { get; } + /// The default API version. + public string DefaultApiVersion { get; } + /// Gets the zone mappings. + public IReadOnlyList ZoneMappings { get; } + /// The API profiles for the resource provider. + public IReadOnlyList ApiProfiles { get; } + /// The additional capabilities offered by this resource type. + public string Capabilities { get; } + /// The properties. + public IReadOnlyDictionary Properties { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceData.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceData.cs new file mode 100644 index 000000000000..488468d0d5d7 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceData.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Models +{ + /// Common fields that are returned in the response for all Azure Resource Manager resources. + public abstract partial class ResourceData + { + /// Initializes a new instance of Resource. + protected ResourceData() + { + } + + /// Initializes a new instance of Resource. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + protected ResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData) + { + Id = id; + Name = name; + ResourceType = resourceType; + SystemData = systemData; + } + + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + public ResourceIdentifier Id { get; } + /// The name of the resource. + public string Name { get; } + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + public ResourceType ResourceType { get; } + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + public SystemData SystemData { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.Serialization.cs new file mode 100644 index 000000000000..4217b5d7054b --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.Tests.ResourceManager.Resources.Models; + +namespace Azure.Core.Tests.ResourceManager.Resources +{ + public partial class ResourceProviderData : IUtf8JsonSerializable, IModelJsonSerializable + { + public static ResourceProviderData DeserializeResourceProviderData(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional @namespace = default; + Optional registrationState = default; + Optional registrationPolicy = default; + Optional> resourceTypes = default; + Optional providerAuthorizationConsentState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("namespace"u8)) + { + @namespace = property.Value.GetString(); + continue; + } + if (property.NameEquals("registrationState"u8)) + { + registrationState = property.Value.GetString(); + continue; + } + if (property.NameEquals("registrationPolicy"u8)) + { + registrationPolicy = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProviderResourceType.DeserializeProviderResourceType(item, options)); + } + resourceTypes = array; + continue; + } + if (property.NameEquals("providerAuthorizationConsentState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + providerAuthorizationConsentState = new ProviderAuthorizationConsentState(property.Value.GetString()); + continue; + } + } + return new ResourceProviderData(id.Value, @namespace.Value, registrationState.Value, registrationPolicy.Value, Optional.ToList(resourceTypes), Optional.ToNullable(providerAuthorizationConsentState)); + } + + ResourceProviderData IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.Parse(data); + return DeserializeResourceProviderData(doc.RootElement, options); + } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + // only used for public access to internal serialize + public void Serialize(Utf8JsonWriter writer) => ((IUtf8JsonSerializable)this).Write(writer); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + Serialize(writer, options); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Namespace)) + { + writer.WritePropertyName("namespace"u8); + writer.WriteStringValue(Namespace); + } + if (Optional.IsCollectionDefined(ResourceTypes)) + { + writer.WritePropertyName("resourceTypes"u8); + writer.WriteStartArray(); + foreach (var item in ResourceTypes) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RegistrationState)) + { + writer.WritePropertyName("registrationState"u8); + writer.WriteStringValue(RegistrationState); + } + if (Optional.IsDefined(RegistrationPolicy)) + { + writer.WritePropertyName("registrationPolicy"u8); + writer.WriteStringValue(RegistrationPolicy); + } + if (Optional.IsDefined(ProviderAuthorizationConsentState)) + { + writer.WritePropertyName("providerAuthorizationConsentState"u8); + writer.WriteStringValue(ProviderAuthorizationConsentState.ToString()); + } + writer.WriteEndObject(); + } + + private struct ResourceProviderDataProperties + { + public Optional Id { get; set; } + public Optional Namespace { get; set; } + public Optional RegistrationState { get; set; } + public Optional RegistrationPolicy { get; set; } + public Optional> ResourceTypes { get; set; } + public Optional ProviderAuthorizationConsentState { get; set; } + } + + ResourceProviderData IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeResourceProviderData(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.cs new file mode 100644 index 000000000000..edb060d13d6c --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceProviderData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.Tests.ResourceManager.Resources.Models; + +namespace Azure.Core.Tests.ResourceManager.Resources +{ + /// + /// A class representing the ResourceProvider data model. + /// Resource provider information. + /// + public partial class ResourceProviderData + { + public static implicit operator RequestContent(ResourceProviderData resourceProviderData) + { + if (resourceProviderData == null) + { + return null; + } + + return RequestContent.Create(resourceProviderData, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator ResourceProviderData(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + using JsonDocument jsonDocument = JsonDocument.Parse(response.ContentStream); + return DeserializeResourceProviderData(jsonDocument.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + + /// Initializes a new instance of ProviderData. + public ResourceProviderData() + { + ResourceTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of ProviderData. + /// The provider ID. + /// The namespace of the resource provider. + /// The registration state of the resource provider. + /// The registration policy of the resource provider. + /// The collection of provider resource types. + /// The provider authorization consent state. + internal ResourceProviderData(ResourceIdentifier id, string @namespace, string registrationState, string registrationPolicy, IReadOnlyList resourceTypes, ProviderAuthorizationConsentState? providerAuthorizationConsentState) + { + Id = id; + Namespace = @namespace; + RegistrationState = registrationState; + RegistrationPolicy = registrationPolicy; + ResourceTypes = resourceTypes; + ProviderAuthorizationConsentState = providerAuthorizationConsentState; + } + + /// The provider ID. + public ResourceIdentifier Id { get; } + /// The namespace of the resource provider. + public string Namespace { get; } + /// The registration state of the resource provider. + public string RegistrationState { get; } + /// The registration policy of the resource provider. + public string RegistrationPolicy { get; } + /// The collection of provider resource types. + public IReadOnlyList ResourceTypes { get; } + /// The provider authorization consent state. + public ProviderAuthorizationConsentState? ProviderAuthorizationConsentState { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.Serialization.cs new file mode 100644 index 000000000000..2e7c5044e8a8 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ResourceTypeAlias : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ResourceTypeAlias DeserializeResourceTypeAlias(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional> paths = default; + Optional type = default; + Optional defaultPath = default; + Optional defaultPattern = default; + Optional defaultMetadata = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("paths"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceTypeAliasPath.DeserializeResourceTypeAliasPath(item, options)); + } + paths = array; + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString().ToResourceTypeAliasType(); + continue; + } + if (property.NameEquals("defaultPath"u8)) + { + defaultPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultPattern"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultPattern = ResourceTypeAliasPattern.DeserializeResourceTypeAliasPattern(property.Value, options); + continue; + } + if (property.NameEquals("defaultMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultMetadata = ResourceTypeAliasPathMetadata.DeserializeResourceTypeAliasPathMetadata(property.Value, options); + continue; + } + } + return new ResourceTypeAlias(name.Value, Optional.ToList(paths), Optional.ToNullable(type), defaultPath.Value, defaultPattern.Value, defaultMetadata.Value); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Paths)) + { + writer.WritePropertyName("paths"u8); + writer.WriteStartArray(); + foreach (var item in Paths) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AliasType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(AliasType.ToString()); + } + if (Optional.IsDefined(DefaultPath)) + { + writer.WritePropertyName("defaultPath"u8); + writer.WriteStringValue(DefaultPath); + } + if (Optional.IsDefined(DefaultPattern)) + { + writer.WritePropertyName("defaultPattern"u8); + writer.WriteObjectValue(DefaultPattern); + } + if (Optional.IsDefined(DefaultMetadata)) + { + writer.WritePropertyName("defaultMetadata"u8); + writer.WriteObjectValue(DefaultMetadata); + } + writer.WriteEndObject(); + } + + private struct ResourceTypeAliasProperties + { + public Optional Name { get; set; } + public Optional> Paths { get; set; } + public Optional AliasType { get; set; } + public Optional DefaultPath { get; set; } + public Optional DefaultPattern { get; set; } + public Optional DefaultMetadata { get; set; } + } + + ResourceTypeAlias IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeResourceTypeAlias(doc.RootElement, options); + } + + ResourceTypeAlias IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeResourceTypeAlias(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.cs new file mode 100644 index 000000000000..50d7c42be0c7 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAlias.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The alias type. + public partial class ResourceTypeAlias + { + /// Initializes a new instance of ResourceTypeAlias. + internal ResourceTypeAlias() + { + Paths = new ChangeTrackingList(); + } + + /// Initializes a new instance of ResourceTypeAlias. + /// The alias name. + /// The paths for an alias. + /// The type of the alias. + /// The default path for an alias. + /// The default pattern for an alias. + /// The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata. + internal ResourceTypeAlias(string name, IReadOnlyList paths, ResourceTypeAliasType? aliasType, string defaultPath, ResourceTypeAliasPattern defaultPattern, ResourceTypeAliasPathMetadata defaultMetadata) + { + Name = name; + Paths = paths; + AliasType = aliasType; + DefaultPath = defaultPath; + DefaultPattern = defaultPattern; + DefaultMetadata = defaultMetadata; + } + + /// The alias name. + public string Name { get; } + /// The paths for an alias. + public IReadOnlyList Paths { get; } + /// The type of the alias. + public ResourceTypeAliasType? AliasType { get; } + /// The default path for an alias. + public string DefaultPath { get; } + /// The default pattern for an alias. + public ResourceTypeAliasPattern DefaultPattern { get; } + /// The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata. + public ResourceTypeAliasPathMetadata DefaultMetadata { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.Serialization.cs new file mode 100644 index 000000000000..536070ad939b --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ResourceTypeAliasPath : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ResourceTypeAliasPath DeserializeResourceTypeAliasPath(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional path = default; + Optional> apiVersions = default; + Optional pattern = default; + Optional metadata = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + apiVersions = array; + continue; + } + if (property.NameEquals("pattern"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pattern = ResourceTypeAliasPattern.DeserializeResourceTypeAliasPattern(property.Value, options); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadata = ResourceTypeAliasPathMetadata.DeserializeResourceTypeAliasPathMetadata(property.Value, options); + continue; + } + } + return new ResourceTypeAliasPath(path.Value, Optional.ToList(apiVersions), pattern.Value, metadata.Value); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsCollectionDefined(ApiVersions)) + { + writer.WritePropertyName("apiVersions"u8); + writer.WriteStartArray(); + foreach (var item in ApiVersions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Pattern)) + { + writer.WritePropertyName("pattern"u8); + writer.WriteObjectValue(Pattern); + } + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteObjectValue(Metadata); + } + writer.WriteEndObject(); + } + + private struct ResourceTypeAliasPathProperties + { + public Optional Path { get; set; } + public Optional> ApiVersions { get; set; } + public Optional Pattern { get; set; } + public Optional Metadata { get; set; } + } + + ResourceTypeAliasPath IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeResourceTypeAliasPath(doc.RootElement, options); + } + + ResourceTypeAliasPath IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeResourceTypeAliasPath(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.cs new file mode 100644 index 000000000000..7fb205533f33 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPath.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The type of the paths for alias. + public partial class ResourceTypeAliasPath + { + /// Initializes a new instance of ResourceTypeAliasPath. + internal ResourceTypeAliasPath() + { + ApiVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of ResourceTypeAliasPath. + /// The path of an alias. + /// The API versions. + /// The pattern for an alias path. + /// The metadata of the alias path. If missing, fall back to the default metadata of the alias. + internal ResourceTypeAliasPath(string path, IReadOnlyList apiVersions, ResourceTypeAliasPattern pattern, ResourceTypeAliasPathMetadata metadata) + { + Path = path; + ApiVersions = apiVersions; + Pattern = pattern; + Metadata = metadata; + } + + /// The path of an alias. + public string Path { get; } + /// The API versions. + public IReadOnlyList ApiVersions { get; } + /// The pattern for an alias path. + public ResourceTypeAliasPattern Pattern { get; } + /// The metadata of the alias path. If missing, fall back to the default metadata of the alias. + public ResourceTypeAliasPathMetadata Metadata { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathAttributes.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathAttributes.cs new file mode 100644 index 000000000000..f9a82274f61e --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathAttributes.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The attributes of the token that the alias path is referring to. + public readonly partial struct ResourceTypeAliasPathAttributes : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceTypeAliasPathAttributes(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string ModifiableValue = "Modifiable"; + + /// The token that the alias path is referring to has no attributes. + public static ResourceTypeAliasPathAttributes None { get; } = new ResourceTypeAliasPathAttributes(NoneValue); + /// The token that the alias path is referring to is modifiable by policies with 'modify' effect. + public static ResourceTypeAliasPathAttributes Modifiable { get; } = new ResourceTypeAliasPathAttributes(ModifiableValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceTypeAliasPathAttributes left, ResourceTypeAliasPathAttributes right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceTypeAliasPathAttributes left, ResourceTypeAliasPathAttributes right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ResourceTypeAliasPathAttributes(string value) => new ResourceTypeAliasPathAttributes(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceTypeAliasPathAttributes other && Equals(other); + /// + public bool Equals(ResourceTypeAliasPathAttributes other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.Serialization.cs new file mode 100644 index 000000000000..ec4303ae5234 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ResourceTypeAliasPathMetadata : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ResourceTypeAliasPathMetadata DeserializeResourceTypeAliasPathMetadata(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional type = default; + Optional attributes = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ResourceTypeAliasPathTokenType(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + attributes = new ResourceTypeAliasPathAttributes(property.Value.GetString()); + continue; + } + } + return new ResourceTypeAliasPathMetadata(Optional.ToNullable(type), Optional.ToNullable(attributes)); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TokenType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TokenType.ToString()); + } + if (Optional.IsDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStringValue(Attributes.ToString()); + } + writer.WriteEndObject(); + } + + private struct ResourceTypeAliasPathMetadataProperties + { + public Optional TokenType { get; set; } + public Optional Attributes { get; set; } + } + + ResourceTypeAliasPathMetadata IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeResourceTypeAliasPathMetadata(doc.RootElement, options); + } + + private static void SetProperty(ReadOnlySpan propertyName, ref ResourceTypeAliasPathMetadataProperties properties, ref Utf8JsonReader reader, ModelSerializerOptions options) + { + if (propertyName.SequenceEqual("type"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.TokenType = new ResourceTypeAliasPathTokenType(reader.GetString()); + return; + } + if (propertyName.SequenceEqual("attributes"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Attributes = new ResourceTypeAliasPathAttributes(reader.GetString()); + return; + } + reader.Skip(); + } + + ResourceTypeAliasPathMetadata IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeResourceTypeAliasPathMetadata(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.cs new file mode 100644 index 000000000000..7b965b6ce2b9 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathMetadata.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The ResourceTypeAliasPathMetadata. + public partial class ResourceTypeAliasPathMetadata + { + /// Initializes a new instance of ResourceTypeAliasPathMetadata. + internal ResourceTypeAliasPathMetadata() + { + } + + /// Initializes a new instance of ResourceTypeAliasPathMetadata. + /// The type of the token that the alias path is referring to. + /// The attributes of the token that the alias path is referring to. + internal ResourceTypeAliasPathMetadata(ResourceTypeAliasPathTokenType? tokenType, ResourceTypeAliasPathAttributes? attributes) + { + TokenType = tokenType; + Attributes = attributes; + } + + /// The type of the token that the alias path is referring to. + public ResourceTypeAliasPathTokenType? TokenType { get; } + /// The attributes of the token that the alias path is referring to. + public ResourceTypeAliasPathAttributes? Attributes { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathTokenType.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathTokenType.cs new file mode 100644 index 000000000000..8b26cdb95a68 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPathTokenType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The type of the token that the alias path is referring to. + public readonly partial struct ResourceTypeAliasPathTokenType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceTypeAliasPathTokenType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSpecifiedValue = "NotSpecified"; + private const string AnyValue = "Any"; + private const string StringValue = "String"; + private const string ObjectValue = "Object"; + private const string ArrayValue = "Array"; + private const string IntegerValue = "Integer"; + private const string NumberValue = "Number"; + private const string BooleanValue = "Boolean"; + + /// The token type is not specified. + public static ResourceTypeAliasPathTokenType NotSpecified { get; } = new ResourceTypeAliasPathTokenType(NotSpecifiedValue); + /// The token type can be anything. + public static ResourceTypeAliasPathTokenType Any { get; } = new ResourceTypeAliasPathTokenType(AnyValue); + /// The token type is string. + public static ResourceTypeAliasPathTokenType String { get; } = new ResourceTypeAliasPathTokenType(StringValue); + /// The token type is object. + public static ResourceTypeAliasPathTokenType Object { get; } = new ResourceTypeAliasPathTokenType(ObjectValue); + /// The token type is array. + public static ResourceTypeAliasPathTokenType Array { get; } = new ResourceTypeAliasPathTokenType(ArrayValue); + /// The token type is integer. + public static ResourceTypeAliasPathTokenType Integer { get; } = new ResourceTypeAliasPathTokenType(IntegerValue); + /// The token type is number. + public static ResourceTypeAliasPathTokenType Number { get; } = new ResourceTypeAliasPathTokenType(NumberValue); + /// The token type is boolean. + public static ResourceTypeAliasPathTokenType Boolean { get; } = new ResourceTypeAliasPathTokenType(BooleanValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceTypeAliasPathTokenType left, ResourceTypeAliasPathTokenType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceTypeAliasPathTokenType left, ResourceTypeAliasPathTokenType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ResourceTypeAliasPathTokenType(string value) => new ResourceTypeAliasPathTokenType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceTypeAliasPathTokenType other && Equals(other); + /// + public bool Equals(ResourceTypeAliasPathTokenType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.Serialization.cs new file mode 100644 index 000000000000..0043395ac214 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ResourceTypeAliasPattern : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ResourceTypeAliasPattern DeserializeResourceTypeAliasPattern(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional phrase = default; + Optional variable = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("phrase"u8)) + { + phrase = property.Value.GetString(); + continue; + } + if (property.NameEquals("variable"u8)) + { + variable = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString().ToResourceTypeAliasPatternType(); + continue; + } + } + return new ResourceTypeAliasPattern(phrase.Value, variable.Value, Optional.ToNullable(type)); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Phrase)) + { + writer.WritePropertyName("phrase"u8); + writer.WriteStringValue(Phrase); + } + if (Optional.IsDefined(Variable)) + { + writer.WritePropertyName("variable"u8); + writer.WriteStringValue(Variable); + } + if (Optional.IsDefined(PatternType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PatternType.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + private struct ResourceTypeAliasPatternProperites + { + public Optional Phrase { get; set; } + public Optional Variable { get; set; } + public Optional PatternType { get; set; } + } + + ResourceTypeAliasPattern IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeResourceTypeAliasPattern(doc.RootElement, options); + } + + private static void SetProperty(ReadOnlySpan propertyName, ref ResourceTypeAliasPatternProperites properties, ref Utf8JsonReader reader, ModelSerializerOptions options) + { + if (propertyName.SequenceEqual("phrase"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Phrase = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("variable"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Variable = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("type"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.PatternType = reader.GetString().ToResourceTypeAliasPatternType(); + return; + } + reader.Skip(); + } + + ResourceTypeAliasPattern IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeResourceTypeAliasPattern(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.cs new file mode 100644 index 000000000000..5e0c3d71cf69 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPattern.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The type of the pattern for an alias path. + public partial class ResourceTypeAliasPattern + { + /// Initializes a new instance of ResourceTypeAliasPattern. + internal ResourceTypeAliasPattern() + { + } + + /// Initializes a new instance of ResourceTypeAliasPattern. + /// The alias pattern phrase. + /// The alias pattern variable. + /// The type of alias pattern. + internal ResourceTypeAliasPattern(string phrase, string variable, ResourceTypeAliasPatternType? patternType) + { + Phrase = phrase; + Variable = variable; + PatternType = patternType; + } + + /// The alias pattern phrase. + public string Phrase { get; } + /// The alias pattern variable. + public string Variable { get; } + /// The type of alias pattern. + public ResourceTypeAliasPatternType? PatternType { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.Serialization.cs new file mode 100644 index 000000000000..b6993ddc0de8 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + internal static partial class ResourceTypeAliasPatternTypeExtensions + { + public static string ToSerialString(this ResourceTypeAliasPatternType value) => value switch + { + ResourceTypeAliasPatternType.NotSpecified => "NotSpecified", + ResourceTypeAliasPatternType.Extract => "Extract", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceTypeAliasPatternType value.") + }; + + public static ResourceTypeAliasPatternType ToResourceTypeAliasPatternType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "NotSpecified")) return ResourceTypeAliasPatternType.NotSpecified; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Extract")) return ResourceTypeAliasPatternType.Extract; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceTypeAliasPatternType value."); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.cs new file mode 100644 index 000000000000..d54d8e5afe88 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasPatternType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The type of alias pattern. + public enum ResourceTypeAliasPatternType + { + /// NotSpecified is not allowed. + NotSpecified, + /// Extract is the only allowed value. + Extract + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.Serialization.cs new file mode 100644 index 000000000000..39d50246fe50 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + internal static partial class ResourceTypeAliasTypeExtensions + { + public static string ToSerialString(this ResourceTypeAliasType value) => value switch + { + ResourceTypeAliasType.NotSpecified => "NotSpecified", + ResourceTypeAliasType.PlainText => "PlainText", + ResourceTypeAliasType.Mask => "Mask", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceTypeAliasType value.") + }; + + public static ResourceTypeAliasType ToResourceTypeAliasType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "NotSpecified")) return ResourceTypeAliasType.NotSpecified; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "PlainText")) return ResourceTypeAliasType.PlainText; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Mask")) return ResourceTypeAliasType.Mask; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceTypeAliasType value."); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.cs new file mode 100644 index 000000000000..c3fc8585f237 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ResourceTypeAliasType.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The type of the alias. + public enum ResourceTypeAliasType + { + /// Alias type is unknown (same as not providing alias type). + NotSpecified, + /// Alias value is not secret. + PlainText, + /// Alias value is secret. + Mask + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.Serialization.cs new file mode 100644 index 000000000000..0acf92d0db1d --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.Serialization.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Models +{ + [JsonConverter(typeof(SystemDataConverter))] + public partial class SystemData : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static SystemData DeserializeSystemData(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional createdBy = default; + Optional createdByType = default; + Optional createdAt = default; + Optional lastModifiedBy = default; + Optional lastModifiedByType = default; + Optional lastModifiedAt = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdBy"u8)) + { + createdBy = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdByType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByType = new CreatedByType(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedBy"u8)) + { + lastModifiedBy = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModifiedByType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedByType = new CreatedByType(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastModifiedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new SystemData(createdBy.Value, Optional.ToNullable(createdByType), Optional.ToNullable(createdAt), lastModifiedBy.Value, Optional.ToNullable(lastModifiedByType), Optional.ToNullable(lastModifiedAt)); + } + + private struct SystemDataProperties + { + public Optional CreatedBy { get; set; } + public Optional CreatedByType { get; set; } + public Optional CreatedOn { get; set; } + public Optional LastModifiedBy { get; set; } + public Optional LastModifiedByType { get; set; } + public Optional LastModifiedOn { get; set; } + } + + SystemData IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeSystemData(doc.RootElement, options); + } + + private static void SetProperty(ReadOnlySpan propertyName, ref SystemDataProperties properties, ref Utf8JsonReader reader, ModelSerializerOptions options) + { + if (propertyName.SequenceEqual("createdBy"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.CreatedBy = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("createdByType"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.CreatedByType = new CreatedByType(reader.GetString()); + return; + } + if (propertyName.SequenceEqual("createdAt"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.CreatedOn = DateTimeOffset.Parse(reader.GetString(), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal); + return; + } + if (propertyName.SequenceEqual("lastModifiedBy"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.LastModifiedBy = reader.GetString(); + return; + } + if (propertyName.SequenceEqual("lastModifiedByType"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.LastModifiedByType = new CreatedByType(reader.GetString()); + return; + } + if (propertyName.SequenceEqual("lastModifiedAt"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.LastModifiedOn = DateTimeOffset.Parse(reader.GetString(), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal); + return; + } + reader.Skip(); + } + + SystemData IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeSystemData(doc.RootElement, options); + } + + internal partial class SystemDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, SystemData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override SystemData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeSystemData(document.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.cs new file mode 100644 index 000000000000..7df008ba04fe --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/SystemData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Core.Tests.ResourceManager.Models +{ + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + /// Initializes a new instance of SystemData. + public SystemData() + { + } + + /// Initializes a new instance of SystemData. + /// The identity that created the resource. + /// The type of identity that created the resource. + /// The timestamp of resource creation (UTC). + /// The identity that last modified the resource. + /// The type of identity that last modified the resource. + /// The timestamp of resource last modification (UTC). + internal SystemData(string createdBy, CreatedByType? createdByType, DateTimeOffset? createdOn, string lastModifiedBy, CreatedByType? lastModifiedByType, DateTimeOffset? lastModifiedOn) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedOn = createdOn; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedOn = lastModifiedOn; + } + + /// The identity that created the resource. + public string CreatedBy { get; } + /// The type of identity that created the resource. + public CreatedByType? CreatedByType { get; } + /// The timestamp of resource creation (UTC). + public DateTimeOffset? CreatedOn { get; } + /// The identity that last modified the resource. + public string LastModifiedBy { get; } + /// The type of identity that last modified the resource. + public CreatedByType? LastModifiedByType { get; } + /// The timestamp of resource last modification (UTC). + public DateTimeOffset? LastModifiedOn { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/TrackedResourceData.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/TrackedResourceData.cs new file mode 100644 index 000000000000..73899a3ea3f7 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/TrackedResourceData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Core.Tests.ResourceManager.Models +{ + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + public abstract partial class TrackedResourceData : ResourceData + { + internal TrackedResourceData() { } + + /// Initializes a new instance of TrackedResource. + /// The geo-location where the resource lives. + protected TrackedResourceData(AzureLocation location) + { + Tags = new ChangeTrackingDictionary(); + Location = location; + } + + /// Initializes a new instance of TrackedResource. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource tags. + /// The geo-location where the resource lives. + protected TrackedResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location) : base(id, name, resourceType, systemData) + { + Tags = tags; + Location = location; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The geo-location where the resource lives. + public AzureLocation Location { get; set; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.Serialization.cs new file mode 100644 index 000000000000..ac104b6d0050 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// + /// A class representing a sub-resource that contains only the ID. + /// + [JsonConverter(typeof(WritableSubResourceConverter))] + public partial class WritableSubResource : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + /// + /// Serialize the input WritableSubResource object. + /// + /// Input Json writer. + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + if (writer is null) + { + throw new ArgumentNullException(nameof(writer)); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + writer.WriteEndObject(); + } + + /// + /// Deserialize the input JSON element to a WritableSubResource object. + /// + /// The JSON element to be deserialized. + /// Deserialized WritableSubResource object. + internal static WritableSubResource DeserializeWritableSubResource(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + ResourceIdentifier id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + } + return new WritableSubResource(id); + } + + private struct WritableSubResourceProperties + { + public ResourceIdentifier Id { get; set; } + } + + WritableSubResource IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeWritableSubResource(doc.RootElement, options); + } + + private static void SetProperty(ReadOnlySpan propertyName, ref WritableSubResourceProperties properties, ref Utf8JsonReader reader, ModelSerializerOptions options) + { + if (propertyName.SequenceEqual("id"u8)) + { + reader.Read(); + if (reader.TokenType != JsonTokenType.Null) + properties.Id = new ResourceIdentifier(reader.GetString()); + return; + } + reader.Skip(); + } + + WritableSubResource IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeWritableSubResource(doc.RootElement, options); + } + + internal partial class WritableSubResourceConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WritableSubResource model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WritableSubResource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWritableSubResource(document.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.cs new file mode 100644 index 000000000000..2267f1e23685 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/WritableSubResource.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// + /// A class representing a sub-resource that contains only the ID. + /// + public partial class WritableSubResource + { + /// + /// Initializes an empty instance of for mocking. + /// + public WritableSubResource() + { + } + + /// Initializes a new instance of . + /// ARM resource Id. + protected internal WritableSubResource(ResourceIdentifier id) + { + Id = id; + } + + /// + /// Gets or sets the ARM resource identifier. + /// + /// + public ResourceIdentifier Id { get; set; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.Serialization.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.Serialization.cs new file mode 100644 index 000000000000..2eb8fe97b0b1 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + public partial class ZoneMapping : IUtf8JsonSerializable, IModelJsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static ZoneMapping DeserializeZoneMapping(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional location = default; + Optional> zones = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + continue; + } + } + return new ZoneMapping(Optional.ToNullable(location), Optional.ToList(zones)); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value.DisplayName); + } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + private struct ZoneMappingProperties + { + public Optional Location { get; set; } + public Optional> Zones { get; set; } + } + + ZoneMapping IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeZoneMapping(doc.RootElement, options); + } + + ZoneMapping IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var doc = JsonDocument.Parse(data); + return DeserializeZoneMapping(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.cs b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.cs new file mode 100644 index 000000000000..40f58aaf7f9f --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/ModelSerializationTests/ServiceModels/ZoneMapping.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Core.Tests.ResourceManager.Resources.Models +{ + /// The ZoneMapping. + public partial class ZoneMapping + { + /// Initializes a new instance of ZoneMapping. + internal ZoneMapping() + { + Zones = new ChangeTrackingList(); + } + + /// Initializes a new instance of ZoneMapping. + /// The location of the zone mapping. + /// + internal ZoneMapping(AzureLocation? location, IReadOnlyList zones) + { + Location = location; + Zones = zones; + } + + /// The location of the zone mapping. + public AzureLocation? Location { get; } + /// Gets the zones. + public IReadOnlyList Zones { get; } + } +} diff --git a/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetData.json b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetData.json new file mode 100644 index 000000000000..0081d88bbfbe --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetData.json @@ -0,0 +1,16 @@ +{ + "name": "testAS-3375", + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375", + "type": "Microsoft.Compute/availabilitySets", + "location": "eastus", + "tags": { + "key": "value" + }, + "properties": { + "platformUpdateDomainCount": 5, + "platformFaultDomainCount": 3 + }, + "sku": { + "name": "Classic" + } +} diff --git a/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWireFormat.json b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWireFormat.json new file mode 100644 index 000000000000..fc1edd16647e --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWireFormat.json @@ -0,0 +1,18 @@ +{ + "name": "testAS-3375", + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375", + "type": "Microsoft.Compute/availabilitySets", + "location": "eastus", + "tags": { + "key": "value" + }, + "properties": { + "platformUpdateDomainCount": 5, + "platformFaultDomainCount": 3 + }, + "sku": { + "name": "Classic" + }, + "extraSku": "extraSku", + "extraRoot": "extraRoot" +} diff --git a/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMs.json b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMs.json new file mode 100644 index 000000000000..173cb7ae02fe --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMs.json @@ -0,0 +1,24 @@ +{ + "name": "testAS-3375", + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375", + "type": "Microsoft.Compute/availabilitySets", + "location": "eastus", + "tags": { + "key": "value" + }, + "properties": { + "platformUpdateDomainCount": 5, + "platformFaultDomainCount": 3, + "virtualMachines": [ + { + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS1" + }, + { + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS2" + } + ] + }, + "sku": { + "name": "Classic" + } +} diff --git a/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMsWireFormat.json b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMsWireFormat.json new file mode 100644 index 000000000000..173cb7ae02fe --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/AvailabilitySetData/AvailabilitySetDataWithVMsWireFormat.json @@ -0,0 +1,24 @@ +{ + "name": "testAS-3375", + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375", + "type": "Microsoft.Compute/availabilitySets", + "location": "eastus", + "tags": { + "key": "value" + }, + "properties": { + "platformUpdateDomainCount": 5, + "platformFaultDomainCount": 3, + "virtualMachines": [ + { + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS1" + }, + { + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS2" + } + ] + }, + "sku": { + "name": "Classic" + } +} diff --git a/sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelX.json b/sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelX.json new file mode 100644 index 000000000000..308a552bea92 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelX.json @@ -0,0 +1,13 @@ +{ + "kind": "X", + "name": "xmodel", + "xProperty": 100, + "fields": [ + "testField" + ], + "nullProperty": null, + "keyValuePairs": { + "color": "red" + }, + "extra": "stuff" +} diff --git a/sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelXWireFormat.json b/sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelXWireFormat.json new file mode 100644 index 000000000000..3c8f056c3eca --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/ModelX/ModelXWireFormat.json @@ -0,0 +1,13 @@ +{ + "kind": "X", + "name": "xmodel", + "xProperty": 100, + "fields": [ + "testField" + ], + "nullProperty": null, + "keyValuePairs": { + "color": "red" + }, + "extra": "stuff" +} diff --git a/sdk/core/Azure.Core/tests/common/TestData/ModelXml.xml b/sdk/core/Azure.Core/tests/common/TestData/ModelXml.xml new file mode 100644 index 000000000000..2d6c52e2cc82 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/ModelXml.xml @@ -0,0 +1,9 @@ + + Color + Red + ReadOnly + + ChildRed + ChildReadOnly + + diff --git a/sdk/core/Azure.Core/tests/common/TestData/ModelXmlX.xml b/sdk/core/Azure.Core/tests/common/TestData/ModelXmlX.xml new file mode 100644 index 000000000000..a6c7329e21d8 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/ModelXmlX.xml @@ -0,0 +1,9 @@ + + Color + Red + ReadOnly + + ChildRed + ChildReadOnly + + diff --git a/sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData-Collapsed.json b/sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData-Collapsed.json new file mode 100644 index 000000000000..174ff6cdbe4d --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData-Collapsed.json @@ -0,0 +1 @@ +{"id":"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/providers/Microsoft.Network","namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"virtualNetworks/taggedTrafficConsumers","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"None"},{"resourceType":"natGateways","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01"],"defaultApiVersion":"2020-03-01","zoneMappings":[{"location":"Australia East","zones":["2","1","3"]},{"location":"Brazil South","zones":["2","1","3"]},{"location":"Canada Central","zones":["2","1","3"]},{"location":"Central India","zones":["2","1","3"]},{"location":"Central US","zones":["2","1","3"]},{"location":"Central US EUAP","zones":["1","2"]},{"location":"East Asia","zones":["2","1","3"]},{"location":"East US","zones":["2","1","3"]},{"location":"East US 2","zones":["2","1","3"]},{"location":"East US 2 EUAP","zones":["2","1","3"]},{"location":"France Central","zones":["2","1","3"]},{"location":"Germany West Central","zones":["2","1","3"]},{"location":"Japan East","zones":["2","1","3"]},{"location":"Korea Central","zones":["2","1","3"]},{"location":"North Central US","zones":[]},{"location":"North Europe","zones":["2","1","3"]},{"location":"Norway East","zones":["2","1","3"]},{"location":"Qatar Central","zones":["2","1","3"]},{"location":"South Africa North","zones":["2","1","3"]},{"location":"South Central US","zones":["2","1","3"]},{"location":"Southeast Asia","zones":["2","1","3"]},{"location":"Sweden Central","zones":["2","1","3"]},{"location":"Switzerland North","zones":["2","1","3"]},{"location":"UAE North","zones":["2","1","3"]},{"location":"UK South","zones":["2","1","3"]},{"location":"West Europe","zones":["2","1","3"]},{"location":"West US","zones":[]},{"location":"West US 2","zones":["2","1","3"]},{"location":"West US 3","zones":["2","1","3"]},{"location":"Poland Central","zones":["2","1","3"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"publicIPAddresses","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"zoneMappings":[{"location":"Australia East","zones":["2","1","3"]},{"location":"Brazil South","zones":["2","1","3"]},{"location":"Canada Central","zones":["2","1","3"]},{"location":"Central India","zones":["2","1","3"]},{"location":"Central US","zones":["2","1","3"]},{"location":"Central US EUAP","zones":["1","2"]},{"location":"East Asia","zones":["2","1","3"]},{"location":"East US","zones":["2","1","3"]},{"location":"East US 2","zones":["2","1","3"]},{"location":"East US 2 EUAP","zones":["2","1","3"]},{"location":"France Central","zones":["2","1","3"]},{"location":"Germany West Central","zones":["2","1","3"]},{"location":"Japan East","zones":["2","1","3"]},{"location":"Korea Central","zones":["2","1","3"]},{"location":"North Central US","zones":[]},{"location":"North Europe","zones":["2","1","3"]},{"location":"Norway East","zones":["2","1","3"]},{"location":"Qatar Central","zones":["2","1","3"]},{"location":"South Africa North","zones":["2","1","3"]},{"location":"South Central US","zones":["2","1","3"]},{"location":"Southeast Asia","zones":["2","1","3"]},{"location":"Sweden Central","zones":["2","1","3"]},{"location":"Switzerland North","zones":["2","1","3"]},{"location":"UAE North","zones":["2","1","3"]},{"location":"UK South","zones":["2","1","3"]},{"location":"West Europe","zones":["2","1","3"]},{"location":"West US","zones":[]},{"location":"West US 2","zones":["2","1","3"]},{"location":"West US 3","zones":["2","1","3"]},{"location":"Poland Central","zones":["2","1","3"]}],"locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"internalPublicIpAddresses","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01"],"capabilities":"None"},{"resourceType":"customIpPrefixes","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01"],"defaultApiVersion":"2020-06-01","zoneMappings":[{"location":"Australia East","zones":["2","1","3"]},{"location":"Brazil South","zones":["2","1","3"]},{"location":"Canada Central","zones":["2","1","3"]},{"location":"Central India","zones":["2","1","3"]},{"location":"Central US","zones":["2","1","3"]},{"location":"Central US EUAP","zones":["1","2"]},{"location":"East Asia","zones":["2","1","3"]},{"location":"East US","zones":["2","1","3"]},{"location":"East US 2","zones":["2","1","3"]},{"location":"East US 2 EUAP","zones":["2","1","3"]},{"location":"France Central","zones":["2","1","3"]},{"location":"Germany West Central","zones":["2","1","3"]},{"location":"Japan East","zones":["2","1","3"]},{"location":"Korea Central","zones":["2","1","3"]},{"location":"North Central US","zones":[]},{"location":"North Europe","zones":["2","1","3"]},{"location":"Norway East","zones":["2","1","3"]},{"location":"Qatar Central","zones":["2","1","3"]},{"location":"South Africa North","zones":["2","1","3"]},{"location":"South Central US","zones":["2","1","3"]},{"location":"Southeast Asia","zones":["2","1","3"]},{"location":"Sweden Central","zones":["2","1","3"]},{"location":"Switzerland North","zones":["2","1","3"]},{"location":"UAE North","zones":["2","1","3"]},{"location":"UK South","zones":["2","1","3"]},{"location":"West Europe","zones":["2","1","3"]},{"location":"West US","zones":[]},{"location":"West US 2","zones":["2","1","3"]},{"location":"West US 3","zones":["2","1","3"]},{"location":"Poland Central","zones":["2","1","3"]}],"locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkInterfaces","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"dscpConfigurations","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01"],"defaultApiVersion":"2020-06-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"privateEndpoints","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01"],"defaultApiVersion":"2020-03-01","locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"privateEndpoints/privateLinkServiceProxies","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01"],"defaultApiVersion":"2020-03-01","capabilities":"None"},{"resourceType":"privateEndpointRedirectMaps","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"loadBalancers","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkSecurityGroups","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"applicationSecurityGroups","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2017-09-01"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"serviceEndpointPolicies","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkIntentPolicies","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"routeTables","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"publicIPPrefixes","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01"],"defaultApiVersion":"2020-03-01","zoneMappings":[{"location":"Australia East","zones":["2","1","3"]},{"location":"Brazil South","zones":["2","1","3"]},{"location":"Canada Central","zones":["2","1","3"]},{"location":"Central India","zones":["2","1","3"]},{"location":"Central US","zones":["2","1","3"]},{"location":"Central US EUAP","zones":["1","2"]},{"location":"East Asia","zones":["2","1","3"]},{"location":"East US","zones":["2","1","3"]},{"location":"East US 2","zones":["2","1","3"]},{"location":"East US 2 EUAP","zones":["2","1","3"]},{"location":"France Central","zones":["2","1","3"]},{"location":"Germany West Central","zones":["2","1","3"]},{"location":"Japan East","zones":["2","1","3"]},{"location":"Korea Central","zones":["2","1","3"]},{"location":"North Central US","zones":[]},{"location":"North Europe","zones":["2","1","3"]},{"location":"Norway East","zones":["2","1","3"]},{"location":"Qatar Central","zones":["2","1","3"]},{"location":"South Africa North","zones":["2","1","3"]},{"location":"South Central US","zones":["2","1","3"]},{"location":"Southeast Asia","zones":["2","1","3"]},{"location":"Sweden Central","zones":["2","1","3"]},{"location":"Switzerland North","zones":["2","1","3"]},{"location":"UAE North","zones":["2","1","3"]},{"location":"UK South","zones":["2","1","3"]},{"location":"West Europe","zones":["2","1","3"]},{"location":"West US","zones":[]},{"location":"West US 2","zones":["2","1","3"]},{"location":"West US 3","zones":["2","1","3"]},{"location":"Poland Central","zones":["2","1","3"]}],"locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkWatchers","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkWatchers/connectionMonitors","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkWatchers/flowLogs","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkWatchers/pingMeshes","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"virtualNetworkGateways","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-03-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"localNetworkGateways","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-03-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"connections","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-03-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"applicationGateways","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","zoneMappings":[{"location":"Australia East","zones":["2","1","3"]},{"location":"Brazil South","zones":["2","1","3"]},{"location":"Canada Central","zones":["2","1","3"]},{"location":"Central India","zones":["2","1","3"]},{"location":"Central US","zones":["2","1","3"]},{"location":"Central US EUAP","zones":["1","2"]},{"location":"East Asia","zones":["2","1","3"]},{"location":"East US","zones":["2","1","3"]},{"location":"East US 2","zones":["2","1","3"]},{"location":"East US 2 EUAP","zones":["2","1","3"]},{"location":"France Central","zones":["2","1","3"]},{"location":"Germany West Central","zones":["2","1","3"]},{"location":"Japan East","zones":["2","1","3"]},{"location":"Korea Central","zones":["2","1","3"]},{"location":"North Central US","zones":[]},{"location":"North Europe","zones":["2","1","3"]},{"location":"Norway East","zones":["2","1","3"]},{"location":"Qatar Central","zones":["2","1","3"]},{"location":"South Africa North","zones":["2","1","3"]},{"location":"South Central US","zones":["2","1","3"]},{"location":"Southeast Asia","zones":["2","1","3"]},{"location":"Sweden Central","zones":["2","1","3"]},{"location":"Switzerland North","zones":["2","1","3"]},{"location":"UAE North","zones":["2","1","3"]},{"location":"UK South","zones":["2","1","3"]},{"location":"West Europe","zones":["2","1","3"]},{"location":"West US","zones":[]},{"location":"West US 2","zones":["2","1","3"]},{"location":"West US 3","zones":["2","1","3"]},{"location":"Poland Central","zones":["2","1","3"]}],"capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"applicationGatewayWebApplicationFirewallPolicies","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"locations","locations":[],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"None"},{"resourceType":"locations/operations","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"None"},{"resourceType":"locations/operationResults","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"None"},{"resourceType":"locations/CheckDnsNameAvailability","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"capabilities":"None"},{"resourceType":"locations/setLoadBalancerFrontendPublicIpAddresses","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01"],"capabilities":"None"},{"resourceType":"cloudServiceSlots","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01"],"capabilities":"SupportsExtension"},{"resourceType":"locations/usages","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2015-06-15"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2017-10-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2017-10-01"}],"capabilities":"None"},{"resourceType":"locations/virtualNetworkAvailableEndpointServices","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01"],"capabilities":"None"},{"resourceType":"locations/availableDelegations","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"capabilities":"None"},{"resourceType":"locations/ApplicationGatewayWafDynamicManifests","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01"],"capabilities":"None"},{"resourceType":"locations/serviceTags","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01"],"capabilities":"None"},{"resourceType":"locations/availablePrivateEndpointTypes","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01"],"capabilities":"None"},{"resourceType":"locations/availableServiceAliases","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01"],"capabilities":"None"},{"resourceType":"locations/checkPrivateLinkServiceVisibility","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01"],"capabilities":"None"},{"resourceType":"locations/autoApprovedPrivateLinkServices","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01"],"capabilities":"None"},{"resourceType":"locations/batchValidatePrivateEndpointsForResourceMove","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01"],"capabilities":"None"},{"resourceType":"locations/batchNotifyPrivateEndpointsForResourceMove","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01"],"capabilities":"None"},{"resourceType":"locations/supportedVirtualMachineSizes","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"capabilities":"None"},{"resourceType":"locations/setAzureNetworkManagerConfiguration","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01"],"capabilities":"None"},{"resourceType":"locations/publishResources","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01"],"capabilities":"None"},{"resourceType":"locations/getAzureNetworkManagerConfiguration","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01"],"capabilities":"None"},{"resourceType":"locations/checkAcceleratedNetworkingSupport","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"capabilities":"None"},{"resourceType":"locations/validateResourceOwnership","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"capabilities":"None"},{"resourceType":"locations/setResourceOwnership","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"capabilities":"None"},{"resourceType":"locations/effectiveResourceOwnership","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"capabilities":"None"},{"resourceType":"operations","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"capabilities":"None"},{"resourceType":"dnszones","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2016-04-01"},{"profileVersion":"2018-03-01-hybrid","apiVersion":"2016-04-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-04-01"}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"dnsOperationResults","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnsOperationStatuses","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"getDnsResourceReference","locations":["global"],"apiVersions":["2018-05-01"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"internalNotify","locations":["global"],"apiVersions":["2018-05-01"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/A","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/AAAA","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/CNAME","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/PTR","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/MX","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/TXT","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/SRV","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/SOA","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/NS","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/CAA","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/recordsets","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"dnszones/all","locations":["global"],"apiVersions":["2018-05-01","2018-03-01-preview","2017-10-01","2017-09-15-preview","2017-09-01","2016-04-01","2015-05-04-preview"],"defaultApiVersion":"2018-05-01","capabilities":"None"},{"resourceType":"privateDnsZones","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"privateDnsZones/virtualNetworkLinks","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"privateDnsOperationResults","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsOperationStatuses","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZonesInternal","locations":["global"],"apiVersions":["2020-06-01","2020-01-01"],"defaultApiVersion":"2020-01-01","capabilities":"None"},{"resourceType":"privateDnsZones/A","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/AAAA","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/CNAME","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/PTR","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/MX","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/TXT","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/SRV","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/SOA","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"privateDnsZones/all","locations":["global"],"apiVersions":["2020-06-01","2020-01-01","2018-09-01"],"defaultApiVersion":"2018-09-01","capabilities":"None"},{"resourceType":"virtualNetworks/privateDnsZoneLinks","locations":["global"],"apiVersions":["2020-06-01"],"defaultApiVersion":"2020-06-01","capabilities":"None"},{"resourceType":"dnsResolvers","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"dnsResolvers/inboundEndpoints","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"dnsResolvers/outboundEndpoints","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"dnsForwardingRulesets","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"dnsForwardingRulesets/forwardingRules","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"None"},{"resourceType":"dnsForwardingRulesets/virtualNetworkLinks","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"None"},{"resourceType":"virtualNetworks/listDnsResolvers","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"None"},{"resourceType":"virtualNetworks/listDnsForwardingRulesets","locations":["West Central US","East US 2","West Europe","North Europe","Australia East","UK South","South Central US","East US","North Central US","West US 2","West US 3","Southeast Asia","Central India","Canada Central","Central US","France Central","Japan East","Germany West Central","South Africa North","Korea Central","Sweden Central","East Asia","Switzerland North","Brazil South","West US","Norway East","UAE North","Australia Southeast","Canada East","Japan West","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"None"},{"resourceType":"locations/dnsResolverOperationResults","locations":[],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"None"},{"resourceType":"locations/dnsResolverOperationStatuses","locations":[],"apiVersions":["2022-07-01","2020-04-01-preview"],"defaultApiVersion":"2020-04-01-preview","capabilities":"None"},{"resourceType":"trafficmanagerprofiles","locations":["global"],"apiVersions":["2022-12-01-preview","2022-04-01-preview","2018-08-01","2018-04-01","2018-03-01","2018-02-01","2017-05-01","2017-03-01","2015-11-01","2015-04-28-preview"],"defaultApiVersion":"2018-08-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"trafficmanagerprofiles/heatMaps","locations":["global"],"apiVersions":["2022-04-01-preview","2018-08-01","2018-04-01","2018-03-01","2018-02-01","2017-09-01-preview"],"defaultApiVersion":"2018-08-01","capabilities":"None"},{"resourceType":"trafficmanagerprofiles/azureendpoints","locations":["global"],"apiVersions":["2022-12-01-preview","2022-04-01-preview","2018-08-01","2018-04-01","2018-03-01","2018-02-01","2017-05-01","2017-03-01","2015-11-01","2015-04-28-preview"],"defaultApiVersion":"2018-08-01","capabilities":"None"},{"resourceType":"trafficmanagerprofiles/externalendpoints","locations":["global"],"apiVersions":["2022-12-01-preview","2022-04-01-preview","2018-08-01","2018-04-01","2018-03-01","2018-02-01","2017-05-01","2017-03-01","2015-11-01","2015-04-28-preview"],"defaultApiVersion":"2018-08-01","capabilities":"None"},{"resourceType":"trafficmanagerprofiles/nestedendpoints","locations":["global"],"apiVersions":["2022-12-01-preview","2022-04-01-preview","2018-08-01","2018-04-01","2018-03-01","2018-02-01","2017-05-01","2017-03-01","2015-11-01","2015-04-28-preview"],"defaultApiVersion":"2018-08-01","capabilities":"None"},{"resourceType":"checkTrafficManagerNameAvailability","locations":["global"],"apiVersions":["2022-12-01-preview","2022-04-01-preview","2018-08-01","2018-04-01","2018-03-01","2018-02-01","2017-05-01","2017-03-01","2015-11-01","2015-04-28-preview"],"defaultApiVersion":"2018-08-01","capabilities":"None"},{"resourceType":"checkTrafficManagerNameAvailabilityV2","locations":["global"],"apiVersions":["2022-12-01-preview"],"defaultApiVersion":"2022-12-01-preview","capabilities":"None"},{"resourceType":"trafficManagerUserMetricsKeys","locations":["global"],"apiVersions":["2022-04-01-preview","2018-08-01","2018-04-01","2017-09-01-preview"],"defaultApiVersion":"2018-08-01","capabilities":"None"},{"resourceType":"trafficManagerGeographicHierarchies","locations":["global"],"apiVersions":["2022-12-01-preview","2022-04-01-preview","2018-08-01","2018-04-01","2018-03-01","2018-02-01","2017-05-01","2017-03-01"],"defaultApiVersion":"2018-08-01","capabilities":"None"},{"resourceType":"expressRouteCircuits","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"expressRouteServiceProviders","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"capabilities":"None"},{"resourceType":"applicationGatewayAvailableWafRuleSets","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01"],"capabilities":"None"},{"resourceType":"applicationGatewayAvailableSslOptions","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01"],"capabilities":"None"},{"resourceType":"applicationGatewayAvailableServerVariables","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01"],"capabilities":"None"},{"resourceType":"applicationGatewayAvailableRequestHeaders","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01"],"capabilities":"None"},{"resourceType":"applicationGatewayAvailableResponseHeaders","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01"],"capabilities":"None"},{"resourceType":"routeFilters","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01","2016-11-01","2016-10-01","2016-09-01","2016-08-01","2016-07-01","2016-06-01","2016-03-30","2015-06-15","2015-05-01-preview","2014-12-01-preview"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"bgpServiceCommunities","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01","2017-08-01","2017-06-01","2017-04-01","2017-03-01","2016-12-01"],"capabilities":"None"},{"resourceType":"virtualWans","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"vpnSites","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"vpnServerConfigurations","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","South Africa North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"virtualHubs","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"vpnGateways","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"p2sVpnGateways","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","UAE North","South Africa North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"expressRouteGateways","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"locations/hybridEdgeZone","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01"],"capabilities":"None"},{"resourceType":"expressRoutePortsLocations","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01"],"capabilities":"None"},{"resourceType":"expressRoutePorts","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","UAE North","South Africa North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"firewallPolicies","locations":["Qatar Central","UAE North","Australia Central 2","UAE Central","Germany North","Central India","Korea South","Switzerland North","Switzerland West","Japan West","France South","South Africa West","West India","Canada East","South India","Germany West Central","Norway East","Norway West","South Africa North","East Asia","Southeast Asia","Korea Central","Brazil South","Brazil Southeast","West US 3","Jio India West","Sweden Central","Japan East","UK West","West US","East US","North Europe","West Europe","West Central US","South Central US","Australia East","Australia Central","Australia Southeast","UK South","East US 2","West US 2","North Central US","Canada Central","France Central","Central US","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01"],"defaultApiVersion":"2020-04-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"ipGroups","locations":["Qatar Central","UAE North","Australia Central 2","UAE Central","Germany North","Central India","Korea South","Switzerland North","Switzerland West","Japan West","France South","South Africa West","West India","Canada East","South India","Germany West Central","Norway East","Norway West","South Africa North","East Asia","Southeast Asia","Korea Central","Brazil South","Brazil Southeast","West US 3","Jio India West","Sweden Central","Japan East","UK West","West US","East US","North Europe","West Europe","South Central US","Australia East","Australia Central","Australia Southeast","UK South","East US 2","West US 2","North Central US","Canada Central","France Central","West Central US","Central US","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01"],"defaultApiVersion":"2020-04-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"azureWebCategories","locations":[],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01"],"defaultApiVersion":"2020-08-01","capabilities":"None"},{"resourceType":"locations/nfvOperations","locations":[],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"capabilities":"None"},{"resourceType":"locations/nfvOperationResults","locations":[],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"capabilities":"None"},{"resourceType":"securityPartnerProviders","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"azureFirewalls","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","France Central","Australia Central","Japan West","Japan East","Korea Central","Korea South","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01"],"defaultApiVersion":"2020-03-01","zoneMappings":[{"location":"Australia East","zones":["2","1","3"]},{"location":"Brazil South","zones":["2","1","3"]},{"location":"Canada Central","zones":["2","1","3"]},{"location":"Central India","zones":["2","1","3"]},{"location":"Central US","zones":["2","1","3"]},{"location":"Central US EUAP","zones":["1","2"]},{"location":"East Asia","zones":["2","1","3"]},{"location":"East US","zones":["2","1","3"]},{"location":"East US 2","zones":["2","1","3"]},{"location":"East US 2 EUAP","zones":["2","1","3"]},{"location":"France Central","zones":["2","1","3"]},{"location":"Germany West Central","zones":["2","1","3"]},{"location":"Japan East","zones":["2","1","3"]},{"location":"Korea Central","zones":["2","1","3"]},{"location":"North Central US","zones":[]},{"location":"North Europe","zones":["2","1","3"]},{"location":"Norway East","zones":["2","1","3"]},{"location":"Qatar Central","zones":["2","1","3"]},{"location":"South Africa North","zones":["2","1","3"]},{"location":"South Central US","zones":["2","1","3"]},{"location":"Southeast Asia","zones":["2","1","3"]},{"location":"Sweden Central","zones":["2","1","3"]},{"location":"Switzerland North","zones":["2","1","3"]},{"location":"UAE North","zones":["2","1","3"]},{"location":"UK South","zones":["2","1","3"]},{"location":"West Europe","zones":["2","1","3"]},{"location":"West US","zones":[]},{"location":"West US 2","zones":["2","1","3"]},{"location":"West US 3","zones":["2","1","3"]},{"location":"Poland Central","zones":["2","1","3"]}],"capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"azureFirewallFqdnTags","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01"],"capabilities":"None"},{"resourceType":"virtualNetworkTaps","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"privateLinkServices","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01"],"defaultApiVersion":"2020-03-01","locationMappings":[{"location":"East US 2 EUAP","type":"EdgeZone","extendedLocations":["microsoftrrdclab1","microsoftrrdclab3"]},{"location":"West US","type":"EdgeZone","extendedLocations":["microsoftlosangeles1"]},{"location":"East US 2","type":"EdgeZone","extendedLocations":["microsoftmiami1"]}],"capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"locations/privateLinkServices","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01"],"capabilities":"None"},{"resourceType":"ddosProtectionPlans","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01"],"defaultApiVersion":"2020-03-01","apiProfiles":[{"profileVersion":"2017-03-09-profile","apiVersion":"2018-02-01"}],"capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"networkProfiles","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01"],"defaultApiVersion":"2020-03-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"checkFrontdoorNameAvailability","locations":["global","Central US","East US","East US 2","North Central US","South Central US","West US","North Europe","West Europe","East Asia","Southeast Asia","Japan East","Japan West","Brazil South","Australia East","Australia Southeast"],"apiVersions":["2021-06-01","2020-07-01","2020-05-01","2020-01-01","2019-08-01","2019-05-01","2019-04-01","2018-08-01"],"defaultApiVersion":"2020-07-01","capabilities":"None"},{"resourceType":"frontdoorWebApplicationFirewallManagedRuleSets","locations":["global","Central US","East US","East US 2","North Central US","South Central US","West US","North Europe","West Europe","East Asia","Southeast Asia","Japan East","Japan West","Brazil South","Australia East","Australia Southeast"],"apiVersions":["2022-05-01","2020-11-01","2020-04-01","2019-10-01","2019-03-01"],"defaultApiVersion":"2020-11-01","capabilities":"None"},{"resourceType":"locations/bareMetalTenants","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01"],"capabilities":"None"},{"resourceType":"bastionHosts","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"virtualRouters","locations":["Qatar Central","UAE North","Australia Central 2","UAE Central","Germany North","Central India","Korea South","Switzerland North","Switzerland West","Japan West","France South","South Africa West","West India","Canada East","South India","Germany West Central","Norway East","Norway West","South Africa North","East Asia","Southeast Asia","Korea Central","Brazil South","Brazil Southeast","West US 3","Jio India West","Sweden Central","Japan East","UK West","West US","East US","North Europe","West Europe","West Central US","South Central US","Australia East","Australia Central","Australia Southeast","UK South","East US 2","West US 2","North Central US","Canada Central","France Central","Central US","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01"],"defaultApiVersion":"2020-04-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"networkVirtualAppliances","locations":["Qatar Central","Brazil Southeast","West US 3","Jio India West","Sweden Central","UAE North","Australia Central 2","UAE Central","Germany North","Central India","Korea South","Switzerland North","Switzerland West","Japan West","France South","South Africa West","West India","Canada East","South India","Germany West Central","Norway East","Norway West","South Africa North","East Asia","Southeast Asia","Korea Central","Brazil South","Japan East","UK West","West US","East US","North Europe","West Europe","West Central US","South Central US","Australia East","Australia Central","Australia Southeast","UK South","East US 2","West US 2","North Central US","Canada Central","France Central","Central US","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01"],"defaultApiVersion":"2020-04-01","capabilities":"SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"ipAllocations","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkManagers","locations":["West Central US","North Central US","West US","West Europe","UAE Central","Germany North","East US","West India","East US 2","Australia Central","Australia Central 2","South Africa West","Brazil South","UK West","North Europe","Central US","UAE North","Germany West Central","Switzerland West","East Asia","Jio India West","South Africa North","UK South","South India","Australia Southeast","France South","West US 2","Sweden Central","Japan West","Norway East","France Central","West US 3","Central India","Korea South","Brazil Southeast","Korea Central","Southeast Asia","South Central US","Norway West","Australia East","Japan East","Canada East","Canada Central","Switzerland North","Qatar Central","Poland Central","East US 2 EUAP","Central US EUAP"],"apiVersions":["2023-03-01-preview","2022-11-01","2022-09-01","2022-07-01","2022-06-01-preview","2022-05-01","2022-04-01-preview","2022-01-01"],"defaultApiVersion":"2022-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"networkManagerConnections","locations":[],"apiVersions":["2023-03-01-preview","2022-11-01","2022-09-01","2022-07-01","2022-06-01-preview","2022-05-01","2022-04-01-preview","2022-01-01"],"defaultApiVersion":"2022-05-01","capabilities":"SupportsExtension"},{"resourceType":"locations/queryNetworkSecurityPerimeter","locations":["West Central US","Jio India West","North Central US","West US","West Europe","UAE Central","Germany North","East US","West India","East US 2","Australia Central","Australia Central 2","South Africa West","Brazil South","UK West","North Europe","Central US","UAE North","Germany West Central","Switzerland West","East Asia","South Africa North","UK South","South India","Australia Southeast","France South","West US 2","Sweden Central","Japan West","Norway East","France Central","West US 3","Central India","Korea South","Brazil Southeast","Korea Central","Southeast Asia","South Central US","Norway West","Australia East","Japan East","Canada East","Canada Central","Switzerland North","Qatar Central","Poland Central","East US 2 EUAP","Central US EUAP"],"apiVersions":["2022-02-01-preview","2021-05-01-preview","2021-02-01-preview"],"defaultApiVersion":"2021-02-01-preview","capabilities":"None"},{"resourceType":"virtualNetworks/listNetworkManagerEffectiveConnectivityConfigurations","locations":["West Central US","North Central US","West US","West Europe","UAE Central","Germany North","East US","West India","East US 2","Australia Central","Australia Central 2","South Africa West","Brazil South","UK West","North Europe","Central US","UAE North","Germany West Central","Switzerland West","East Asia","Jio India West","South Africa North","UK South","South India","Australia Southeast","France South","West US 2","Sweden Central","Japan West","Norway East","France Central","West US 3","Central India","Korea South","Brazil Southeast","Korea Central","Southeast Asia","South Central US","Norway West","Australia East","Japan East","Canada East","Canada Central","Switzerland North","Qatar Central","Poland Central","East US 2 EUAP","Central US EUAP"],"apiVersions":["2023-03-01-preview","2022-11-01","2022-09-01","2022-07-01","2022-06-01-preview","2022-05-01","2022-04-01-preview","2022-01-01"],"defaultApiVersion":"2022-05-01","capabilities":"None"},{"resourceType":"virtualNetworks/listNetworkManagerEffectiveSecurityAdminRules","locations":["West Central US","North Central US","West US","West Europe","UAE Central","Germany North","East US","West India","East US 2","Australia Central","Australia Central 2","South Africa West","Brazil South","UK West","North Europe","Central US","UAE North","Germany West Central","Switzerland West","East Asia","Jio India West","South Africa North","UK South","South India","Australia Southeast","France South","West US 2","Sweden Central","Japan West","Norway East","France Central","West US 3","Central India","Korea South","Brazil Southeast","Korea Central","Southeast Asia","South Central US","Norway West","Australia East","Japan East","Canada East","Canada Central","Switzerland North","Qatar Central","Poland Central","East US 2 EUAP","Central US EUAP"],"apiVersions":["2023-03-01-preview","2022-11-01","2022-09-01","2022-07-01","2022-06-01-preview","2022-05-01","2022-04-01-preview","2022-01-01"],"defaultApiVersion":"2022-05-01","capabilities":"None"},{"resourceType":"networkGroupMemberships","locations":["West Central US","North Central US","West US","West Europe","UAE Central","Germany North","East US","West India","East US 2","Australia Central","Australia Central 2","South Africa West","Brazil South","UK West","North Europe","Central US","UAE North","Germany West Central","Switzerland West","East Asia","Jio India West","South Africa North","UK South","South India","Australia Southeast","France South","West US 2","Sweden Central","Japan West","Norway East","France Central","West US 3","Central India","Korea South","Brazil Southeast","Korea Central","Southeast Asia","South Central US","Norway West","Australia East","Japan East","Canada East","Canada Central","Switzerland North","Qatar Central","Poland Central","East US 2 EUAP","Central US EUAP"],"apiVersions":["2022-06-01-preview"],"defaultApiVersion":"2022-06-01-preview","capabilities":"SupportsExtension"},{"resourceType":"locations/commitInternalAzureNetworkManagerConfiguration","locations":["West Central US","North Central US","West US","West Europe","UAE Central","Germany North","East US","West India","East US 2","Australia Central","Australia Central 2","South Africa West","Brazil South","UK West","North Europe","Central US","UAE North","Germany West Central","Switzerland West","East Asia","Jio India West","South Africa North","UK South","South India","Australia Southeast","France South","West US 2","Sweden Central","Japan West","Norway East","France Central","West US 3","Central India","Korea South","Brazil Southeast","Korea Central","Southeast Asia","South Central US","Norway West","Australia East","Japan East","Canada East","Canada Central","Switzerland North","Qatar Central","Poland Central","East US 2 EUAP","Central US EUAP"],"apiVersions":["2023-03-01-preview","2022-11-01","2022-09-01","2022-07-01","2022-06-01-preview","2022-05-01","2022-04-01-preview","2022-01-01"],"capabilities":"None"},{"resourceType":"locations/internalAzureVirtualNetworkManagerOperation","locations":["West Central US","North Central US","West US","West Europe","UAE Central","Germany North","East US","West India","East US 2","Australia Central","Australia Central 2","South Africa West","Brazil South","UK West","North Europe","Central US","UAE North","Germany West Central","Switzerland West","East Asia","Jio India West","South Africa North","UK South","South India","Australia Southeast","France South","West US 2","Sweden Central","Japan West","Norway East","France Central","West US 3","Central India","Korea South","Brazil Southeast","Korea Central","Southeast Asia","South Central US","Norway West","Australia East","Japan East","Canada East","Canada Central","Switzerland North","Qatar Central","Poland Central","East US 2 EUAP","Central US EUAP"],"apiVersions":["2023-03-01-preview","2022-11-01","2022-09-01","2022-07-01","2022-06-01-preview","2022-05-01","2022-04-01-preview","2022-01-01"],"capabilities":"None"},{"resourceType":"networkVirtualApplianceSkus","locations":[],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01"],"defaultApiVersion":"2020-04-01","capabilities":"None"},{"resourceType":"locations/serviceTagDetails","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01"],"capabilities":"None"},{"resourceType":"locations/dataTasks","locations":["West US","East US","North Europe","West Europe","East Asia","Southeast Asia","North Central US","South Central US","Central US","East US 2","Japan East","Japan West","Brazil South","Australia East","Australia Southeast","Central India","South India","West India","Canada Central","Canada East","West Central US","West US 2","UK West","UK South","Korea Central","Korea South","France Central","Australia Central","South Africa North","UAE North","Switzerland North","Germany West Central","Norway East","West US 3","Jio India West","Sweden Central","Qatar Central","Poland Central","Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01"],"capabilities":"None"},{"resourceType":"networkWatchers/lenses","locations":["Central US EUAP","East US 2 EUAP"],"apiVersions":["2023-02-01","2022-11-01","2022-09-01","2022-07-01","2022-05-01","2022-01-01","2021-12-01","2021-08-01","2021-06-01","2021-05-01","2021-04-01","2021-03-01","2021-02-01","2021-01-01","2020-11-01","2020-08-01","2020-07-01","2020-06-01","2020-05-01","2020-04-01","2020-03-01","2020-01-01","2019-12-01","2019-11-01","2019-09-01","2019-08-01","2019-07-01","2019-06-01","2019-04-01","2019-02-01","2018-12-01","2018-11-01","2018-10-01","2018-08-01","2018-07-01","2018-06-01","2018-05-01","2018-04-01","2018-03-01","2018-02-01","2018-01-01","2017-11-01","2017-10-01","2017-09-01"],"defaultApiVersion":"2020-03-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"frontdoorOperationResults","locations":["global"],"apiVersions":["2022-05-01","2021-06-01","2020-11-01","2020-07-01","2020-05-01","2020-04-01","2020-01-01","2019-11-01","2019-10-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-08-01"],"defaultApiVersion":"2020-07-01","capabilities":"None"},{"resourceType":"frontdoors","locations":["Central US EUAP","East US 2 EUAP","global","Central US","East US","East US 2","North Central US","South Central US","West US","North Europe","West Europe","East Asia","Southeast Asia","Japan East","Japan West","Brazil South","Australia East","Australia Southeast"],"apiVersions":["2021-06-01","2020-07-01","2020-05-01","2020-04-01","2020-01-01","2019-08-01","2019-05-01","2019-04-01","2018-08-01"],"defaultApiVersion":"2020-07-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"frontdoors/frontendEndpoints","locations":["Central US EUAP","East US 2 EUAP","global","Central US","East US","East US 2","North Central US","South Central US","West US","North Europe","West Europe","East Asia","Southeast Asia","Japan East","Japan West","Brazil South","Australia East","Australia Southeast"],"apiVersions":["2021-06-01","2020-07-01","2020-05-01","2020-04-01","2020-01-01","2019-08-01","2019-05-01","2019-04-01","2018-08-01"],"defaultApiVersion":"2020-07-01","capabilities":"None"},{"resourceType":"frontdoors/frontendEndpoints/customHttpsConfiguration","locations":["Central US EUAP","East US 2 EUAP","global","Central US","East US","East US 2","North Central US","South Central US","West US","North Europe","West Europe","East Asia","Southeast Asia","Japan East","Japan West","Brazil South","Australia East","Australia Southeast"],"apiVersions":["2021-06-01","2020-07-01","2020-05-01","2020-04-01","2020-01-01","2019-08-01","2019-05-01","2019-04-01","2018-08-01"],"defaultApiVersion":"2020-07-01","capabilities":"None"},{"resourceType":"frontdoorWebApplicationFirewallPolicies","locations":["East US 2 EUAP","global","Central US","East US","East US 2","North Central US","South Central US","West US","North Europe","West Europe","East Asia","Southeast Asia","Japan East","Japan West","Brazil South","Australia East","Australia Southeast"],"apiVersions":["2022-05-01","2020-11-01","2020-04-01","2019-10-01","2019-03-01","2018-08-01"],"defaultApiVersion":"2020-11-01","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"networkExperimentProfiles","locations":["Central US EUAP","East US 2 EUAP","global","Central US","East US","East US 2","North Central US","South Central US","West US","West US 2","North Europe","West Europe","East Asia","Southeast Asia","Japan East","Japan West","Brazil South","Australia East","Australia Southeast"],"apiVersions":["2019-11-01"],"defaultApiVersion":"2019-11-01","capabilities":"SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"} diff --git a/sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData.json b/sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData.json new file mode 100644 index 000000000000..5e95ddfd70d2 --- /dev/null +++ b/sdk/core/Azure.Core/tests/common/TestData/ResourceProviderData/ResourceProviderData.json @@ -0,0 +1,11392 @@ +{ + "id": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/providers/Microsoft.Network", + "namespace": "Microsoft.Network", + "resourceTypes": [ + { + "resourceType": "virtualNetworks", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "virtualNetworks/taggedTrafficConsumers", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "None" + }, + { + "resourceType": "natGateways", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01" + ], + "defaultApiVersion": "2020-03-01", + "zoneMappings": [ + { + "location": "Australia East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Brazil South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Canada Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central India", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US EUAP", + "zones": [ + "1", + "2" + ] + }, + { + "location": "East Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2 EUAP", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "France Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Germany West Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Japan East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Korea Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "North Central US", + "zones": [] + }, + { + "location": "North Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Norway East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Qatar Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Africa North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Southeast Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Sweden Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Switzerland North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UAE North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UK South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US", + "zones": [] + }, + { + "location": "West US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US 3", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Poland Central", + "zones": [ + "2", + "1", + "3" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "publicIPAddresses", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "zoneMappings": [ + { + "location": "Australia East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Brazil South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Canada Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central India", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US EUAP", + "zones": [ + "1", + "2" + ] + }, + { + "location": "East Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2 EUAP", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "France Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Germany West Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Japan East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Korea Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "North Central US", + "zones": [] + }, + { + "location": "North Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Norway East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Qatar Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Africa North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Southeast Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Sweden Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Switzerland North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UAE North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UK South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US", + "zones": [] + }, + { + "location": "West US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US 3", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Poland Central", + "zones": [ + "2", + "1", + "3" + ] + } + ], + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "internalPublicIpAddresses", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01" + ], + "capabilities": "None" + }, + { + "resourceType": "customIpPrefixes", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01" + ], + "defaultApiVersion": "2020-06-01", + "zoneMappings": [ + { + "location": "Australia East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Brazil South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Canada Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central India", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US EUAP", + "zones": [ + "1", + "2" + ] + }, + { + "location": "East Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2 EUAP", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "France Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Germany West Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Japan East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Korea Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "North Central US", + "zones": [] + }, + { + "location": "North Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Norway East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Qatar Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Africa North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Southeast Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Sweden Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Switzerland North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UAE North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UK South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US", + "zones": [] + }, + { + "location": "West US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US 3", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Poland Central", + "zones": [ + "2", + "1", + "3" + ] + } + ], + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkInterfaces", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "dscpConfigurations", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01" + ], + "defaultApiVersion": "2020-06-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "privateEndpoints", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01" + ], + "defaultApiVersion": "2020-03-01", + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "privateEndpoints/privateLinkServiceProxies", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "None" + }, + { + "resourceType": "privateEndpointRedirectMaps", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "loadBalancers", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkSecurityGroups", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "applicationSecurityGroups", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2017-09-01" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "serviceEndpointPolicies", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkIntentPolicies", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "routeTables", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "publicIPPrefixes", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01" + ], + "defaultApiVersion": "2020-03-01", + "zoneMappings": [ + { + "location": "Australia East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Brazil South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Canada Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central India", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US EUAP", + "zones": [ + "1", + "2" + ] + }, + { + "location": "East Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2 EUAP", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "France Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Germany West Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Japan East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Korea Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "North Central US", + "zones": [] + }, + { + "location": "North Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Norway East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Qatar Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Africa North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Southeast Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Sweden Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Switzerland North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UAE North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UK South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US", + "zones": [] + }, + { + "location": "West US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US 3", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Poland Central", + "zones": [ + "2", + "1", + "3" + ] + } + ], + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkWatchers", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkWatchers/connectionMonitors", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkWatchers/flowLogs", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkWatchers/pingMeshes", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "virtualNetworkGateways", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-03-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "localNetworkGateways", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-03-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "connections", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-03-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "applicationGateways", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "zoneMappings": [ + { + "location": "Australia East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Brazil South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Canada Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central India", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US EUAP", + "zones": [ + "1", + "2" + ] + }, + { + "location": "East Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2 EUAP", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "France Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Germany West Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Japan East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Korea Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "North Central US", + "zones": [] + }, + { + "location": "North Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Norway East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Qatar Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Africa North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Southeast Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Sweden Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Switzerland North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UAE North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UK South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US", + "zones": [] + }, + { + "location": "West US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US 3", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Poland Central", + "zones": [ + "2", + "1", + "3" + ] + } + ], + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "applicationGatewayWebApplicationFirewallPolicies", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "locations", + "locations": [], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "None" + }, + { + "resourceType": "locations/operations", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "None" + }, + { + "resourceType": "locations/operationResults", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "None" + }, + { + "resourceType": "locations/CheckDnsNameAvailability", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/setLoadBalancerFrontendPublicIpAddresses", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01" + ], + "capabilities": "None" + }, + { + "resourceType": "cloudServiceSlots", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01" + ], + "capabilities": "SupportsExtension" + }, + { + "resourceType": "locations/usages", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2015-06-15" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + } + ], + "capabilities": "None" + }, + { + "resourceType": "locations/virtualNetworkAvailableEndpointServices", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/availableDelegations", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/ApplicationGatewayWafDynamicManifests", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/serviceTags", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/availablePrivateEndpointTypes", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/availableServiceAliases", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/checkPrivateLinkServiceVisibility", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/autoApprovedPrivateLinkServices", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/batchValidatePrivateEndpointsForResourceMove", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/batchNotifyPrivateEndpointsForResourceMove", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/supportedVirtualMachineSizes", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/setAzureNetworkManagerConfiguration", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/publishResources", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/getAzureNetworkManagerConfiguration", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/checkAcceleratedNetworkingSupport", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/validateResourceOwnership", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/setResourceOwnership", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/effectiveResourceOwnership", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "capabilities": "None" + }, + { + "resourceType": "operations", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "capabilities": "None" + }, + { + "resourceType": "dnszones", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2016-04-01" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2016-04-01" + }, + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2016-04-01" + } + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "dnsOperationResults", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnsOperationStatuses", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "getDnsResourceReference", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "internalNotify", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/A", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/AAAA", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/CNAME", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/PTR", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/MX", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/TXT", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/SRV", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/SOA", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/NS", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/CAA", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/recordsets", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "dnszones/all", + "locations": [ + "global" + ], + "apiVersions": [ + "2018-05-01", + "2018-03-01-preview", + "2017-10-01", + "2017-09-15-preview", + "2017-09-01", + "2016-04-01", + "2015-05-04-preview" + ], + "defaultApiVersion": "2018-05-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "privateDnsZones/virtualNetworkLinks", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "privateDnsOperationResults", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsOperationStatuses", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZonesInternal", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01" + ], + "defaultApiVersion": "2020-01-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/A", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/AAAA", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/CNAME", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/PTR", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/MX", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/TXT", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/SRV", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/SOA", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "privateDnsZones/all", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01", + "2020-01-01", + "2018-09-01" + ], + "defaultApiVersion": "2018-09-01", + "capabilities": "None" + }, + { + "resourceType": "virtualNetworks/privateDnsZoneLinks", + "locations": [ + "global" + ], + "apiVersions": [ + "2020-06-01" + ], + "defaultApiVersion": "2020-06-01", + "capabilities": "None" + }, + { + "resourceType": "dnsResolvers", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "dnsResolvers/inboundEndpoints", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "dnsResolvers/outboundEndpoints", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "dnsForwardingRulesets", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "dnsForwardingRulesets/forwardingRules", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "None" + }, + { + "resourceType": "dnsForwardingRulesets/virtualNetworkLinks", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "None" + }, + { + "resourceType": "virtualNetworks/listDnsResolvers", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "None" + }, + { + "resourceType": "virtualNetworks/listDnsForwardingRulesets", + "locations": [ + "West Central US", + "East US 2", + "West Europe", + "North Europe", + "Australia East", + "UK South", + "South Central US", + "East US", + "North Central US", + "West US 2", + "West US 3", + "Southeast Asia", + "Central India", + "Canada Central", + "Central US", + "France Central", + "Japan East", + "Germany West Central", + "South Africa North", + "Korea Central", + "Sweden Central", + "East Asia", + "Switzerland North", + "Brazil South", + "West US", + "Norway East", + "UAE North", + "Australia Southeast", + "Canada East", + "Japan West", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "None" + }, + { + "resourceType": "locations/dnsResolverOperationResults", + "locations": [], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "None" + }, + { + "resourceType": "locations/dnsResolverOperationStatuses", + "locations": [], + "apiVersions": [ + "2022-07-01", + "2020-04-01-preview" + ], + "defaultApiVersion": "2020-04-01-preview", + "capabilities": "None" + }, + { + "resourceType": "trafficmanagerprofiles", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-12-01-preview", + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2017-05-01", + "2017-03-01", + "2015-11-01", + "2015-04-28-preview" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "trafficmanagerprofiles/heatMaps", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2017-09-01-preview" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "None" + }, + { + "resourceType": "trafficmanagerprofiles/azureendpoints", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-12-01-preview", + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2017-05-01", + "2017-03-01", + "2015-11-01", + "2015-04-28-preview" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "None" + }, + { + "resourceType": "trafficmanagerprofiles/externalendpoints", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-12-01-preview", + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2017-05-01", + "2017-03-01", + "2015-11-01", + "2015-04-28-preview" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "None" + }, + { + "resourceType": "trafficmanagerprofiles/nestedendpoints", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-12-01-preview", + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2017-05-01", + "2017-03-01", + "2015-11-01", + "2015-04-28-preview" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "None" + }, + { + "resourceType": "checkTrafficManagerNameAvailability", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-12-01-preview", + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2017-05-01", + "2017-03-01", + "2015-11-01", + "2015-04-28-preview" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "None" + }, + { + "resourceType": "checkTrafficManagerNameAvailabilityV2", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-12-01-preview" + ], + "defaultApiVersion": "2022-12-01-preview", + "capabilities": "None" + }, + { + "resourceType": "trafficManagerUserMetricsKeys", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2017-09-01-preview" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "None" + }, + { + "resourceType": "trafficManagerGeographicHierarchies", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-12-01-preview", + "2022-04-01-preview", + "2018-08-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2017-05-01", + "2017-03-01" + ], + "defaultApiVersion": "2018-08-01", + "capabilities": "None" + }, + { + "resourceType": "expressRouteCircuits", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "expressRouteServiceProviders", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "capabilities": "None" + }, + { + "resourceType": "applicationGatewayAvailableWafRuleSets", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01" + ], + "capabilities": "None" + }, + { + "resourceType": "applicationGatewayAvailableSslOptions", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01" + ], + "capabilities": "None" + }, + { + "resourceType": "applicationGatewayAvailableServerVariables", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01" + ], + "capabilities": "None" + }, + { + "resourceType": "applicationGatewayAvailableRequestHeaders", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01" + ], + "capabilities": "None" + }, + { + "resourceType": "applicationGatewayAvailableResponseHeaders", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01" + ], + "capabilities": "None" + }, + { + "resourceType": "routeFilters", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01", + "2016-11-01", + "2016-10-01", + "2016-09-01", + "2016-08-01", + "2016-07-01", + "2016-06-01", + "2016-03-30", + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "bgpServiceCommunities", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01", + "2017-08-01", + "2017-06-01", + "2017-04-01", + "2017-03-01", + "2016-12-01" + ], + "capabilities": "None" + }, + { + "resourceType": "virtualWans", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "vpnSites", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "vpnServerConfigurations", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "South Africa North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "virtualHubs", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "vpnGateways", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "p2sVpnGateways", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "UAE North", + "South Africa North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "expressRouteGateways", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "locations/hybridEdgeZone", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01" + ], + "capabilities": "None" + }, + { + "resourceType": "expressRoutePortsLocations", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01" + ], + "capabilities": "None" + }, + { + "resourceType": "expressRoutePorts", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "UAE North", + "South Africa North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "firewallPolicies", + "locations": [ + "Qatar Central", + "UAE North", + "Australia Central 2", + "UAE Central", + "Germany North", + "Central India", + "Korea South", + "Switzerland North", + "Switzerland West", + "Japan West", + "France South", + "South Africa West", + "West India", + "Canada East", + "South India", + "Germany West Central", + "Norway East", + "Norway West", + "South Africa North", + "East Asia", + "Southeast Asia", + "Korea Central", + "Brazil South", + "Brazil Southeast", + "West US 3", + "Jio India West", + "Sweden Central", + "Japan East", + "UK West", + "West US", + "East US", + "North Europe", + "West Europe", + "West Central US", + "South Central US", + "Australia East", + "Australia Central", + "Australia Southeast", + "UK South", + "East US 2", + "West US 2", + "North Central US", + "Canada Central", + "France Central", + "Central US", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01" + ], + "defaultApiVersion": "2020-04-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "ipGroups", + "locations": [ + "Qatar Central", + "UAE North", + "Australia Central 2", + "UAE Central", + "Germany North", + "Central India", + "Korea South", + "Switzerland North", + "Switzerland West", + "Japan West", + "France South", + "South Africa West", + "West India", + "Canada East", + "South India", + "Germany West Central", + "Norway East", + "Norway West", + "South Africa North", + "East Asia", + "Southeast Asia", + "Korea Central", + "Brazil South", + "Brazil Southeast", + "West US 3", + "Jio India West", + "Sweden Central", + "Japan East", + "UK West", + "West US", + "East US", + "North Europe", + "West Europe", + "South Central US", + "Australia East", + "Australia Central", + "Australia Southeast", + "UK South", + "East US 2", + "West US 2", + "North Central US", + "Canada Central", + "France Central", + "West Central US", + "Central US", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01" + ], + "defaultApiVersion": "2020-04-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "azureWebCategories", + "locations": [], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01" + ], + "defaultApiVersion": "2020-08-01", + "capabilities": "None" + }, + { + "resourceType": "locations/nfvOperations", + "locations": [], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/nfvOperationResults", + "locations": [], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "capabilities": "None" + }, + { + "resourceType": "securityPartnerProviders", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "azureFirewalls", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "France Central", + "Australia Central", + "Japan West", + "Japan East", + "Korea Central", + "Korea South", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01" + ], + "defaultApiVersion": "2020-03-01", + "zoneMappings": [ + { + "location": "Australia East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Brazil South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Canada Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central India", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Central US EUAP", + "zones": [ + "1", + "2" + ] + }, + { + "location": "East Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "East US 2 EUAP", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "France Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Germany West Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Japan East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Korea Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "North Central US", + "zones": [] + }, + { + "location": "North Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Norway East", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Qatar Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Africa North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "South Central US", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Southeast Asia", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Sweden Central", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Switzerland North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UAE North", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "UK South", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West Europe", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US", + "zones": [] + }, + { + "location": "West US 2", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "West US 3", + "zones": [ + "2", + "1", + "3" + ] + }, + { + "location": "Poland Central", + "zones": [ + "2", + "1", + "3" + ] + } + ], + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "azureFirewallFqdnTags", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01" + ], + "capabilities": "None" + }, + { + "resourceType": "virtualNetworkTaps", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "privateLinkServices", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-03-01", + "locationMappings": [ + { + "location": "East US 2 EUAP", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftrrdclab1", + "microsoftrrdclab3" + ] + }, + { + "location": "West US", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftlosangeles1" + ] + }, + { + "location": "East US 2", + "type": "EdgeZone", + "extendedLocations": [ + "microsoftmiami1" + ] + } + ], + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "locations/privateLinkServices", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01" + ], + "capabilities": "None" + }, + { + "resourceType": "ddosProtectionPlans", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01" + ], + "defaultApiVersion": "2020-03-01", + "apiProfiles": [ + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2018-02-01" + } + ], + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkProfiles", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "checkFrontdoorNameAvailability", + "locations": [ + "global", + "Central US", + "East US", + "East US 2", + "North Central US", + "South Central US", + "West US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast" + ], + "apiVersions": [ + "2021-06-01", + "2020-07-01", + "2020-05-01", + "2020-01-01", + "2019-08-01", + "2019-05-01", + "2019-04-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-07-01", + "capabilities": "None" + }, + { + "resourceType": "frontdoorWebApplicationFirewallManagedRuleSets", + "locations": [ + "global", + "Central US", + "East US", + "East US 2", + "North Central US", + "South Central US", + "West US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast" + ], + "apiVersions": [ + "2022-05-01", + "2020-11-01", + "2020-04-01", + "2019-10-01", + "2019-03-01" + ], + "defaultApiVersion": "2020-11-01", + "capabilities": "None" + }, + { + "resourceType": "locations/bareMetalTenants", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01" + ], + "capabilities": "None" + }, + { + "resourceType": "bastionHosts", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "virtualRouters", + "locations": [ + "Qatar Central", + "UAE North", + "Australia Central 2", + "UAE Central", + "Germany North", + "Central India", + "Korea South", + "Switzerland North", + "Switzerland West", + "Japan West", + "France South", + "South Africa West", + "West India", + "Canada East", + "South India", + "Germany West Central", + "Norway East", + "Norway West", + "South Africa North", + "East Asia", + "Southeast Asia", + "Korea Central", + "Brazil South", + "Brazil Southeast", + "West US 3", + "Jio India West", + "Sweden Central", + "Japan East", + "UK West", + "West US", + "East US", + "North Europe", + "West Europe", + "West Central US", + "South Central US", + "Australia East", + "Australia Central", + "Australia Southeast", + "UK South", + "East US 2", + "West US 2", + "North Central US", + "Canada Central", + "France Central", + "Central US", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01" + ], + "defaultApiVersion": "2020-04-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkVirtualAppliances", + "locations": [ + "Qatar Central", + "Brazil Southeast", + "West US 3", + "Jio India West", + "Sweden Central", + "UAE North", + "Australia Central 2", + "UAE Central", + "Germany North", + "Central India", + "Korea South", + "Switzerland North", + "Switzerland West", + "Japan West", + "France South", + "South Africa West", + "West India", + "Canada East", + "South India", + "Germany West Central", + "Norway East", + "Norway West", + "South Africa North", + "East Asia", + "Southeast Asia", + "Korea Central", + "Brazil South", + "Japan East", + "UK West", + "West US", + "East US", + "North Europe", + "West Europe", + "West Central US", + "South Central US", + "Australia East", + "Australia Central", + "Australia Southeast", + "UK South", + "East US 2", + "West US 2", + "North Central US", + "Canada Central", + "France Central", + "Central US", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01" + ], + "defaultApiVersion": "2020-04-01", + "capabilities": "SystemAssignedResourceIdentity, SupportsTags, SupportsLocation" + }, + { + "resourceType": "ipAllocations", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkManagers", + "locations": [ + "West Central US", + "North Central US", + "West US", + "West Europe", + "UAE Central", + "Germany North", + "East US", + "West India", + "East US 2", + "Australia Central", + "Australia Central 2", + "South Africa West", + "Brazil South", + "UK West", + "North Europe", + "Central US", + "UAE North", + "Germany West Central", + "Switzerland West", + "East Asia", + "Jio India West", + "South Africa North", + "UK South", + "South India", + "Australia Southeast", + "France South", + "West US 2", + "Sweden Central", + "Japan West", + "Norway East", + "France Central", + "West US 3", + "Central India", + "Korea South", + "Brazil Southeast", + "Korea Central", + "Southeast Asia", + "South Central US", + "Norway West", + "Australia East", + "Japan East", + "Canada East", + "Canada Central", + "Switzerland North", + "Qatar Central", + "Poland Central", + "East US 2 EUAP", + "Central US EUAP" + ], + "apiVersions": [ + "2023-03-01-preview", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-06-01-preview", + "2022-05-01", + "2022-04-01-preview", + "2022-01-01" + ], + "defaultApiVersion": "2022-05-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkManagerConnections", + "locations": [], + "apiVersions": [ + "2023-03-01-preview", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-06-01-preview", + "2022-05-01", + "2022-04-01-preview", + "2022-01-01" + ], + "defaultApiVersion": "2022-05-01", + "capabilities": "SupportsExtension" + }, + { + "resourceType": "locations/queryNetworkSecurityPerimeter", + "locations": [ + "West Central US", + "Jio India West", + "North Central US", + "West US", + "West Europe", + "UAE Central", + "Germany North", + "East US", + "West India", + "East US 2", + "Australia Central", + "Australia Central 2", + "South Africa West", + "Brazil South", + "UK West", + "North Europe", + "Central US", + "UAE North", + "Germany West Central", + "Switzerland West", + "East Asia", + "South Africa North", + "UK South", + "South India", + "Australia Southeast", + "France South", + "West US 2", + "Sweden Central", + "Japan West", + "Norway East", + "France Central", + "West US 3", + "Central India", + "Korea South", + "Brazil Southeast", + "Korea Central", + "Southeast Asia", + "South Central US", + "Norway West", + "Australia East", + "Japan East", + "Canada East", + "Canada Central", + "Switzerland North", + "Qatar Central", + "Poland Central", + "East US 2 EUAP", + "Central US EUAP" + ], + "apiVersions": [ + "2022-02-01-preview", + "2021-05-01-preview", + "2021-02-01-preview" + ], + "defaultApiVersion": "2021-02-01-preview", + "capabilities": "None" + }, + { + "resourceType": "virtualNetworks/listNetworkManagerEffectiveConnectivityConfigurations", + "locations": [ + "West Central US", + "North Central US", + "West US", + "West Europe", + "UAE Central", + "Germany North", + "East US", + "West India", + "East US 2", + "Australia Central", + "Australia Central 2", + "South Africa West", + "Brazil South", + "UK West", + "North Europe", + "Central US", + "UAE North", + "Germany West Central", + "Switzerland West", + "East Asia", + "Jio India West", + "South Africa North", + "UK South", + "South India", + "Australia Southeast", + "France South", + "West US 2", + "Sweden Central", + "Japan West", + "Norway East", + "France Central", + "West US 3", + "Central India", + "Korea South", + "Brazil Southeast", + "Korea Central", + "Southeast Asia", + "South Central US", + "Norway West", + "Australia East", + "Japan East", + "Canada East", + "Canada Central", + "Switzerland North", + "Qatar Central", + "Poland Central", + "East US 2 EUAP", + "Central US EUAP" + ], + "apiVersions": [ + "2023-03-01-preview", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-06-01-preview", + "2022-05-01", + "2022-04-01-preview", + "2022-01-01" + ], + "defaultApiVersion": "2022-05-01", + "capabilities": "None" + }, + { + "resourceType": "virtualNetworks/listNetworkManagerEffectiveSecurityAdminRules", + "locations": [ + "West Central US", + "North Central US", + "West US", + "West Europe", + "UAE Central", + "Germany North", + "East US", + "West India", + "East US 2", + "Australia Central", + "Australia Central 2", + "South Africa West", + "Brazil South", + "UK West", + "North Europe", + "Central US", + "UAE North", + "Germany West Central", + "Switzerland West", + "East Asia", + "Jio India West", + "South Africa North", + "UK South", + "South India", + "Australia Southeast", + "France South", + "West US 2", + "Sweden Central", + "Japan West", + "Norway East", + "France Central", + "West US 3", + "Central India", + "Korea South", + "Brazil Southeast", + "Korea Central", + "Southeast Asia", + "South Central US", + "Norway West", + "Australia East", + "Japan East", + "Canada East", + "Canada Central", + "Switzerland North", + "Qatar Central", + "Poland Central", + "East US 2 EUAP", + "Central US EUAP" + ], + "apiVersions": [ + "2023-03-01-preview", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-06-01-preview", + "2022-05-01", + "2022-04-01-preview", + "2022-01-01" + ], + "defaultApiVersion": "2022-05-01", + "capabilities": "None" + }, + { + "resourceType": "networkGroupMemberships", + "locations": [ + "West Central US", + "North Central US", + "West US", + "West Europe", + "UAE Central", + "Germany North", + "East US", + "West India", + "East US 2", + "Australia Central", + "Australia Central 2", + "South Africa West", + "Brazil South", + "UK West", + "North Europe", + "Central US", + "UAE North", + "Germany West Central", + "Switzerland West", + "East Asia", + "Jio India West", + "South Africa North", + "UK South", + "South India", + "Australia Southeast", + "France South", + "West US 2", + "Sweden Central", + "Japan West", + "Norway East", + "France Central", + "West US 3", + "Central India", + "Korea South", + "Brazil Southeast", + "Korea Central", + "Southeast Asia", + "South Central US", + "Norway West", + "Australia East", + "Japan East", + "Canada East", + "Canada Central", + "Switzerland North", + "Qatar Central", + "Poland Central", + "East US 2 EUAP", + "Central US EUAP" + ], + "apiVersions": [ + "2022-06-01-preview" + ], + "defaultApiVersion": "2022-06-01-preview", + "capabilities": "SupportsExtension" + }, + { + "resourceType": "locations/commitInternalAzureNetworkManagerConfiguration", + "locations": [ + "West Central US", + "North Central US", + "West US", + "West Europe", + "UAE Central", + "Germany North", + "East US", + "West India", + "East US 2", + "Australia Central", + "Australia Central 2", + "South Africa West", + "Brazil South", + "UK West", + "North Europe", + "Central US", + "UAE North", + "Germany West Central", + "Switzerland West", + "East Asia", + "Jio India West", + "South Africa North", + "UK South", + "South India", + "Australia Southeast", + "France South", + "West US 2", + "Sweden Central", + "Japan West", + "Norway East", + "France Central", + "West US 3", + "Central India", + "Korea South", + "Brazil Southeast", + "Korea Central", + "Southeast Asia", + "South Central US", + "Norway West", + "Australia East", + "Japan East", + "Canada East", + "Canada Central", + "Switzerland North", + "Qatar Central", + "Poland Central", + "East US 2 EUAP", + "Central US EUAP" + ], + "apiVersions": [ + "2023-03-01-preview", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-06-01-preview", + "2022-05-01", + "2022-04-01-preview", + "2022-01-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/internalAzureVirtualNetworkManagerOperation", + "locations": [ + "West Central US", + "North Central US", + "West US", + "West Europe", + "UAE Central", + "Germany North", + "East US", + "West India", + "East US 2", + "Australia Central", + "Australia Central 2", + "South Africa West", + "Brazil South", + "UK West", + "North Europe", + "Central US", + "UAE North", + "Germany West Central", + "Switzerland West", + "East Asia", + "Jio India West", + "South Africa North", + "UK South", + "South India", + "Australia Southeast", + "France South", + "West US 2", + "Sweden Central", + "Japan West", + "Norway East", + "France Central", + "West US 3", + "Central India", + "Korea South", + "Brazil Southeast", + "Korea Central", + "Southeast Asia", + "South Central US", + "Norway West", + "Australia East", + "Japan East", + "Canada East", + "Canada Central", + "Switzerland North", + "Qatar Central", + "Poland Central", + "East US 2 EUAP", + "Central US EUAP" + ], + "apiVersions": [ + "2023-03-01-preview", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-06-01-preview", + "2022-05-01", + "2022-04-01-preview", + "2022-01-01" + ], + "capabilities": "None" + }, + { + "resourceType": "networkVirtualApplianceSkus", + "locations": [], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01" + ], + "defaultApiVersion": "2020-04-01", + "capabilities": "None" + }, + { + "resourceType": "locations/serviceTagDetails", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01" + ], + "capabilities": "None" + }, + { + "resourceType": "locations/dataTasks", + "locations": [ + "West US", + "East US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "North Central US", + "South Central US", + "Central US", + "East US 2", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast", + "Central India", + "South India", + "West India", + "Canada Central", + "Canada East", + "West Central US", + "West US 2", + "UK West", + "UK South", + "Korea Central", + "Korea South", + "France Central", + "Australia Central", + "South Africa North", + "UAE North", + "Switzerland North", + "Germany West Central", + "Norway East", + "West US 3", + "Jio India West", + "Sweden Central", + "Qatar Central", + "Poland Central", + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01" + ], + "capabilities": "None" + }, + { + "resourceType": "networkWatchers/lenses", + "locations": [ + "Central US EUAP", + "East US 2 EUAP" + ], + "apiVersions": [ + "2023-02-01", + "2022-11-01", + "2022-09-01", + "2022-07-01", + "2022-05-01", + "2022-01-01", + "2021-12-01", + "2021-08-01", + "2021-06-01", + "2021-05-01", + "2021-04-01", + "2021-03-01", + "2021-02-01", + "2021-01-01", + "2020-11-01", + "2020-08-01", + "2020-07-01", + "2020-06-01", + "2020-05-01", + "2020-04-01", + "2020-03-01", + "2020-01-01", + "2019-12-01", + "2019-11-01", + "2019-09-01", + "2019-08-01", + "2019-07-01", + "2019-06-01", + "2019-04-01", + "2019-02-01", + "2018-12-01", + "2018-11-01", + "2018-10-01", + "2018-08-01", + "2018-07-01", + "2018-06-01", + "2018-05-01", + "2018-04-01", + "2018-03-01", + "2018-02-01", + "2018-01-01", + "2017-11-01", + "2017-10-01", + "2017-09-01" + ], + "defaultApiVersion": "2020-03-01", + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation" + }, + { + "resourceType": "frontdoorOperationResults", + "locations": [ + "global" + ], + "apiVersions": [ + "2022-05-01", + "2021-06-01", + "2020-11-01", + "2020-07-01", + "2020-05-01", + "2020-04-01", + "2020-01-01", + "2019-11-01", + "2019-10-01", + "2019-08-01", + "2019-05-01", + "2019-04-01", + "2019-03-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-07-01", + "capabilities": "None" + }, + { + "resourceType": "frontdoors", + "locations": [ + "Central US EUAP", + "East US 2 EUAP", + "global", + "Central US", + "East US", + "East US 2", + "North Central US", + "South Central US", + "West US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast" + ], + "apiVersions": [ + "2021-06-01", + "2020-07-01", + "2020-05-01", + "2020-04-01", + "2020-01-01", + "2019-08-01", + "2019-05-01", + "2019-04-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-07-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "frontdoors/frontendEndpoints", + "locations": [ + "Central US EUAP", + "East US 2 EUAP", + "global", + "Central US", + "East US", + "East US 2", + "North Central US", + "South Central US", + "West US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast" + ], + "apiVersions": [ + "2021-06-01", + "2020-07-01", + "2020-05-01", + "2020-04-01", + "2020-01-01", + "2019-08-01", + "2019-05-01", + "2019-04-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-07-01", + "capabilities": "None" + }, + { + "resourceType": "frontdoors/frontendEndpoints/customHttpsConfiguration", + "locations": [ + "Central US EUAP", + "East US 2 EUAP", + "global", + "Central US", + "East US", + "East US 2", + "North Central US", + "South Central US", + "West US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast" + ], + "apiVersions": [ + "2021-06-01", + "2020-07-01", + "2020-05-01", + "2020-04-01", + "2020-01-01", + "2019-08-01", + "2019-05-01", + "2019-04-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-07-01", + "capabilities": "None" + }, + { + "resourceType": "frontdoorWebApplicationFirewallPolicies", + "locations": [ + "East US 2 EUAP", + "global", + "Central US", + "East US", + "East US 2", + "North Central US", + "South Central US", + "West US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast" + ], + "apiVersions": [ + "2022-05-01", + "2020-11-01", + "2020-04-01", + "2019-10-01", + "2019-03-01", + "2018-08-01" + ], + "defaultApiVersion": "2020-11-01", + "capabilities": "SupportsTags, SupportsLocation" + }, + { + "resourceType": "networkExperimentProfiles", + "locations": [ + "Central US EUAP", + "East US 2 EUAP", + "global", + "Central US", + "East US", + "East US 2", + "North Central US", + "South Central US", + "West US", + "West US 2", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "Brazil South", + "Australia East", + "Australia Southeast" + ], + "apiVersions": [ + "2019-11-01" + ], + "defaultApiVersion": "2019-11-01", + "capabilities": "SupportsTags, SupportsLocation" + } + ], + "registrationState": "Registered", + "registrationPolicy": "RegistrationRequired" +} diff --git a/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj b/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj index 3a6fb9509979..dd5cf6cebc4f 100644 --- a/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj +++ b/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj @@ -23,6 +23,7 @@ + diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTests.cs new file mode 100644 index 000000000000..d350351a0912 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.ResourceManager.Compute; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class AvailabilitySetDataTests : ModelJsonTests + { + protected override string WirePayload => File.ReadAllText(TestData.GetLocation("AvailabilitySetData/AvailabilitySetDataWireFormat.json")).TrimEnd(); + + protected override string JsonPayload => WirePayload; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (AvailabilitySetData)response; + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + var expectedSerializedString = "{"; + if (format == ModelSerializerFormat.Json) + expectedSerializedString += "\"name\":\"testAS-3375\",\"id\":\"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375\",\"type\":\"Microsoft.Compute/availabilitySets\","; + expectedSerializedString += "\"sku\":{\"name\":\"Classic\""; + //if (!ignoreAdditionalProperties) + // expectedSerializedString += ",\"extraSku\":\"extraSku\""; + expectedSerializedString += "},\"tags\":{\"key\":\"value\"},\"location\":\"eastus\",\"properties\":{\"platformUpdateDomainCount\":5,\"platformFaultDomainCount\":3}"; + //if (!ignoreAdditionalProperties) + // expectedSerializedString += ",\"extraRoot\":\"extraRoot\""; + expectedSerializedString += "}"; + return expectedSerializedString; ; + } + + protected override void VerifyModel(AvailabilitySetData model, ModelSerializerFormat format) + { + Dictionary expectedTags = new Dictionary() { { "key", "value" } }; + + Assert.AreEqual("/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375", model.Id.ToString()); + CollectionAssert.AreEquivalent(expectedTags, model.Tags); + Assert.AreEqual(AzureLocation.EastUS, model.Location); + Assert.AreEqual("testAS-3375", model.Name); + Assert.AreEqual("Microsoft.Compute/availabilitySets", model.ResourceType.ToString()); + Assert.AreEqual(5, model.PlatformUpdateDomainCount); + Assert.AreEqual(3, model.PlatformFaultDomainCount); + Assert.AreEqual("Classic", model.Sku.Name); + } + + protected override void CompareModels(AvailabilitySetData model, AvailabilitySetData model2, ModelSerializerFormat format) + { + Assert.AreEqual(format == ModelSerializerFormat.Wire ? null : model.Id, model2.Id); + Assert.AreEqual(model.Location, model2.Location); + Assert.AreEqual(format == ModelSerializerFormat.Wire ? null : model.Name, model2.Name); + Assert.AreEqual(model.PlatformFaultDomainCount, model2.PlatformFaultDomainCount); + Assert.AreEqual(model.PlatformUpdateDomainCount, model2.PlatformUpdateDomainCount); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual(model.ResourceType, model2.ResourceType); + CollectionAssert.AreEquivalent(model.Tags, model2.Tags); + Assert.AreEqual(model.Sku.Name, model2.Sku.Name); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTestsWithVMs.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTestsWithVMs.cs new file mode 100644 index 000000000000..26e1624a1eb4 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/AvailabilitySetDataTestsWithVMs.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.ResourceManager.Compute; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class AvailabilitySetDataTestsWithVMs : ModelJsonTests + { + protected override string WirePayload => File.ReadAllText(TestData.GetLocation("AvailabilitySetData/AvailabilitySetDataWithVMsWireFormat.json")).TrimEnd(); + + protected override string JsonPayload => WirePayload; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (AvailabilitySetData)response; + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + var expectedSerializedString = "{"; + if (format == ModelSerializerFormat.Json) + expectedSerializedString += "\"name\":\"testAS-3375\",\"id\":\"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375\",\"type\":\"Microsoft.Compute/availabilitySets\","; + expectedSerializedString += "\"sku\":{\"name\":\"Classic\""; + //if (!ignoreAdditionalProperties) + // expectedSerializedString += ",\"extraSku\":\"extraSku\""; + expectedSerializedString += "},\"tags\":{\"key\":\"value\"},\"location\":\"eastus\",\"properties\":{\"platformUpdateDomainCount\":5,\"platformFaultDomainCount\":3"; + //if (!ignoreAdditionalProperties) + // expectedSerializedString += ",\"extraRoot\":\"extraRoot\""; + expectedSerializedString += ",\"virtualMachines\":[{\"id\":\"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS1\"},{\"id\":\"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS2\"}]"; + expectedSerializedString += "}}"; + return expectedSerializedString; ; + } + + protected override void VerifyModel(AvailabilitySetData model, ModelSerializerFormat format) + { + Dictionary expectedTags = new Dictionary() { { "key", "value" } }; + + Assert.AreEqual("/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS-3375", model.Id.ToString()); + CollectionAssert.AreEquivalent(expectedTags, model.Tags); + Assert.AreEqual(AzureLocation.EastUS, model.Location); + Assert.AreEqual("testAS-3375", model.Name); + Assert.AreEqual("Microsoft.Compute/availabilitySets", model.ResourceType.ToString()); + Assert.AreEqual(5, model.PlatformUpdateDomainCount); + Assert.AreEqual(3, model.PlatformFaultDomainCount); + Assert.AreEqual("Classic", model.Sku.Name); + Assert.AreEqual(2, model.VirtualMachines.Count); + Assert.AreEqual("/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS1", model.VirtualMachines[0].Id.ToString()); + Assert.AreEqual("/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/testRG-6497/providers/Microsoft.Compute/availabilitySets/testAS2", model.VirtualMachines[1].Id.ToString()); + } + + protected override void CompareModels(AvailabilitySetData model, AvailabilitySetData model2, ModelSerializerFormat format) + { + Assert.AreEqual(format == ModelSerializerFormat.Wire ? null : model.Id, model2.Id); + Assert.AreEqual(model.Location, model2.Location); + Assert.AreEqual(format == ModelSerializerFormat.Wire ? null : model.Name, model2.Name); + Assert.AreEqual(model.PlatformFaultDomainCount, model2.PlatformFaultDomainCount); + Assert.AreEqual(model.PlatformUpdateDomainCount, model2.PlatformUpdateDomainCount); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual(model.ResourceType, model2.ResourceType); + CollectionAssert.AreEquivalent(model.Tags, model2.Tags); + Assert.AreEqual(model.Sku.Name, model2.Sku.Name); + Assert.AreEqual(model.VirtualMachines.Count, model2.VirtualMachines.Count); + Assert.AreEqual(model.VirtualMachines[0].Id, model2.VirtualMachines[0].Id); + Assert.AreEqual(model.VirtualMachines[1].Id, model2.VirtualMachines[1].Id); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/BaseModelTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/BaseModelTests.cs new file mode 100644 index 000000000000..8ffd4e4b6db7 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/BaseModelTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class BaseModelTests : ModelJsonTests + { + protected override BaseModel GetModelInstance() + { + var typeToActivate = typeof(BaseModel).Assembly.GetTypes().FirstOrDefault(t => t.Name == $"Unknown{typeof(BaseModel).Name}"); + return Activator.CreateInstance(typeToActivate, true) as BaseModel; + } + + protected override string JsonPayload => WirePayload; + + protected override string WirePayload => "{\"kind\":\"X\",\"name\":\"xmodel\",\"xProperty\":100,\"extra\":\"stuff\"}"; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (BaseModel)response; + + protected override void CompareModels(BaseModel model, BaseModel model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Name, model2.Name); + Assert.AreEqual(model.Kind, model2.Kind); + if (format == ModelSerializerFormat.Json) + { + var rawData = GetRawData(model); + var rawData2 = GetRawData(model2); + Assert.IsNotNull(rawData); + Assert.IsNotNull(rawData2); + Assert.AreEqual(rawData.Count, rawData2.Count); + Assert.AreEqual(rawData["extra"].ToObjectFromJson(), rawData2["extra"].ToObjectFromJson()); + } + } + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + string expected = "{\"kind\":\"X\",\"name\":\"xmodel\""; + if (format == ModelSerializerFormat.Json) + expected += ",\"xProperty\":100"; + if (format == ModelSerializerFormat.Json) + expected += ",\"extra\":\"stuff\""; + expected += "}"; + return expected; + } + + protected override void VerifyModel(BaseModel model, ModelSerializerFormat format) + { + Assert.AreEqual("X", model.Kind); + Assert.AreEqual("xmodel", model.Name); + var rawData = GetRawData(model); + Assert.IsNotNull(rawData); + if (format == ModelSerializerFormat.Json) + { + Assert.AreEqual("stuff", rawData["extra"].ToObjectFromJson()); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/EnvelopeTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/EnvelopeTests.cs new file mode 100644 index 000000000000..c7b8535e1174 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/EnvelopeTests.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text; +using Azure.Core.Serialization; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class EnvelopeTests : ModelJsonTests> + { + protected override string JsonPayload => WirePayload; + + protected override string WirePayload => "{\"readOnlyProperty\":\"read\"," + + "\"modelA\":{\"name\":\"Cat\",\"isHungry\":false,\"weight\":2.5}," + + "\"modelC\":{\"x\":\"hello\",\"y\":\"bye\"}" + + "}"; + + protected override Func, RequestContent> ToRequestContent => model => model; + + protected override Func> FromResponse => response => (Envelope)response; + + protected override Func GetObjectSerializerFactory(ModelSerializerFormat format) + { + if (format == ModelSerializerFormat.Wire) + { + JsonSerializerSettings settings = new JsonSerializerSettings + { + ContractResolver = new IgnoreReadOnlyPropertiesResolver() + }; + return type => type.Equals(typeof(ModelC)) ? new NewtonsoftJsonObjectSerializer(settings) : null; + } + else + { + return type => type.Equals(typeof(ModelC)) ? new NewtonsoftJsonObjectSerializer() : null; + } + } + + protected override void CompareModels(Envelope model, Envelope model2, ModelSerializerFormat format) + { + if (format == ModelSerializerFormat.Json) + { + Assert.AreEqual(model.ReadOnlyProperty, model2.ReadOnlyProperty); + Assert.AreEqual(model.ModelA.LatinName, model2.ModelA.LatinName); + Assert.AreEqual(model.ModelA.HasWhiskers, model2.ModelA.HasWhiskers); + } + Assert.AreEqual(model.ModelA.Name, model2.ModelA.Name); + Assert.AreEqual(model.ModelA.IsHungry, model2.ModelA.IsHungry); + Assert.AreEqual(model.ModelA.Weight, model2.ModelA.Weight); + Assert.AreEqual(model.ModelT.X, model2.ModelT.X); + Assert.AreEqual(model.ModelT.Y, model2.ModelT.Y); + } + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + StringBuilder expectedSerialized = new StringBuilder("{"); + if (format == ModelSerializerFormat.Json) + { + expectedSerialized.Append("\"readOnlyProperty\":\"read\","); + } + expectedSerialized.Append("\"modelA\":{"); + if (format == ModelSerializerFormat.Json) + { + expectedSerialized.Append("\"latinName\":\"Felis catus\",\"hasWhiskers\":false,"); + } + expectedSerialized.Append("\"name\":\"Cat\",\"isHungry\":false,\"weight\":2.5},"); + expectedSerialized.Append("\"modelC\":{\"X\":\"hello\",\"Y\":\"bye\"}"); //using NewtonSoft Serializer + expectedSerialized.Append("}"); + return expectedSerialized.ToString(); + } + + protected override void VerifyModel(Envelope model, ModelSerializerFormat format) + { + Assert.IsNotNull(model.ModelA); + if (format == ModelSerializerFormat.Json) + { + Assert.AreEqual("read", model.ReadOnlyProperty); + Assert.AreEqual("Felis catus", model.ModelA.LatinName); + Assert.AreEqual(false, model.ModelA.HasWhiskers); + } + Assert.AreEqual("Cat", model.ModelA.Name); + Assert.AreEqual(false, model.ModelA.IsHungry); + Assert.AreEqual(2.5, model.ModelA.Weight); + Assert.IsNotNull(model.ModelT); + Assert.AreEqual("hello", model.ModelT.X); + Assert.AreEqual("bye", model.ModelT.Y); + } + + // Generate a class that implements the NewtonSoft default contract resolver so that ReadOnly properties are not serialized + // This is used to verify that the ReadOnly properties are not serialized when IgnoreReadOnlyProperties is set to true + private class IgnoreReadOnlyPropertiesResolver : Newtonsoft.Json.Serialization.DefaultContractResolver + { + protected override Newtonsoft.Json.Serialization.JsonProperty CreateProperty(System.Reflection.MemberInfo member, MemberSerialization memberSerialization) + { + Newtonsoft.Json.Serialization.JsonProperty property = base.CreateProperty(member, memberSerialization); + + if (!property.Writable) + { + property.ShouldSerialize = obj => false; + } + + return property; + } + } + + public class ModelC + { + public ModelC(string x1, string y1) + { + X = x1; + Y = y1; + } + + public string X { get; set; } + public string Y { get; set; } + + public static void VerifyModelC(ModelC c1, ModelC c2) + { + Assert.That(c1.X == c2.X); + Assert.That(c1.Y == c2.Y); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelAsStructTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelAsStructTests.cs new file mode 100644 index 000000000000..29e3cdd85a42 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelAsStructTests.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class ModelAsStructTests : ModelJsonTests + { + protected override string JsonPayload => WirePayload; + + protected override string WirePayload => "{\"id\":5,\"extra\":\"stuff\"}"; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (ModelAsStruct)response; + + protected override void CompareModels(ModelAsStruct model, ModelAsStruct model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Id, model2.Id); + var rawData1 = GetRawData(model); + var rawData2 = GetRawData(model2); + Assert.IsNotNull(rawData1); + Assert.IsNotNull(rawData2); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual(rawData1["extra"].ToObjectFromJson(), rawData2["extra"].ToObjectFromJson()); + } + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + string expected = "{\"id\":5"; + if (format == ModelSerializerFormat.Json) + expected += ",\"extra\":\"stuff\""; + expected += "}"; + return expected; + } + + protected override void VerifyModel(ModelAsStruct model, ModelSerializerFormat format) + { + Assert.AreEqual(5, model.Id); + var rawData = GetRawData(model); + Assert.IsNotNull(rawData); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual("stuff", rawData["extra"].ToObjectFromJson()); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelJsonTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelJsonTests.cs new file mode 100644 index 000000000000..6a9488ec32e1 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelJsonTests.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.Serialization; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal abstract class ModelJsonTests : ModelTests where T : IModelJsonSerializable + { + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithJsonInterfaceOfT(string format) + => RoundTripTest(format, new JsonInterfaceStrategy()); + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithJsonInterfaceNonGeneric(string format) + => RoundTripTest(format, new JsonInterfaceNonGenericStrategy()); + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithJsonInterfaceUtf8Reader(string format) + => RoundTripTest(format, new JsonInterfaceUtf8ReaderStrategy()); + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithJsonInterfaceUtf8ReaderNonGeneric(string format) + => RoundTripTest(format, new JsonInterfaceUtf8ReaderNonGenericStrategy()); + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithModelJsonConverter(string format) + => RoundTripTest(format, new ModelJsonConverterStrategy()); + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelTests.cs new file mode 100644 index 000000000000..9a9bf45f5041 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelTests.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Azure.Core.Serialization; +using Microsoft.Extensions.Options; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + public abstract class ModelTests where T : IModelSerializable + { + private T _modelInstance; + private T ModelInstance => _modelInstance ??= GetModelInstance(); + + private bool IsXmlWireFormat => WirePayload.StartsWith("<", StringComparison.Ordinal); + + protected virtual T GetModelInstance() + { + return (T)Activator.CreateInstance(typeof(T), true); + } + + protected abstract string GetExpectedResult(ModelSerializerFormat format); + protected abstract void VerifyModel(T model, ModelSerializerFormat format); + protected abstract void CompareModels(T model, T model2, ModelSerializerFormat format); + protected abstract string JsonPayload { get; } + protected abstract string WirePayload { get; } + protected abstract Func ToRequestContent { get; } + protected abstract Func FromResponse { get; } + + protected virtual Func GetObjectSerializerFactory(ModelSerializerFormat format) => null; + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithModelSerializer(string format) + => RoundTripTest(format, new ModelSerializerStrategy()); + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithModelSerializerNonGeneric(string format) + => RoundTripTest(format, new ModelSerializerNonGenericStrategy()); + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithModelSerializerFormatOverload(string format) + { + //if we only pass in the format we can't test BYOM + if (!typeof(T).IsGenericType) + RoundTripTest(format, new ModelSerializerFormatOverloadStrategy()); + } + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithModelInterface(string format) + => RoundTripTest(format, new ModelInterfaceStrategy()); + + [TestCase("J")] + [TestCase("W")] + public void RoundTripWithModelInterfaceNonGeneric(string format) + => RoundTripTest(format, new ModelInterfaceNonGenericStrategy()); + + [Test] + public void RoundTripWithCast() + { + //cast does not work without options + if (!typeof(T).IsGenericType) + RoundTripTest(ModelSerializerFormat.Wire, new CastStrategy(ToRequestContent, FromResponse)); + } + + protected void RoundTripTest(ModelSerializerFormat format, RoundTripStrategy strategy) + { + string serviceResponse = format == ModelSerializerFormat.Json ? JsonPayload : WirePayload; + + ModelSerializerOptions options = new ModelSerializerOptions(format); + options.ObjectSerializerResolver = GetObjectSerializerFactory(format); + + var expectedSerializedString = GetExpectedResult(format); + + if (AssertFailures(strategy, format, serviceResponse, options)) + return; + + T model = (T)strategy.Deserialize(serviceResponse, ModelInstance, options); + + VerifyModel(model, format); + var data = strategy.Serialize(model, options); + string roundTrip = data.ToString(); + + Assert.That(roundTrip, Is.EqualTo(expectedSerializedString)); + + T model2 = (T)strategy.Deserialize(roundTrip, ModelInstance, options); + CompareModels(model, model2, format); + } + + private bool AssertFailures(RoundTripStrategy strategy, ModelSerializerFormat format, string serviceResponse, ModelSerializerOptions options) + { + bool result = false; + if (IsXmlWireFormat && (strategy.IsExplicitJsonDeserialize || strategy.IsExplicitJsonSerialize) && format == ModelSerializerFormat.Wire) + { + if (strategy.IsExplicitJsonDeserialize) + { + if (strategy.GetType().Name.StartsWith("ModelJsonConverterStrategy")) + { + //we never get to the interface implementation because JsonSerializer errors before that + Assert.Throws(() => { T model = (T)strategy.Deserialize(serviceResponse, ModelInstance, options); }); + result = true; + } + else + { + Assert.Throws(() => { T model = (T)strategy.Deserialize(serviceResponse, ModelInstance, options); }); + result = true; + } + } + + if (strategy.IsExplicitJsonSerialize) + { + Assert.Throws(() => { var data = strategy.Serialize(ModelInstance, options); }); + result = true; + } + } + else if (ModelInstance is not IModelJsonSerializable && format == ModelSerializerFormat.Json) + { + Assert.Throws(() => { T model = (T)strategy.Deserialize(serviceResponse, ModelInstance, options); }); + Assert.Throws(() => { var data = strategy.Serialize(ModelInstance, options); }); + result = true; + } + return result; + } + + internal static Dictionary GetRawData(object model) + { + Type modelType = model.GetType(); + while (modelType.BaseType != typeof(object) && modelType.BaseType != typeof(ValueType)) + { + modelType = modelType.BaseType; + } + var propertyInfo = modelType.GetField("_rawData", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); + return propertyInfo.GetValue(model) as Dictionary; + } + + [Test] + public void ThrowsIfUnknownFormat() + { + ModelSerializerOptions options = new ModelSerializerOptions("x"); + Assert.Throws(() => ModelSerializer.Serialize(ModelInstance, options)); + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData("x"), options)); + + Assert.Throws(() => ModelSerializer.Serialize((IModelSerializable)ModelInstance, options)); + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData("x"), typeof(T), options)); + if (ModelInstance is IModelJsonSerializable jsonModel) + { + Assert.Throws(() => jsonModel.Serialize(new Utf8JsonWriter(new MemoryStream()), options)); + Assert.Throws(() => ((IModelJsonSerializable)jsonModel).Serialize(new Utf8JsonWriter(new MemoryStream()), options)); + bool gotException = false; + try + { + Utf8JsonReader reader = default; + jsonModel.Deserialize(ref reader, options); + } + catch (FormatException) + { + gotException = true; + } + finally + { + Assert.IsTrue(gotException); + } + + gotException = false; + try + { + Utf8JsonReader reader = default; + ((IModelJsonSerializable)jsonModel).Deserialize(ref reader, options); + } + catch (FormatException) + { + gotException = true; + } + finally + { + Assert.IsTrue(gotException); + } + } + } + + [Test] + public void ThrowsIfWireIsNotJson() + { + if (ModelInstance is IModelJsonSerializable jsonModel && IsXmlWireFormat) + { + Assert.Throws(() => jsonModel.Serialize(new Utf8JsonWriter(new MemoryStream()), new ModelSerializerOptions(ModelSerializerFormat.Wire))); + Utf8JsonReader reader = new Utf8JsonReader(new byte[] { }); + bool exceptionCaught = false; + try + { + jsonModel.Deserialize(ref reader, new ModelSerializerOptions(ModelSerializerFormat.Wire)); + } + catch (InvalidOperationException) + { + exceptionCaught = true; + } + Assert.IsTrue(exceptionCaught, "Expected InvalidOperationException to be thrown when deserializing wire format as json"); + } + } + + [Test] + public void CastNull() + { + if (typeof(T).IsClass) + { + object model = null; + RequestContent content = ToRequestContent((T)model); + Assert.IsNull(content); + } + else + { + T model = default; + RequestContent content = ToRequestContent(model); + Assert.IsNotNull(content); + } + + Response response = null; + Assert.Throws(() => FromResponse(response)); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXDeserializationProxyTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXDeserializationProxyTests.cs new file mode 100644 index 000000000000..78abf3723fef --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXDeserializationProxyTests.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class ModelXDeserializationProxyTests + { + [TestCase("J")] + [TestCase("W")] + public void CanDeserializeModelX(string format) + { + ModelSerializerOptions options = new ModelSerializerOptions(format); + BinaryData data = new BinaryData(Encoding.UTF8.GetBytes("{\"kind\":\"X\",\"name\":\"xmodel\",\"xProperty\":100,\"extra\":\"stuff\"}")); + object modelX = ModelSerializer.Deserialize(data, typeof(ModelXDeserializationProxy), options); + Assert.IsNotNull(modelX); + Assert.IsInstanceOf(modelX); + Assert.AreEqual("X", ((ModelX)modelX).Kind); + Assert.AreEqual("xmodel", ((ModelX)modelX).Name); + Assert.AreEqual(100, ((ModelX)modelX).XProperty); + if (format == ModelSerializerFormat.Json) + { + var rawData = ModelTests.GetRawData((ModelX)modelX); + Assert.IsNotNull(rawData); + Assert.AreEqual("stuff", rawData["extra"].ToObjectFromJson()); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXTests.cs new file mode 100644 index 000000000000..368479c4c3a2 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXTests.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class ModelXTests : ModelJsonTests + { + protected override string JsonPayload => WirePayload; + + protected override string WirePayload => File.ReadAllText(TestData.GetLocation("ModelX/ModelXWireFormat.json")).TrimEnd(); + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (ModelX)response; + + protected override void CompareModels(ModelX model, ModelX model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Name, model2.Name); + Assert.AreEqual(model.Kind, model2.Kind); + + Assert.AreEqual(model.Fields, model2.Fields); + Assert.AreEqual(model.KeyValuePairs, model2.KeyValuePairs); + Assert.AreEqual(model.NullProperty, model2.NullProperty); + + if (format == ModelSerializerFormat.Json) + { + Assert.AreEqual(model.XProperty, model2.XProperty); + var rawData = GetRawData(model); + var rawData2 = GetRawData(model2); + Assert.IsNotNull(rawData); + Assert.IsNotNull(rawData2); + Assert.AreEqual(rawData.Count, rawData2.Count); + Assert.AreEqual(rawData["extra"].ToObjectFromJson(), rawData2["extra"].ToObjectFromJson()); + } + } + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + string expected = "{\"kind\":\"X\",\"name\":\"xmodel\""; + expected += ",\"fields\":[\"testField\"]"; + expected += ",\"keyValuePairs\":{\"color\":\"red\"}"; + if (format == ModelSerializerFormat.Json) + expected += ",\"xProperty\":100"; + if (format == ModelSerializerFormat.Json) + expected += ",\"extra\":\"stuff\""; + expected += "}"; + return expected; + } + + protected override void VerifyModel(ModelX model, ModelSerializerFormat format) + { + Assert.AreEqual("X", model.Kind); + Assert.AreEqual("xmodel", model.Name); + + Assert.AreEqual(1, model.Fields.Count); + Assert.AreEqual("testField", model.Fields[0]); + Assert.AreEqual(1, model.KeyValuePairs.Count); + Assert.AreEqual("red", model.KeyValuePairs["color"]); + Assert.IsNull(model.NullProperty); + + var rawData = GetRawData(model); + Assert.IsNotNull(rawData); + if (format == ModelSerializerFormat.Json) + { + Assert.AreEqual(100, model.XProperty); + Assert.AreEqual("stuff", rawData["extra"].ToObjectFromJson()); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlCrossLibraryTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlCrossLibraryTests.cs new file mode 100644 index 000000000000..ce5d94676c97 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlCrossLibraryTests.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Text; +using System.Text.Json; +using System.Xml; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.Public.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class ModelXmlCrossLibraryTests : ModelJsonTests + { + protected override string WirePayload => File.ReadAllText(TestData.GetLocation("ModelXmlX.xml")).TrimEnd(); + + protected override string JsonPayload => "{\"key\":\"Color\",\"value\":\"Red\",\"readOnlyProperty\":\"ReadOnly\",\"childTag\":{\"childValue\":\"ChildRed\",\"childReadOnlyProperty\":\"ChildReadOnly\"}}"; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (ModelXmlCrossLibrary)response; + + [Test] + public void ThrowsIfMismatch() + { + ModelSerializerOptions jsonOptions = new ModelSerializerOptions(ModelSerializerFormat.Json); + ModelXmlCrossLibrary model = ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(JsonPayload)), jsonOptions); + + Assert.Throws(Is.InstanceOf(), () => ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(WirePayload)), jsonOptions)); + + ModelSerializerOptions wireOptions = ModelSerializerOptions.DefaultWireOptions; + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(JsonPayload)), wireOptions)); + } + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + if (format == ModelSerializerFormat.Wire) + { + var expectedSerializedString = "\uFEFFColorRed"; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += "ReadOnly"; + expectedSerializedString += "ChildRed"; + //TODO this is broken until we update the IXmlSerializable interface to include ModelSerializerOptions + //if (format.Equals(ModelSerializerFormat.Json)) + // expectedSerializedString += "ChildReadOnly"; + expectedSerializedString += ""; + return expectedSerializedString; + } + if (format == ModelSerializerFormat.Json) + { + var expectedSerializedString = "{\"key\":\"Color\",\"value\":\"Red\""; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += ",\"readOnlyProperty\":\"ReadOnly\""; + expectedSerializedString += ",\"childTag\":{\"childValue\":\"ChildRed\""; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += ",\"childReadOnlyProperty\":\"ChildReadOnly\""; + expectedSerializedString += "}}"; + return expectedSerializedString; + } + throw new InvalidOperationException($"Unknown format used in test {format}"); + } + + protected override void VerifyModel(ModelXmlCrossLibrary model, ModelSerializerFormat format) + { + Assert.AreEqual("Color", model.Key); + Assert.AreEqual("Red", model.Value); + Assert.AreEqual("ReadOnly", model.ReadOnlyProperty); + Assert.IsNotNull(model.ChildModelXml); + Assert.AreEqual("ChildRed", model.ChildModelXml.ChildValue); + Assert.AreEqual("ChildReadOnly", model.ChildModelXml.ChildReadOnlyProperty); + } + + protected override void CompareModels(ModelXmlCrossLibrary model, ModelXmlCrossLibrary model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Key, model2.Key); + Assert.AreEqual(model.Value, model2.Value); + if (format.Equals(ModelSerializerFormat.Json)) + Assert.AreEqual(model.ReadOnlyProperty, model2.ReadOnlyProperty); + Assert.AreEqual(model.ChildModelXml.ChildValue, model2.ChildModelXml.ChildValue); + //TODO this is broken until we update the IXmlSerializable interface to include ModelSerializerOptions + //if (format.Equals(ModelSerializerFormat.Data)) + // Assert.AreEqual(model.RenamedChildModelXml.ChildReadOnlyProperty, model2.RenamedChildModelXml.ChildReadOnlyProperty); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlOnlyTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlOnlyTests.cs new file mode 100644 index 000000000000..257b73244a1d --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlOnlyTests.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.Public.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class ModelXmlOnlyTests : ModelTests + { + protected override string WirePayload => File.ReadAllText(TestData.GetLocation("ModelXml.xml")).TrimEnd(); + + protected override string JsonPayload => string.Empty; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (ModelXmlOnly)response; + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + var expectedSerializedString = "\uFEFFColorRed"; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += "ReadOnly"; + expectedSerializedString += "ChildRed"; + //TODO this is broken until we update the IXmlSerializable interface to include ModelSerializerOptions + //if (format.Equals(ModelSerializerFormat.Json)) + // expectedSerializedString += "ChildReadOnly"; + expectedSerializedString += ""; + return expectedSerializedString; + } + + protected override void VerifyModel(ModelXmlOnly model, ModelSerializerFormat format) + { + Assert.AreEqual("Color", model.Key); + Assert.AreEqual("Red", model.Value); + Assert.AreEqual("ReadOnly", model.ReadOnlyProperty); + Assert.IsNotNull(model.RenamedChildModelXml); + Assert.AreEqual("ChildRed", model.RenamedChildModelXml.ChildValue); + Assert.AreEqual("ChildReadOnly", model.RenamedChildModelXml.ChildReadOnlyProperty); + } + + protected override void CompareModels(ModelXmlOnly model, ModelXmlOnly model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Key, model2.Key); + Assert.AreEqual(model.Value, model2.Value); + if (format.Equals(ModelSerializerFormat.Json)) + Assert.AreEqual(model.ReadOnlyProperty, model2.ReadOnlyProperty); + Assert.AreEqual(model.RenamedChildModelXml.ChildValue, model2.RenamedChildModelXml.ChildValue); + //TODO this is broken until we update the IXmlSerializable interface to include ModelSerializerOptions + //if (format.Equals(ModelSerializerFormat.Json)) + // Assert.AreEqual(model.RenamedChildModelXml.ChildReadOnlyProperty, model2.RenamedChildModelXml.ChildReadOnlyProperty); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlTests.cs new file mode 100644 index 000000000000..2f7259555061 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ModelXmlTests.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Text; +using System.Text.Json; +using System.Xml; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class ModelXmlTests : ModelJsonTests + { + protected override string WirePayload => File.ReadAllText(TestData.GetLocation("ModelXml.xml")).TrimEnd(); + + protected override string JsonPayload => "{\"key\":\"Color\",\"value\":\"Red\",\"readOnlyProperty\":\"ReadOnly\",\"renamedChildModelXml\":{\"childValue\":\"ChildRed\",\"childReadOnlyProperty\":\"ChildReadOnly\"}}"; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (ModelXml)response; + + [Test] + public void ThrowsIfMismatch() + { + ModelSerializerOptions jsonOptions = new ModelSerializerOptions(ModelSerializerFormat.Json); + ModelXml model = ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(JsonPayload)), jsonOptions); + + Assert.Throws(Is.InstanceOf(), () => ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(WirePayload)), jsonOptions)); + + ModelSerializerOptions wireOptions = ModelSerializerOptions.DefaultWireOptions; + Assert.Throws(() => ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(JsonPayload)), wireOptions)); + } + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + if (format == ModelSerializerFormat.Wire) + { + var expectedSerializedString = "\uFEFFColorRed"; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += "ReadOnly"; + expectedSerializedString += "ChildRed"; + //TODO this is broken until we update the IXmlSerializable interface to include ModelSerializerOptions + //if (format.Equals(ModelSerializerFormat.Json)) + // expectedSerializedString += "ChildReadOnly"; + expectedSerializedString += ""; + return expectedSerializedString; + } + if (format == ModelSerializerFormat.Json) + { + var expectedSerializedString = "{\"key\":\"Color\",\"value\":\"Red\""; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += ",\"readOnlyProperty\":\"ReadOnly\""; + expectedSerializedString += ",\"renamedChildModelXml\":{\"childValue\":\"ChildRed\""; + //TODO this is broken until we update the IXmlSerializable interface to include ModelSerializerOptions + //if (format.Equals(ModelSerializerFormat.Json)) + // expectedSerializedString += ",\"childReadOnlyProperty\":\"ChildReadOnly\""; + expectedSerializedString += "}}"; + return expectedSerializedString; + } + throw new InvalidOperationException($"Unknown format used in test {format}"); + } + + protected override void VerifyModel(ModelXml model, ModelSerializerFormat format) + { + Assert.AreEqual("Color", model.Key); + Assert.AreEqual("Red", model.Value); + Assert.AreEqual("ReadOnly", model.ReadOnlyProperty); + Assert.IsNotNull(model.RenamedChildModelXml); + Assert.AreEqual("ChildRed", model.RenamedChildModelXml.ChildValue); + Assert.AreEqual("ChildReadOnly", model.RenamedChildModelXml.ChildReadOnlyProperty); + } + + protected override void CompareModels(ModelXml model, ModelXml model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Key, model2.Key); + Assert.AreEqual(model.Value, model2.Value); + if (format.Equals(ModelSerializerFormat.Json)) + Assert.AreEqual(model.ReadOnlyProperty, model2.ReadOnlyProperty); + Assert.AreEqual(model.RenamedChildModelXml.ChildValue, model2.RenamedChildModelXml.ChildValue); + //TODO this is broken until we update the IXmlSerializable interface to include ModelSerializerOptions + //if (format.Equals(ModelSerializerFormat.Json)) + // Assert.AreEqual(model.RenamedChildModelXml.ChildReadOnlyProperty, model2.RenamedChildModelXml.ChildReadOnlyProperty); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Animal.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Animal.cs new file mode 100644 index 000000000000..b6d43ba572e9 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Animal.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + public class Animal : IUtf8JsonSerializable, IModelJsonSerializable + { + private Dictionary RawData { get; set; } = new Dictionary(); + + public bool IsHungry { get; set; } = false; + public double Weight { get; set; } = 1.1d; + public string LatinName { get; private set; } = "Animalia"; + public string Name { get; set; } = "Animal"; + + public Animal() + { + } + + public Animal(double weight, string latinName, string name, bool isHungry) + { + Weight = weight; + LatinName = latinName; + Name = name; + IsHungry = isHungry; + } + + internal Animal(double weight, string latinName, string name, bool isHungry, Dictionary rawData) + { + Weight = weight; + LatinName = latinName; + Name = name; + IsHungry = isHungry; + RawData = rawData; + } + + internal Animal(string name) + { + Name = name; + } + + #region Serialization + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("latinName"u8); + writer.WriteStringValue(LatinName); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("isHungry"u8); + writer.WriteBooleanValue(IsHungry); + writer.WritePropertyName("weight"u8); + writer.WriteNumberValue(Weight); + + if (options.Format == ModelSerializerFormat.Json) + { + //write out the raw data + foreach (var property in RawData) + { + writer.WritePropertyName(property.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(property.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(property.Value.ToString()).RootElement); +#endif + } + } + writer.WriteEndObject(); + } + + internal static Animal DeserializeAnimal(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + double weight = default; + string name = ""; + string latinName = ""; + bool isHungry = default; + + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("weight"u8)) + { + weight = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("latinName"u8)) + { + latinName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isHungry"u8)) + { + isHungry = property.Value.GetBoolean(); + continue; + } + + if (options.Format == ModelSerializerFormat.Json) + { + //this means it's an unknown property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new Animal(weight, latinName, name, isHungry, rawData); + } + #endregion + + #region InterfaceImplementation + + Animal IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return DeserializeAnimal(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + Animal IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeAnimal(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + + #endregion + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/CatReadOnlyProperty.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/CatReadOnlyProperty.cs new file mode 100644 index 000000000000..0996ac733a73 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/CatReadOnlyProperty.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + public class CatReadOnlyProperty : Animal, IModelJsonSerializable, IUtf8JsonSerializable + { + private Dictionary RawData { get; set; } = new Dictionary(); + + public CatReadOnlyProperty(double weight, string latinName, string name, bool isHungry, bool hasWhiskers) : base(weight, "Felis catus", name, isHungry) + { + HasWhiskers = hasWhiskers; + } + + internal CatReadOnlyProperty(double weight, string latinName, string name, bool isHungry, bool hasWhiskers, Dictionary rawData) : this(weight, latinName, name, isHungry, hasWhiskers) + { + RawData = rawData; + } + + internal CatReadOnlyProperty() + { + } + + public bool HasWhiskers { get; private set; } = true; + + #region Serialization + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("latinName"u8); + writer.WriteStringValue(LatinName); + + writer.WritePropertyName("hasWhiskers"u8); + writer.WriteBooleanValue(HasWhiskers); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("isHungry"u8); + writer.WriteBooleanValue(IsHungry); + writer.WritePropertyName("weight"u8); + writer.WriteNumberValue(Weight); + + if (options.Format == ModelSerializerFormat.Json) + { + //write out the raw data + foreach (var property in RawData) + { + writer.WritePropertyName(property.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(property.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(property.Value.ToString()).RootElement); +#endif + } + } + writer.WriteEndObject(); + } + + internal static CatReadOnlyProperty DeserializeCatReadOnlyProperty(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + double weight = default; + string name = ""; + string latinName = ""; + bool isHungry = default; + bool hasWhiskers = default; + + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("weight"u8)) + { + weight = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("latinName"u8)) + { + latinName = property.Value.GetString(); + continue; + } + + if (property.NameEquals("isHungry"u8)) + { + isHungry = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("hasWhiskers"u8)) + { + hasWhiskers = property.Value.GetBoolean(); + continue; + } + if (options.Format == ModelSerializerFormat.Json) + { + //this means its an unknown property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new CatReadOnlyProperty(weight, latinName, name, isHungry, hasWhiskers, rawData); + } + + CatReadOnlyProperty IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return DeserializeCatReadOnlyProperty(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + CatReadOnlyProperty IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeCatReadOnlyProperty(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + + #endregion + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ChildModelXmlOnly.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ChildModelXmlOnly.cs new file mode 100644 index 000000000000..703eb6f1f02f --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ChildModelXmlOnly.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests.Models +{ + [XmlRoot("ChildTag")] + public class ChildModelXmlOnly : IXmlSerializable, IModelSerializable + { + internal ChildModelXmlOnly() { } + + /// Initializes a new instance of ModelXml for testing. + /// + /// is null. + public ChildModelXmlOnly(string value, string readonlyProperty) + { + Argument.AssertNotNull(value, nameof(value)); + + ChildValue = value; + ChildReadOnlyProperty = readonlyProperty; + } + + /// Gets or sets the value. + [XmlElement("ChildValue")] + public string ChildValue { get; set; } + /// Gets or sets the value. + [XmlElement("ChildReadOnlyProperty")] + public string ChildReadOnlyProperty { get; } + + void IXmlSerializable.Write(XmlWriter writer, string nameHint) => + Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + private void Serialize(XmlWriter writer, ModelSerializerOptions options, string nameHint) + { + if (options.Format != ModelSerializerFormat.Wire) + throw new NotSupportedException($"{nameof(ChildModelXmlOnly)} does not support '{options.Format}' format"); + + writer.WriteStartElement(nameHint ?? "ChildTag"); + writer.WriteStartElement("ChildValue"); + writer.WriteValue(ChildValue); + writer.WriteEndElement(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WriteStartElement("ChildReadOnlyProperty"); + writer.WriteValue(ChildReadOnlyProperty); + writer.WriteEndElement(); + } + writer.WriteEndElement(); + } + + internal static ChildModelXmlOnly DeserializeChildModelXmlOnly(XElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + if (options.Format != ModelSerializerFormat.Wire) + throw new NotSupportedException($"{nameof(ChildModelXmlOnly)} does not support '{options.Format}' format"); + + string value = default; + string readonlyProperty = default; + if (element.Element("ChildValue") is XElement valueElement) + { + value = (string)valueElement; + } + if (element.Element("ChildReadOnlyProperty") is XElement readonlyPropertyElement) + { + readonlyProperty = (string)readonlyPropertyElement; + } + return new ChildModelXmlOnly(value, readonlyProperty); + } + + ChildModelXmlOnly IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + => DeserializeChildModelXmlOnly(XElement.Load(data.ToStream()), options); + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + using MemoryStream stream = new MemoryStream(); + using XmlWriter writer = XmlWriter.Create(stream); + Serialize(writer, options, null); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListProperty.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListProperty.cs new file mode 100644 index 000000000000..31448ddc11c5 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListProperty.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + [JsonConverter(typeof(DogListPropertyConverter))] + public class DogListProperty : Animal, IModelJsonSerializable, IUtf8JsonSerializable + { + private Dictionary RawData { get; set; } = new Dictionary(); + public IList FoodConsumed { get; private set; } + + public DogListProperty(string name) : base(name) + { + Name = name; + FoodConsumed = new ChangeTrackingList(); + } + + internal DogListProperty(double weight, string latinName, string name, bool isHungry, IList foodConsumed, Dictionary rawData) : base(weight, latinName, name, isHungry, rawData) + { + RawData = rawData; + FoodConsumed = foodConsumed; + } + + public DogListProperty() + { + FoodConsumed = new ChangeTrackingList(); + } + + public static explicit operator DogListProperty(Response response) + { + using JsonDocument jsonDocument = JsonDocument.Parse(response.ContentStream); + return DeserializeDogListProperty(jsonDocument.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + + public static implicit operator RequestContent(DogListProperty dog) + { + return RequestContent.Create(dog, ModelSerializerOptions.DefaultWireOptions); + } + + #region Serialization + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("latinName"u8); + writer.WriteStringValue(LatinName); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("isHungry"u8); + writer.WriteBooleanValue(IsHungry); + writer.WritePropertyName("weight"u8); + writer.WriteNumberValue(Weight); + + if (Optional.IsCollectionDefined(FoodConsumed)) + { + writer.WritePropertyName("foodConsumed"u8); + writer.WriteStartArray(); + foreach (var item in FoodConsumed) + { + writer.WriteStringValue($"{item}"); + } + writer.WriteEndArray(); + } + + if (options.Format == ModelSerializerFormat.Json) + { + //write out the raw data + foreach (var property in RawData) + { + writer.WritePropertyName(property.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(property.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(property.Value.ToString()).RootElement); +#endif + } + } + writer.WriteEndObject(); + } + + internal static DogListProperty DeserializeDogListProperty(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + double weight = default; + string name = ""; + string latinName = ""; + bool isHungry = default; + Dictionary rawData = new Dictionary(); + List foodConsumed = new List(); + + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("weight"u8)) + { + weight = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("latinName"u8)) + { + latinName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isHungry"u8)) + { + isHungry = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("foodConsumed"u8)) + { + foreach (var item in property.Value.EnumerateArray()) + { + foodConsumed.Add(item.GetString()); + } + continue; + } + if (options.Format == ModelSerializerFormat.Json) + { + //this means its an unknown property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new DogListProperty(weight, latinName, name, isHungry, foodConsumed, rawData); + } + #endregion + + internal class DogListPropertyConverter : JsonConverter + { + public override DogListProperty Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var model = DeserializeDogListProperty(JsonDocument.ParseValue(ref reader).RootElement, GetOptions(options)); + //marker used for testing to know if this converter fires + model.RawData.Add("DogListPropertyConverterMarker", new BinaryData("true")); + return model; + } + + public override void Write(Utf8JsonWriter writer, DogListProperty value, JsonSerializerOptions options) + { + ((IModelJsonSerializable)value).Serialize(writer, GetOptions(options)); + } + + private ModelSerializerOptions GetOptions(JsonSerializerOptions options) + { + //pulls the additional properties setting from the ModelJsonConverter if it exists + //if it does not exist it uses the default value of true for azure sdk use cases + var modelConverter = options.Converters.FirstOrDefault(c => c.GetType() == typeof(ModelJsonConverter)) as ModelJsonConverter; + return modelConverter is not null ? modelConverter.ModelSerializerOptions : ModelSerializerOptions.DefaultWireOptions; + } + } + DogListProperty IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return DeserializeDogListProperty(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + DogListProperty IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeDogListProperty(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListPropertyBlankConverter.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListPropertyBlankConverter.cs new file mode 100644 index 000000000000..188048b7250d --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/DogListPropertyBlankConverter.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + public class DogListPropertyBlankConverter : JsonConverter + { + public override DogListProperty Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var model = JsonDocument.ParseValue(ref reader); + return new DogListProperty(); + } + + public override void Write(Utf8JsonWriter writer, DogListProperty value, JsonSerializerOptions options) + { + return; + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Envelope.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Envelope.cs new file mode 100644 index 000000000000..3d828ce22275 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/Envelope.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + public class Envelope : IModelJsonSerializable>, IUtf8JsonSerializable + { + private Dictionary RawData { get; set; } = new Dictionary(); + + public string ReadOnlyProperty { get; private set; } = "readonly"; + + public Envelope() + { + } + + public Envelope(string readOnlyProperty) + { + ReadOnlyProperty = readOnlyProperty; + } + + internal Envelope(string readOnlyProperty, CatReadOnlyProperty modelA, T modelT, Dictionary rawData) + { + ReadOnlyProperty = readOnlyProperty; + ModelA = modelA; + ModelT = modelT; + RawData = rawData; + } + + public CatReadOnlyProperty ModelA { get; set; } + public T ModelT { get; set; } + + public static implicit operator RequestContent(Envelope envelope) + { + if (envelope == null) + { + return null; + } + + return RequestContent.Create(envelope, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator Envelope(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + using JsonDocument jsonDocument = JsonDocument.Parse(response.ContentStream); + return DeserializeEnvelope(jsonDocument.RootElement, ModelSerializerOptions.DefaultWireOptions); + } + + #region Serialization + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable>)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + void IModelJsonSerializable>.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + Serialize(writer, options); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("readOnlyProperty"u8); + writer.WriteStringValue(ReadOnlyProperty); + } + + writer.WritePropertyName("modelA"u8); + ((IModelJsonSerializable)ModelA).Serialize(writer, options); + writer.WritePropertyName("modelC"u8); + SerializeT(writer, options); + + if (options.Format == ModelSerializerFormat.Json) + { + //write out the raw data + foreach (var property in RawData) + { + writer.WritePropertyName(property.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(property.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(property.Value.ToString()).RootElement); +#endif + } + } + writer.WriteEndObject(); + } + + internal static Envelope DeserializeEnvelope(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string readonlyProperty = ""; + CatReadOnlyProperty modelA = new CatReadOnlyProperty(); + T modelT = default(T); + Dictionary rawData = new Dictionary(); + + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("readOnlyProperty"u8)) + { + readonlyProperty = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelA"u8)) + { + modelA = CatReadOnlyProperty.DeserializeCatReadOnlyProperty(property.Value, options); + continue; + } + if (property.NameEquals("modelC"u8)) + { + modelT = DeserializeT(property.Value, options); + continue; + } + + if (options.Format == ModelSerializerFormat.Json) + { + //this means it's an modelC property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new Envelope(readonlyProperty, modelA, modelT, rawData); + } + + private void SerializeT(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ObjectSerializer serializer = GetObjectSerializer(options); + BinaryData data = serializer.Serialize(ModelT); +#if NET6_0_OR_GREATER + writer.WriteRawValue(data); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(data.ToString()).RootElement); +#endif + } + + private static ObjectSerializer GetObjectSerializer(ModelSerializerOptions options) + { + var serializer = options.ObjectSerializerResolver is not null ? options.ObjectSerializerResolver(typeof(T)) : null; + return serializer ?? JsonObjectSerializer.Default; + } + + private static T DeserializeT(JsonElement element, ModelSerializerOptions options) + { + ObjectSerializer serializer = GetObjectSerializer(options); + MemoryStream m = new MemoryStream(); + Utf8JsonWriter w = new Utf8JsonWriter(m); + element.WriteTo(w); + w.Flush(); + m.Position = 0; + return (T)serializer.Deserialize(m, typeof(T), default); + } + + Envelope IModelSerializable>.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return DeserializeEnvelope(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + Envelope IModelJsonSerializable>.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeEnvelope(doc.RootElement, options); + } + + BinaryData IModelSerializable>.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + #endregion + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/JsonModelForCombinedInterface.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/JsonModelForCombinedInterface.cs new file mode 100644 index 000000000000..e2d6c9317bd8 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/JsonModelForCombinedInterface.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests.Models +{ + internal class JsonModelForCombinedInterface : IUtf8JsonSerializable, IModelJsonSerializable + { + private Dictionary RawData { get; set; } = new Dictionary(); + + public JsonModelForCombinedInterface() { } + + /// Initializes a new instance of ModelXml for testing. + /// + /// + /// or is null. + public JsonModelForCombinedInterface(string key, string value, string readOnlyProperty) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + ReadOnlyProperty = readOnlyProperty; + } + + internal JsonModelForCombinedInterface(string key, string value, string readOnlyProperty, Dictionary rawData) + { + Key = key; + Value = value; + ReadOnlyProperty = readOnlyProperty; + RawData = rawData; + } + + /// Gets or sets the key. + public string Key { get; set; } + /// Gets or sets the value. + public string Value { get; set; } + public string ReadOnlyProperty { get; } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IModelJsonSerializable)this).Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + + internal static JsonModelForCombinedInterface DeserializeJsonModelForCombinedInterface(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readOnlyProperty = default; + Dictionary rawData = new Dictionary(); + + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("readOnlyProperty"u8)) + { + readOnlyProperty = property.Value.GetString(); + continue; + } + if (options.Format == ModelSerializerFormat.Json) + { + //this means its an unknown property we got + rawData.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + return new JsonModelForCombinedInterface(key, value, readOnlyProperty, rawData); + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("readOnlyProperty"u8); + writer.WriteStringValue(ReadOnlyProperty); + } + if (options.Format == ModelSerializerFormat.Json) + { + //write out the raw data + foreach (var property in RawData) + { + writer.WritePropertyName(property.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(property.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(property.Value.ToString()).RootElement); +#endif + } + } + writer.WriteEndObject(); + } + + JsonModelForCombinedInterface IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + return DeserializeJsonModelForCombinedInterface(JsonDocument.Parse(data.ToString()).RootElement, options); + } + + JsonModelForCombinedInterface IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeJsonModelForCombinedInterface(doc.RootElement, options); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return ModelSerializer.SerializeCore(this, options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlCrossLibrary.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlCrossLibrary.cs new file mode 100644 index 000000000000..4b13e96b1e4c --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlCrossLibrary.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Text.Json; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; + +namespace Azure.Core.Tests.Public.ModelSerializationTests.Models +{ + [XmlRoot("Tag")] + public class ModelXmlCrossLibrary : IXmlSerializable, IModelSerializable, IModelJsonSerializable, IUtf8JsonSerializable + { + internal ModelXmlCrossLibrary() { } + + /// Initializes a new instance of ModelXml for testing. + /// + /// + /// or is null. + public ModelXmlCrossLibrary(string key, string value, string readonlyProperty, ChildModelXml childModelXml) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + ReadOnlyProperty = readonlyProperty; + ChildModelXml = childModelXml; + } + + /// Gets or sets the key. + [XmlElement("Key")] + public string Key { get; set; } + /// Gets or sets the value. + [XmlElement("Value")] + public string Value { get; set; } + /// Gets or sets the value. + [XmlElement("ReadOnlyProperty")] + public string ReadOnlyProperty { get; } + [XmlElement("ChildTag")] + public ChildModelXml ChildModelXml { get; set; } + + public static implicit operator RequestContent(ModelXmlCrossLibrary modelXmlCrossLibrary) + { + if (modelXmlCrossLibrary == null) + { + return null; + } + + return RequestContent.Create((IModelSerializable)modelXmlCrossLibrary, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator ModelXmlCrossLibrary(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + return DeserializeModelXmlCrossLibrary(XElement.Load(response.ContentStream), ModelSerializerOptions.DefaultWireOptions); + } + + public void Serialize(XmlWriter writer, string nameHint) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + void IXmlSerializable.Write(XmlWriter writer, string nameHint) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + private void Serialize(XmlWriter writer, ModelSerializerOptions options, string nameHint) + { + writer.WriteStartElement(nameHint ?? "Tag"); + writer.WriteStartElement("Key"); + writer.WriteValue(Key); + writer.WriteEndElement(); + writer.WriteStartElement("Value"); + writer.WriteValue(Value); + writer.WriteEndElement(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WriteStartElement("ReadOnlyProperty"); + writer.WriteValue(ReadOnlyProperty); + writer.WriteEndElement(); + } + var childModelXml = ModelSerializer.Serialize(ChildModelXml, options); + var bytes = childModelXml.ToArray(); + int start = bytes.AsSpan(1).IndexOf((byte)'>') + 2; + var chars = Encoding.UTF8.GetChars(bytes, start, bytes.Length - start); + writer.WriteRaw(chars, 0, chars.Length); + writer.WriteEndElement(); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("readOnlyProperty"u8); + writer.WriteStringValue(ReadOnlyProperty); + } + writer.WritePropertyName("childTag"u8); + ((IModelJsonSerializable)ChildModelXml).Serialize(writer, options); + writer.WriteEndObject(); + } + + public static ModelXmlCrossLibrary DeserializeModelXmlCrossLibrary(XElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readonlyProperty = default; + ChildModelXml childModelXml = default; + if (element.Element("Key") is XElement keyElement) + { + key = (string)keyElement; + } + if (element.Element("Value") is XElement valueElement) + { + value = (string)valueElement; + } + if (element.Element("ReadOnlyProperty") is XElement readonlyPropertyElement) + { + readonlyProperty = (string)readonlyPropertyElement; + } + if (element.Element("ChildTag") is XElement renamedChildModelXmlElement) + { + using MemoryStream stream = new MemoryStream(); + renamedChildModelXmlElement.Save(stream); + BinaryData data = stream.Position > int.MaxValue + ? BinaryData.FromStream(stream) + : new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + childModelXml = ModelSerializer.Deserialize(data, options); + } + return new ModelXmlCrossLibrary(key, value, readonlyProperty, childModelXml); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + return ModelSerializer.SerializeCore(this, options); + } + else + { + options ??= ModelSerializerOptions.DefaultWireOptions; + using MemoryStream stream = new MemoryStream(); + using XmlWriter writer = XmlWriter.Create(stream); + Serialize(writer, options, null); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + } + + internal static ModelXmlCrossLibrary DeserializeModelXmlCrossLibrary(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readOnlyProperty = default; + ChildModelXml childModelXml = default; + + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("readOnlyProperty"u8)) + { + readOnlyProperty = property.Value.GetString(); + continue; + } + if (property.NameEquals("childTag"u8)) + { + childModelXml = ModelSerializer.Deserialize(BinaryData.FromString(property.Value.GetRawText()), options);// ChildModelXml.DeserializeChildModelXml(property.Value, options); + continue; + } + } + return new ModelXmlCrossLibrary(key, value, readOnlyProperty, childModelXml); + } + + ModelXmlCrossLibrary IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + using var doc = JsonDocument.Parse(data); + return DeserializeModelXmlCrossLibrary(doc.RootElement, options); + } + else + { + return DeserializeModelXmlCrossLibrary(XElement.Load(data.ToStream()), options); + } + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format != ModelSerializerFormat.Json) + throw new InvalidOperationException($"Must use '{ModelSerializerFormat.Json}' format when calling the {nameof(IModelJsonSerializable)} interface"); + Serialize(writer, options); + } + + ModelXmlCrossLibrary IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format != ModelSerializerFormat.Json) + throw new InvalidOperationException($"Must use '{ModelSerializerFormat.Json}' format when calling the {nameof(IModelJsonSerializable)} interface"); + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeModelXmlCrossLibrary(doc.RootElement, options); + } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlOnly.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlOnly.cs new file mode 100644 index 000000000000..5c8f81f96489 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/ModelXmlOnly.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests.Models +{ + [XmlRoot("Tag")] + public class ModelXmlOnly : IXmlSerializable, IModelSerializable + { + internal ModelXmlOnly() { } + + /// Initializes a new instance of ModelXml for testing. + /// + /// + /// or is null. + public ModelXmlOnly(string key, string value, string readonlyProperty, ChildModelXmlOnly childModel) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + ReadOnlyProperty = readonlyProperty; + RenamedChildModelXml = childModel; + } + + /// Gets or sets the key. + [XmlElement("Key")] + public string Key { get; set; } + /// Gets or sets the value. + [XmlElement("Value")] + public string Value { get; set; } + /// Gets or sets the value. + [XmlElement("ReadOnlyProperty")] + public string ReadOnlyProperty { get; } + [XmlElement("RenamedChildModelXml")] + public ChildModelXmlOnly RenamedChildModelXml { get; set; } + + public static implicit operator RequestContent(ModelXmlOnly modelXml) + { + if (modelXml == null) + { + return null; + } + + return RequestContent.Create(modelXml, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator ModelXmlOnly(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + return DeserializeModelXmlOnly(XElement.Load(response.ContentStream), ModelSerializerOptions.DefaultWireOptions); + } + + public void Serialize(XmlWriter writer, string nameHint) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + void IXmlSerializable.Write(XmlWriter writer, string nameHint) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + private void Serialize(XmlWriter writer, ModelSerializerOptions options, string nameHint) + { + writer.WriteStartElement(nameHint ?? "Tag"); + writer.WriteStartElement("Key"); + writer.WriteValue(Key); + writer.WriteEndElement(); + writer.WriteStartElement("Value"); + writer.WriteValue(Value); + writer.WriteEndElement(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WriteStartElement("ReadOnlyProperty"); + writer.WriteValue(ReadOnlyProperty); + writer.WriteEndElement(); + } + writer.WriteObjectValue(RenamedChildModelXml, "RenamedChildModelXml"); + writer.WriteEndElement(); + } + + public static ModelXmlOnly DeserializeModelXmlOnly(XElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readonlyProperty = default; + ChildModelXmlOnly childModelXml = default; + if (element.Element("Key") is XElement keyElement) + { + key = (string)keyElement; + } + if (element.Element("Value") is XElement valueElement) + { + value = (string)valueElement; + } + if (element.Element("ReadOnlyProperty") is XElement readonlyPropertyElement) + { + readonlyProperty = (string)readonlyPropertyElement; + } + if (element.Element("RenamedChildModelXml") is XElement renamedChildModelXmlElement) + { + childModelXml = ChildModelXmlOnly.DeserializeChildModelXmlOnly(renamedChildModelXmlElement, options); + } + return new ModelXmlOnly(key, value, readonlyProperty, childModelXml); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + using MemoryStream stream = new MemoryStream(); + using XmlWriter writer = XmlWriter.Create(stream); + Serialize(writer, options, null); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + ModelXmlOnly IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + return DeserializeModelXmlOnly(XElement.Load(data.ToStream()), options); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/XmlModelForCombinedInterface.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/XmlModelForCombinedInterface.cs new file mode 100644 index 000000000000..b8d35812b851 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/Models/XmlModelForCombinedInterface.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; +using Azure.Core.Serialization; + +namespace Azure.Core.Tests.Public.ModelSerializationTests.Models +{ + [XmlRoot("Tag")] + internal class XmlModelForCombinedInterface : IXmlSerializable, IModelSerializable, IModelJsonSerializable, IUtf8JsonSerializable + { + public XmlModelForCombinedInterface() { } + + /// Initializes a new instance of ModelXml for testing. + /// + /// + /// or is null. + public XmlModelForCombinedInterface(string key, string value, string readOnlyProperty) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + ReadOnlyProperty = readOnlyProperty; + } + + /// Gets or sets the key. + [XmlElement("Key")] + public string Key { get; set; } + /// Gets or sets the value. + [XmlElement("Value")] + public string Value { get; set; } + /// Gets or sets the value. + [XmlElement("ReadOnlyProperty")] + public string ReadOnlyProperty { get; } + + public static implicit operator RequestContent(XmlModelForCombinedInterface xmlModelForCombinedInterface) + { + if (xmlModelForCombinedInterface == null) + { + return null; + } + + return RequestContent.Create((IModelSerializable)xmlModelForCombinedInterface, ModelSerializerOptions.DefaultWireOptions); + } + + public static explicit operator XmlModelForCombinedInterface(Response response) + { + Argument.AssertNotNull(response, nameof(response)); + + return DeserializeXmlModelForCombinedInterface(XElement.Load(response.ContentStream), ModelSerializerOptions.DefaultWireOptions); + } + + void IXmlSerializable.Write(XmlWriter writer, string nameHint) => + Serialize(writer, ModelSerializerOptions.DefaultWireOptions, nameHint); + + internal static XmlModelForCombinedInterface DeserializeXmlModelForCombinedInterface(XElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readOnlyProperty = default; + if (element.Element("Key") is XElement keyElement) + { + key = (string)keyElement; + } + if (element.Element("Value") is XElement valueElement) + { + value = (string)valueElement; + } + if (element.Element("ReadOnlyProperty") is XElement readOnlyPropertyElement) + { + readOnlyProperty = (string)readOnlyPropertyElement; + } + return new XmlModelForCombinedInterface(key, value, readOnlyProperty); + } + + private void Serialize(XmlWriter writer, ModelSerializerOptions options, string nameHint) + { + writer.WriteStartElement(nameHint ?? "Tag"); + writer.WriteStartElement("Key"); + writer.WriteValue(Key); + writer.WriteEndElement(); + writer.WriteStartElement("Value"); + writer.WriteValue(Value); + writer.WriteEndElement(); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WriteStartElement("ReadOnlyProperty"); + writer.WriteValue(ReadOnlyProperty); + writer.WriteEndElement(); + } + writer.WriteEndElement(); + } + + private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format == ModelSerializerFormat.Json) + { + writer.WritePropertyName("readOnlyProperty"u8); + writer.WriteStringValue(ReadOnlyProperty); + } + writer.WriteEndObject(); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + return ModelSerializer.SerializeCore(this, options); + } + else + { + options ??= ModelSerializerOptions.DefaultWireOptions; + using MemoryStream stream = new MemoryStream(); + using XmlWriter writer = XmlWriter.Create(stream); + Serialize(writer, options, null); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + } + + internal static XmlModelForCombinedInterface DeserializeXmlModelForCombinedInterface(JsonElement element, ModelSerializerOptions options = default) + { + options ??= ModelSerializerOptions.DefaultWireOptions; + + string key = default; + string value = default; + string readOnlyProperty = default; + + Dictionary rawData = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("readOnlyProperty"u8)) + { + readOnlyProperty = property.Value.GetString(); + continue; + } + } + return new XmlModelForCombinedInterface(key, value, readOnlyProperty); + } + + XmlModelForCombinedInterface IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format == ModelSerializerFormat.Json) + { + using var doc = JsonDocument.Parse(data); + return DeserializeXmlModelForCombinedInterface(doc.RootElement, options); + } + else + { + return DeserializeXmlModelForCombinedInterface(XElement.Load(data.ToStream()), options); + } + } + + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format != ModelSerializerFormat.Json) + throw new InvalidOperationException($"Must use '{ModelSerializerFormat.Json}' format when calling the {nameof(IModelJsonSerializable)} interface"); + + Serialize(writer, options); + } + + XmlModelForCombinedInterface IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + ModelSerializerHelper.ValidateFormat(this, options.Format); + + if (options.Format != ModelSerializerFormat.Json) + throw new InvalidOperationException($"Must use '{ModelSerializerFormat.Json}' format when calling the {nameof(IModelJsonSerializable)} interface"); + + using var doc = JsonDocument.ParseValue(ref reader); + return DeserializeXmlModelForCombinedInterface(doc.RootElement, options); + } + + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => + Serialize(writer, ModelSerializerOptions.DefaultWireOptions); + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ResourceProviderDataTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ResourceProviderDataTests.cs new file mode 100644 index 000000000000..9740b86da459 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/ResourceProviderDataTests.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using Azure.Core.Serialization; +using Azure.Core.Tests.Common; +using Azure.Core.Tests.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class ResourceProviderDataTests : ModelJsonTests + { + protected override string JsonPayload => WirePayload; + + protected override string WirePayload => File.ReadAllText(TestData.GetLocation("ResourceProviderData/ResourceProviderData-Collapsed.json")).TrimEnd(); + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (ResourceProviderData)response; + + protected override void CompareModels(ResourceProviderData model, ResourceProviderData model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Id, model2.Id); + } + + protected override string GetExpectedResult(ModelSerializerFormat format) => WirePayload; + + protected override void VerifyModel(ResourceProviderData model, ModelSerializerFormat format) + { + Assert.IsNotNull(model); + Assert.IsNotNull(model.Id); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/RoundTripStrategy.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/RoundTripStrategy.cs new file mode 100644 index 000000000000..efc2cb3f4ab5 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/RoundTripStrategy.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Reflection.Metadata.Ecma335; +using System.Text; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.TestFramework; + +#pragma warning disable SA1402 // File may only contain a single type +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + public abstract class RoundTripStrategy + { + public abstract object Deserialize(string payload, object model, ModelSerializerOptions options); + public abstract BinaryData Serialize(T model, ModelSerializerOptions options); + public abstract bool IsExplicitJsonSerialize { get; } + public abstract bool IsExplicitJsonDeserialize { get; } + } + + public class ModelSerializerStrategy : RoundTripStrategy where T : IModelSerializable + { + public override bool IsExplicitJsonSerialize => false; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return ModelSerializer.Serialize(model, options); + } + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), options); + } + } + + public class ModelSerializerFormatOverloadStrategy : RoundTripStrategy where T : IModelSerializable + { + public override bool IsExplicitJsonSerialize => false; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return ModelSerializer.Serialize(model, options.Format); + } + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), options.Format); + } + } + + public class ModelSerializerNonGenericStrategy : RoundTripStrategy where T : IModelSerializable + { + public override bool IsExplicitJsonSerialize => false; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return ModelSerializer.Serialize((object)model, options); + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ModelSerializer.Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), typeof(T), options); + } + } + + public class ModelInterfaceStrategy : RoundTripStrategy where T : IModelSerializable + { + public override bool IsExplicitJsonSerialize => false; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return model.Serialize(options); + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ((IModelSerializable)model).Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), options); + } + } + + public class ModelInterfaceNonGenericStrategy : RoundTripStrategy where T : IModelSerializable + { + public override bool IsExplicitJsonSerialize => false; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return ((IModelSerializable)model).Serialize(options); + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ((IModelSerializable)model).Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), options); + } + } + + public class JsonInterfaceStrategy : RoundTripStrategy where T : IModelJsonSerializable + { + public override bool IsExplicitJsonSerialize => true; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + using MemoryStream stream = new MemoryStream(); + using Utf8JsonWriter writer = new Utf8JsonWriter(stream); + model.Serialize(writer, options); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ((IModelJsonSerializable)model).Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), options); + } + } + + public class JsonModelWriterStrategy : RoundTripStrategy where T : IModelJsonSerializable + { + public override bool IsExplicitJsonSerialize => true; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return ModelSerializer.SerializeCore(model, options); + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ((IModelJsonSerializable)model).Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), options); + } + } + + public class JsonInterfaceNonGenericStrategy : RoundTripStrategy where T : IModelJsonSerializable + { + public override bool IsExplicitJsonSerialize => true; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return ModelSerializer.SerializeCore((IModelJsonSerializable)model, options); + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + return ((IModelJsonSerializable)model).Deserialize(new BinaryData(Encoding.UTF8.GetBytes(payload)), options); + } + } + + public class JsonInterfaceUtf8ReaderStrategy : RoundTripStrategy where T : IModelJsonSerializable + { + public override bool IsExplicitJsonSerialize => true; + public override bool IsExplicitJsonDeserialize => true; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + using MemoryStream stream = new MemoryStream(); + using Utf8JsonWriter writer = new Utf8JsonWriter(stream); + model.Serialize(writer, options); + writer.Flush(); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + var reader = new Utf8JsonReader(new BinaryData(Encoding.UTF8.GetBytes(payload))); + return ((IModelJsonSerializable)model).Deserialize(ref reader, options); + } + } + + public class JsonInterfaceUtf8ReaderNonGenericStrategy : RoundTripStrategy where T : IModelJsonSerializable + { + public override bool IsExplicitJsonSerialize => true; + public override bool IsExplicitJsonDeserialize => true; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + return ModelSerializer.SerializeCore((IModelJsonSerializable)model, options); + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + var reader = new Utf8JsonReader(new BinaryData(Encoding.UTF8.GetBytes(payload))); + return ((IModelJsonSerializable)model).Deserialize(ref reader, options); + } + } + + public class CastStrategy : RoundTripStrategy where T : IModelSerializable + { + private Func _toRequestContent; + private Func _fromResponse; + + public CastStrategy(Func toRequestContent, Func fromResponse) + { + _toRequestContent = toRequestContent; + _fromResponse = fromResponse; + } + + public override bool IsExplicitJsonSerialize => false; + public override bool IsExplicitJsonDeserialize => false; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + RequestContent content = _toRequestContent(model); + content.TryComputeLength(out var length); + using var stream = new MemoryStream((int)length); + content.WriteTo(stream, default); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + var response = new MockResponse(200); + response.ContentStream = new MemoryStream(Encoding.UTF8.GetBytes(payload)); + return _fromResponse(response); + } + } + + public class ModelJsonConverterStrategy : RoundTripStrategy where T : IModelJsonSerializable + { + public override bool IsExplicitJsonSerialize => true; + public override bool IsExplicitJsonDeserialize => true; + + public override BinaryData Serialize(T model, ModelSerializerOptions options) + { + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(); + jsonSerializerOptions.Converters.Add(new ModelJsonConverter(options)); + return BinaryData.FromString(JsonSerializer.Serialize(model, jsonSerializerOptions)); + } + public override object Deserialize(string payload, object model, ModelSerializerOptions options) + { + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(); + jsonSerializerOptions.Converters.Add(new ModelJsonConverter(options)); + return JsonSerializer.Deserialize(payload, jsonSerializerOptions); + } + } +} +#pragma warning restore SA1402 // File may only contain a single type diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/UnknownBaseModelTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/UnknownBaseModelTests.cs new file mode 100644 index 000000000000..d81a640721a0 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/UnknownBaseModelTests.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class UnknownBaseModelTests : ModelJsonTests + { + protected override BaseModel GetModelInstance() + { + var typeToActivate = typeof(BaseModel).Assembly.GetTypes().FirstOrDefault(t => t.Name == $"Unknown{typeof(BaseModel).Name}"); + return Activator.CreateInstance(typeToActivate, true) as BaseModel; + } + + protected override string JsonPayload => WirePayload; + + protected override string WirePayload => "{\"kind\":\"Z\",\"name\":\"zmodel\",\"zProperty\":1.5,\"extra\":\"stuff\"}"; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (BaseModel)response; + + protected override void CompareModels(BaseModel model, BaseModel model2, ModelSerializerFormat format) + { + Assert.AreEqual("UnknownBaseModel", model.GetType().Name); + Assert.AreEqual("UnknownBaseModel", model2.GetType().Name); + Assert.AreEqual(model.Kind, model2.Kind); + Assert.AreEqual(model.Name, model2.Name); + var rawData = GetRawData(model); + var rawData2 = GetRawData(model2); + Assert.IsNotNull(rawData); + Assert.IsNotNull(rawData2); + if (format == ModelSerializerFormat.Json) + { + Assert.AreEqual(rawData.Count, rawData2.Count); + Assert.AreEqual(rawData["zProperty"].ToObjectFromJson(), rawData2["zProperty"].ToObjectFromJson()); + Assert.AreEqual(rawData["extra"].ToObjectFromJson(), rawData2["extra"].ToObjectFromJson()); + } + } + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + string expected = "{\"kind\":\"Z\",\"name\":\"zmodel\""; + if (format == ModelSerializerFormat.Json) + expected += ",\"zProperty\":1.5,\"extra\":\"stuff\""; + expected += "}"; + return expected; + } + + protected override void VerifyModel(BaseModel model, ModelSerializerFormat format) + { + Assert.AreEqual("UnknownBaseModel", model.GetType().Name); + Assert.AreEqual("Z", model.Kind); + Assert.AreEqual("zmodel", model.Name); + var rawData = GetRawData(model); + Assert.IsNotNull(rawData); + if (format == ModelSerializerFormat.Json) + { + Assert.AreEqual(1.5, rawData["zProperty"].ToObjectFromJson()); + Assert.AreEqual("stuff", rawData["extra"].ToObjectFromJson()); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/UsingJsonSerializerTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/UsingJsonSerializerTests.cs new file mode 100644 index 000000000000..4d1a05616025 --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/UsingJsonSerializerTests.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.Tests.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + public class UsingJsonSerializerTests + { + [TestCase("J")] + [TestCase("W")] + public void CanSerializeTwoModelsWithSameConverter(string format) + { + string modelYResponse = "{\"kind\":\"Y\",\"name\":\"ymodel\",\"yProperty\":\"100\",\"extra\":\"stuff\"}"; + string modelXResponse = "{\"kind\":\"X\",\"name\":\"xmodel\",\"xProperty\":100,\"extra\":\"stuff\"}"; + + var options = new JsonSerializerOptions(); + options.Converters.Add(new ModelJsonConverter(format)); + ModelY modelY = JsonSerializer.Deserialize(modelYResponse, options); + + Assert.AreEqual("Y", modelY.Kind); + Assert.AreEqual("ymodel", modelY.Name); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual("100", modelY.YProperty); + + var additionalProperties = ModelTests.GetRawData(modelY); + Assert.IsNotNull(additionalProperties); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual("stuff", additionalProperties["extra"].ToObjectFromJson()); + + string expectedModelY = "{"; + expectedModelY += "\"kind\":\"Y\",\"name\":\"ymodel\""; + if (format == ModelSerializerFormat.Json) + expectedModelY += ",\"yProperty\":\"100\",\"extra\":\"stuff\""; + expectedModelY += "}"; + + var actualModelY = JsonSerializer.Serialize(modelY, options); + Assert.AreEqual(expectedModelY, actualModelY); + + ModelX modelX = JsonSerializer.Deserialize(modelXResponse, options); + + Assert.AreEqual("X", modelX.Kind); + Assert.AreEqual("xmodel", modelX.Name); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual(100, modelX.XProperty); + + additionalProperties = ModelTests.GetRawData(modelX); + Assert.IsNotNull(additionalProperties); + if (format == ModelSerializerFormat.Json) + Assert.AreEqual("stuff", additionalProperties["extra"].ToObjectFromJson()); + + string expectedModelX = "{"; + expectedModelX += "\"kind\":\"X\""; + expectedModelX += ",\"name\":\"xmodel\""; + if (format == ModelSerializerFormat.Json) + expectedModelX += ",\"xProperty\":100"; + if (format == ModelSerializerFormat.Json) + expectedModelX += ",\"extra\":\"stuff\""; + expectedModelX += "}"; + + var actualModelX = JsonSerializer.Serialize(modelX, options); + Assert.AreEqual(expectedModelX, actualModelX); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/VerifyModels.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/VerifyModels.cs new file mode 100644 index 000000000000..3c8aea67019e --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/VerifyModels.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Azure.Core.Serialization; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class VerifyModels + { + public static void CheckAnimals(Animal x, Animal y, ModelSerializerOptions options) + { + VerifyProperties(x, y, options); + } + + private static void VerifyProperties(Animal x, Animal y, ModelSerializerOptions options) + { + if (options.Format == ModelSerializerFormat.Json) + Assert.That(x.LatinName, Is.EqualTo(y.LatinName)); + Assert.That(x.Name, Is.EqualTo(y.Name)); + Assert.That(x.Weight, Is.EqualTo(y.Weight)); + + if (options.Format == ModelSerializerFormat.Json) + { + var additionalPropertiesX = typeof(Animal).GetProperty("RawData", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(x) as Dictionary; + var additionalPropertiesY = typeof(Animal).GetProperty("RawData", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(y) as Dictionary; + + Assert.AreEqual(additionalPropertiesX.Count, additionalPropertiesY.Count); + + foreach (var additionalProperty in additionalPropertiesX) + { + Assert.IsTrue(additionalPropertiesY.ContainsKey(additionalProperty.Key)); + Assert.AreEqual(additionalProperty.Value.ToString(), additionalPropertiesY[additionalProperty.Key].ToString()); + } + foreach (var additionalProperty in additionalPropertiesY) + { + Assert.IsTrue(additionalPropertiesX.ContainsKey(additionalProperty.Key)); + Assert.AreEqual(additionalProperty.Value.ToString(), additionalPropertiesX[additionalProperty.Key].ToString()); + } + } + } + + public static void CheckCats(CatReadOnlyProperty x, CatReadOnlyProperty y, ModelSerializerOptions options) + { + VerifyProperties(x, y, options); + Assert.That(x.HasWhiskers, Is.EqualTo(y.HasWhiskers)); + } + + public static void CheckDogs(DogListProperty x, DogListProperty y, ModelSerializerOptions options) + { + VerifyProperties(x, y, options); + Assert.That(x.FoodConsumed, Is.EqualTo(y.FoodConsumed)); + } + + public static string NormalizeNewLines(string value) + { + return value + .Replace("\r\n", "\n") + .Replace("\n", Environment.NewLine); + } + } +} diff --git a/sdk/core/Azure.Core/tests/public/ModelSerializationTests/XmlModelForCombinedInterfaceTests.cs b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/XmlModelForCombinedInterfaceTests.cs new file mode 100644 index 000000000000..0543b09a435b --- /dev/null +++ b/sdk/core/Azure.Core/tests/public/ModelSerializationTests/XmlModelForCombinedInterfaceTests.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Azure.Core.Serialization; +using Azure.Core.Tests.Public.ModelSerializationTests.Models; +using NUnit.Framework; + +namespace Azure.Core.Tests.Public.ModelSerializationTests +{ + internal class XmlModelForCombinedInterfaceTests : ModelJsonTests + { + protected override string JsonPayload => "{\"key\":\"Color\",\"value\":\"Red\",\"readOnlyProperty\":\"ReadOnly\"}"; + + protected override string WirePayload => "" + + "Color" + + "Red" + + "ReadOnly" + + ""; + + protected override Func ToRequestContent => model => model; + + protected override Func FromResponse => response => (XmlModelForCombinedInterface)response; + + protected override string GetExpectedResult(ModelSerializerFormat format) + { + if (format == ModelSerializerFormat.Wire) + { + var expectedSerializedString = "\uFEFFColorRed"; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += "ReadOnly"; + expectedSerializedString += ""; + return expectedSerializedString; + } + if (format == ModelSerializerFormat.Json) + { + var expectedSerializedString = "{\"key\":\"Color\",\"value\":\"Red\""; + if (format.Equals(ModelSerializerFormat.Json)) + expectedSerializedString += ",\"readOnlyProperty\":\"ReadOnly\""; + expectedSerializedString += "}"; + return expectedSerializedString; + } + throw new InvalidOperationException($"Unknown format used in test {format}"); + } + + protected override void VerifyModel(XmlModelForCombinedInterface model, ModelSerializerFormat format) + { + Assert.AreEqual("Color", model.Key); + Assert.AreEqual("Red", model.Value); + if (format.Equals(ModelSerializerFormat.Json)) + Assert.AreEqual("ReadOnly", model.ReadOnlyProperty); + } + + protected override void CompareModels(XmlModelForCombinedInterface model, XmlModelForCombinedInterface model2, ModelSerializerFormat format) + { + Assert.AreEqual(model.Key, model2.Key); + Assert.AreEqual(model.Value, model2.Value); + if (format.Equals(ModelSerializerFormat.Json)) + Assert.AreEqual(model.ReadOnlyProperty, model2.ReadOnlyProperty); + } + } +} From ef1253216064e0b43552eba87e98b898f5087441 Mon Sep 17 00:00:00 2001 From: yzt Date: Mon, 11 Sep 2023 21:21:09 +0800 Subject: [PATCH 03/45] Release v1.11.1 (#38602) --- .../CHANGELOG.md | 10 ++++------ ...soft.Azure.WebJobs.Extensions.SignalRService.csproj | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md index d03e49145d9e..3ef417a09ff2 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md @@ -1,14 +1,12 @@ # Release History -## 1.12.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes +## 1.11.1 (2023-09-11) ### Bugs Fixed +* Fixed the issue when using customized server endpoint with Azure AD credential. ### Other Changes +* Upgraded `Microsoft.Azure.SignalR`, `Microsoft.Azure.SignalR.Management`, `Microsoft.Azure.SignalR.Protocols` from 1.21.4 to 1.21.6 ## 1.11.0 (2023-06-17) @@ -16,7 +14,7 @@ * Fixed the bug that a wrong exception is thrown when the SignalR connection is not found using REST API to close a connection or add a connection to group. ### Other Changes -* Upgraded `Microsoft.Azure.SignalR`, `Microsoft.Azure.SignalR.Management`, `Microsoft.Azure.SignalR.Protocols` to 1.21.3 +* Upgraded `Microsoft.Azure.SignalR`, `Microsoft.Azure.SignalR.Management`, `Microsoft.Azure.SignalR.Protocols` to 1.21.4 ## 1.10.0 (2023-04-11) diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj index f4ea727e9423..c98da6ff9c9d 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj @@ -3,7 +3,7 @@ $(RequiredTargetFrameworks) Microsoft.Azure.WebJobs.Extensions.SignalRService - 1.12.0-beta.1 + 1.11.1 1.11.0 true From 5687a7924f790435c8ac8ab8b4bee4dec5622cde Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Mon, 11 Sep 2023 11:37:58 -0400 Subject: [PATCH 04/45] [Event Hubs] September 2023 Release Prep (#38604) The focus of these changes is to prepare the core Event Hubs library for the September 2023 release. --- sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md | 6 +----- .../src/Azure.Messaging.EventHubs.csproj | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md index d48cb0b73bc1..0fb1efe2eb5f 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md @@ -1,10 +1,6 @@ # Release History -## 5.10.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes +## 5.9.3 (2023-09-12) ### Bugs Fixed diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj index f3933b68fb05..14d18b5d936e 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj @@ -1,7 +1,7 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This client library allows for both publishing and consuming events using Azure Event Hubs. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ - 5.10.0-beta.1 + 5.9.3 5.9.2 Azure;Event Hubs;EventHubs;.NET;AMQP;IoT;$(PackageCommonTags) From 9128b31d894af50b5ae65463fb79076dcefd173a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 11 Sep 2023 08:52:48 -0700 Subject: [PATCH 05/45] Sync eng/common directory with azure-sdk-tools repository (#38606) --- .../Service-Level-Readme-Automation.ps1 | 42 +++++++++++++------ .../Verify-RequiredDocsJsonMembers.ps1 | 10 +++++ .../stress-test-deployment-lib.ps1 | 2 +- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/eng/common/scripts/Service-Level-Readme-Automation.ps1 b/eng/common/scripts/Service-Level-Readme-Automation.ps1 index 2d0e5c67920a..e7dcbf7bf5fd 100644 --- a/eng/common/scripts/Service-Level-Readme-Automation.ps1 +++ b/eng/common/scripts/Service-Level-Readme-Automation.ps1 @@ -1,12 +1,12 @@ <# .SYNOPSIS -The script is to generate service level readme if it is missing. +The script is to generate service level readme if it is missing. For exist ones, we do 2 things here: 1. Generate the client but not import to the existing service level readme. 2. Update the metadata of service level readme .DESCRIPTION -Given a doc repo location, and the credential for fetching the ms.author. +Given a doc repo location, and the credential for fetching the ms.author. Generate missing service level readme and updating metadata of the existing ones. .PARAMETER DocRepoLocation @@ -53,9 +53,9 @@ $fullMetadata = Get-CSVMetadata $monikers = @("latest", "preview") foreach($moniker in $monikers) { # The onboarded packages return is key-value pair, which key is the package index, and value is the package info from {metadata}.json - # E.g. + # E.g. # Key as: @azure/storage-blob - # Value as: + # Value as: # { # "Name": "@azure/storage-blob", # "Version": "12.10.0-beta.1", @@ -73,22 +73,38 @@ foreach($moniker in $monikers) { $onboardedPackages = &$GetOnboardedDocsMsPackagesForMonikerFn ` -DocRepoLocation $DocRepoLocation -moniker $moniker $csvMetadata = @() + foreach($metadataEntry in $fullMetadata) { if ($metadataEntry.Package -and $metadataEntry.Hide -ne 'true') { $pkgKey = GetPackageKey $metadataEntry - if($onboardedPackages.ContainsKey($pkgKey)) { - if ($onboardedPackages[$pkgKey] -and $onboardedPackages[$pkgKey].DirectoryPath) { - if (!($metadataEntry.PSObject.Members.Name -contains "DirectoryPath")) { - Add-Member -InputObject $metadataEntry ` - -MemberType NoteProperty ` - -Name DirectoryPath ` - -Value $onboardedPackages[$pkgKey].DirectoryPath - } - } + + if (!$onboardedPackages.ContainsKey($pkgKey)) { + continue + } + + $package = $onboardedPackages[$pkgKey] + + if (!$package) { $csvMetadata += $metadataEntry + continue } + + # If the metadata JSON entry has a DirectoryPath, but the CSV entry + # does not, add the DirectoryPath to the CSV entry + if (($package.PSObject.Members.Name -contains 'DirectoryPath') ` + -and !($metadataEntry.PSObject.Members.Name -contains "DirectoryPath") ) { + + Add-Member -InputObject $metadataEntry ` + -MemberType NoteProperty ` + -Name DirectoryPath ` + -Value $package.DirectoryPath + } + + $csvMetadata += $metadataEntry + } } + $packagesForService = @{} $allPackages = GetPackageLookup $csvMetadata foreach ($metadataKey in $allPackages.Keys) { diff --git a/eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1 b/eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1 index 4bdd5adfaf8c..8875d80e4348 100644 --- a/eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1 +++ b/eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1 @@ -91,6 +91,16 @@ function Test-RequiredDocsJsonMembers($moniker) { $script:FoundError = $true } + if ($fileObject.PSObject.Members.Name -contains 'DirectoryPath') { + if ($null -eq $fileObject.DirectoryPath) { + Write-Host "$path has a null DirectoryPath member. If the DirectoryPath is unknown please use the value `"`"." + $script:FoundError = $true + } + } else { + Write-Host "$path is missing its DirectoryPath member. If the DirectoryPath is unknown please use the value `"`"." + $script:FoundError = $true + } + if ($Language -eq "java") { if ($fileObject.PSObject.Members.Name -contains "Group") { diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index 0f5ae468a98c..bdaec9e711a9 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -401,7 +401,7 @@ function CheckDependencies() $job | Remove-Job -Force if (($result -eq $null -and $job.State -ne "Completed") -or ($result | Select -Last 1) -ne 0) { - throw "Docker does not appear to be running. Start/restart docker." + throw "Docker does not appear to be running. Start/restart docker or re-run this script with -SkipPushImages" } } From 3a998b079ac1b23f0b684fc2e0063608096be776 Mon Sep 17 00:00:00 2001 From: Anne Thompson Date: Mon, 11 Sep 2023 13:36:39 -0700 Subject: [PATCH 06/45] Don't allow setting Variant to Variant (#38592) * Don't allow setting Variant to Variant * pr fb --- .../src/Variant/Variant.cs | 12 ++++- .../tests/Variant/VariantUsage.cs | 52 +++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs b/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs index 68dcf68018da..ec3264b5edd2 100644 --- a/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs +++ b/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs @@ -22,8 +22,16 @@ public readonly partial struct Variant /// public Variant(object? value) { - _object = value; - _union = default; + if (value is Variant variant) + { + _object = variant._object; + _union = variant._union; + } + else + { + _object = value; + _union = default; + } } /// diff --git a/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs b/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs index ece22ee4e7ca..3c115b0ae7b6 100644 --- a/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs +++ b/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs @@ -39,6 +39,58 @@ public void CanGetAsString(Variant v, Variant s) Assert.AreEqual(value, v.ToString()); } + [Test] + public void VariantDoesntStoreVariant() + { + Variant a = new("hi"); + Variant b = new(a); + + Assert.AreEqual(a, b); + Assert.AreEqual(typeof(string), b.Type); + } + + [Test] + public void VariantAssignmentHasReferenceSemantics() + { + // Variant should use reference semantics with reference types + // so that it behaves like object in these cases. + // + // e.g. since: + // List list = new List { "1" }; + // object oa = list; + // object ob = oa; + // list[0] = "2"; + // + // Assert.AreEqual("2", list[0]); + // Assert.AreEqual("2", ((List)oa)[0]); + // Assert.AreEqual("2", ((List)ob)[0]); + // + // Variant should do the same. + // The following test validates this functionality. + + List list = new List { "1" }; + Variant a = new(list); + + Assert.AreEqual("1", list[0]); + Assert.AreEqual("1", a.As>()[0]); + + list[0] = "2"; + + Assert.AreEqual("2", list[0]); + Assert.AreEqual("2", a.As>()[0]); + + Variant b = new(a); + + Assert.AreEqual(a, b); + Assert.AreEqual("2", b.As>()[0]); + + list[0] = "3"; + + Assert.AreEqual("3", list[0]); + Assert.AreEqual("3", a.As>()[0]); + Assert.AreEqual("3", b.As>()[0]); + } + #region Helpers public static IEnumerable VariantValues() { From 8a37c316fda4588473bc0bad4305017be3fb7b58 Mon Sep 17 00:00:00 2001 From: Anne Thompson Date: Mon, 11 Sep 2023 15:31:07 -0700 Subject: [PATCH 07/45] Allow As to return null for reference types (#38611) * Allow As to return null for reference types * Improve cast exception message --- .../src/Variant/Variant.cs | 19 +++++++--- .../tests/Variant/VariantUsage.cs | 36 +++++++++++++++++++ 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs b/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs index ec3264b5edd2..12cb8bd9efd0 100644 --- a/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs +++ b/sdk/core/Azure.Core.Experimental/src/Variant/Variant.cs @@ -77,7 +77,17 @@ public readonly Type? Type } [DoesNotReturn] - private static void ThrowInvalidCast() => throw new InvalidCastException(); + private static void ThrowInvalidCast(Type? source, Type target) + { + if (source is null) + { + throw new InvalidCastException($"Unable to cast null Variant to type '{target}'."); + } + else + { + throw new InvalidCastException($"Unable to cast Variant of type '{source}' to type '{target}'."); + } + } [DoesNotReturn] private static void ThrowArgumentNull(string paramName) => throw new ArgumentNullException(paramName); @@ -1296,11 +1306,12 @@ private readonly bool TryGetObjectSlow(out T value) { // Single return has a significant performance benefit. - bool result = false; + bool result; if (_object is null) { value = default!; + result = true; } else if (typeof(T) == typeof(char[])) { @@ -1380,9 +1391,9 @@ private readonly bool TryGetObjectSlow(out T value) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly T As() { - if (!TryGetValue(out T value)) + if (!TryGetValue(out T value)) { - ThrowInvalidCast(); + ThrowInvalidCast(Type, typeof(T)); } return value; diff --git a/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs b/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs index 3c115b0ae7b6..23c8b43815fb 100644 --- a/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs +++ b/sdk/core/Azure.Core.Experimental/tests/Variant/VariantUsage.cs @@ -91,6 +91,42 @@ public void VariantAssignmentHasReferenceSemantics() Assert.AreEqual("3", b.As>()[0]); } + [Test] + public void ReferenceTypesCanBeNull() + { + string s = null; + Variant stringVariant = new(s); + + Assert.AreEqual(Variant.Null, stringVariant); + Assert.IsNull(stringVariant.As()); + + List list = null; + Variant listVariant = new(list); + + Assert.AreEqual(Variant.Null, listVariant); + Assert.IsNull(listVariant.As()); + } + + [Test] + public void NonNullableValueTypesCannotBeNull() + { + int? i = null; + Variant intVariant = new(i); + + Assert.AreEqual(Variant.Null, intVariant); + Assert.Throws(() => intVariant.As()); + } + + [Test] + public void NullableValueTypesCanBeNull() + { + int? i = null; + Variant intVariant = new(i); + + Assert.AreEqual(Variant.Null, intVariant); + Assert.IsNull(intVariant.As()); + } + #region Helpers public static IEnumerable VariantValues() { From 8730dd7190daf5db68e36620aa4458b957c2589b Mon Sep 17 00:00:00 2001 From: Joel Eniqs <32092984+Joeleniqs@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:55:53 -0700 Subject: [PATCH 08/45] [Communication]Enable managed identity in ACScommunication resource sdk (#37566) * Update autorest mark down to latest OpenApi spec * initial code generation with new Swagger spec hash * remove bugged format and generate code * update spec link to remote link * Adding test scenario for MI * Update Export Api * Update to most recent spec hash * Update Sample Snippets * Add Managed Identity tests session records assets * Re-enforce resourceId format * updated test recording * updated recordings * updated-recordings * fix tests and Update test recordings * Update changelog release history * Provide backward compatibility to accomodate breaking change * remove param from fallback overload * Update customize folder with communication service resource data * fix build issues * fix build issues * export api to support older resource data * fix build issues * Update release date of `1.2.0-beta.2` --------- Co-authored-by: Joel Enikanorogbon Co-authored-by: Jorge Beauregard Co-authored-by: Mingzhe Huang --- .../CHANGELOG.md | 14 +- ...rceManager.Communication.netstandard2.0.cs | 3 + .../assets.json | 2 +- .../Sample_CommunicationDomainResource.cs | 10 +- ...e_CommunicationDomainResourceCollection.cs | 8 +- .../Sample_CommunicationServiceResource.cs | 187 +++++++++++++++++- ..._CommunicationServiceResourceCollection.cs | 49 ++++- .../Samples/Sample_EmailServiceResource.cs | 10 +- .../Sample_EmailServiceResourceCollection.cs | 8 +- .../Samples/Sample_SenderUsernameResource.cs | 6 +- ...Sample_SenderUsernameResourceCollection.cs | 8 +- .../Customize/ArmCommunicationModelFactory.cs | 40 ++++ .../CommunicationServiceResourceData.cs | 43 ++++ .../Generated/ArmCommunicationModelFactory.cs | 5 +- .../CommunicationServiceResourceData.cs | 6 +- ...cationServiceResourceData.Serialization.cs | 19 +- ...ationServiceResourcePatch.Serialization.cs | 7 + .../CommunicationServiceResourcePatch.cs | 3 + .../CommunicationServicesRestOperations.cs | 2 +- .../RestOperations/DomainsRestOperations.cs | 2 +- .../EmailServicesRestOperations.cs | 2 +- .../SenderUsernamesRestOperations.cs | 2 +- .../src/autorest.md | 3 +- .../CommunicationServiceTests.cs | 27 +++ 24 files changed, 408 insertions(+), 58 deletions(-) create mode 100644 sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs create mode 100644 sdk/communication/Azure.ResourceManager.Communication/src/Customize/CommunicationServiceResourceData.cs diff --git a/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md b/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md index db4ee60ac203..1a0c9c3eea61 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md +++ b/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.2.0-beta.2 (Unreleased) +## 1.2.0-beta.2 (2023-09-12) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for System Assigned, User Assigned and SystemAndUserAssigned Managed Identity ## 1.2.0-beta.1 (2023-05-29) @@ -118,7 +114,7 @@ Guidance to migrate from previous version of Azure Management SDK Example: Create A Communication Service Instance: Before upgrade: -```C# +```C# using Azure.Identity; using Azure.ResourceManager.Communication; using Azure.ResourceManager.Communication.Models; @@ -131,7 +127,7 @@ var resourceGroupName = "myResourceGroupName"; var resourceName = "myResource"; var resource = new CommunicationServiceResource { Location = "Global", DataLocation = "UnitedStates" }; var operation = await communicationServiceClient.CommunicationService.StartCreateOrUpdateAsync(resourceGroupName, resourceName, resource); -await operation.WaitForCompletionAsync(); +await operation.WaitForCompletionAsync(); ``` After upgrade: @@ -161,7 +157,7 @@ CommunicationService communicationService = communicationServiceLro.Value; ``` ## 1.0.0 (2021-03-29) -This release is the first stable release of the management library for Azure Communication Services. +This release is the first stable release of the management library for Azure Communication Services. Minor changes since the public preview release: - CheckNameAvailability has been added diff --git a/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs b/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs index f1fa06bfc217..1dfd2fcb0bc4 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs @@ -121,6 +121,7 @@ public partial class CommunicationServiceResourceData : Azure.ResourceManager.Mo public CommunicationServiceResourceData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } public string DataLocation { get { throw null; } set { } } public string HostName { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Guid? ImmutableResourceId { get { throw null; } } public System.Collections.Generic.IList LinkedDomains { get { throw null; } } public Azure.Core.ResourceIdentifier NotificationHubId { get { throw null; } } @@ -216,6 +217,7 @@ public static partial class ArmCommunicationModelFactory public static Azure.ResourceManager.Communication.CommunicationDomainResourceData CommunicationDomainResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Communication.Models.DomainProvisioningState? provisioningState = default(Azure.ResourceManager.Communication.Models.DomainProvisioningState?), string dataLocation = null, string fromSenderDomain = null, string mailFromSenderDomain = null, Azure.ResourceManager.Communication.Models.DomainManagement? domainManagement = default(Azure.ResourceManager.Communication.Models.DomainManagement?), Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationStates verificationStates = null, Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationRecords verificationRecords = null, Azure.ResourceManager.Communication.Models.UserEngagementTracking? userEngagementTracking = default(Azure.ResourceManager.Communication.Models.UserEngagementTracking?)) { throw null; } public static Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityResult CommunicationNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityReason? reason = default(Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityReason?), string message = null) { throw null; } public static Azure.ResourceManager.Communication.Models.CommunicationServiceKeys CommunicationServiceKeys(string primaryKey = null, string secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) { throw null; } + public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState = default(Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState?), string hostName = null, string dataLocation = null, Azure.Core.ResourceIdentifier notificationHubId = null, string version = null, System.Guid? immutableResourceId = default(System.Guid?), System.Collections.Generic.IEnumerable linkedDomains = null) { throw null; } public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState = default(Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState?), string hostName = null, string dataLocation = null, Azure.Core.ResourceIdentifier notificationHubId = null, string version = null, System.Guid? immutableResourceId = default(System.Guid?), System.Collections.Generic.IEnumerable linkedDomains = null) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationRecords DomainPropertiesVerificationRecords(Azure.ResourceManager.Communication.Models.VerificationDnsRecord domain = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord spf = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dkim = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dkim2 = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dmarc = null) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationStates DomainPropertiesVerificationStates(Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord domain = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord spf = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dkim = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dkim2 = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dmarc = null) { throw null; } @@ -311,6 +313,7 @@ public CommunicationServiceNameAvailabilityContent() { } public partial class CommunicationServiceResourcePatch : Azure.ResourceManager.Communication.Models.CommunicationAcceptTags { public CommunicationServiceResourcePatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IList LinkedDomains { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] diff --git a/sdk/communication/Azure.ResourceManager.Communication/assets.json b/sdk/communication/Azure.ResourceManager.Communication/assets.json index 22753827e574..73014c588927 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/assets.json +++ b/sdk/communication/Azure.ResourceManager.Communication/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/communication/Azure.ResourceManager.Communication", - "Tag": "net/communication/Azure.ResourceManager.Communication_7b093c3b15" + "Tag": "net/communication/Azure.ResourceManager.Communication_696b7aac1e" } diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResource.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResource.cs index 73017847a389..a7fc3b2dca01 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResource.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResource.cs @@ -23,7 +23,7 @@ public partial class Sample_CommunicationDomainResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDomainsResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/get.json // this example is just showing the usage of "Domains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetDomainsResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteDomainsResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/delete.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/delete.json // this example is just showing the usage of "Domains_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_DeleteDomainsResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateDomainsResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/update.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/update.json // this example is just showing the usage of "Domains_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Update_UpdateDomainsResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InitiateVerification_InitiateVerification() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/initiateVerification.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/initiateVerification.json // this example is just showing the usage of "Domains_InitiateVerification" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task InitiateVerification_InitiateVerification() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CancelVerification_CancelVerification() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/cancelVerification.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/cancelVerification.json // this example is just showing the usage of "Domains_CancelVerification" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResourceCollection.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResourceCollection.cs index 11d2f9ff4682..0d2e9969b2ed 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResourceCollection.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationDomainResourceCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_CommunicationDomainResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDomainsResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/get.json // this example is just showing the usage of "Domains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_GetDomainsResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDomainsResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/get.json // this example is just showing the usage of "Domains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Exists_GetDomainsResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDomainsResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/createOrUpdate.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/createOrUpdate.json // this example is just showing the usage of "Domains_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDomainsResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListDomainsResourcesByEmailServiceName() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/listByEmailService.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/listByEmailService.json // this example is just showing the usage of "Domains_ListByEmailServiceResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResource.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResource.cs index 52067451d628..c93c8c82b2eb 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResource.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResource.cs @@ -13,6 +13,7 @@ using Azure.ResourceManager; using Azure.ResourceManager.Communication; using Azure.ResourceManager.Communication.Models; +using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Communication.Samples @@ -24,7 +25,7 @@ public partial class Sample_CommunicationServiceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CheckCommunicationNameAvailability_CheckNameAvailabilityAvailable() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/checkNameAvailabilityAvailable.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/checkNameAvailabilityAvailable.json // this example is just showing the usage of "CommunicationServices_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +55,7 @@ public async Task CheckCommunicationNameAvailability_CheckNameAvailabilityAvaila [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CheckCommunicationNameAvailability_CheckNameAvailabilityUnavailable() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/checkNameAvailabilityUnavailable.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/checkNameAvailabilityUnavailable.json // this example is just showing the usage of "CommunicationServices_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +85,7 @@ public async Task CheckCommunicationNameAvailability_CheckNameAvailabilityUnavai [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task LinkNotificationHub_LinkNotificationHub() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/linkNotificationHub.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/linkNotificationHub.json // this example is just showing the usage of "CommunicationServices_LinkNotificationHub" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,7 +113,7 @@ public async Task LinkNotificationHub_LinkNotificationHub() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCommunicationServiceResources_ListBySubscription() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/listBySubscription.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/listBySubscription.json // this example is just showing the usage of "CommunicationServices_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +145,7 @@ public async Task GetCommunicationServiceResources_ListBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/update.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/update.json // this example is just showing the usage of "CommunicationServices_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,12 +178,180 @@ public async Task Update_UpdateResource() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Update resource to add System and User managed identities + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateResourceToAddSystemAndUserManagedIdentities() + { + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateWithSystemAndUserIdentity.json + // this example is just showing the usage of "CommunicationServices_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CommunicationServiceResource created on azure + // for more information of creating CommunicationServiceResource, please refer to the document of CommunicationServiceResource + string subscriptionId = "11112222-3333-4444-5555-666677778888"; + string resourceGroupName = "MyResourceGroup"; + string communicationServiceName = "MyCommunicationResource"; + ResourceIdentifier communicationServiceResourceId = CommunicationServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, communicationServiceName); + CommunicationServiceResource communicationServiceResource = client.GetCommunicationServiceResource(communicationServiceResourceId); + + // invoke the operation + CommunicationServiceResourcePatch patch = new CommunicationServiceResourcePatch() + { + Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/user/assigned/resource/id")] = new UserAssignedIdentity(), +}, + }, + Tags = +{ +["newTag"] = "newVal", +}, + }; + CommunicationServiceResource result = await communicationServiceResource.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CommunicationServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update resource to add a System Assigned managed identity + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateResourceToAddASystemAssignedManagedIdentity() + { + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateWithSystemAssignedIdentity.json + // this example is just showing the usage of "CommunicationServices_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CommunicationServiceResource created on azure + // for more information of creating CommunicationServiceResource, please refer to the document of CommunicationServiceResource + string subscriptionId = "11112222-3333-4444-5555-666677778888"; + string resourceGroupName = "MyResourceGroup"; + string communicationServiceName = "MyCommunicationResource"; + ResourceIdentifier communicationServiceResourceId = CommunicationServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, communicationServiceName); + CommunicationServiceResource communicationServiceResource = client.GetCommunicationServiceResource(communicationServiceResourceId); + + // invoke the operation + CommunicationServiceResourcePatch patch = new CommunicationServiceResourcePatch() + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + Tags = +{ +["newTag"] = "newVal", +}, + }; + CommunicationServiceResource result = await communicationServiceResource.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CommunicationServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update resource to add a User Assigned managed identity + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateResourceToAddAUserAssignedManagedIdentity() + { + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateWithUserAssignedIdentity.json + // this example is just showing the usage of "CommunicationServices_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CommunicationServiceResource created on azure + // for more information of creating CommunicationServiceResource, please refer to the document of CommunicationServiceResource + string subscriptionId = "11112222-3333-4444-5555-666677778888"; + string resourceGroupName = "MyResourceGroup"; + string communicationServiceName = "MyCommunicationResource"; + ResourceIdentifier communicationServiceResourceId = CommunicationServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, communicationServiceName); + CommunicationServiceResource communicationServiceResource = client.GetCommunicationServiceResource(communicationServiceResourceId); + + // invoke the operation + CommunicationServiceResourcePatch patch = new CommunicationServiceResourcePatch() + { + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/user/assigned/resource/id")] = new UserAssignedIdentity(), +}, + }, + Tags = +{ +["newTag"] = "newVal", +}, + }; + CommunicationServiceResource result = await communicationServiceResource.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CommunicationServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update resource to remove identity + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateResourceToRemoveIdentity() + { + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateRemoveSystemIdentity.json + // this example is just showing the usage of "CommunicationServices_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CommunicationServiceResource created on azure + // for more information of creating CommunicationServiceResource, please refer to the document of CommunicationServiceResource + string subscriptionId = "11112222-3333-4444-5555-666677778888"; + string resourceGroupName = "MyResourceGroup"; + string communicationServiceName = "MyCommunicationResource"; + ResourceIdentifier communicationServiceResourceId = CommunicationServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, communicationServiceName); + CommunicationServiceResource communicationServiceResource = client.GetCommunicationServiceResource(communicationServiceResourceId); + + // invoke the operation + CommunicationServiceResourcePatch patch = new CommunicationServiceResourcePatch() + { + Identity = new ManagedServiceIdentity("None"), + Tags = +{ +["newTag"] = "newVal", +}, + }; + CommunicationServiceResource result = await communicationServiceResource.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CommunicationServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Get resource [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/get.json // this example is just showing the usage of "CommunicationServices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +382,7 @@ public async Task Get_GetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/delete.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/delete.json // this example is just showing the usage of "CommunicationServices_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -240,7 +409,7 @@ public async Task Delete_DeleteResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeys() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/listKeys.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/listKeys.json // this example is just showing the usage of "CommunicationServices_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -267,7 +436,7 @@ public async Task GetKeys_ListKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKey_RegenerateKey() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/regenerateKey.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/regenerateKey.json // this example is just showing the usage of "CommunicationServices_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResourceCollection.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResourceCollection.cs index 7a8185280ad5..38503e5e4986 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResourceCollection.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_CommunicationServiceResourceCollection.cs @@ -12,6 +12,7 @@ using Azure.Identity; using Azure.ResourceManager; using Azure.ResourceManager.Communication; +using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Communication.Samples @@ -23,7 +24,7 @@ public partial class Sample_CommunicationServiceResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListByResourceGroup() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/listByResourceGroup.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/listByResourceGroup.json // this example is just showing the usage of "CommunicationServices_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +60,7 @@ public async Task GetAll_ListByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/get.json // this example is just showing the usage of "CommunicationServices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +94,7 @@ public async Task Get_GetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/get.json // this example is just showing the usage of "CommunicationServices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +124,7 @@ public async Task Exists_GetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/createOrUpdate.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/createOrUpdate.json // this example is just showing the usage of "CommunicationServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,5 +157,45 @@ public async Task CreateOrUpdate_CreateOrUpdateResource() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Create or update resource with managed identity + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateResourceWithManagedIdentity() + { + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/createOrUpdateWithSystemAssignedIdentity.json + // this example is just showing the usage of "CommunicationServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "11112222-3333-4444-5555-666677778888"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CommunicationServiceResource + CommunicationServiceResourceCollection collection = resourceGroupResource.GetCommunicationServiceResources(); + + // invoke the operation + string communicationServiceName = "MyCommunicationResource"; + CommunicationServiceResourceData data = new CommunicationServiceResourceData(new AzureLocation("Global")) + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + DataLocation = "United States", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, communicationServiceName, data); + CommunicationServiceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CommunicationServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResource.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResource.cs index 51fb7119c56e..e137b353e40f 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResource.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResource.cs @@ -24,7 +24,7 @@ public partial class Sample_EmailServiceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEmailServiceResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/get.json // this example is just showing the usage of "EmailServices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetEmailServiceResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteEmailServiceResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/delete.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/delete.json // this example is just showing the usage of "EmailServices_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_DeleteEmailServiceResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateEmailServiceResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/update.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/update.json // this example is just showing the usage of "EmailServices_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +121,7 @@ public async Task Update_UpdateEmailServiceResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetEmailServiceResources_ListEmailServiceResourcesBySubscription() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/listBySubscription.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/listBySubscription.json // this example is just showing the usage of "EmailServices_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -153,7 +153,7 @@ public async Task GetEmailServiceResources_ListEmailServiceResourcesBySubscripti [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVerifiedExchangeOnlineDomainsEmailServices_GetVerifiedExchangeOnlineDomains() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/getVerifiedExchangeOnlineDomains.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/getVerifiedExchangeOnlineDomains.json // this example is just showing the usage of "EmailServices_ListVerifiedExchangeOnlineDomains" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResourceCollection.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResourceCollection.cs index 79f5cf26b712..c3b6f1fd9059 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResourceCollection.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_EmailServiceResourceCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_EmailServiceResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEmailServiceResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/get.json // this example is just showing the usage of "EmailServices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task Get_GetEmailServiceResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetEmailServiceResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/get.json // this example is just showing the usage of "EmailServices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Exists_GetEmailServiceResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateEmailServiceResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/createOrUpdate.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/createOrUpdate.json // this example is just showing the usage of "EmailServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task CreateOrUpdate_CreateOrUpdateEmailServiceResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListEmailServiceResourcesByResourceGroup() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/listByResourceGroup.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/listByResourceGroup.json // this example is just showing the usage of "EmailServices_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResource.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResource.cs index 4e6555545056..95647f9bd151 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResource.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResource.cs @@ -22,7 +22,7 @@ public partial class Sample_SenderUsernameResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSenderUsernamesResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/get.json // this example is just showing the usage of "SenderUsernames_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetSenderUsernamesResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateSenderUsernamesResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/createOrUpdate.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/createOrUpdate.json // this example is just showing the usage of "SenderUsernames_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Update_CreateOrUpdateSenderUsernamesResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteSenderUsernamesResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/delete.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/delete.json // this example is just showing the usage of "SenderUsernames_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResourceCollection.cs b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResourceCollection.cs index 5e3dc66ac777..646ceb10fb40 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResourceCollection.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/samples/Generated/Samples/Sample_SenderUsernameResourceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SenderUsernameResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetSenderUsernamesResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/listByDomain.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/listByDomain.json // this example is just showing the usage of "SenderUsernames_ListByDomains" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_GetSenderUsernamesResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSenderUsernamesResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/get.json // this example is just showing the usage of "SenderUsernames_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetSenderUsernamesResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSenderUsernamesResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/get.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/get.json // this example is just showing the usage of "SenderUsernames_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Exists_GetSenderUsernamesResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateSenderUsernamesResource() { - // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/createOrUpdate.json + // Generated from example definition: specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/createOrUpdate.json // this example is just showing the usage of "SenderUsernames_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs new file mode 100644 index 000000000000..e507d0fbc55a --- /dev/null +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Communication.Models +{ + /// Model factory for models. + public static partial class ArmCommunicationModelFactory + { + /// Initializes a new instance of CommunicationServiceResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the resource. + /// FQDN of the CommunicationService instance. + /// The location where the communication service stores its data at rest. + /// Resource ID of an Azure Notification Hub linked to this resource. + /// Version of the CommunicationService resource. Probably you need the same or higher version of client SDKs. + /// The immutable resource Id of the communication service. + /// List of email Domain resource Ids. + /// A new instance for mocking. + public static CommunicationServiceResourceData CommunicationServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, Azure.ResourceManager.Models.SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CommunicationServicesProvisioningState? provisioningState = null, string hostName = null, string dataLocation = null, ResourceIdentifier notificationHubId = null, string version = null, Guid? immutableResourceId = null, IEnumerable linkedDomains = null) + { + tags ??= new Dictionary(); + linkedDomains ??= new List(); + + return new CommunicationServiceResourceData(id, name, resourceType, systemData, tags, location, provisioningState, hostName, dataLocation, notificationHubId, version, immutableResourceId, linkedDomains?.ToList()); + } + } +} diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Customize/CommunicationServiceResourceData.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Customize/CommunicationServiceResourceData.cs new file mode 100644 index 000000000000..99ddaa63b3f0 --- /dev/null +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Customize/CommunicationServiceResourceData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Communication.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Communication +{ + /// + /// A class representing the CommunicationServiceResource data model. + /// A class representing a CommunicationService resource. + /// + public partial class CommunicationServiceResourceData : TrackedResourceData + { + /// Initializes a new instance of CommunicationServiceResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the resource. + /// FQDN of the CommunicationService instance. + /// The location where the communication service stores its data at rest. + /// Resource ID of an Azure Notification Hub linked to this resource. + /// Version of the CommunicationService resource. Probably you need the same or higher version of client SDKs. + /// The immutable resource Id of the communication service. + /// List of email Domain resource Ids. + internal CommunicationServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, IDictionary tags, AzureLocation location, CommunicationServicesProvisioningState? provisioningState, string hostName, string dataLocation, ResourceIdentifier notificationHubId, string version, Guid? immutableResourceId, IList linkedDomains) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + HostName = hostName; + DataLocation = dataLocation; + NotificationHubId = notificationHubId; + Version = version; + ImmutableResourceId = immutableResourceId; + LinkedDomains = linkedDomains; + } + } +} diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs index 790a2a160020..ba6b9309c751 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs @@ -42,6 +42,7 @@ public static LinkedNotificationHub LinkedNotificationHub(ResourceIdentifier res /// The systemData. /// The tags. /// The location. + /// Managed service identity (system assigned and/or user assigned identities). /// Provisioning state of the resource. /// FQDN of the CommunicationService instance. /// The location where the communication service stores its data at rest. @@ -50,12 +51,12 @@ public static LinkedNotificationHub LinkedNotificationHub(ResourceIdentifier res /// The immutable resource Id of the communication service. /// List of email Domain resource Ids. /// A new instance for mocking. - public static CommunicationServiceResourceData CommunicationServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CommunicationServicesProvisioningState? provisioningState = null, string hostName = null, string dataLocation = null, ResourceIdentifier notificationHubId = null, string version = null, Guid? immutableResourceId = null, IEnumerable linkedDomains = null) + public static CommunicationServiceResourceData CommunicationServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, CommunicationServicesProvisioningState? provisioningState = null, string hostName = null, string dataLocation = null, ResourceIdentifier notificationHubId = null, string version = null, Guid? immutableResourceId = null, IEnumerable linkedDomains = null) { tags ??= new Dictionary(); linkedDomains ??= new List(); - return new CommunicationServiceResourceData(id, name, resourceType, systemData, tags, location, provisioningState, hostName, dataLocation, notificationHubId, version, immutableResourceId, linkedDomains?.ToList()); + return new CommunicationServiceResourceData(id, name, resourceType, systemData, tags, location, identity, provisioningState, hostName, dataLocation, notificationHubId, version, immutableResourceId, linkedDomains?.ToList()); } /// Initializes a new instance of CommunicationServiceKeys. diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationServiceResourceData.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationServiceResourceData.cs index 752a80fd7ea2..df41749843d2 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationServiceResourceData.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationServiceResourceData.cs @@ -33,6 +33,7 @@ public CommunicationServiceResourceData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. + /// Managed service identity (system assigned and/or user assigned identities). /// Provisioning state of the resource. /// FQDN of the CommunicationService instance. /// The location where the communication service stores its data at rest. @@ -40,8 +41,9 @@ public CommunicationServiceResourceData(AzureLocation location) : base(location) /// Version of the CommunicationService resource. Probably you need the same or higher version of client SDKs. /// The immutable resource Id of the communication service. /// List of email Domain resource Ids. - internal CommunicationServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CommunicationServicesProvisioningState? provisioningState, string hostName, string dataLocation, ResourceIdentifier notificationHubId, string version, Guid? immutableResourceId, IList linkedDomains) : base(id, name, resourceType, systemData, tags, location) + internal CommunicationServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, CommunicationServicesProvisioningState? provisioningState, string hostName, string dataLocation, ResourceIdentifier notificationHubId, string version, Guid? immutableResourceId, IList linkedDomains) : base(id, name, resourceType, systemData, tags, location) { + Identity = identity; ProvisioningState = provisioningState; HostName = hostName; DataLocation = dataLocation; @@ -51,6 +53,8 @@ internal CommunicationServiceResourceData(ResourceIdentifier id, string name, Re LinkedDomains = linkedDomains; } + /// Managed service identity (system assigned and/or user assigned identities). + public ManagedServiceIdentity Identity { get; set; } /// Provisioning state of the resource. public CommunicationServicesProvisioningState? ProvisioningState { get; } /// FQDN of the CommunicationService instance. diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourceData.Serialization.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourceData.Serialization.cs index 7f1efde6d685..4c4316dc5314 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourceData.Serialization.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourceData.Serialization.cs @@ -19,6 +19,12 @@ public partial class CommunicationServiceResourceData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -59,6 +65,7 @@ internal static CommunicationServiceResourceData DeserializeCommunicationService { return null; } + Optional identity = default; Optional> tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -74,6 +81,16 @@ internal static CommunicationServiceResourceData DeserializeCommunicationService Optional> linkedDomains = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -186,7 +203,7 @@ internal static CommunicationServiceResourceData DeserializeCommunicationService continue; } } - return new CommunicationServiceResourceData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(provisioningState), hostName.Value, dataLocation.Value, notificationHubId.Value, version.Value, Optional.ToNullable(immutableResourceId), Optional.ToList(linkedDomains)); + return new CommunicationServiceResourceData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, identity, Optional.ToNullable(provisioningState), hostName.Value, dataLocation.Value, notificationHubId.Value, version.Value, Optional.ToNullable(immutableResourceId), Optional.ToList(linkedDomains)); } } } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.Serialization.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.Serialization.cs index 6a191267a994..6f7800baa37d 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.Serialization.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.Serialization.cs @@ -7,6 +7,7 @@ using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Communication.Models { @@ -15,6 +16,12 @@ public partial class CommunicationServiceResourcePatch : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.cs index b1f1657a6da4..5e7c3757b444 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Models/CommunicationServiceResourcePatch.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Communication.Models { @@ -19,6 +20,8 @@ public CommunicationServiceResourcePatch() LinkedDomains = new ChangeTrackingList(); } + /// Managed service identity (system assigned and/or user assigned identities). + public ManagedServiceIdentity Identity { get; set; } /// List of email Domain resource Ids. public IList LinkedDomains { get; } } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/CommunicationServicesRestOperations.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/CommunicationServicesRestOperations.cs index 3e7ccde21997..f43aeec376af 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/CommunicationServicesRestOperations.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/CommunicationServicesRestOperations.cs @@ -33,7 +33,7 @@ public CommunicationServicesRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-31"; + _apiVersion = apiVersion ?? "2023-04-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/DomainsRestOperations.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/DomainsRestOperations.cs index cca2058e6d5e..8121b7511752 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/DomainsRestOperations.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/DomainsRestOperations.cs @@ -33,7 +33,7 @@ public DomainsRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-31"; + _apiVersion = apiVersion ?? "2023-04-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/EmailServicesRestOperations.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/EmailServicesRestOperations.cs index 35fe8414d47a..8a123c692ec3 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/EmailServicesRestOperations.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/EmailServicesRestOperations.cs @@ -34,7 +34,7 @@ public EmailServicesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-31"; + _apiVersion = apiVersion ?? "2023-04-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/SenderUsernamesRestOperations.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/SenderUsernamesRestOperations.cs index 9914a7d7b5cd..7de90a78d3f7 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/SenderUsernamesRestOperations.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/RestOperations/SenderUsernamesRestOperations.cs @@ -33,7 +33,7 @@ public SenderUsernamesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-31"; + _apiVersion = apiVersion ?? "2023-04-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/autorest.md b/sdk/communication/Azure.ResourceManager.Communication/src/autorest.md index 13d245acd9bd..6dba6fb0a221 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/autorest.md +++ b/sdk/communication/Azure.ResourceManager.Communication/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true title: communication namespace: Azure.ResourceManager.Communication # default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/bbee55edb05169aba6d8d1944c0e2bc2b9408943/specification/communication/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/d71132a3e8bf8ad22ab77991805e033ed1b66dff/specification/communication/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -80,5 +80,4 @@ directive: where: $.parameters.SubscriptionIdParameter transform: > delete $["format"]; - ``` diff --git a/sdk/communication/Azure.ResourceManager.Communication/tests/ScenarioTests/CommunicationServiceTests.cs b/sdk/communication/Azure.ResourceManager.Communication/tests/ScenarioTests/CommunicationServiceTests.cs index 59891b0ddd46..d72b071ee100 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/tests/ScenarioTests/CommunicationServiceTests.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/tests/ScenarioTests/CommunicationServiceTests.cs @@ -8,6 +8,7 @@ using Azure.Core; using Azure.Core.TestFramework; using Azure.ResourceManager.Communication.Models; +using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -52,6 +53,15 @@ public async Task TearDown() } } + private async Task CreateUserAssignedIdentityAsync() + { + string userAssignedIdentityName = Recording.GenerateAssetName("testMsi-"); + ResourceIdentifier userIdentityId = new ResourceIdentifier($"{_resourceGroup.Id}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"); + var input = new GenericResourceData("westus2"); + var response = await ArmClient.GetGenericResources().CreateOrUpdateAsync(WaitUntil.Completed, userIdentityId, input); + return response.Value; + } + [TestCase(null)] [TestCase(true)] [TestCase(false)] @@ -111,6 +121,23 @@ public async Task SetTags(bool? useTagResource) Assert.AreEqual(tagValue.Value, "newtestvalue"); } + [Test] + public async Task CreateResourceWithManagedIdentity() + { + var identity = new ManagedServiceIdentity(ManagedServiceIdentityType.SystemAssignedUserAssigned); + var userAssignedIdentity = await CreateUserAssignedIdentityAsync(); + identity.UserAssignedIdentities.Add(userAssignedIdentity.Id, new UserAssignedIdentity()); + CommunicationServiceResourceData data = new CommunicationServiceResourceData(ResourceLocation) + { + DataLocation = ResourceDataLocation, + Identity = identity + }; + string communicationServiceName = Recording.GenerateAssetName("communication-service-"); + var communicationServiceLro = await _resourceGroup.GetCommunicationServiceResources().CreateOrUpdateAsync(WaitUntil.Completed, communicationServiceName, data); + var resource = communicationServiceLro.Value; + Assert.AreEqual(resource.Data.Identity.ManagedServiceIdentityType, ManagedServiceIdentityType.SystemAssignedUserAssigned); + } + [Test] public async Task GetKeys() { From 77383ded7a54e4c595630a7cf350c77c3756d9de Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Sep 2023 06:33:12 -0700 Subject: [PATCH 09/45] Increment package version after release of Microsoft.Azure.WebJobs.Extensions.SignalRService (#38618) --- .../CHANGELOG.md | 10 ++++++++++ ...soft.Azure.WebJobs.Extensions.SignalRService.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md index 3ef417a09ff2..57180d9832f5 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.12.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.11.1 (2023-09-11) ### Bugs Fixed diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj index c98da6ff9c9d..d276a2149c8a 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj @@ -3,9 +3,9 @@ $(RequiredTargetFrameworks) Microsoft.Azure.WebJobs.Extensions.SignalRService - 1.11.1 + 1.12.0-beta.1 - 1.11.0 + 1.11.1 true true $(NoWarn);CS1591;AZC0001;AZC0107; From cf01c56261f87a7d2584383969fc5b5858b39bf0 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Sep 2023 06:33:27 -0700 Subject: [PATCH 10/45] Increment package version after release of Azure.ResourceManager.Communication (#38617) --- .../Azure.ResourceManager.Communication/CHANGELOG.md | 10 ++++++++++ .../src/Azure.ResourceManager.Communication.csproj | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md b/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md index 1a0c9c3eea61..be64b1a0f05e 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md +++ b/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.2.0-beta.3 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.2.0-beta.2 (2023-09-12) ### Features Added diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Azure.ResourceManager.Communication.csproj b/sdk/communication/Azure.ResourceManager.Communication/src/Azure.ResourceManager.Communication.csproj index eae2d2640aec..14e9d4d70fb2 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Azure.ResourceManager.Communication.csproj +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Azure.ResourceManager.Communication.csproj @@ -1,6 +1,6 @@ - 1.2.0-beta.2 + 1.2.0-beta.3 1.1.0 Azure.ResourceManager.Communication From 0dc921a55af1d6273b68a9d2ad6a52ed0d468093 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Sep 2023 07:26:54 -0700 Subject: [PATCH 11/45] Increment package version after release of Azure.Messaging.EventHubs (#38627) --- sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Messaging.EventHubs.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md index 0fb1efe2eb5f..dc0aab039605 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 5.10.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 5.9.3 (2023-09-12) ### Bugs Fixed diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj index 14d18b5d936e..a95daecef2b1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj @@ -1,9 +1,9 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This client library allows for both publishing and consuming events using Azure Event Hubs. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ - 5.9.3 + 5.10.0-beta.1 - 5.9.2 + 5.9.3 Azure;Event Hubs;EventHubs;.NET;AMQP;IoT;$(PackageCommonTags) $(RequiredTargetFrameworks) true From e75845ff5afbfc8b93118c8eab84fd6749b4efca Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Tue, 12 Sep 2023 11:00:00 -0400 Subject: [PATCH 12/45] [Event Hubs] September 2023 Release Prep (non-core) (#38605) The focus of these changes is to prepare the Event Hubs processor and function extensions libraries for the September 2023 release. --- eng/Packages.Data.props | 2 +- .../Azure.Messaging.EventHubs.Processor/CHANGELOG.md | 10 ++++------ .../src/Azure.Messaging.EventHubs.Processor.csproj | 2 +- .../CHANGELOG.md | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index be25f77b5f3d..2a2d360ab680 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -89,7 +89,7 @@ - + diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md index 9dc6b206e17e..5cab94e6a443 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md @@ -1,14 +1,12 @@ # Release History -## 5.10.0-beta.1 (Unreleased) +## 5.9.3 (2023-09-12) -### Features Added +### Other Changes -### Breaking Changes +- Several improvements to logging have been made to capture additional context and fix typos. Most notable among them is the inclusion of starting and ending sequence numbers when events are read from Event Hubs and dispatched for processing. -### Bugs Fixed - -### Other Changes +- The reference for the AMQP transport library, `Microsoft.Azure.Amqp`, has been bumped to 2.6.3. This fixes an issue with timeout duration calculations during link creation and includes several efficiency improvements. ## 5.9.2 (2023-06-06) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj index b22672b43127..90a7732b0a61 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj @@ -1,7 +1,7 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This library extends its Event Processor with durable storage for checkpoint information using Azure Blob storage. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ - 5.10.0-beta.1 + 5.9.3 5.9.2 Azure;Event Hubs;EventHubs;.NET;Event Processor;EventProcessor;$(PackageCommonTags) diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md index c5bf78915cfe..0424a8d45e19 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 6.0.0 (2023-09-06) +## 6.0.0 (2023-09-12) ### Breaking Changes @@ -16,7 +16,7 @@ - When binding to a `CancellationToken`, the token will no longer be signaled when in Drain Mode. To detect if the function app is in Drain Mode, use dependency injection to inject the - `IDrainModeManager`, and check the `IsDrainModeEnabled` property. Additionally, checkpointing + `IDrainModeManager`, and check the `IsDrainModeEnabled` property. Additionally, checkpointing will now occur when the function app is in Drain Mode. ## 5.4.0 (2023-06-06) From 35ce2129cc32356f9879cc4a768d7f4a3f74ba22 Mon Sep 17 00:00:00 2001 From: Anne Thompson Date: Tue, 12 Sep 2023 08:07:00 -0700 Subject: [PATCH 13/45] Remove circular shared source references in Azure.Core tests files (#38607) * Initial reshuffle * Second reshuffle * nits * fix --- .../src/Azure.Core.TestFramework.csproj | 1 - .../src/Shared/TestClientOptions.cs | 2 +- .../Azure.Core.TestFramework.Tests.csproj | 2 -- sdk/core/Azure.Core/Azure.Core.sln | 8 +------- .../Azure.Core/tests/Azure.Core.Tests.csproj | 2 -- .../tests/ResourceIdentifierTests.cs | 3 +-- .../tests/Azure.ResourceManager.Tests.csproj | 7 ++----- .../ManagementPipelineBuilderTests.cs | 0 .../TestFramework}/IMockOperationInternal.cs | 0 .../tests/TestFramework}/MockOperation.cs | 0 .../TestFramework}/MockOperationInternal.cs | 0 .../TestFramework}/MockOperationInternalOfT.cs | 0 .../tests/TestFramework}/MockOperationOfT.cs | 8 ++++---- .../TestClients/ManagementTestClient.cs | 2 +- .../TestClients/MockOperationOfInt.cs | 0 .../TestClients/TestResourceCollection.cs | 5 +---- .../tests/TestFramework}/TestResource.cs | 3 +-- .../TestFramework}/TestResourceOperation.cs | 2 +- .../Tests}/ManagementRecordedTestBaseTests.cs | 0 .../tests/TestFramework}/UpdateResult.cs | 2 +- .../tests/Unit/Resource/TestResource.cs | 12 ------------ .../tests/Unit/Resource/TestTrackedResource.cs | 18 ------------------ 22 files changed, 14 insertions(+), 63 deletions(-) rename sdk/{core/Azure.Core/tests => resourcemanager/Azure.ResourceManager/tests/Scenario}/ManagementPipelineBuilderTests.cs (100%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/IMockOperationInternal.cs (100%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/MockOperation.cs (100%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/MockOperationInternal.cs (100%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/MockOperationInternalOfT.cs (100%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/MockOperationOfT.cs (94%) rename sdk/{core/Azure.Core.TestFramework/tests => resourcemanager/Azure.ResourceManager/tests/TestFramework}/TestClients/ManagementTestClient.cs (95%) rename sdk/{core/Azure.Core/tests => resourcemanager/Azure.ResourceManager/tests/TestFramework}/TestClients/MockOperationOfInt.cs (100%) rename sdk/{core/Azure.Core.TestFramework/tests => resourcemanager/Azure.ResourceManager/tests/TestFramework}/TestClients/TestResourceCollection.cs (93%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/TestResource.cs (99%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/TestResourceOperation.cs (96%) rename sdk/{core/Azure.Core.TestFramework/tests => resourcemanager/Azure.ResourceManager/tests/TestFramework/Tests}/ManagementRecordedTestBaseTests.cs (100%) rename sdk/{core/Azure.Core.TestFramework/src/Shared => resourcemanager/Azure.ResourceManager/tests/TestFramework}/UpdateResult.cs (88%) delete mode 100644 sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestResource.cs delete mode 100644 sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestTrackedResource.cs diff --git a/sdk/core/Azure.Core.TestFramework/src/Azure.Core.TestFramework.csproj b/sdk/core/Azure.Core.TestFramework/src/Azure.Core.TestFramework.csproj index e43c8f1abcd9..c7b91ffe8e82 100644 --- a/sdk/core/Azure.Core.TestFramework/src/Azure.Core.TestFramework.csproj +++ b/sdk/core/Azure.Core.TestFramework/src/Azure.Core.TestFramework.csproj @@ -1,7 +1,6 @@  $(RequiredTargetFrameworks);net47 - true true diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/TestClientOptions.cs b/sdk/core/Azure.Core.TestFramework/src/Shared/TestClientOptions.cs index 5cc988b40b2a..4289b5cacab5 100644 --- a/sdk/core/Azure.Core.TestFramework/src/Shared/TestClientOptions.cs +++ b/sdk/core/Azure.Core.TestFramework/src/Shared/TestClientOptions.cs @@ -3,7 +3,7 @@ namespace Azure.Core.TestFramework { - internal class TestClientOptions : ClientOptions + public class TestClientOptions : ClientOptions { } } diff --git a/sdk/core/Azure.Core.TestFramework/tests/Azure.Core.TestFramework.Tests.csproj b/sdk/core/Azure.Core.TestFramework/tests/Azure.Core.TestFramework.Tests.csproj index cc6050c2faf7..9a4f8f1832af 100644 --- a/sdk/core/Azure.Core.TestFramework/tests/Azure.Core.TestFramework.Tests.csproj +++ b/sdk/core/Azure.Core.TestFramework/tests/Azure.Core.TestFramework.Tests.csproj @@ -13,14 +13,12 @@ - - diff --git a/sdk/core/Azure.Core/Azure.Core.sln b/sdk/core/Azure.Core/Azure.Core.sln index 6cdf7559841e..d4dc8ece4d35 100644 --- a/sdk/core/Azure.Core/Azure.Core.sln +++ b/sdk/core/Azure.Core/Azure.Core.sln @@ -29,8 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Perf", "perf\Azu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Test.Perf", "..\..\..\common\Perf\Azure.Test.Perf\Azure.Test.Perf.csproj", "{96E9F605-9C38-4D77-96F4-679EF8B9390F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager", "..\..\resourcemanager\Azure.ResourceManager\src\Azure.ResourceManager.csproj", "{8E60A748-3973-471A-B103-EC9406BB3313}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework.Tests", "..\Azure.Core.TestFramework\tests\Azure.Core.TestFramework.Tests.csproj", "{33C299B5-ABDA-47BC-838F-973E62C067F9}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{13A04222-4F21-40FC-BE42-A37EE34FF272}" @@ -53,7 +51,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Expressions.Data EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Tests.Public", "tests\public\Azure.Core.Tests.Public.csproj", "{BFBF8EF7-61D8-40E7-9E98-468A0427761E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Core.Tests.Common", "tests\common\Azure.Core.Tests.Common.csproj", "{0EEDF53F-120A-45B1-8468-A97A0D46DBAC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Tests.Common", "tests\common\Azure.Core.Tests.Common.csproj", "{0EEDF53F-120A-45B1-8468-A97A0D46DBAC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -113,10 +111,6 @@ Global {96E9F605-9C38-4D77-96F4-679EF8B9390F}.Debug|Any CPU.Build.0 = Debug|Any CPU {96E9F605-9C38-4D77-96F4-679EF8B9390F}.Release|Any CPU.ActiveCfg = Release|Any CPU {96E9F605-9C38-4D77-96F4-679EF8B9390F}.Release|Any CPU.Build.0 = Release|Any CPU - {8E60A748-3973-471A-B103-EC9406BB3313}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E60A748-3973-471A-B103-EC9406BB3313}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E60A748-3973-471A-B103-EC9406BB3313}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E60A748-3973-471A-B103-EC9406BB3313}.Release|Any CPU.Build.0 = Release|Any CPU {33C299B5-ABDA-47BC-838F-973E62C067F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {33C299B5-ABDA-47BC-838F-973E62C067F9}.Debug|Any CPU.Build.0 = Debug|Any CPU {33C299B5-ABDA-47BC-838F-973E62C067F9}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj index c4a965be26e4..cf58535b30a5 100644 --- a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj +++ b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj @@ -25,7 +25,6 @@ - @@ -75,7 +74,6 @@ - diff --git a/sdk/core/Azure.Core/tests/ResourceIdentifierTests.cs b/sdk/core/Azure.Core/tests/ResourceIdentifierTests.cs index 35020f06e00c..d9733037eae6 100644 --- a/sdk/core/Azure.Core/tests/ResourceIdentifierTests.cs +++ b/sdk/core/Azure.Core/tests/ResourceIdentifierTests.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.Core.Tests @@ -779,7 +778,7 @@ public void VerifyRootResource() { var root = ResourceIdentifier.Root; Assert.IsNull(root.Parent); - Assert.AreEqual(root.ResourceType, TenantResource.ResourceType.ToString()); + Assert.AreEqual(root.ResourceType, "Microsoft.Resources/tenants"); Assert.AreEqual("/", root.ToString()); } diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Azure.ResourceManager.Tests.csproj b/sdk/resourcemanager/Azure.ResourceManager/tests/Azure.ResourceManager.Tests.csproj index 28f109a3149e..0fe82886dacf 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Azure.ResourceManager.Tests.csproj +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/Azure.ResourceManager.Tests.csproj @@ -30,11 +30,8 @@ - - - - - + + diff --git a/sdk/core/Azure.Core/tests/ManagementPipelineBuilderTests.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/Scenario/ManagementPipelineBuilderTests.cs similarity index 100% rename from sdk/core/Azure.Core/tests/ManagementPipelineBuilderTests.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/Scenario/ManagementPipelineBuilderTests.cs diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/IMockOperationInternal.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/IMockOperationInternal.cs similarity index 100% rename from sdk/core/Azure.Core.TestFramework/src/Shared/IMockOperationInternal.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/IMockOperationInternal.cs diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/MockOperation.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperation.cs similarity index 100% rename from sdk/core/Azure.Core.TestFramework/src/Shared/MockOperation.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperation.cs diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationInternal.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationInternal.cs similarity index 100% rename from sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationInternal.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationInternal.cs diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationInternalOfT.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationInternalOfT.cs similarity index 100% rename from sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationInternalOfT.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationInternalOfT.cs diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationOfT.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationOfT.cs similarity index 94% rename from sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationOfT.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationOfT.cs index 8e2742ef462d..6faa8bcd2fb5 100644 --- a/sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationOfT.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationOfT.cs @@ -11,7 +11,7 @@ namespace Azure.Core.Tests { #pragma warning disable SA1649 // File name should match first type name - internal class MockOperation : Operation, IOperation + public class MockOperation : Operation, IOperation #pragma warning restore SA1649 // File name should match first type name { private static ClientDiagnostics _clientDiagnostics = new(new TestClientOptions()); @@ -121,7 +121,7 @@ public override Response UpdateStatus(CancellationToken cancellationToken = defa return MockOperationInternal.UpdateStatus(cancellationToken); } - public ValueTask> UpdateStateAsync(bool async, CancellationToken cancellationToken) + ValueTask> IOperation.UpdateStateAsync(bool async, CancellationToken cancellationToken) { MockOperationInternal.UpdateStatusCallCount++; MockOperationInternal.LastTokenReceivedByUpdateStatus = cancellationToken; @@ -129,8 +129,8 @@ public ValueTask> UpdateStateAsync(bool async, CancellationTok return new ValueTask>(OnUpdateState(cancellationToken)); } - public MockOperationInternal MockOperationInternal { get; } + internal MockOperationInternal MockOperationInternal { get; } - public Func> OnUpdateState { get; set; } + internal Func> OnUpdateState { get; set; } } } diff --git a/sdk/core/Azure.Core.TestFramework/tests/TestClients/ManagementTestClient.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/ManagementTestClient.cs similarity index 95% rename from sdk/core/Azure.Core.TestFramework/tests/TestClients/ManagementTestClient.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/ManagementTestClient.cs index 24bc7d7897fc..311b7346d071 100644 --- a/sdk/core/Azure.Core.TestFramework/tests/TestClients/ManagementTestClient.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/ManagementTestClient.cs @@ -6,7 +6,7 @@ namespace Azure.Core.TestFramework.Tests { - internal class ManagementTestClient + public class ManagementTestClient { private readonly ClientDiagnostics _diagnostics; diff --git a/sdk/core/Azure.Core/tests/TestClients/MockOperationOfInt.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/MockOperationOfInt.cs similarity index 100% rename from sdk/core/Azure.Core/tests/TestClients/MockOperationOfInt.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/MockOperationOfInt.cs diff --git a/sdk/core/Azure.Core.TestFramework/tests/TestClients/TestResourceCollection.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/TestResourceCollection.cs similarity index 93% rename from sdk/core/Azure.Core.TestFramework/tests/TestClients/TestResourceCollection.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/TestResourceCollection.cs index 45ffc863d0c8..3a6ab5e21d65 100644 --- a/sdk/core/Azure.Core.TestFramework/tests/TestClients/TestResourceCollection.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestClients/TestResourceCollection.cs @@ -4,18 +4,15 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; using Azure.Core.Pipeline; -using Azure.Core.TestFramework; using Azure.ResourceManager; -using Azure.ResourceManager.Resources; namespace Azure.Core.TestFramework.Tests { - internal class TestResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public class TestResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private DiagnosticScopeFactory _diagnostic = new DiagnosticScopeFactory("Azure.Clients", "Microsoft.Azure.Core.Cool.Tests", true, false); diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/TestResource.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestResource.cs similarity index 99% rename from sdk/core/Azure.Core.TestFramework/src/Shared/TestResource.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestResource.cs index 0cc06cedb542..3205a20411ad 100644 --- a/sdk/core/Azure.Core.TestFramework/src/Shared/TestResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestResource.cs @@ -4,14 +4,13 @@ using System; using System.Threading; using System.Threading.Tasks; -using Azure; using Azure.Core.Pipeline; using Azure.Core.Tests; using Azure.ResourceManager; namespace Azure.Core.TestFramework { - internal class TestResource : ArmResource + public class TestResource : ArmResource { private DiagnosticScopeFactory _diagnostic = new DiagnosticScopeFactory("Azure.Clients", "Microsoft.Azure.Core.Cool.Tests", true, false); private static MockResponse mockResponse = new(200); diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/TestResourceOperation.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestResourceOperation.cs similarity index 96% rename from sdk/core/Azure.Core.TestFramework/src/Shared/TestResourceOperation.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestResourceOperation.cs index 1cceef629905..0d586501710e 100644 --- a/sdk/core/Azure.Core.TestFramework/src/Shared/TestResourceOperation.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/TestResourceOperation.cs @@ -7,7 +7,7 @@ namespace Azure.Core.TestFramework { - internal class TestResourceOperation : Operation, IOperationSource + public class TestResourceOperation : Operation, IOperationSource { private TestResource _value; private bool _exceptionOnWait; diff --git a/sdk/core/Azure.Core.TestFramework/tests/ManagementRecordedTestBaseTests.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/Tests/ManagementRecordedTestBaseTests.cs similarity index 100% rename from sdk/core/Azure.Core.TestFramework/tests/ManagementRecordedTestBaseTests.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/Tests/ManagementRecordedTestBaseTests.cs diff --git a/sdk/core/Azure.Core.TestFramework/src/Shared/UpdateResult.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/UpdateResult.cs similarity index 88% rename from sdk/core/Azure.Core.TestFramework/src/Shared/UpdateResult.cs rename to sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/UpdateResult.cs index f9afd22b7474..53179f614ada 100644 --- a/sdk/core/Azure.Core.TestFramework/src/Shared/UpdateResult.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/UpdateResult.cs @@ -3,7 +3,7 @@ namespace Azure.Core.TestFramework { - internal enum UpdateResult + public enum UpdateResult { Pending, Failure, diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestResource.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestResource.cs deleted file mode 100644 index 311d614c73a2..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestResource.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.Tests -{ - //public class TestResource : Resource - //{ - // public TestResource(TIdentifier id) - // :base(id, id.Name, id.ResourceType) - // { - // } - //} -} diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestTrackedResource.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestTrackedResource.cs deleted file mode 100644 index 6a9749b554e2..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/Resource/TestTrackedResource.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.Tests -{ - public class TestTrackedResource : TrackedResourceData - { - public TestTrackedResource(ResourceIdentifier id) : this(id, AzureLocation.WestUS) - { - } - - public TestTrackedResource(ResourceIdentifier id, string location) - :base(id, id.Name, id.ResourceType, null, null, location) - { - } - } -} From 02768e36ec8c99704930cb4808f96f61ec8b0ec0 Mon Sep 17 00:00:00 2001 From: yzt Date: Wed, 13 Sep 2023 00:07:51 +0800 Subject: [PATCH 14/45] [SignalR extensions] Release v1.11.2 (#38623) * Release v1.11.2 * Fix test issue --- eng/Packages.Data.props | 6 +++--- .../CHANGELOG.md | 12 +----------- ...ft.Azure.WebJobs.Extensions.SignalRService.csproj | 2 +- .../tests/JobhostEndToEnd.cs | 3 ++- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 2a2d360ab680..dffc545e11b2 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -142,9 +142,9 @@ - - - + + + diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md index 57180d9832f5..2abc205131db 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History -## 1.12.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.11.1 (2023-09-11) +## 1.11.2 (2023-09-12) ### Bugs Fixed * Fixed the issue when using customized server endpoint with Azure AD credential. diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj index d276a2149c8a..c51bf6cbeccb 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj @@ -3,7 +3,7 @@ $(RequiredTargetFrameworks) Microsoft.Azure.WebJobs.Extensions.SignalRService - 1.12.0-beta.1 + 1.11.2 1.11.1 true diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/tests/JobhostEndToEnd.cs b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/tests/JobhostEndToEnd.cs index 4b74a00fa340..b2b6a7a0e5ea 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/tests/JobhostEndToEnd.cs +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/tests/JobhostEndToEnd.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IdentityModel.Tokens.Jwt; using System.Linq; +using System.Net.Http; using System.Reflection; using System.Text; using System.Threading.Tasks; @@ -203,7 +204,7 @@ await signalRMessages.AddAsync( Arguments = new[] { "message" } }); } - catch (AzureSignalRInaccessibleEndpointException) + catch (AzureSignalRException ex) when (ex.InnerException is HttpRequestException) { // ignore, since we don't really connect to Azure SignalR Service } From 769be8d4a1dc83cdefd67ad96638c8c6b79a0d14 Mon Sep 17 00:00:00 2001 From: Sean McCullough <44180881+seanmcc-msft@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:48:19 -0400 Subject: [PATCH 15/45] STG 90 GA release prep (#38631) --- sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md | 11 ++--------- .../src/Azure.Storage.Blobs.Batch.csproj | 2 +- .../Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md | 11 ++--------- sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 11 ++--------- .../src/Azure.Storage.Blobs.csproj | 2 +- sdk/storage/Azure.Storage.Common/CHANGELOG.md | 11 ++--------- .../src/Azure.Storage.Common.csproj | 2 +- sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md | 11 ++--------- .../src/Azure.Storage.Files.DataLake.csproj | 2 +- sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md | 11 ++--------- .../src/Azure.Storage.Files.Shares.csproj | 2 +- sdk/storage/Azure.Storage.Queues/CHANGELOG.md | 11 ++--------- .../src/Azure.Storage.Queues.csproj | 2 +- 13 files changed, 20 insertions(+), 69 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md index bccff254ba59..4b4bbd99079a 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History -## 12.15.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 12.15.0 (2023-09-12) +- Includes all features from 12.15.0-beta.1. ## 12.15.0-beta.1 (2023-08-08) - Added support for service version 2023-05-03 and 2023-08-03. diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj index c2a6e83364fc..0f85ba103a1f 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs.Batch client library - 12.15.0-beta.2 + 12.15.0 12.14.0 BlobSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md index 0cff7942732d..9276af9c07ce 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History -## 12.0.0-preview.38 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 12.0.0-preview.38 (2023-09-12) +- This release contains bug fixes to improve quality. ## 12.0.0-preview.37 (2023-08-08) - Added support for service version 2023-05-03 and 2023-08-03. diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index 7c47f13f74de..ee2e47c6df78 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History -## 12.18.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 12.18.0 (2023-09-12) +- Includes all features from 12.18.0-beta.1. ## 12.18.0-beta.1 (2023-08-08) - Added support for service version 2023-05-03 and 2023-08-03. diff --git a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj index d639b3426747..98957055b74d 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj +++ b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs client library - 12.18.0-beta.2 + 12.18.0 12.17.0 BlobSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md index ca4e5cc17c31..65c6ee546c7e 100644 --- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History -## 12.17.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 12.17.0 (2023-09-12) +- Includes all features from 12.17.0-beta.1. ## 12.17.0-beta.1 (2023-08-08) - This release contains bug fixes to improve quality. diff --git a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj index 204b45adcfda..b8d8591b1c8c 100644 --- a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj +++ b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Common client library - 12.17.0-beta.2 + 12.17.0 12.16.0 CommonSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index a0b4993f494d..98ece9d814cf 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History -## 12.16.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 12.16.0 (2023-09-12) +- Includes all features from 12.16.0-beta.1. ## 12.16.0-beta.1 (2023-08-08) - Added support for service version 2023-05-03 and 2023-08-03. diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj index a5baeea941ee..5cf917704f63 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Files.DataLake client library - 12.16.0-beta.2 + 12.16.0 12.15.0 DataLakeSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index e237dc381a75..0c43200cbab1 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History -## 12.16.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 12.16.0 (2023-09-12) +- Includes all features from 12.16.0-beta.1. ## 12.16.0-beta.1 (2023-08-08) - Added support for service version 2023-05-03 and 2023-08-03. diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj index 001e01421512..298eb7e362bb 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Files.Shares client library - 12.16.0-beta.2 + 12.16.0 12.15.0 FileSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md index 07ed6f2cdb17..a78d2f7502ad 100644 --- a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History -## 12.16.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 12.16.0 (2023-09-12) +- Includes all features from 12.16.0-beta.1. ## 12.16.0-beta.1 (2023-08-08) - This release contains bug fixes to improve quality. diff --git a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj index 308e1739f463..c5371d6b05df 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj +++ b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Queues client library - 12.16.0-beta.2 + 12.16.0 12.15.0 QueueSDK;$(DefineConstants) From 6ceae18442793de1d7c49657289772fac034d99e Mon Sep 17 00:00:00 2001 From: Christopher Scott Date: Tue, 12 Sep 2023 12:20:33 -0500 Subject: [PATCH 16/45] Fix release date for Confidential Ledger (#38629) --- .../Azure.Security.ConfidentialLedger/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md index 4a961f96fb47..50b770ac5822 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0 (2023-08-03) +## 1.2.0 (2023-09-12) ### Bugs Fixed From 5eb9eb6e5d18772f8b2895904525df0437cf517c Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:11:25 -0700 Subject: [PATCH 17/45] Increment version for eventhub releases (#38632) * Increment package version after release of Microsoft.Azure.WebJobs.Extensions.EventHubs * Increment package version after release of Azure.Messaging.EventHubs.Processor --- .../Azure.Messaging.EventHubs.Processor/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Messaging.EventHubs.Processor.csproj | 4 ++-- .../CHANGELOG.md | 10 ++++++++++ ...Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj | 4 ++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md index 5cab94e6a443..2e2506756e25 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 5.10.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 5.9.3 (2023-09-12) ### Other Changes diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj index 90a7732b0a61..5a0965221a14 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj @@ -1,9 +1,9 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This library extends its Event Processor with durable storage for checkpoint information using Azure Blob storage. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ - 5.9.3 + 5.10.0-beta.1 - 5.9.2 + 5.9.3 Azure;Event Hubs;EventHubs;.NET;Event Processor;EventProcessor;$(PackageCommonTags) $(RequiredTargetFrameworks) true diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md index 0424a8d45e19..876cef756300 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 6.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 6.0.0 (2023-09-12) ### Breaking Changes diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj index 123cec1cf3c5..cf70369b84a3 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj @@ -3,9 +3,9 @@ netstandard2.0 Microsoft Azure WebJobs SDK EventHubs Extension - 6.0.0 + 6.1.0-beta.1 - 5.5.0 + 6.0.0 $(NoWarn);AZC0001;CS1591;SA1636 sign.snk true From febbc5a82bbcf022147d4ece7012212dbffe9167 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Tue, 12 Sep 2023 14:14:15 -0400 Subject: [PATCH 18/45] [AppConfig] Update API Compat version (#38628) The focus of these changes is to update the API Compat target after the 1.2.1 release. --- .../src/Azure.Data.AppConfiguration.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj index ec5901560b07..b9f435968c36 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj @@ -5,7 +5,7 @@ Microsoft Azure.Data.AppConfiguration client library 1.3.0-beta.3 - 1.2.0 + 1.2.1 Microsoft Azure Application Configuration;Data;AppConfig;$(PackageCommonTags) $(RequiredTargetFrameworks) $(NoWarn);3021; From 8a110f564fb2a8982d4d7b7128978c80a22680bf Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:33:54 -0700 Subject: [PATCH 19/45] Prepare for release (#38612) * Prepare for release * change log --- .../Azure.Messaging.EventGrid/CHANGELOG.md | 11 +- ...zure.Messaging.EventGrid.netstandard2.0.cs | 111 +++++++++++++++++- .../Azure.Messaging.EventGrid/assets.json | 2 +- .../src/Azure.Messaging.EventGrid.csproj | 2 +- .../Customization/EventGridModelFactory.cs | 14 +++ .../src/Generated/EventGridModelFactory.cs | 96 ++++++++++++++- ...ngReportReceivedEventData.Serialization.cs | 8 +- ...gagementTrackingReportReceivedEventData.cs | 6 +- ...nSnapshotCreatedEventData.Serialization.cs | 61 ++++++++++ ...ppConfigurationSnapshotCreatedEventData.cs | 26 ++++ ...gurationSnapshotEventData.Serialization.cs | 61 ++++++++++ .../AppConfigurationSnapshotEventData.cs | 36 ++++++ ...SnapshotModifiedEventData.Serialization.cs | 61 ++++++++++ ...pConfigurationSnapshotModifiedEventData.cs | 26 ++++ ...CreatedOrUpdatedEventData.Serialization.cs | 107 +++++++++++++++++ ...GridMqttClientCreatedOrUpdatedEventData.cs | 48 ++++++++ ...qttClientDeletedEventData.Serialization.cs | 61 ++++++++++ .../EventGridMqttClientDeletedEventData.cs | 26 ++++ .../EventGridMqttClientDisconnectionReason.cs | 78 ++++++++++++ ...ntGridMqttClientEventData.Serialization.cs | 61 ++++++++++ .../Models/EventGridMqttClientEventData.cs | 36 ++++++ ...SessionConnectedEventData.Serialization.cs | 77 ++++++++++++ ...GridMqttClientSessionConnectedEventData.cs | 35 ++++++ ...sionDisconnectedEventData.Serialization.cs | 87 ++++++++++++++ ...dMqttClientSessionDisconnectedEventData.cs | 39 ++++++ .../Models/EventGridMqttClientState.cs | 51 ++++++++ .../Azure.Messaging.EventGrid/src/autorest.md | 10 +- .../tests/ConsumeEventTests.cs | 89 ++++++++++++++ .../tests/SystemEventTests.cs | 8 +- 29 files changed, 1319 insertions(+), 15 deletions(-) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientState.cs diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index e090db708501..801d9fed1bde 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,15 +1,22 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.18.0 (2023-09-12) ### Features Added +- Added new system events for Event Grid and App Configuration. +- Added `Recipient` property to `AcsEmailEngagementTrackingReportReceivedEventData` event. + ### Breaking Changes -### Bugs Fixed +- `EventGridClient` has been removed for the stable release. It will be included in a subsequent release. + +## 4.18.0-beta.1 (2023-07-16) ### Other Changes +- Shipping the `EventGridClient` on top of the latest system events. + ## 4.17.0 (2023-06-08) ### Features Added diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs index cac68b6fbd64..e69e10780493 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs @@ -60,7 +60,9 @@ public static partial class EventGridModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus?), System.DateTimeOffset? deliveryAttemptTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDetails(string statusMessage = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string messageId = null, System.DateTimeOffset? userActionTimestamp = default(System.DateTimeOffset?), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender, string messageId, System.DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? engagement) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset? userActionTimestamp = default(System.DateTimeOffset?), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext AcsIncomingCallCustomContext(System.Collections.Generic.IReadOnlyDictionary sipHeaders = null, System.Collections.Generic.IReadOnlyDictionary voipHeaders = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData AcsIncomingCallEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel toCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, string correlationId = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -111,6 +113,9 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData ApiManagementUserUpdatedEventData(string resourceUri = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueDeletedEventData(string key = null, string label = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData AppConfigurationKeyValueModifiedEventData(string key = null, string label = null, string etag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind? stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind?), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction?), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null) { throw null; } @@ -151,6 +156,11 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint DeviceTwinInfoX509Thumbprint(string primaryThumbprint = null, string secondaryThumbprint = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata DeviceTwinMetadata(string lastUpdated = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties DeviceTwinProperties(Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata metadata = null, float? version = default(float?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset? firstEnqueueTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastEnqueueTime = default(System.DateTimeOffset?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEventData(string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } @@ -383,6 +393,8 @@ public static partial class SystemEventNames public const string ApiManagementUserUpdated = "Microsoft.ApiManagement.UserUpdated"; public const string AppConfigurationKeyValueDeleted = "Microsoft.AppConfiguration.KeyValueDeleted"; public const string AppConfigurationKeyValueModified = "Microsoft.AppConfiguration.KeyValueModified"; + public const string AppConfigurationSnapshotCreated = "Microsoft.AppConfiguration.SnapshotCreated"; + public const string AppConfigurationSnapshotModified = "Microsoft.AppConfiguration.SnapshotModified"; public const string ContainerRegistryChartDeleted = "Microsoft.ContainerRegistry.ChartDeleted"; public const string ContainerRegistryChartPushed = "Microsoft.ContainerRegistry.ChartPushed"; public const string ContainerRegistryImageDeleted = "Microsoft.ContainerRegistry.ImageDeleted"; @@ -396,6 +408,10 @@ public static partial class SystemEventNames public const string DataBoxCopyCompleted = "Microsoft.DataBox.CopyCompleted"; public const string DataBoxCopyStarted = "Microsoft.DataBox.CopyStarted"; public const string DataBoxOrderCompleted = "Microsoft.DataBox.OrderCompleted"; + public const string EventGridMqttClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; + public const string EventGridMqttClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; + public const string EventGridMqttClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; + public const string EventGridMqttClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; public const string EventGridSubscriptionDeleted = "Microsoft.EventGrid.SubscriptionDeletedEvent"; public const string EventGridSubscriptionValidation = "Microsoft.EventGrid.SubscriptionValidationEvent"; public const string EventHubCaptureFileCreated = "Microsoft.EventHub.CaptureFileCreated"; @@ -765,6 +781,7 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? Engagement { get { throw null; } } public string EngagementContext { get { throw null; } } public string MessageId { get { throw null; } } + public string Recipient { get { throw null; } } public string Sender { get { throw null; } } public System.DateTimeOffset? UserActionTimestamp { get { throw null; } } public string UserAgent { get { throw null; } } @@ -1093,6 +1110,21 @@ internal AppConfigurationKeyValueModifiedEventData() { } public string Label { get { throw null; } } public string SyncToken { get { throw null; } } } + public partial class AppConfigurationSnapshotCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData + { + internal AppConfigurationSnapshotCreatedEventData() { } + } + public partial class AppConfigurationSnapshotEventData + { + internal AppConfigurationSnapshotEventData() { } + public string Etag { get { throw null; } } + public string Name { get { throw null; } } + public string SyncToken { get { throw null; } } + } + public partial class AppConfigurationSnapshotModifiedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData + { + internal AppConfigurationSnapshotModifiedEventData() { } + } public partial class AppEventTypeDetail { internal AppEventTypeDetail() { } @@ -1402,6 +1434,83 @@ internal DeviceTwinProperties() { } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata Metadata { get { throw null; } } public float? Version { get { throw null; } } } + public partial class EventGridMqttClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData + { + internal EventGridMqttClientCreatedOrUpdatedEventData() { } + public System.Collections.Generic.IReadOnlyDictionary Attributes { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? State { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + } + public partial class EventGridMqttClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData + { + internal EventGridMqttClientDeletedEventData() { } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EventGridMqttClientDisconnectionReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EventGridMqttClientDisconnectionReason(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthenticationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthorizationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ConnectionLost { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason IpForbidden { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason QuotaExceeded { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionOverflow { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionTakenOver { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EventGridMqttClientEventData + { + internal EventGridMqttClientEventData() { } + public string ClientAuthenticationName { get { throw null; } } + public string ClientName { get { throw null; } } + public string NamespaceName { get { throw null; } } + } + public partial class EventGridMqttClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData + { + internal EventGridMqttClientSessionConnectedEventData() { } + public string ClientSessionName { get { throw null; } } + public long? SequenceNumber { get { throw null; } } + } + public partial class EventGridMqttClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData + { + internal EventGridMqttClientSessionDisconnectedEventData() { } + public string ClientSessionName { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? DisconnectionReason { get { throw null; } } + public long? SequenceNumber { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EventGridMqttClientState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EventGridMqttClientState(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Disabled { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Enabled { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } + public override string ToString() { throw null; } + } public partial class EventHubCaptureFileCreatedEventData { internal EventHubCaptureFileCreatedEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/assets.json b/sdk/eventgrid/Azure.Messaging.EventGrid/assets.json index 42da5c291ae2..8bf42accf061 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/assets.json +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/eventgrid/Azure.Messaging.EventGrid", - "Tag": "net/eventgrid/Azure.Messaging.EventGrid_113caaf23d" + "Tag": "net/eventgrid/Azure.Messaging.EventGrid_2bad09d27c" } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj index 5581b4f19c08..0c9c4024cb48 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj @@ -2,7 +2,7 @@ This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. Microsoft Azure.Messaging.EventGrid client library - 4.18.0-beta.1 + 4.18.0 4.17.0 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs index 2c166af00186..828100f2ec55 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs @@ -570,6 +570,20 @@ public static HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEv { return new HealthcareDicomImageDeletedEventData(default, imageStudyInstanceUid, imageSeriesInstanceUid, imageSopInstanceUid, serviceHostName, sequenceNumber); } + + /// Initializes a new instance of AcsEmailEngagementTrackingReportReceivedEventData. + /// The Sender Email Address. + /// The Id of the email that has been sent. + /// The time at which the user interacted with the email. + /// The context of the type of engagement user had with email. + /// The user agent interacting with the email. + /// The type of engagement user have with email. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement) + { + return new AcsEmailEngagementTrackingReportReceivedEventData(sender, null, messageId, userActionTimestamp, engagementContext, userAgent, engagement); + } } #pragma warning restore CA1054 // URI-like parameters should not be strings } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs index 949bd7a5dd8d..c6d8be9fbfcb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs @@ -230,6 +230,67 @@ public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string e return new SubscriptionDeletedEventData(eventSubscriptionId); } + /// Initializes a new instance of EventGridMqttClientCreatedOrUpdatedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// Configured state of the client. The value could be Enabled or Disabled. + /// Time the client resource is created based on the provider's UTC time. + /// Time the client resource is last updated based on the provider's UTC time. If the client resource was never updated, this value is identical to the value of the 'createdOn' property. + /// The key-value attributes that are assigned to the client resource. + /// A new instance for mocking. + public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, EventGridMqttClientState? state = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, IReadOnlyDictionary attributes = null) + { + attributes ??= new Dictionary(); + + return new EventGridMqttClientCreatedOrUpdatedEventData(clientAuthenticationName, clientName, namespaceName, state, createdOn, updatedOn, attributes); + } + + /// Initializes a new instance of EventGridMqttClientEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// A new instance for mocking. + public static EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + { + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName); + } + + /// Initializes a new instance of EventGridMqttClientDeletedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// A new instance for mocking. + public static EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + { + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName); + } + + /// Initializes a new instance of EventGridMqttClientSessionConnectedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// Unique identifier for the MQTT client's session. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// A number that helps indicate order of MQTT client session connected or disconnected events. Latest event will have a sequence number that is higher than the previous event. + /// A new instance for mocking. + public static EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null) + { + return new EventGridMqttClientSessionConnectedEventData(clientAuthenticationName, clientName, namespaceName, clientSessionName, sequenceNumber); + } + + /// Initializes a new instance of EventGridMqttClientSessionDisconnectedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// Unique identifier for the MQTT client's session. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// A number that helps indicate order of MQTT client session connected or disconnected events. Latest event will have a sequence number that is higher than the previous event. + /// Reason for the disconnection of the MQTT client's session. The value could be one of the values in the disconnection reasons table. + /// A new instance for mocking. + public static EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null, EventGridMqttClientDisconnectionReason? disconnectionReason = null) + { + return new EventGridMqttClientSessionDisconnectedEventData(clientAuthenticationName, clientName, namespaceName, clientSessionName, sequenceNumber, disconnectionReason); + } + /// Initializes a new instance of DataBoxCopyStartedEventData. /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. /// Name of the current Stage. @@ -1086,6 +1147,36 @@ public static AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueD return new AppConfigurationKeyValueDeletedEventData(key, label, etag, syncToken); } + /// Initializes a new instance of AppConfigurationSnapshotEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + /// A new instance for mocking. + public static AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) + { + return new AppConfigurationSnapshotEventData(name, etag, syncToken); + } + + /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + /// A new instance for mocking. + public static AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) + { + return new AppConfigurationSnapshotCreatedEventData(name, etag, syncToken); + } + + /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + /// A new instance for mocking. + public static AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) + { + return new AppConfigurationSnapshotModifiedEventData(name, etag, syncToken); + } + /// Initializes a new instance of SignalRServiceClientConnectionConnectedEventData. /// The time at which the event occurred. /// The hub of connected client connection. @@ -2105,15 +2196,16 @@ public static AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDe /// Initializes a new instance of AcsEmailEngagementTrackingReportReceivedEventData. /// The Sender Email Address. + /// The Recipient Email Address. /// The Id of the email that has been sent. /// The time at which the user interacted with the email. /// The context of the type of engagement user had with email. /// The user agent interacting with the email. /// The type of engagement user have with email. /// A new instance for mocking. - public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string messageId = null, DateTimeOffset? userActionTimestamp = null, string engagementContext = null, string userAgent = null, AcsUserEngagement? engagement = null) + public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, DateTimeOffset? userActionTimestamp = null, string engagementContext = null, string userAgent = null, AcsUserEngagement? engagement = null) { - return new AcsEmailEngagementTrackingReportReceivedEventData(sender, messageId, userActionTimestamp, engagementContext, userAgent, engagement); + return new AcsEmailEngagementTrackingReportReceivedEventData(sender, recipient, messageId, userActionTimestamp, engagementContext, userAgent, engagement); } /// Initializes a new instance of PolicyInsightsPolicyStateCreatedEventData. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs index 755833397fc5..16e10f202e33 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs @@ -22,6 +22,7 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs return null; } Optional sender = default; + Optional recipient = default; Optional messageId = default; Optional userActionTimeStamp = default; Optional engagementContext = default; @@ -34,6 +35,11 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs sender = property.Value.GetString(); continue; } + if (property.NameEquals("recipient"u8)) + { + recipient = property.Value.GetString(); + continue; + } if (property.NameEquals("messageId"u8)) { messageId = property.Value.GetString(); @@ -68,7 +74,7 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs continue; } } - return new AcsEmailEngagementTrackingReportReceivedEventData(sender.Value, messageId.Value, Optional.ToNullable(userActionTimeStamp), engagementContext.Value, userAgent.Value, Optional.ToNullable(engagementType)); + return new AcsEmailEngagementTrackingReportReceivedEventData(sender.Value, recipient.Value, messageId.Value, Optional.ToNullable(userActionTimeStamp), engagementContext.Value, userAgent.Value, Optional.ToNullable(engagementType)); } internal partial class AcsEmailEngagementTrackingReportReceivedEventDataConverter : JsonConverter diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.cs index 5454b81325af..864ad03c0c42 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsEmailEngagementTrackingReportReceivedEventData.cs @@ -19,14 +19,16 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() /// Initializes a new instance of AcsEmailEngagementTrackingReportReceivedEventData. /// The Sender Email Address. + /// The Recipient Email Address. /// The Id of the email that has been sent. /// The time at which the user interacted with the email. /// The context of the type of engagement user had with email. /// The user agent interacting with the email. /// The type of engagement user have with email. - internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement) + internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement) { Sender = sender; + Recipient = recipient; MessageId = messageId; UserActionTimestamp = userActionTimestamp; EngagementContext = engagementContext; @@ -36,6 +38,8 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string /// The Sender Email Address. public string Sender { get; } + /// The Recipient Email Address. + public string Recipient { get; } /// The Id of the email that has been sent. public string MessageId { get; } /// The time at which the user interacted with the email. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs new file mode 100644 index 000000000000..fc51ea60fa5d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AppConfigurationSnapshotCreatedEventDataConverter))] + public partial class AppConfigurationSnapshotCreatedEventData + { + internal static AppConfigurationSnapshotCreatedEventData DeserializeAppConfigurationSnapshotCreatedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional etag = default; + Optional syncToken = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("etag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncToken"u8)) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationSnapshotCreatedEventData(name.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationSnapshotCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotCreatedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AppConfigurationSnapshotCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotCreatedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs new file mode 100644 index 000000000000..3c7cda555e09 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotCreated event. + public partial class AppConfigurationSnapshotCreatedEventData : AppConfigurationSnapshotEventData + { + /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. + internal AppConfigurationSnapshotCreatedEventData() + { + } + + /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + internal AppConfigurationSnapshotCreatedEventData(string name, string etag, string syncToken) : base(name, etag, syncToken) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs new file mode 100644 index 000000000000..822ccd440d0b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AppConfigurationSnapshotEventDataConverter))] + public partial class AppConfigurationSnapshotEventData + { + internal static AppConfigurationSnapshotEventData DeserializeAppConfigurationSnapshotEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional etag = default; + Optional syncToken = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("etag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncToken"u8)) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationSnapshotEventData(name.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationSnapshotEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AppConfigurationSnapshotEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs new file mode 100644 index 000000000000..5aaaa39d9d98 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of snapshot events. + public partial class AppConfigurationSnapshotEventData + { + /// Initializes a new instance of AppConfigurationSnapshotEventData. + internal AppConfigurationSnapshotEventData() + { + } + + /// Initializes a new instance of AppConfigurationSnapshotEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + internal AppConfigurationSnapshotEventData(string name, string etag, string syncToken) + { + Name = name; + Etag = etag; + SyncToken = syncToken; + } + + /// The name of the snapshot. + public string Name { get; } + /// The etag representing the new state of the snapshot. + public string Etag { get; } + /// The sync token representing the server state after the event. + public string SyncToken { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs new file mode 100644 index 000000000000..bbebcd9cde47 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AppConfigurationSnapshotModifiedEventDataConverter))] + public partial class AppConfigurationSnapshotModifiedEventData + { + internal static AppConfigurationSnapshotModifiedEventData DeserializeAppConfigurationSnapshotModifiedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional etag = default; + Optional syncToken = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("etag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncToken"u8)) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationSnapshotModifiedEventData(name.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationSnapshotModifiedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotModifiedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AppConfigurationSnapshotModifiedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotModifiedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs new file mode 100644 index 000000000000..02a7096ba3d2 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotModified event. + public partial class AppConfigurationSnapshotModifiedEventData : AppConfigurationSnapshotEventData + { + /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. + internal AppConfigurationSnapshotModifiedEventData() + { + } + + /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + internal AppConfigurationSnapshotModifiedEventData(string name, string etag, string syncToken) : base(name, etag, syncToken) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs new file mode 100644 index 000000000000..4ae9bb791ef1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(EventGridMqttClientCreatedOrUpdatedEventDataConverter))] + public partial class EventGridMqttClientCreatedOrUpdatedEventData + { + internal static EventGridMqttClientCreatedOrUpdatedEventData DeserializeEventGridMqttClientCreatedOrUpdatedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional state = default; + Optional createdOn = default; + Optional updatedOn = default; + Optional> attributes = default; + Optional clientAuthenticationName = default; + Optional clientName = default; + Optional namespaceName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new EventGridMqttClientState(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + attributes = dictionary; + continue; + } + if (property.NameEquals("clientAuthenticationName"u8)) + { + clientAuthenticationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientName"u8)) + { + clientName = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespaceName"u8)) + { + namespaceName = property.Value.GetString(); + continue; + } + } + return new EventGridMqttClientCreatedOrUpdatedEventData(clientAuthenticationName.Value, clientName.Value, namespaceName.Value, Optional.ToNullable(state), Optional.ToNullable(createdOn), Optional.ToNullable(updatedOn), Optional.ToDictionary(attributes)); + } + + internal partial class EventGridMqttClientCreatedOrUpdatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, EventGridMqttClientCreatedOrUpdatedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override EventGridMqttClientCreatedOrUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.cs new file mode 100644 index 000000000000..8f99c8ef287d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientCreatedOrUpdatedEventData.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Event data for Microsoft.EventGrid.MQTTClientCreatedOrUpdated event. + public partial class EventGridMqttClientCreatedOrUpdatedEventData : EventGridMqttClientEventData + { + /// Initializes a new instance of EventGridMqttClientCreatedOrUpdatedEventData. + internal EventGridMqttClientCreatedOrUpdatedEventData() + { + Attributes = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of EventGridMqttClientCreatedOrUpdatedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// Configured state of the client. The value could be Enabled or Disabled. + /// Time the client resource is created based on the provider's UTC time. + /// Time the client resource is last updated based on the provider's UTC time. If the client resource was never updated, this value is identical to the value of the 'createdOn' property. + /// The key-value attributes that are assigned to the client resource. + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName) + { + State = state; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + Attributes = attributes; + } + + /// Configured state of the client. The value could be Enabled or Disabled. + public EventGridMqttClientState? State { get; } + /// Time the client resource is created based on the provider's UTC time. + public DateTimeOffset? CreatedOn { get; } + /// Time the client resource is last updated based on the provider's UTC time. If the client resource was never updated, this value is identical to the value of the 'createdOn' property. + public DateTimeOffset? UpdatedOn { get; } + /// The key-value attributes that are assigned to the client resource. + public IReadOnlyDictionary Attributes { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.Serialization.cs new file mode 100644 index 000000000000..698d1ea39d41 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(EventGridMqttClientDeletedEventDataConverter))] + public partial class EventGridMqttClientDeletedEventData + { + internal static EventGridMqttClientDeletedEventData DeserializeEventGridMqttClientDeletedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional clientAuthenticationName = default; + Optional clientName = default; + Optional namespaceName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientAuthenticationName"u8)) + { + clientAuthenticationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientName"u8)) + { + clientName = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespaceName"u8)) + { + namespaceName = property.Value.GetString(); + continue; + } + } + return new EventGridMqttClientDeletedEventData(clientAuthenticationName.Value, clientName.Value, namespaceName.Value); + } + + internal partial class EventGridMqttClientDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, EventGridMqttClientDeletedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override EventGridMqttClientDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.cs new file mode 100644 index 000000000000..b978530a3605 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDeletedEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Event data for Microsoft.EventGrid.MQTTClientDeleted event. + public partial class EventGridMqttClientDeletedEventData : EventGridMqttClientEventData + { + /// Initializes a new instance of EventGridMqttClientDeletedEventData. + internal EventGridMqttClientDeletedEventData() + { + } + + /// Initializes a new instance of EventGridMqttClientDeletedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName) : base(clientAuthenticationName, clientName, namespaceName) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs new file mode 100644 index 000000000000..81327714b606 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Reason for the disconnection of the MQTT client's session. The value could be one of the values in the disconnection reasons table. + public readonly partial struct EventGridMqttClientDisconnectionReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EventGridMqttClientDisconnectionReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ClientAuthenticationErrorValue = "ClientAuthenticationError"; + private const string ClientAuthorizationErrorValue = "ClientAuthorizationError"; + private const string ClientErrorValue = "ClientError"; + private const string ClientInitiatedDisconnectValue = "ClientInitiatedDisconnect"; + private const string ConnectionLostValue = "ConnectionLost"; + private const string IpForbiddenValue = "IpForbidden"; + private const string QuotaExceededValue = "QuotaExceeded"; + private const string ServerErrorValue = "ServerError"; + private const string ServerInitiatedDisconnectValue = "ServerInitiatedDisconnect"; + private const string SessionOverflowValue = "SessionOverflow"; + private const string SessionTakenOverValue = "SessionTakenOver"; + + /// The client got disconnected for any authentication reasons (for example, certificate expired, client got disabled, or client configuration changed). + public static EventGridMqttClientDisconnectionReason ClientAuthenticationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthenticationErrorValue); + /// The client got disconnected for any authorization reasons (for example, because of a change in the configuration of topic spaces, permission bindings, or client groups). + public static EventGridMqttClientDisconnectionReason ClientAuthorizationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthorizationErrorValue); + /// The client sent a bad request or used one of the unsupported features that resulted in a connection termination by the service. + public static EventGridMqttClientDisconnectionReason ClientError { get; } = new EventGridMqttClientDisconnectionReason(ClientErrorValue); + /// The client initiates a graceful disconnect through a DISCONNECT packet for MQTT or a close frame for MQTT over WebSocket. + public static EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ClientInitiatedDisconnectValue); + /// The client-server connection is lost. (EXCHANGE ONLINE PROTECTION). + public static EventGridMqttClientDisconnectionReason ConnectionLost { get; } = new EventGridMqttClientDisconnectionReason(ConnectionLostValue); + /// The client's IP address is blocked by IP filter or Private links configuration. + public static EventGridMqttClientDisconnectionReason IpForbidden { get; } = new EventGridMqttClientDisconnectionReason(IpForbiddenValue); + /// The client exceeded one or more of the throttling limits that resulted in a connection termination by the service. + public static EventGridMqttClientDisconnectionReason QuotaExceeded { get; } = new EventGridMqttClientDisconnectionReason(QuotaExceededValue); + /// The connection got terminated due to an unexpected server error. + public static EventGridMqttClientDisconnectionReason ServerError { get; } = new EventGridMqttClientDisconnectionReason(ServerErrorValue); + /// The server initiates a graceful disconnect for any operational reason. + public static EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ServerInitiatedDisconnectValue); + /// The client's queue for unacknowledged QoS1 messages reached its limit, which resulted in a connection termination by the server. + public static EventGridMqttClientDisconnectionReason SessionOverflow { get; } = new EventGridMqttClientDisconnectionReason(SessionOverflowValue); + /// The client reconnected with the same authentication name, which resulted in the termination of the previous connection. + public static EventGridMqttClientDisconnectionReason SessionTakenOver { get; } = new EventGridMqttClientDisconnectionReason(SessionTakenOverValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EventGridMqttClientDisconnectionReason(string value) => new EventGridMqttClientDisconnectionReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EventGridMqttClientDisconnectionReason other && Equals(other); + /// + public bool Equals(EventGridMqttClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.Serialization.cs new file mode 100644 index 000000000000..5a31fec3c765 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(EventGridMqttClientEventDataConverter))] + public partial class EventGridMqttClientEventData + { + internal static EventGridMqttClientEventData DeserializeEventGridMqttClientEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional clientAuthenticationName = default; + Optional clientName = default; + Optional namespaceName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientAuthenticationName"u8)) + { + clientAuthenticationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientName"u8)) + { + clientName = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespaceName"u8)) + { + namespaceName = property.Value.GetString(); + continue; + } + } + return new EventGridMqttClientEventData(clientAuthenticationName.Value, clientName.Value, namespaceName.Value); + } + + internal partial class EventGridMqttClientEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, EventGridMqttClientEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override EventGridMqttClientEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.cs new file mode 100644 index 000000000000..7e7edc66538f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientEventData.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for MQTT Client state changes. + public partial class EventGridMqttClientEventData + { + /// Initializes a new instance of EventGridMqttClientEventData. + internal EventGridMqttClientEventData() + { + } + + /// Initializes a new instance of EventGridMqttClientEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + internal EventGridMqttClientEventData(string clientAuthenticationName, string clientName, string namespaceName) + { + ClientAuthenticationName = clientAuthenticationName; + ClientName = clientName; + NamespaceName = namespaceName; + } + + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + public string ClientAuthenticationName { get; } + /// Name of the client resource in the Event Grid namespace. + public string ClientName { get; } + /// Name of the Event Grid namespace where the MQTT client was created or updated. + public string NamespaceName { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.Serialization.cs new file mode 100644 index 000000000000..3c94611be216 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(EventGridMqttClientSessionConnectedEventDataConverter))] + public partial class EventGridMqttClientSessionConnectedEventData + { + internal static EventGridMqttClientSessionConnectedEventData DeserializeEventGridMqttClientSessionConnectedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional clientSessionName = default; + Optional sequenceNumber = default; + Optional clientAuthenticationName = default; + Optional clientName = default; + Optional namespaceName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientSessionName"u8)) + { + clientSessionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sequenceNumber"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceNumber = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("clientAuthenticationName"u8)) + { + clientAuthenticationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientName"u8)) + { + clientName = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespaceName"u8)) + { + namespaceName = property.Value.GetString(); + continue; + } + } + return new EventGridMqttClientSessionConnectedEventData(clientAuthenticationName.Value, clientName.Value, namespaceName.Value, clientSessionName.Value, Optional.ToNullable(sequenceNumber)); + } + + internal partial class EventGridMqttClientSessionConnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, EventGridMqttClientSessionConnectedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override EventGridMqttClientSessionConnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.cs new file mode 100644 index 000000000000..fd1508d0182e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionConnectedEventData.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Event data for Microsoft.EventGrid.MQTTClientSessionConnected event. + public partial class EventGridMqttClientSessionConnectedEventData : EventGridMqttClientEventData + { + /// Initializes a new instance of EventGridMqttClientSessionConnectedEventData. + internal EventGridMqttClientSessionConnectedEventData() + { + } + + /// Initializes a new instance of EventGridMqttClientSessionConnectedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// Unique identifier for the MQTT client's session. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// A number that helps indicate order of MQTT client session connected or disconnected events. Latest event will have a sequence number that is higher than the previous event. + internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName) + { + ClientSessionName = clientSessionName; + SequenceNumber = sequenceNumber; + } + + /// Unique identifier for the MQTT client's session. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + public string ClientSessionName { get; } + /// A number that helps indicate order of MQTT client session connected or disconnected events. Latest event will have a sequence number that is higher than the previous event. + public long? SequenceNumber { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs new file mode 100644 index 000000000000..3313430f4201 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(EventGridMqttClientSessionDisconnectedEventDataConverter))] + public partial class EventGridMqttClientSessionDisconnectedEventData + { + internal static EventGridMqttClientSessionDisconnectedEventData DeserializeEventGridMqttClientSessionDisconnectedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional clientSessionName = default; + Optional sequenceNumber = default; + Optional disconnectionReason = default; + Optional clientAuthenticationName = default; + Optional clientName = default; + Optional namespaceName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientSessionName"u8)) + { + clientSessionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sequenceNumber"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceNumber = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("disconnectionReason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disconnectionReason = new EventGridMqttClientDisconnectionReason(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientAuthenticationName"u8)) + { + clientAuthenticationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientName"u8)) + { + clientName = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespaceName"u8)) + { + namespaceName = property.Value.GetString(); + continue; + } + } + return new EventGridMqttClientSessionDisconnectedEventData(clientAuthenticationName.Value, clientName.Value, namespaceName.Value, clientSessionName.Value, Optional.ToNullable(sequenceNumber), Optional.ToNullable(disconnectionReason)); + } + + internal partial class EventGridMqttClientSessionDisconnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, EventGridMqttClientSessionDisconnectedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override EventGridMqttClientSessionDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.cs new file mode 100644 index 000000000000..b67d8d98e8bb --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientSessionDisconnectedEventData.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Event data for Microsoft.EventGrid.MQTTClientSessionDisconnected event. + public partial class EventGridMqttClientSessionDisconnectedEventData : EventGridMqttClientEventData + { + /// Initializes a new instance of EventGridMqttClientSessionDisconnectedEventData. + internal EventGridMqttClientSessionDisconnectedEventData() + { + } + + /// Initializes a new instance of EventGridMqttClientSessionDisconnectedEventData. + /// Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// Unique identifier for the MQTT client's session. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + /// A number that helps indicate order of MQTT client session connected or disconnected events. Latest event will have a sequence number that is higher than the previous event. + /// Reason for the disconnection of the MQTT client's session. The value could be one of the values in the disconnection reasons table. + internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, string clientSessionName, long? sequenceNumber, EventGridMqttClientDisconnectionReason? disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName) + { + ClientSessionName = clientSessionName; + SequenceNumber = sequenceNumber; + DisconnectionReason = disconnectionReason; + } + + /// Unique identifier for the MQTT client's session. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters. + public string ClientSessionName { get; } + /// A number that helps indicate order of MQTT client session connected or disconnected events. Latest event will have a sequence number that is higher than the previous event. + public long? SequenceNumber { get; } + /// Reason for the disconnection of the MQTT client's session. The value could be one of the values in the disconnection reasons table. + public EventGridMqttClientDisconnectionReason? DisconnectionReason { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientState.cs new file mode 100644 index 000000000000..abf21e396f81 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Configured state of the client. The value could be Enabled or Disabled. + public readonly partial struct EventGridMqttClientState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EventGridMqttClientState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static EventGridMqttClientState Enabled { get; } = new EventGridMqttClientState(EnabledValue); + /// Disabled. + public static EventGridMqttClientState Disabled { get; } = new EventGridMqttClientState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientState left, EventGridMqttClientState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientState left, EventGridMqttClientState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EventGridMqttClientState(string value) => new EventGridMqttClientState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EventGridMqttClientState other && Equals(other); + /// + public bool Equals(EventGridMqttClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md index 6de471d7d767..d6cfbef81429 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml title: EventGridClient -require: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/eventgrid/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/eventgrid/data-plane/readme.md generation1-convenience-client: true model-factory-for-hlc: - MediaJobOutputAsset @@ -147,6 +147,14 @@ directive: $[path]["properties"]["status"]["x-namespace"] = namespace; $[path]["properties"]["summaryReportBlobUrl"]["x-ms-client-name"] = "SummaryReportBlobUri"; } + if (path.includes("EventGridMQTTClientCreatedOrUpdatedEventData")) + { + $[path]["properties"]["state"]["x-namespace"] = namespace; + } + if (path.includes("EventGridMQTTClientSessionDisconnectedEventData")) + { + $[path]["properties"]["disconnectionReason"]["x-namespace"] = namespace; + } } ``` diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs index b146d9d08952..99319c4deed5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs @@ -2299,6 +2299,36 @@ public void ConsumeCloudEventAppConfigurationKeyValueModifiedEvent() var sysEvent = events[0].Data.ToObjectFromJson(); Assert.AreEqual("key1", sysEvent.Key); } + + [Test] + public void ConsumeCloudEventAppConfigurationSnapshotCreatedEvent() + { + string requestContent = "[{\"specversion\": \"1.0\", \"id\": \"56afc886-767b-d359-d59e-0da7877166b2\", \"source\": \"/SUBSCRIPTIONS/ID/RESOURCEGROUPS/rg/PROVIDERS/MICROSOFT.Maps/test1\", \"subject\": \"test1\", \"type\": \"Microsoft.AppConfiguration.SnapshotCreated\",\"time\": \"2018-01-02T19:17:44.4383997Z\", \"data\": {\"name\":\"Foo\",\"etag\":\"FnUExLaj2moIi4tJX9AXn9sakm0\",\"syncToken\":\"zAJw6V16=Njo1IzUxNjQ2NzM=;sn=5164673\"}}]"; + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + Assert.True(events[0].TryGetSystemEventData(out object eventData)); + Assert.AreEqual("Foo", (eventData as AppConfigurationSnapshotCreatedEventData).Name); + Assert.AreEqual("zAJw6V16=Njo1IzUxNjQ2NzM=;sn=5164673", (eventData as AppConfigurationSnapshotCreatedEventData).SyncToken); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("Foo", sysEvent.Name); + } + + [Test] + public void ConsumeCloudEventAppConfigurationSnapshotModifiedEvent() + { + string requestContent = "[{\"specversion\": \"1.0\", \"id\": \"56afc886-767b-d359-d59e-0da7877166b2\", \"source\": \"/SUBSCRIPTIONS/ID/RESOURCEGROUPS/rg/PROVIDERS/MICROSOFT.Maps/test1\", \"subject\": \"test1\", \"type\": \"Microsoft.AppConfiguration.SnapshotModified\",\"time\": \"2018-01-02T19:17:44.4383997Z\", \"data\": {\"name\":\"Foo\",\"etag\":\"FnUExLaj2moIi4tJX9AXn9sakm0\",\"syncToken\":\"zAJw6V16=Njo1IzUxNjQ2NzM=;sn=5164673\"}}]"; + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + Assert.True(events[0].TryGetSystemEventData(out object eventData)); + Assert.AreEqual("Foo", (eventData as AppConfigurationSnapshotModifiedEventData).Name); + Assert.AreEqual("zAJw6V16=Njo1IzUxNjQ2NzM=;sn=5164673", (eventData as AppConfigurationSnapshotModifiedEventData).SyncToken); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("Foo", sysEvent.Name); + } #endregion #region ContainerRegistry events @@ -2565,6 +2595,65 @@ public void ConsumeCloudEventEventGridSubscriptionDeletedEvent() Assert.True(events[0].TryGetSystemEventData(out object eventData)); Assert.AreEqual("/subscriptions/id/resourceGroups/rg/providers/Microsoft.EventGrid/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1", (eventData as SubscriptionDeletedEventData).EventSubscriptionId); } + + [Test] + public void ConsumeCloudEventEventGridMqttClientCreatedOrUpdatedEvent() + { + string requestContent = "[{ \"id\": \"2d1781af-3a4c-4d7c-bd0c-e34b19da4e66\", \"source\": \"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\", \"subject\": \"\", \"data\": { \"createdOn\": \"2023-07-29T01:14:34.2048108Z\", \"updatedOn\": \"2023-07-29T01:14:34.2048108Z\",\"namespaceName\": \"myns\",\"clientName\": \"client1\",\"clientAuthenticationName\": \"client1\",\"state\": \"Enabled\",\"attributes\": {\"attribute1\": \"value1\"} }, \"type\": \"Microsoft.EventGrid.MQTTClientCreatedOrUpdated\", \"time\": \"2018-01-25T22:12:19.4556811Z\", \"specversion\": \"1.0\"}]"; + + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + Assert.True(events[0].TryGetSystemEventData(out object eventData)); + Assert.AreEqual("client1", (eventData as EventGridMqttClientCreatedOrUpdatedEventData).ClientName); + Assert.AreEqual("myns", (eventData as EventGridMqttClientCreatedOrUpdatedEventData).NamespaceName); + Assert.AreEqual("client1", (eventData as EventGridMqttClientCreatedOrUpdatedEventData).ClientAuthenticationName); + } + + [Test] + public void ConsumeCloudEventEventGridMqttClientDeletedEvent() + { + string requestContent = "[{ \"id\": \"2d1781af-3a4c-4d7c-bd0c-e34b19da4e66\", \"source\": \"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\", \"subject\": \"\", \"data\": { \"namespaceName\": \"myns\",\"clientName\": \"client1\",\"clientAuthenticationName\": \"client1\" }, \"type\": \"Microsoft.EventGrid.MQTTClientDeleted\", \"time\": \"2018-01-25T22:12:19.4556811Z\", \"specversion\": \"1.0\"}]"; + + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + Assert.True(events[0].TryGetSystemEventData(out object eventData)); + Assert.AreEqual("client1", (eventData as EventGridMqttClientDeletedEventData).ClientName); + Assert.AreEqual("myns", (eventData as EventGridMqttClientDeletedEventData).NamespaceName); + Assert.AreEqual("client1", (eventData as EventGridMqttClientDeletedEventData).ClientAuthenticationName); + } + + [Test] + public void ConsumeCloudEventEventGridMqttClientSessionConnectedEvent() + { + string requestContent = "[{ \"id\": \"2d1781af-3a4c-4d7c-bd0c-e34b19da4e66\", \"source\": \"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\", \"subject\": \"\", \"data\": { \"namespaceName\": \"myns\",\"clientSessionName\": \"session\",\"clientAuthenticationName\": \"client1\", \"sequenceNumber\": 1 }, \"type\": \"Microsoft.EventGrid.MQTTClientSessionConnected\", \"time\": \"2018-01-25T22:12:19.4556811Z\", \"specversion\": \"1.0\"}]"; + + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + Assert.True(events[0].TryGetSystemEventData(out object eventData)); + Assert.AreEqual("session", (eventData as EventGridMqttClientSessionConnectedEventData).ClientSessionName); + Assert.AreEqual("myns", (eventData as EventGridMqttClientSessionConnectedEventData).NamespaceName); + Assert.AreEqual("client1", (eventData as EventGridMqttClientSessionConnectedEventData).ClientAuthenticationName); + Assert.AreEqual(1, (eventData as EventGridMqttClientSessionConnectedEventData).SequenceNumber); + } + + [Test] + public void ConsumeCloudEventEventGridMqttClientSessionDisconnectedEvent() + { + string requestContent = "[{ \"id\": \"2d1781af-3a4c-4d7c-bd0c-e34b19da4e66\", \"source\": \"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\", \"subject\": \"\", \"data\": { \"namespaceName\": \"myns\",\"clientSessionName\": \"session\",\"clientAuthenticationName\": \"client1\", \"sequenceNumber\": 1, \"disconnectionReason\": \"ClientInitiatedDisconnect\" }, \"type\": \"Microsoft.EventGrid.MQTTClientSessionDisconnected\", \"time\": \"2018-01-25T22:12:19.4556811Z\", \"specversion\": \"1.0\"}]"; + + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + Assert.True(events[0].TryGetSystemEventData(out object eventData)); + Assert.AreEqual("session", (eventData as EventGridMqttClientSessionDisconnectedEventData).ClientSessionName); + Assert.AreEqual("myns", (eventData as EventGridMqttClientSessionDisconnectedEventData).NamespaceName); + Assert.AreEqual("client1", (eventData as EventGridMqttClientSessionDisconnectedEventData).ClientAuthenticationName); + Assert.AreEqual(1, (eventData as EventGridMqttClientSessionDisconnectedEventData).SequenceNumber); + Assert.AreEqual(EventGridMqttClientDisconnectionReason.ClientInitiatedDisconnect, (eventData as EventGridMqttClientSessionDisconnectedEventData).DisconnectionReason); + } #endregion #region Event Hub Events diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs index e986529ef3a6..317eeb3c768c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs @@ -24,14 +24,12 @@ public void MappingContainsAllSystemEvents() { foreach (var systemEvent in Assembly.GetAssembly(typeof(EventGridEvent)).GetTypes().Where(t => t.Name.EndsWith("EventData"))) { - // skip base types - if (systemEvent == typeof(ContainerRegistryArtifactEventData) || - systemEvent == typeof(ContainerRegistryEventData) || - systemEvent == typeof(ContainerServiceClusterSupportEventData) || - systemEvent == typeof(ContainerServiceNodePoolRollingEventData)) + // skip types that have no public constructors, e.g. base types + if (systemEvent.GetConstructors().Length == 0) { continue; } + ValidateName(systemEvent.Name); Assert.IsTrue( SystemEventExtensions.s_systemEventDeserializers.Values.Any( From cdd2c880eae6a6900d85a40222a0eeb94018eb0d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:20:21 -0700 Subject: [PATCH 20/45] Increment package version after release of Azure.Communication.JobRouter (#38641) --- .../Azure.Communication.JobRouter/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Communication.JobRouter.csproj | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/communication/Azure.Communication.JobRouter/CHANGELOG.md b/sdk/communication/Azure.Communication.JobRouter/CHANGELOG.md index 0f5c7b7909df..aeefffbde61d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.JobRouter/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.4 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.3 (2023-09-07) ### Bugs Fixed diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Azure.Communication.JobRouter.csproj b/sdk/communication/Azure.Communication.JobRouter/src/Azure.Communication.JobRouter.csproj index 8d8a89aaa296..0b88444575c2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Azure.Communication.JobRouter.csproj +++ b/sdk/communication/Azure.Communication.JobRouter/src/Azure.Communication.JobRouter.csproj @@ -7,7 +7,7 @@ Microsoft Azure Communication Router quickstart - Coming Soon Azure Communication Router Service - 1.0.0-beta.3 + 1.0.0-beta.4 Microsoft Azure Communication Router Service;Microsoft;Azure;Azure Communication Service;Azure Communication Router Service;Router;Communication;$(PackageCommonTags) $(RequiredTargetFrameworks) true From 3e71762d2cb38d41254bb1373d0f78dc575f3f3a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:56:20 -0700 Subject: [PATCH 21/45] Increment version for storage releases (#38642) --- sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Blobs.Batch.csproj | 4 ++-- .../Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Blobs.ChangeFeed.csproj | 2 +- sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 10 ++++++++++ .../Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj | 4 ++-- sdk/storage/Azure.Storage.Common/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Common.csproj | 4 ++-- sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Files.DataLake.csproj | 4 ++-- sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Files.Shares.csproj | 4 ++-- sdk/storage/Azure.Storage.Queues/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Queues.csproj | 4 ++-- 14 files changed, 83 insertions(+), 13 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md index 4b4bbd99079a..b24b892d6c83 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.16.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.15.0 (2023-09-12) - Includes all features from 12.15.0-beta.1. diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj index 0f85ba103a1f..a419d8189b7d 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj @@ -4,9 +4,9 @@ Microsoft Azure.Storage.Blobs.Batch client library - 12.15.0 + 12.16.0-beta.1 - 12.14.0 + 12.15.0 BlobSDK;$(DefineConstants) Microsoft Azure Storage Blobs Batching;Batch blob;Batch operation;BlobBatchClient;BlobBatch;Microsoft;Azure;Blobs;Blob;Storage;StorageScalable;$(PackageCommonTags) diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md index 9276af9c07ce..eb3b40230840 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.0.0-preview.39 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.0.0-preview.38 (2023-09-12) - This release contains bug fixes to improve quality. diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj index ecf41dbfb98b..5e3bed907c2f 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs.ChangeFeed client library - 12.0.0-preview.38 + 12.0.0-preview.39 ChangeFeedSDK;$(DefineConstants) Microsoft Azure Change Feed;Microsoft;Azure;Storage;StorageScalable;$(PackageCommonTags) diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index ee2e47c6df78..cf89b9d4ceac 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.19.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.18.0 (2023-09-12) - Includes all features from 12.18.0-beta.1. diff --git a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj index 98957055b74d..e787a5333ae1 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj +++ b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj @@ -4,9 +4,9 @@ Microsoft Azure.Storage.Blobs client library - 12.18.0 + 12.19.0-beta.1 - 12.17.0 + 12.18.0 BlobSDK;$(DefineConstants) Microsoft Azure Storage Blobs;Microsoft;Azure;Blobs;Blob;Storage;StorageScalable;$(PackageCommonTags) diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md index 65c6ee546c7e..0c1afe6fce66 100644 --- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.18.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.17.0 (2023-09-12) - Includes all features from 12.17.0-beta.1. diff --git a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj index b8d8591b1c8c..30e439ce9148 100644 --- a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj +++ b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj @@ -4,9 +4,9 @@ Microsoft Azure.Storage.Common client library - 12.17.0 + 12.18.0-beta.1 - 12.16.0 + 12.17.0 CommonSDK;$(DefineConstants) Microsoft Azure Storage Common, Microsoft, Azure, StorageScalable, azureofficial diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index 98ece9d814cf..3da2f5a68db5 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.17.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.16.0 (2023-09-12) - Includes all features from 12.16.0-beta.1. diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj index 5cf917704f63..d6baa7bbf757 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj @@ -4,9 +4,9 @@ Microsoft Azure.Storage.Files.DataLake client library - 12.16.0 + 12.17.0-beta.1 - 12.15.0 + 12.16.0 DataLakeSDK;$(DefineConstants) Microsoft Azure Storage Files;Microsoft;Azure;File;Files;Data Lake;Storage;StorageScalable;$(PackageCommonTags) diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index 0c43200cbab1..b29edce7d428 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.17.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.16.0 (2023-09-12) - Includes all features from 12.16.0-beta.1. diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj index 298eb7e362bb..14cb0c8cc4c3 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj @@ -4,9 +4,9 @@ Microsoft Azure.Storage.Files.Shares client library - 12.16.0 + 12.17.0-beta.1 - 12.15.0 + 12.16.0 FileSDK;$(DefineConstants) Microsoft Azure Storage Files;Microsoft;Azure;File;Files;Storage;StorageScalable;$(PackageCommonTags) diff --git a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md index a78d2f7502ad..c8525daa9090 100644 --- a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.17.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.16.0 (2023-09-12) - Includes all features from 12.16.0-beta.1. diff --git a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj index c5371d6b05df..9c9e35c5e1b0 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj +++ b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj @@ -4,9 +4,9 @@ Microsoft Azure.Storage.Queues client library - 12.16.0 + 12.17.0-beta.1 - 12.15.0 + 12.16.0 QueueSDK;$(DefineConstants) Microsoft Azure Storage Queues;Microsoft;Azure;Queues;Queue;Storage;StorageScalable;$(PackageCommonTags) From 1e637c17ad0de895656e60f3d4ef74455323f7d5 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Wed, 13 Sep 2023 09:59:34 +0800 Subject: [PATCH 22/45] revert some unexpected sample configuration changes (#38619) --- .../src/autorest.md | 2 - .../Samples/Sample_ArmResourceExtensions.cs | 44 +++++++++++++++++++ .../Azure.ResourceManager.Dns/src/autorest.md | 1 + .../src/autorest.md | 5 ++- .../Azure.ResourceManager.SecurityDevOps.sln | 2 +- ...ourceManager.SecurityDevOps.Samples.csproj | 2 +- .../Sample_AzureDevOpsConnectorCollection.cs | 0 .../Sample_AzureDevOpsConnectorResource.cs | 0 .../Sample_AzureDevOpsOrgCollection.cs | 0 .../Samples/Sample_AzureDevOpsOrgResource.cs | 0 .../Sample_AzureDevOpsProjectCollection.cs | 0 .../Sample_AzureDevOpsProjectResource.cs | 0 .../Sample_AzureDevOpsRepoCollection.cs | 0 .../Samples/Sample_AzureDevOpsRepoResource.cs | 0 .../Sample_GitHubConnectorCollection.cs | 0 .../Samples/Sample_GitHubConnectorResource.cs | 0 .../Samples/Sample_GitHubOwnerCollection.cs | 0 .../Samples/Sample_GitHubOwnerResource.cs | 0 .../Samples/Sample_GitHubRepoCollection.cs | 0 .../Samples/Sample_GitHubRepoResource.cs | 0 20 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Azure.ResourceManager.SecurityDevOps.Samples.csproj (89%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsConnectorCollection.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsConnectorResource.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsOrgCollection.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsOrgResource.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsProjectCollection.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsProjectResource.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsRepoCollection.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_AzureDevOpsRepoResource.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_GitHubConnectorCollection.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_GitHubConnectorResource.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_GitHubOwnerCollection.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_GitHubOwnerResource.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_GitHubRepoCollection.cs (100%) rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/{Samples => samples}/Generated/Samples/Sample_GitHubRepoResource.cs (100%) diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/src/autorest.md b/sdk/attestation/Azure.ResourceManager.Attestation/src/autorest.md index e0867a569090..3d400e29b0c7 100644 --- a/sdk/attestation/Azure.ResourceManager.Attestation/src/autorest.md +++ b/sdk/attestation/Azure.ResourceManager.Attestation/src/autorest.md @@ -16,8 +16,6 @@ clear-output-folder: true sample-gen: output-folder: $(this-folder)/../samples/Generated clear-output-folder: true - skipped-operations: - - EligibleChildResources_Get skip-csproj: true modelerfour: flatten-payloads: false diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs b/sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs new file mode 100644 index 000000000000..cd8ab4c9bd34 --- /dev/null +++ b/sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.Authorization.Models; + +namespace Azure.ResourceManager.Authorization.Samples +{ + public partial class Sample_ArmResourceExtensions + { + // GetEligibleChildResourcesByScope + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetEligibleChildResources_GetEligibleChildResourcesByScope() + { + // Generated from example definition: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json + // this example is just showing the usage of "EligibleChildResources_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // invoke the operation and iterate over the result + string scope = "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + ResourceIdentifier scope0 = new ResourceIdentifier(string.Format("/{0}", scope)); + string filter = "resourceType+eq+'resourcegroup'"; + await foreach (EligibleChildResource item in client.GetEligibleChildResourcesAsync(scope0, filter: filter)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/dns/Azure.ResourceManager.Dns/src/autorest.md b/sdk/dns/Azure.ResourceManager.Dns/src/autorest.md index 0b97d5d0df96..80147fdbf72a 100644 --- a/sdk/dns/Azure.ResourceManager.Dns/src/autorest.md +++ b/sdk/dns/Azure.ResourceManager.Dns/src/autorest.md @@ -12,6 +12,7 @@ clear-output-folder: true sample-gen: output-folder: $(this-folder)/../samples/Generated clear-output-folder: true + sample: false skip-csproj: true modelerfour: flatten-payloads: false diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/autorest.md b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/autorest.md index 2be94ed1f021..b4d3521f0592 100644 --- a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/autorest.md +++ b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/autorest.md @@ -14,6 +14,7 @@ clear-output-folder: true sample-gen: output-folder: $(this-folder)/../samples/Generated clear-output-folder: true + sample: false skip-csproj: true modelerfour: flatten-payloads: false @@ -28,7 +29,7 @@ format-by-name-rules: 'ifMatch': 'etag' 'IPv6Address': 'ip-address' 'IPv4Address': 'ip-address' - + acronym-mapping: CPU: Cpu CPUs: Cpus @@ -59,7 +60,7 @@ acronym-mapping: SoaRecord: PrivateDnsSoaRecordInfo SrvRecord: PrivateDnsSrvRecordInfo TxtRecord: PrivateDnsTxtRecordInfo - ProvisioningState : PrivateDnsProvisioningState + ProvisioningState : PrivateDnsProvisioningState override-operation-name: RecordSets_List: GetRecords diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Azure.ResourceManager.SecurityDevOps.sln b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Azure.ResourceManager.SecurityDevOps.sln index 1485ae167440..e872cc2fca14 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Azure.ResourceManager.SecurityDevOps.sln +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Azure.ResourceManager.SecurityDevOps.sln @@ -7,7 +7,7 @@ Project("{E298A5B7-DDEE-4DDB-ADB5-86437D7668A3}") = "Azure.ResourceManager.Secur EndProject Project("{E298A5B7-DDEE-4DDB-ADB5-86437D7668A3}") = "Azure.ResourceManager.SecurityDevOps.Tests", "tests\Azure.ResourceManager.SecurityDevOps.Tests.csproj", "{29307F4D-07DD-433A-BE5A-401689A3B737}" EndProject -Project("{E298A5B7-DDEE-4DDB-ADB5-86437D7668A3}") = "Azure.ResourceManager.SecurityDevOps.Samples", "Samples\Azure.ResourceManager.SecurityDevOps.Samples.csproj", "{F340C8EB-943B-41CF-B9B3-CB5E5BF339BF}" +Project("{E298A5B7-DDEE-4DDB-ADB5-86437D7668A3}") = "Azure.ResourceManager.SecurityDevOps.Samples", "samples\Azure.ResourceManager.SecurityDevOps.Samples.csproj", "{F340C8EB-943B-41CF-B9B3-CB5E5BF339BF}" EndProject Global GlobalSection(SolutionProperties) = preSolution diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Azure.ResourceManager.SecurityDevOps.Samples.csproj b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Azure.ResourceManager.SecurityDevOps.Samples.csproj similarity index 89% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Azure.ResourceManager.SecurityDevOps.Samples.csproj rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Azure.ResourceManager.SecurityDevOps.Samples.csproj index 5ed002d2e594..07959df64d38 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Azure.ResourceManager.SecurityDevOps.Samples.csproj +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Azure.ResourceManager.SecurityDevOps.Samples.csproj @@ -1,4 +1,4 @@ - + diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsConnectorCollection.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsConnectorCollection.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsConnectorCollection.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsConnectorCollection.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsConnectorResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsConnectorResource.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsConnectorResource.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsConnectorResource.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsOrgCollection.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsOrgCollection.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsOrgCollection.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsOrgCollection.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsOrgResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsOrgResource.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsOrgResource.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsOrgResource.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsProjectCollection.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsProjectCollection.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsProjectCollection.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsProjectCollection.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsProjectResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsProjectResource.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsProjectResource.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsProjectResource.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsRepoCollection.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsRepoCollection.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsRepoCollection.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsRepoCollection.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsRepoResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsRepoResource.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_AzureDevOpsRepoResource.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_AzureDevOpsRepoResource.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubConnectorCollection.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubConnectorCollection.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubConnectorCollection.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubConnectorCollection.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubConnectorResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubConnectorResource.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubConnectorResource.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubConnectorResource.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubOwnerCollection.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubOwnerCollection.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubOwnerCollection.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubOwnerCollection.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubOwnerResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubOwnerResource.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubOwnerResource.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubOwnerResource.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubRepoCollection.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubRepoCollection.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubRepoCollection.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubRepoCollection.cs diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubRepoResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubRepoResource.cs similarity index 100% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/Samples/Generated/Samples/Sample_GitHubRepoResource.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/samples/Generated/Samples/Sample_GitHubRepoResource.cs From 35dfccc3a958e264923c245180e2f0e1fa3604c7 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:21:49 -0700 Subject: [PATCH 23/45] Update AutoRest C# version to 3.0.0-beta.20230912.3 (#38653) --- eng/Packages.Data.props | 2 +- eng/emitter-package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index dffc545e11b2..377663597db0 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -174,7 +174,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 2f9d4af050cb..76eb3ac20398 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,6 +1,6 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20230907.2" + "@azure-tools/typespec-csharp": "0.2.0-beta.20230912.3" } } From 126689bd68fc7c18f5fae270376c1b42f3031b67 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 13 Sep 2023 06:16:35 -0700 Subject: [PATCH 24/45] Increment package version after release of Azure.Security.ConfidentialLedger (#38644) --- .../Azure.Security.ConfidentialLedger/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Security.ConfidentialLedger.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md index 50b770ac5822..da15c6266305 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.3.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.2.0 (2023-09-12) ### Bugs Fixed diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj index 8fc08c597c37..920700393548 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj @@ -2,9 +2,9 @@ Client SDK for the Azure Confidential Ledger service Azure Confidential Ledger - 1.2.0 + 1.3.0-beta.1 - 1.1.0 + 1.2.0 Azure ConfidentialLedger $(RequiredTargetFrameworks) $(DefineConstants) From d7569e6cbfddd0f018ae8635bd3827c7e2a31838 Mon Sep 17 00:00:00 2001 From: Christopher Scott Date: Wed, 13 Sep 2023 09:13:26 -0500 Subject: [PATCH 25/45] update version to patch (#38646) --- sdk/identity/Azure.Identity/CHANGELOG.md | 2 +- sdk/identity/Azure.Identity/src/Azure.Identity.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/identity/Azure.Identity/CHANGELOG.md b/sdk/identity/Azure.Identity/CHANGELOG.md index a4efcdb6718d..d6e805d0f261 100644 --- a/sdk/identity/Azure.Identity/CHANGELOG.md +++ b/sdk/identity/Azure.Identity/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.11.0-beta.1 (2023-09-13) +## 1.10.1 (2023-09-12) ### Bugs Fixed diff --git a/sdk/identity/Azure.Identity/src/Azure.Identity.csproj b/sdk/identity/Azure.Identity/src/Azure.Identity.csproj index 9bc8e7238e8b..ad8d0d417b01 100644 --- a/sdk/identity/Azure.Identity/src/Azure.Identity.csproj +++ b/sdk/identity/Azure.Identity/src/Azure.Identity.csproj @@ -2,7 +2,7 @@ This is the implementation of the Azure SDK Client Library for Azure Identity Microsoft Azure.Identity Component - 1.11.0-beta.1 + 1.10.1 1.10.0 Microsoft Azure Identity;$(PackageCommonTags) From 01a82ba4f5d10f867190fe7c659df0c768c3dc1b Mon Sep 17 00:00:00 2001 From: Christopher Scott Date: Wed, 13 Sep 2023 09:14:19 -0500 Subject: [PATCH 26/45] Update dockerfile for net6.0 (#38645) --- eng/containers/UbuntuNetCoreKeyring/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/containers/UbuntuNetCoreKeyring/Dockerfile b/eng/containers/UbuntuNetCoreKeyring/Dockerfile index c11f06a7fa92..14e3016c526c 100644 --- a/eng/containers/UbuntuNetCoreKeyring/Dockerfile +++ b/eng/containers/UbuntuNetCoreKeyring/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/powershell:7.2.1-ubuntu-focal AS build +FROM mcr.microsoft.com/azure-powershell:10.3.0-ubuntu-20.04 AS build ENV \ NO_AT_BRIDGE=1 \ @@ -8,7 +8,7 @@ ENV \ # Do not generate certificate DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ # SDK version - DOTNET_SDK_VERSION_5_0=5.0.404 \ + DOTNET_SDK_VERSION_6_0=6.0.413 \ DOTNET_SDK_VERSION_3_1=3.1.416 \ # Enable correct mode for dotnet watch (only mode supported in a container) DOTNET_USE_POLLING_FILE_WATCHER=true \ @@ -18,7 +18,7 @@ ENV \ POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetSDK-Ubuntu-20.04 \ # Setup Dotnet envs DOTNET_ROOT=/usr/share/dotnet \ - PATH=$PATH:usr/share/dotnet + PATH=$PATH:usr/share/dotnet # Install apt-add-repository RUN apt-get update && apt-get install -y software-properties-common @@ -39,8 +39,8 @@ RUN apt-add-repository ppa:git-core/ppa \ # Below adapated from https://hub.docker.com/_/microsoft-dotnet-sdk # https://github.com/dotnet/dotnet-docker/blob/b20c03e0644b42167d66a85fe6077ec2428a47fa/src/sdk/5.0/focal/amd64/Dockerfile -RUN curl -fSL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION_5_0/dotnet-sdk-$DOTNET_SDK_VERSION_5_0-linux-x64.tar.gz \ - && dotnet_sha512='6f9b83b2b661ce3b033a04d4c50ff3a435efa288de1a48f58be1150e64c5dd9d6bd2a4bf40f697dcd7d64ffaac24f14cc4a874e738544c5d0e8113c474fd2ee0' \ +RUN curl -fSL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION_6_0/dotnet-sdk-$DOTNET_SDK_VERSION_6_0-linux-x64.tar.gz \ + && dotnet_sha512='ee0a77d54e6d4917be7310ff0abb3bad5525bfb4beb1db0c215e65f64eb46511f5f12d6c7ff465a1d4ab38577e6a1950fde479ee94839c50e627020328a702de' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /usr/share/dotnet \ && tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \ From 4ce20d11fc0b0b4b49215c6a98fa061a105dd3da Mon Sep 17 00:00:00 2001 From: Reuben Bond <203839+ReubenBond@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:57:04 -0700 Subject: [PATCH 27/45] NonDisposingStream: delegate remaining Stream APIs to inner stream (#38184) --- .../src/Shared/NonDisposingStream.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/NonDisposingStream.cs b/sdk/storage/Azure.Storage.Common/src/Shared/NonDisposingStream.cs index adfefc06fffd..64ff1b266502 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/NonDisposingStream.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/NonDisposingStream.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -21,6 +22,8 @@ internal class NonDisposingStream : Stream public override bool CanWrite => _innerStream.CanWrite; + public override bool CanTimeout => _innerStream.CanTimeout; + public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => _innerStream.CopyToAsync(destination, bufferSize, cancellationToken); public override long Length => _innerStream.Length; @@ -42,6 +45,36 @@ internal class NonDisposingStream : Stream public override void Write(byte[] buffer, int offset, int count) => _innerStream.Write(buffer, offset, count); public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _innerStream.WriteAsync(buffer, offset, count, cancellationToken); + + public override int ReadByte() => _innerStream.ReadByte(); + + public override void WriteByte(byte value) => _innerStream.WriteByte(value); + + public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => _innerStream.BeginRead(buffer, offset, count, callback, state); + + public override int EndRead(IAsyncResult asyncResult) => _innerStream.EndRead(asyncResult); + + public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => _innerStream.BeginWrite(buffer, offset, count, callback, state); + + public override void EndWrite(IAsyncResult asyncResult) => _innerStream.EndWrite(asyncResult); + + public override int ReadTimeout { get => _innerStream.ReadTimeout; set => _innerStream.ReadTimeout = value; } + + public override int WriteTimeout { get => _innerStream.WriteTimeout; set => _innerStream.WriteTimeout = value; } + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER + + public override void CopyTo(Stream destination, int bufferSize) => _innerStream.CopyTo(destination, bufferSize); + + public override int Read(Span buffer) => _innerStream.Read(buffer); + + public override void Write(ReadOnlySpan buffer) => _innerStream.Write(buffer); + + public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) => _innerStream.WriteAsync(buffer, cancellationToken); + + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) => _innerStream.ReadAsync(buffer, cancellationToken); + +#endif } internal static partial class StreamExtensions From 729947037d6a63c87197a6d5ae2bb07d5eb12c76 Mon Sep 17 00:00:00 2001 From: ShivangiReja <45216704+ShivangiReja@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:56:18 -0700 Subject: [PATCH 28/45] [App Config] Snapshot API Updates Based on Arch Board Feedback (#38650) [App Configuration] Updates in snapshot API --- .../Azure.Data.AppConfiguration/README.md | 26 +-- ...re.Data.AppConfiguration.netstandard2.0.cs | 131 ++++++------ .../Azure.Data.AppConfiguration/assets.json | 2 +- .../samples/Sample11_SettingsSnapshot.md | 44 ++-- .../src/ConfigurationClient.cs | 200 +++++++++--------- .../src/CreateSnapshotOperation.cs | 16 +- ...=> ConfigurationSnapshot.Serialization.cs} | 18 +- ...gsSnapshot.cs => ConfigurationSnapshot.cs} | 16 +- .../src/Models/ConfigurationSnapshotStatus.cs | 53 +++++ ...positionType.cs => SnapshotComposition.cs} | 26 +-- .../src/Models/SnapshotFields.cs | 4 +- .../src/Models/SnapshotSelector.cs | 39 ++++ .../src/Models/SnapshotStatus.cs | 53 ----- .../src/Models/SnapshotUpdateParameters.cs | 2 +- .../tests/ConfigurationLiveTests.cs | 74 +++++-- .../ConfigurationSettingsSnapshotTest.cs | 8 +- .../samples/Sample11_SettingsSnapshot.cs | 96 ++++----- 17 files changed, 443 insertions(+), 365 deletions(-) rename sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/{ConfigurationSettingsSnapshot.Serialization.cs => ConfigurationSnapshot.Serialization.cs} (87%) rename sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/{ConfigurationSettingsSnapshot.cs => ConfigurationSnapshot.cs} (86%) create mode 100644 sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshotStatus.cs rename sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/{CompositionType.cs => SnapshotComposition.cs} (52%) create mode 100644 sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotSelector.cs delete mode 100644 sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotStatus.cs diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md index 0ee8894920d8..c1438e5fc87e 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md @@ -160,26 +160,26 @@ client.DeleteConfigurationSetting("some_key"); ### Create a Snapshot -To create a snapshot, you need to instantiate the `ConfigurationSettingsSnapshot` class and specify filters to determine which configuration settings should be included. The creation process is a Long-Running Operation (LRO) and can be achieved by calling the `CreateSnapshot` method. +To create a snapshot, you need to instantiate the `ConfigurationSnapshot` class and specify filters to determine which configuration settings should be included. The creation process is a Long-Running Operation (LRO) and can be achieved by calling the `CreateSnapshot` method. ```C# Snippet:AzConfigSample11_CreateSnapshot_AutomaticPolling -var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter("some_key") }); -var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); +var snapshotFilter = new List { new SnapshotSettingFilter("some_key") }; +var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; var operation = client.CreateSnapshot(WaitUntil.Completed, snapshotName, settingsSnapshot); var createdSnapshot = operation.Value; -Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); +Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); ``` ### Retrieve a Snapshot -Once a configuration setting snapshot is created, you can retrieve it using the `GetSnapshot` method. +Once a configuration snapshot is created, you can retrieve it using the `GetSnapshot` method. ```C# Snippet:AzConfigSample11_GetSnapshot var snapshotName = "some_snapshot"; -ConfigurationSettingsSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); -Console.WriteLine($"Retrieved configuration setting snapshot: {retrievedSnapshot.Name}, status: {retrievedSnapshot.Status}"); +ConfigurationSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); +Console.WriteLine($"Retrieved configuration snapshot: {retrievedSnapshot.Name}, status: {retrievedSnapshot.Status}"); ``` ### Archive a Snapshot @@ -188,8 +188,8 @@ To archive a snapshot, you can utilize the `ArchiveSnapshot` method. This operat ```C# Snippet:AzConfigSample11_ArchiveSnapshot var snapshotName = "some_snapshot"; -ConfigurationSettingsSnapshot archivedSnapshot = client.ArchiveSnapshot(snapshotName); -Console.WriteLine($"Archived configuration setting snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); +ConfigurationSnapshot archivedSnapshot = client.ArchiveSnapshot(snapshotName); +Console.WriteLine($"Archived configuration snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); ``` ### Recover a snapshot @@ -198,8 +198,8 @@ You can recover an archived snapshot by using the `RecoverSnapshot` method. This ```C# Snippet:AzConfigSample11_RecoverSnapshot var snapshotName = "some_snapshot"; -ConfigurationSettingsSnapshot recoveredSnapshot = client.RecoverSnapshot(snapshotName); -Console.WriteLine($"Recovered configuration setting snapshot: {recoveredSnapshot.Name}, status: {recoveredSnapshot.Status}"); +ConfigurationSnapshot recoveredSnapshot = client.RecoverSnapshot(snapshotName); +Console.WriteLine($"Recovered configuration snapshot: {recoveredSnapshot.Name}, status: {recoveredSnapshot.Status}"); ``` ### Retrieve all Snapshots @@ -208,10 +208,10 @@ To retrieve all snapshots, you can use the `GetSnapshots` method. ```C# Snippet:AzConfigSample11_GetSnapshots var count = 0; -foreach (var item in client.GetSnapshots()) +foreach (var item in client.GetSnapshots(new SnapshotSelector())) { count++; - Console.WriteLine($"Retrieved configuration setting snapshot: {item.Name}, status {item.Status}"); + Console.WriteLine($"Retrieved configuration snapshot: {item.Name}, status {item.Status}"); } Console.WriteLine($"Total number of snapshots retrieved: {count}"); ``` diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/api/Azure.Data.AppConfiguration.netstandard2.0.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/api/Azure.Data.AppConfiguration.netstandard2.0.cs index b08fb395f051..aba93aa1e5e3 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/api/Azure.Data.AppConfiguration.netstandard2.0.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/api/Azure.Data.AppConfiguration.netstandard2.0.cs @@ -1,23 +1,5 @@ namespace Azure.Data.AppConfiguration { - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct CompositionType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public CompositionType(string value) { throw null; } - public static Azure.Data.AppConfiguration.CompositionType Key { get { throw null; } } - public static Azure.Data.AppConfiguration.CompositionType KeyLabel { get { throw null; } } - public bool Equals(Azure.Data.AppConfiguration.CompositionType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Data.AppConfiguration.CompositionType left, Azure.Data.AppConfiguration.CompositionType right) { throw null; } - public static implicit operator Azure.Data.AppConfiguration.CompositionType (string value) { throw null; } - public static bool operator !=(Azure.Data.AppConfiguration.CompositionType left, Azure.Data.AppConfiguration.CompositionType right) { throw null; } - public override string ToString() { throw null; } - } public partial class ConfigurationClient { protected ConfigurationClient() { } @@ -30,12 +12,12 @@ public ConfigurationClient(System.Uri endpoint, Azure.Core.TokenCredential crede public virtual Azure.Response AddConfigurationSetting(string key, string value, string label = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddConfigurationSettingAsync(Azure.Data.AppConfiguration.ConfigurationSetting setting, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddConfigurationSettingAsync(string key, string value, string label = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response ArchiveSnapshot(Azure.Data.AppConfiguration.ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response ArchiveSnapshot(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ArchiveSnapshotAsync(Azure.Data.AppConfiguration.ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ArchiveSnapshotAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Data.AppConfiguration.CreateSnapshotOperation CreateSnapshot(Azure.WaitUntil wait, string name, Azure.Data.AppConfiguration.ConfigurationSettingsSnapshot snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task CreateSnapshotAsync(Azure.WaitUntil wait, string name, Azure.Data.AppConfiguration.ConfigurationSettingsSnapshot snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ArchiveSnapshot(Azure.Data.AppConfiguration.ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ArchiveSnapshot(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ArchiveSnapshotAsync(Azure.Data.AppConfiguration.ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ArchiveSnapshotAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Data.AppConfiguration.CreateSnapshotOperation CreateSnapshot(Azure.WaitUntil wait, string name, Azure.Data.AppConfiguration.ConfigurationSnapshot snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateSnapshotAsync(Azure.WaitUntil wait, string name, Azure.Data.AppConfiguration.ConfigurationSnapshot snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DeleteConfigurationSetting(Azure.Data.AppConfiguration.ConfigurationSetting setting, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DeleteConfigurationSetting(string key, string label = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteConfigurationSettingAsync(Azure.Data.AppConfiguration.ConfigurationSetting setting, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -60,14 +42,14 @@ public ConfigurationClient(System.Uri endpoint, Azure.Core.TokenCredential crede public virtual Azure.Pageable GetRevisions(string keyFilter, string labelFilter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetRevisionsAsync(Azure.Data.AppConfiguration.SettingSelector selector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetRevisionsAsync(string keyFilter, string labelFilter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetSnapshot(string name, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetSnapshotAsync(string name, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetSnapshots(string name = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable status = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetSnapshotsAsync(string name = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable status = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RecoverSnapshot(Azure.Data.AppConfiguration.ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RecoverSnapshot(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RecoverSnapshotAsync(Azure.Data.AppConfiguration.ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RecoverSnapshotAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSnapshot(string name, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSnapshotAsync(string name, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSnapshots(Azure.Data.AppConfiguration.SnapshotSelector selector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSnapshotsAsync(Azure.Data.AppConfiguration.SnapshotSelector selector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RecoverSnapshot(Azure.Data.AppConfiguration.ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RecoverSnapshot(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RecoverSnapshotAsync(Azure.Data.AppConfiguration.ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RecoverSnapshotAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetConfigurationSetting(Azure.Data.AppConfiguration.ConfigurationSetting setting, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetConfigurationSetting(string key, string value, string label = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetConfigurationSettingAsync(Azure.Data.AppConfiguration.ConfigurationSetting setting, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -116,10 +98,10 @@ public ConfigurationSetting(string key, string value, string label, Azure.ETag e [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } - public partial class ConfigurationSettingsSnapshot + public partial class ConfigurationSnapshot { - public ConfigurationSettingsSnapshot(System.Collections.Generic.IEnumerable filters) { } - public Azure.Data.AppConfiguration.CompositionType? CompositionType { get { throw null; } set { } } + public ConfigurationSnapshot(System.Collections.Generic.IEnumerable filters) { } + public Azure.Data.AppConfiguration.SnapshotComposition? CompositionType { get { throw null; } set { } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public Azure.ETag ETag { get { throw null; } } public System.DateTimeOffset? ExpiresOn { get { throw null; } } @@ -127,22 +109,42 @@ public ConfigurationSettingsSnapshot(System.Collections.Generic.IEnumerable Tags { get { throw null; } } } - public partial class CreateSnapshotOperation : Azure.Operation + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConfigurationSnapshotStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConfigurationSnapshotStatus(string value) { throw null; } + public static Azure.Data.AppConfiguration.ConfigurationSnapshotStatus Archived { get { throw null; } } + public static Azure.Data.AppConfiguration.ConfigurationSnapshotStatus Failed { get { throw null; } } + public static Azure.Data.AppConfiguration.ConfigurationSnapshotStatus Provisioning { get { throw null; } } + public static Azure.Data.AppConfiguration.ConfigurationSnapshotStatus Ready { get { throw null; } } + public bool Equals(Azure.Data.AppConfiguration.ConfigurationSnapshotStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Data.AppConfiguration.ConfigurationSnapshotStatus left, Azure.Data.AppConfiguration.ConfigurationSnapshotStatus right) { throw null; } + public static implicit operator Azure.Data.AppConfiguration.ConfigurationSnapshotStatus (string value) { throw null; } + public static bool operator !=(Azure.Data.AppConfiguration.ConfigurationSnapshotStatus left, Azure.Data.AppConfiguration.ConfigurationSnapshotStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CreateSnapshotOperation : Azure.Operation { protected CreateSnapshotOperation() { } public override bool HasCompleted { get { throw null; } } public override bool HasValue { get { throw null; } } public override string Id { get { throw null; } } - public override Azure.Data.AppConfiguration.ConfigurationSettingsSnapshot Value { get { throw null; } } + public override Azure.Data.AppConfiguration.ConfigurationSnapshot Value { get { throw null; } } public override Azure.Response GetRawResponse() { throw null; } public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; } } public partial class FeatureFlagConfigurationSetting : Azure.Data.AppConfiguration.ConfigurationSetting { @@ -197,6 +199,24 @@ public SettingSelector() { } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SnapshotComposition : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SnapshotComposition(string value) { throw null; } + public static Azure.Data.AppConfiguration.SnapshotComposition Key { get { throw null; } } + public static Azure.Data.AppConfiguration.SnapshotComposition KeyLabel { get { throw null; } } + public bool Equals(Azure.Data.AppConfiguration.SnapshotComposition other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Data.AppConfiguration.SnapshotComposition left, Azure.Data.AppConfiguration.SnapshotComposition right) { throw null; } + public static implicit operator Azure.Data.AppConfiguration.SnapshotComposition (string value) { throw null; } + public static bool operator !=(Azure.Data.AppConfiguration.SnapshotComposition left, Azure.Data.AppConfiguration.SnapshotComposition right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SnapshotFields : System.IEquatable { private readonly object _dummy; @@ -210,7 +230,7 @@ public SettingSelector() { } public static Azure.Data.AppConfiguration.SnapshotFields ItemCount { get { throw null; } } public static Azure.Data.AppConfiguration.SnapshotFields Name { get { throw null; } } public static Azure.Data.AppConfiguration.SnapshotFields RetentionPeriod { get { throw null; } } - public static Azure.Data.AppConfiguration.SnapshotFields Size { get { throw null; } } + public static Azure.Data.AppConfiguration.SnapshotFields SizeInBytes { get { throw null; } } public static Azure.Data.AppConfiguration.SnapshotFields Status { get { throw null; } } public static Azure.Data.AppConfiguration.SnapshotFields Tags { get { throw null; } } public bool Equals(Azure.Data.AppConfiguration.SnapshotFields other) { throw null; } @@ -223,32 +243,19 @@ public SettingSelector() { } public static bool operator !=(Azure.Data.AppConfiguration.SnapshotFields left, Azure.Data.AppConfiguration.SnapshotFields right) { throw null; } public override string ToString() { throw null; } } + public partial class SnapshotSelector + { + public SnapshotSelector() { } + public System.Collections.Generic.IList Fields { get { throw null; } } + public string Name { get { throw null; } set { } } + public System.Collections.Generic.IList Status { get { throw null; } } + } public partial class SnapshotSettingFilter { public SnapshotSettingFilter(string key) { } public string Key { get { throw null; } set { } } public string Label { get { throw null; } set { } } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct SnapshotStatus : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public SnapshotStatus(string value) { throw null; } - public static Azure.Data.AppConfiguration.SnapshotStatus Archived { get { throw null; } } - public static Azure.Data.AppConfiguration.SnapshotStatus Failed { get { throw null; } } - public static Azure.Data.AppConfiguration.SnapshotStatus Provisioning { get { throw null; } } - public static Azure.Data.AppConfiguration.SnapshotStatus Ready { get { throw null; } } - public bool Equals(Azure.Data.AppConfiguration.SnapshotStatus other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Data.AppConfiguration.SnapshotStatus left, Azure.Data.AppConfiguration.SnapshotStatus right) { throw null; } - public static implicit operator Azure.Data.AppConfiguration.SnapshotStatus (string value) { throw null; } - public static bool operator !=(Azure.Data.AppConfiguration.SnapshotStatus left, Azure.Data.AppConfiguration.SnapshotStatus right) { throw null; } - public override string ToString() { throw null; } - } } namespace Microsoft.Extensions.Azure { diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/assets.json b/sdk/appconfiguration/Azure.Data.AppConfiguration/assets.json index b0514d7bdc68..6be2f9404c2b 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/assets.json +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/appconfiguration/Azure.Data.AppConfiguration", - "Tag": "net/appconfiguration/Azure.Data.AppConfiguration_9577bdfe93" + "Tag": "net/appconfiguration/Azure.Data.AppConfiguration_c13e90b6f4" } diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample11_SettingsSnapshot.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample11_SettingsSnapshot.md index 57fc94539a62..710af03dac9e 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample11_SettingsSnapshot.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample11_SettingsSnapshot.md @@ -2,45 +2,45 @@ Azure App Configuration allows users to create a point-in-time snapshot of their configuration store, providing them with the ability to treat settings as one consistent version. This feature enables applications to hold a consistent view of configuration, ensuring that there are no version mismatches to individual settings due to reading as updates were made. Snapshots are immutable, ensuring that configuration can confidently be rolled back to a last-known-good configuration in the event of a problem. -This sample illustrates how to create, retrieve, and modify the status of a `ConfigurationSettingSnapshot`. +This sample illustrates how to create, retrieve, and modify the status of a `ConfigurationSnapshot`. To get started, you'll need to instantiate the `ConfigurationClient` class. In order to do so, you have two options: provide the connection string of the Configuration Store or authenticate with Azure Active Directory. For detailed instructions, please refer to the [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md#authenticate-the-client). ## Create a Snapshot -To create a snapshot, you need to create an instance of `ConfigurationSettingsSnapshot` and add filters to determine which configuration settings are included in the snapshot. The creation of a snapshot is an LRO (Long-Running Operation) method, and there are three ways to call the `CreateSnapshot` method: +To create a snapshot, you need to create an instance of `ConfigurationSnapshot` and add filters to determine which configuration settings are included in the snapshot. The creation of a snapshot is an LRO (Long-Running Operation) method, and there are three ways to call the `CreateSnapshot` method: ### Automatic Polling ```C# Snippet:AzConfigSample11_CreateSnapshot_AutomaticPolling -var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter("some_key") }); -var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); +var snapshotFilter = new List { new SnapshotSettingFilter("some_key") }; +var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; var operation = client.CreateSnapshot(WaitUntil.Completed, snapshotName, settingsSnapshot); var createdSnapshot = operation.Value; -Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); +Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); ``` ### Automatic Polling with `WaitForCompletion` ```C# Snippet:AzConfigSample11_CreateSnapshot_AutomaticPollingLater -var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter("some_key") }); -var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); +var snapshotFilter = new List { new SnapshotSettingFilter("some_key") }; +var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; var operation = client.CreateSnapshot(WaitUntil.Started, snapshotName, settingsSnapshot); operation.WaitForCompletion(); var createdSnapshot = operation.Value; -Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); +Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); ``` ### Manual Polling ```C# Snippet:AzConfigSample11_CreateSnapshot_ManualPolling -var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter("some_key") }); -var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); +var snapshotFilter = new List { new SnapshotSettingFilter("some_key") }; +var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; var operation = client.CreateSnapshot(WaitUntil.Started, snapshotName, settingsSnapshot); @@ -53,7 +53,7 @@ while (true) } var createdSnapshot = operation.Value; -Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); +Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); ``` ## Retrieve a Snapshot @@ -62,8 +62,8 @@ After creating a configuration setting snapshot, you can retrieve it using the ` ```C# Snippet:AzConfigSample11_GetSnapshot var snapshotName = "some_snapshot"; -ConfigurationSettingsSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); -Console.WriteLine($"Retrieved configuration setting snapshot: {retrievedSnapshot.Name}, status: {retrievedSnapshot.Status}"); +ConfigurationSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); +Console.WriteLine($"Retrieved configuration snapshot: {retrievedSnapshot.Name}, status: {retrievedSnapshot.Status}"); ``` ## Archive a Snapshot @@ -72,8 +72,8 @@ To archive a snapshot, you can use the `ArchiveSnapshot` method. This operation ```C# Snippet:AzConfigSample11_ArchiveSnapshot var snapshotName = "some_snapshot"; -ConfigurationSettingsSnapshot archivedSnapshot = client.ArchiveSnapshot(snapshotName); -Console.WriteLine($"Archived configuration setting snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); +ConfigurationSnapshot archivedSnapshot = client.ArchiveSnapshot(snapshotName); +Console.WriteLine($"Archived configuration snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); ``` ## Recover a snapshot @@ -82,8 +82,8 @@ To recover an archived snapshot, you can use the `RecoverSnapshot` method. This ```C# Snippet:AzConfigSample11_RecoverSnapshot var snapshotName = "some_snapshot"; -ConfigurationSettingsSnapshot recoveredSnapshot = client.RecoverSnapshot(snapshotName); -Console.WriteLine($"Recovered configuration setting snapshot: {recoveredSnapshot.Name}, status: {recoveredSnapshot.Status}"); +ConfigurationSnapshot recoveredSnapshot = client.RecoverSnapshot(snapshotName); +Console.WriteLine($"Recovered configuration snapshot: {recoveredSnapshot.Name}, status: {recoveredSnapshot.Status}"); ``` ## Retrieve all Snapshots @@ -92,10 +92,10 @@ To retrieve all snapshots, you can use the `GetSnapshots` method. ```C# Snippet:AzConfigSample11_GetSnapshots var count = 0; -foreach (var item in client.GetSnapshots()) +foreach (var item in client.GetSnapshots(new SnapshotSelector())) { count++; - Console.WriteLine($"Retrieved configuration setting snapshot: {item.Name}, status {item.Status}"); + Console.WriteLine($"Retrieved configuration snapshot: {item.Name}, status {item.Status}"); } Console.WriteLine($"Total number of snapshots retrieved: {count}"); ``` @@ -111,13 +111,13 @@ client.AddConfigurationSetting(firstSetting); var secondSetting = new ConfigurationSetting("second_key", "second_value"); client.AddConfigurationSetting(secondSetting); -var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(firstSetting.Key), new SnapshotSettingFilter(secondSetting.Key) }); -var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); +var snapshotFilter = new List { new SnapshotSettingFilter(firstSetting.Key), new SnapshotSettingFilter(secondSetting.Key) }; +var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; var operation = client.CreateSnapshot(WaitUntil.Completed, snapshotName, settingsSnapshot); var createdSnapshot = operation.Value; -Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); +Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); var count = 0; foreach (var item in client.GetConfigurationSettingsForSnapshot(snapshotName)) diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs index 3e1cf755ded5..cdf1c3e100bd 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs @@ -726,11 +726,11 @@ public virtual Pageable GetConfigurationSettingsForSnapsho return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConfigurationServiceSerializer.ReadSetting, ClientDiagnostics, _pipeline, "ConfigurationClient.GetConfigurationSettingsForSnapshot", "items", "@nextLink", context); } - /// Gets a single configuration setting snapshot. - /// The name of the configuration setting snapshot to retrieve. + /// Gets a single configuration snapshot. + /// The name of the configuration snapshot to retrieve. /// Used to select what fields are present in the returned resource(s). /// The cancellation token to use. - public virtual async Task> GetSnapshotAsync(string name, IEnumerable fields = null, CancellationToken cancellationToken = default) + public virtual async Task> GetSnapshotAsync(string name, IEnumerable fields = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); @@ -750,7 +750,7 @@ public virtual async Task> GetSnapshotAs } Response response = await GetSnapshotAsync(name, snapshotFields, new MatchConditions(), context).ConfigureAwait(false); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -760,11 +760,11 @@ public virtual async Task> GetSnapshotAs } } - /// Gets a single configuration setting snapshot. - /// The name of the configuration setting snapshot to retrieve. + /// Gets a single configuration snapshot. + /// The name of the configuration snapshot to retrieve. /// Used to select what fields are present in the returned resource(s). /// The cancellation token to use. - public virtual Response GetSnapshot(string name, IEnumerable fields = null, CancellationToken cancellationToken = default) + public virtual Response GetSnapshot(string name, IEnumerable fields = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); @@ -784,7 +784,7 @@ public virtual Response GetSnapshot(string name, } Response response = GetSnapshot(name, snapshotFields, new MatchConditions(), context); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -794,15 +794,15 @@ public virtual Response GetSnapshot(string name, } } - /// Creates a configuration setting snapshot. + /// Creates a configuration snapshot. /// /// if the method should wait to return until the long-running operation has completed on the service; /// if it should return after starting the operation /// - /// The name of the configuration setting snapshot to create. - /// The configuration setting snapshot to create. + /// The name of the configuration snapshot to create. + /// The configuration snapshot to create. /// The cancellation token to use. - public virtual async Task CreateSnapshotAsync(WaitUntil wait, string name, ConfigurationSettingsSnapshot snapshot, CancellationToken cancellationToken = default) + public virtual async Task CreateSnapshotAsync(WaitUntil wait, string name, ConfigurationSnapshot snapshot, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(snapshot, nameof(snapshot)); @@ -812,7 +812,7 @@ public virtual async Task CreateSnapshotAsync(WaitUntil try { RequestContext context = CreateRequestContext(ErrorOptions.Default, cancellationToken); - using RequestContent content = ConfigurationSettingsSnapshot.ToRequestContent(snapshot); + using RequestContent content = ConfigurationSnapshot.ToRequestContent(snapshot); ContentType contentType = new(HttpHeader.Common.JsonContentType.Value.ToString()); // Start the operation @@ -834,15 +834,15 @@ public virtual async Task CreateSnapshotAsync(WaitUntil } } - /// Creates a configuration setting snapshot. + /// Creates a configuration snapshot. /// /// if the method should wait to return until the long-running operation has completed on the service; /// if it should return after starting the operation. /// - /// The name of the configuration setting snapshot to create. - /// The configuration setting snapshot to create. + /// The name of the configuration snapshot to create. + /// The configuration snapshot to create. /// The cancellation token to use. - public virtual CreateSnapshotOperation CreateSnapshot(WaitUntil wait, string name, ConfigurationSettingsSnapshot snapshot, CancellationToken cancellationToken = default) + public virtual CreateSnapshotOperation CreateSnapshot(WaitUntil wait, string name, ConfigurationSnapshot snapshot, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(snapshot, nameof(snapshot)); @@ -852,7 +852,7 @@ public virtual CreateSnapshotOperation CreateSnapshot(WaitUntil wait, string nam try { RequestContext context = CreateRequestContext(ErrorOptions.Default, cancellationToken); - using RequestContent content = ConfigurationSettingsSnapshot.ToRequestContent(snapshot); + using RequestContent content = ConfigurationSnapshot.ToRequestContent(snapshot); ContentType contentType = new(HttpHeader.Common.JsonContentType.Value.ToString()); // Start the operation @@ -874,10 +874,10 @@ public virtual CreateSnapshotOperation CreateSnapshot(WaitUntil wait, string nam } } - /// Updates the state of a configuration setting snapshot to archive. - /// The name of the configuration setting snapshot to delete. + /// Updates the state of a configuration snapshot to archive. + /// The name of the configuration snapshot to delete. /// The cancellation token to use. - public virtual async Task> ArchiveSnapshotAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> ArchiveSnapshotAsync(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); @@ -889,12 +889,12 @@ public virtual async Task> ArchiveSnapsh SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Archived + Status = ConfigurationSnapshotStatus.Archived }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); Response response = await UpdateSnapshotStatusAsync(name, content, new MatchConditions(), context).ConfigureAwait(false); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -904,10 +904,10 @@ public virtual async Task> ArchiveSnapsh } } - /// Updates the state of a configuration setting snapshot to archive. - /// The name of the configuration setting snapshot to delete. + /// Updates the state of a configuration snapshot to archive. + /// The name of the configuration snapshot to delete. /// The cancellation token to use. - public virtual Response ArchiveSnapshot(string name, CancellationToken cancellationToken = default) + public virtual Response ArchiveSnapshot(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); @@ -919,12 +919,12 @@ public virtual Response ArchiveSnapshot(string na SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Archived + Status = ConfigurationSnapshotStatus.Archived }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); Response response = UpdateSnapshotStatus(name, content, new MatchConditions(), context); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -934,14 +934,14 @@ public virtual Response ArchiveSnapshot(string na } } - /// Updates the state of a configuration setting snapshot to archive. - /// The snapshot object of the configuration setting snapshot to archive. + /// Updates the state of a configuration snapshot to archive. + /// The snapshot object of the configuration snapshot to archive. /// If set to true and the configuration settings snapshot exists in the configuration store, update the snapshot - /// status if the passed-in has the same status as the one in the configuration store. The status + /// status if the passed-in has the same status as the one in the configuration store. The status /// is the same if their ETag fields match. If the two snapshots have a different status, this method will throw an exception to indicate /// that the snapshot in the configuration store was modified since it was last obtained by the client. /// The cancellation token to use. - public virtual async Task> ArchiveSnapshotAsync(ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) + public virtual async Task> ArchiveSnapshotAsync(ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) { Argument.AssertNotNull(snapshot, nameof(snapshot)); @@ -953,7 +953,7 @@ public virtual async Task> ArchiveSnapsh SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Archived + Status = ConfigurationSnapshotStatus.Archived }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); @@ -962,7 +962,7 @@ public virtual async Task> ArchiveSnapsh MatchConditions requestOptions = onlyIfUnchanged ? new MatchConditions { IfMatch = snapshot.ETag } : default; Response response = await UpdateSnapshotStatusAsync(snapshot.Name, content, requestOptions, context).ConfigureAwait(false); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -972,14 +972,14 @@ public virtual async Task> ArchiveSnapsh } } - /// Updates the state of a configuration setting snapshot to archive. - /// The snapshot object of the configuration setting snapshot to archive. + /// Updates the state of a configuration snapshot to archive. + /// The snapshot object of the configuration snapshot to archive. /// If set to true and the configuration settings snapshot exists in the configuration store, update the snapshot - /// status if the passed-in has the same status as the one in the configuration store. The status + /// status if the passed-in has the same status as the one in the configuration store. The status /// is the same if their ETag fields match. If the two snapshots have a different status, this method will throw an exception to indicate /// that the snapshot in the configuration store was modified since it was last obtained by the client. /// The cancellation token to use. - public virtual Response ArchiveSnapshot(ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) + public virtual Response ArchiveSnapshot(ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) { Argument.AssertNotNull(snapshot, nameof(snapshot)); @@ -991,14 +991,14 @@ public virtual Response ArchiveSnapshot(Configura SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Archived + Status = ConfigurationSnapshotStatus.Archived }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); MatchConditions requestOptions = onlyIfUnchanged ? new MatchConditions { IfMatch = snapshot.ETag } : default; Response response = UpdateSnapshotStatus(snapshot.Name, content, requestOptions, context); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -1008,10 +1008,10 @@ public virtual Response ArchiveSnapshot(Configura } } - /// Updates the state of a configuration setting snapshot to ready. - /// The name of the configuration setting snapshot to recover. + /// Updates the state of a configuration snapshot to ready. + /// The name of the configuration snapshot to recover. /// The cancellation token to use. - public virtual async Task> RecoverSnapshotAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> RecoverSnapshotAsync(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); @@ -1023,12 +1023,12 @@ public virtual async Task> RecoverSnapsh SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Ready + Status = ConfigurationSnapshotStatus.Ready }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); Response response = await UpdateSnapshotStatusAsync(name, content, new MatchConditions(), context).ConfigureAwait(false); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -1038,10 +1038,10 @@ public virtual async Task> RecoverSnapsh } } - /// Updates the state of a configuration setting snapshot to ready. - /// The name of the configuration setting snapshot to recover. + /// Updates the state of a configuration snapshot to ready. + /// The name of the configuration snapshot to recover. /// The cancellation token to use. - public virtual Response RecoverSnapshot(string name, CancellationToken cancellationToken = default) + public virtual Response RecoverSnapshot(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); @@ -1053,12 +1053,12 @@ public virtual Response RecoverSnapshot(string na SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Ready + Status = ConfigurationSnapshotStatus.Ready }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); Response response = UpdateSnapshotStatus(name, content, new MatchConditions(), context); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -1068,14 +1068,14 @@ public virtual Response RecoverSnapshot(string na } } - /// Updates the state of a configuration setting snapshot to ready. - /// The name of the configuration setting snapshot to recover. - /// If set to true and the configuration settings snapshot exists in the configuration store, update the snapshot - /// status if the passed-in has the same status as the one in the configuration store. The status + /// Updates the state of a configuration snapshot to ready. + /// The name of the configuration snapshot to recover. + /// If set to true and the configuration snapshot exists in the configuration store, update the snapshot + /// status if the passed-in has the same status as the one in the configuration store. The status /// is the same if their ETag fields match. If the two snapshots have a different status, this method will throw an exception to indicate /// that the snapshot in the configuration store was modified since it was last obtained by the client. /// The cancellation token to use. - public virtual async Task> RecoverSnapshotAsync(ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) + public virtual async Task> RecoverSnapshotAsync(ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) { Argument.AssertNotNull(snapshot, nameof(snapshot)); @@ -1087,14 +1087,14 @@ public virtual async Task> RecoverSnapsh SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Ready + Status = ConfigurationSnapshotStatus.Ready }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); MatchConditions requestOptions = onlyIfUnchanged ? new MatchConditions { IfMatch = snapshot.ETag } : default; Response response = await UpdateSnapshotStatusAsync(snapshot.Name, content, requestOptions, context).ConfigureAwait(false); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -1104,14 +1104,14 @@ public virtual async Task> RecoverSnapsh } } - /// Updates the state of a configuration setting snapshot to ready. - /// The name of the configuration setting snapshot to recover. - /// If set to true and the configuration settings snapshot exists in the configuration store, update the snapshot - /// status if the passed-in has the same status as the one in the configuration store. The status + /// Updates the state of a configuration snapshot to ready. + /// The name of the configuration snapshot to recover. + /// If set to true and the configuration snapshot exists in the configuration store, update the snapshot + /// status if the passed-in has the same status as the one in the configuration store. The status /// is the same if their ETag fields match. If the two snapshots have a different status, this method will throw an exception to indicate /// that the snapshot in the configuration store was modified since it was last obtained by the client. /// The cancellation token to use. - public virtual Response RecoverSnapshot(ConfigurationSettingsSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) + public virtual Response RecoverSnapshot(ConfigurationSnapshot snapshot, bool onlyIfUnchanged = false, CancellationToken cancellationToken = default) { Argument.AssertNotNull(snapshot, nameof(snapshot)); @@ -1123,14 +1123,14 @@ public virtual Response RecoverSnapshot(Configura SnapshotUpdateParameters snapshotUpdateParameters = new() { - Status = SnapshotStatus.Ready + Status = ConfigurationSnapshotStatus.Ready }; using RequestContent content = SnapshotUpdateParameters.ToRequestContent(snapshotUpdateParameters); MatchConditions requestOptions = onlyIfUnchanged ? new MatchConditions { IfMatch = snapshot.ETag } : default; Response response = UpdateSnapshotStatus(snapshot.Name, content, requestOptions, context); - ConfigurationSettingsSnapshot value = ConfigurationSettingsSnapshot.FromResponse(response); + ConfigurationSnapshot value = ConfigurationSnapshot.FromResponse(response); return Response.FromValue(value, response); } catch (Exception e) @@ -1140,70 +1140,62 @@ public virtual Response RecoverSnapshot(Configura } } - /// Gets a list of configuration setting snapshots. - /// A filter for the name of the returned snapshots. - /// Used to select what fields are present in the returned resource(s). - /// Used to filter returned snapshots by their status property. + /// Gets a list of configuration snapshots. + /// Set of options for selecting . /// The cancellation token to use. - public virtual AsyncPageable GetSnapshotsAsync(string name = null, IEnumerable fields = null, IEnumerable status = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetSnapshotsAsync(SnapshotSelector selector, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(selector, nameof(selector)); + var name = selector.Name; + var fields = selector.Fields; + var status = selector.Status; + RequestContext context = CreateRequestContext(ErrorOptions.Default, cancellationToken); - List snapshotFields = null; - if (fields != null) + + var snapshotFields = new ChangeTrackingList(); + foreach (SnapshotFields field in fields) { - snapshotFields = new(); - foreach (SnapshotFields field in fields) - { - snapshotFields.Add(field.ToString()); - } + snapshotFields.Add(field.ToString()); } - List snapshotStatus = null; - if (status != null) + var snapshotStatus = new ChangeTrackingList(); + foreach (ConfigurationSnapshotStatus st in status) { - snapshotStatus = new(); - foreach (SnapshotStatus st in status) - { - snapshotStatus.Add(st.ToString()); - } + snapshotStatus.Add(st.ToString()); } HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSnapshotsRequest(name, null, snapshotFields, snapshotStatus, context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSnapshotsNextPageRequest(nextLink, name, null, snapshotFields, snapshotStatus, context); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConfigurationSettingsSnapshot.DeserializeSnapshot, ClientDiagnostics, _pipeline, "ConfigurationClient.GetSnapshots", "items", "@nextLink", cancellationToken); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConfigurationSnapshot.DeserializeSnapshot, ClientDiagnostics, _pipeline, "ConfigurationClient.GetSnapshots", "items", "@nextLink", cancellationToken); } - /// Gets a list of configuration setting snapshots. - /// A filter for the name of the returned snapshots. - /// Used to select what fields are present in the returned resource(s). - /// Used to filter returned snapshots by their status property. + /// Gets a list of configuration snapshots. + /// Set of options for selecting . /// The cancellation token to use. - public virtual Pageable GetSnapshots(string name = null, IEnumerable fields = null, IEnumerable status = null, CancellationToken cancellationToken = default) + public virtual Pageable GetSnapshots(SnapshotSelector selector, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(selector, nameof(selector)); + var name = selector.Name; + var fields = selector.Fields; + var status = selector.Status; + RequestContext context = CreateRequestContext(ErrorOptions.Default, cancellationToken); - List snapshotFields = null; - if (fields != null) + + var snapshotFields = new ChangeTrackingList(); + foreach (SnapshotFields field in fields) { - snapshotFields = new(); - foreach (SnapshotFields field in fields) - { - snapshotFields.Add(field.ToString()); - } + snapshotFields.Add(field.ToString()); } - List snapshotStatus = null; - if (status != null) + var snapshotStatus = new ChangeTrackingList(); + foreach (ConfigurationSnapshotStatus st in status) { - snapshotStatus = new(); - foreach (SnapshotStatus st in status) - { - snapshotStatus.Add(st.ToString()); - } + snapshotStatus.Add(st.ToString()); } HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSnapshotsRequest(name, null, snapshotFields, snapshotStatus, context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSnapshotsNextPageRequest(nextLink, name, null, snapshotFields, snapshotStatus, context); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConfigurationSettingsSnapshot.DeserializeSnapshot, ClientDiagnostics, _pipeline, "ConfigurationClient.GetSnapshots", "items", "@nextLink", cancellationToken); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConfigurationSnapshot.DeserializeSnapshot, ClientDiagnostics, _pipeline, "ConfigurationClient.GetSnapshots", "items", "@nextLink", cancellationToken); } /// diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/CreateSnapshotOperation.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/CreateSnapshotOperation.cs index 35c4da22ebd4..4d80a65ac5c8 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/CreateSnapshotOperation.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/CreateSnapshotOperation.cs @@ -14,10 +14,10 @@ namespace Azure.Data.AppConfiguration { /// - /// A long-running operation for - /// or . + /// A long-running operation for + /// or . /// - public class CreateSnapshotOperation : Operation + public class CreateSnapshotOperation : Operation { private readonly ClientDiagnostics _diagnostics; private Operation _operation; @@ -25,10 +25,10 @@ public class CreateSnapshotOperation : Operation private static readonly TimeSpan s_defaultPollingInterval = TimeSpan.FromSeconds(5); /// - /// Gets the . This snapshot will have a status of - /// until the operation has completed. + /// Gets the . This snapshot will have a status of + /// until the operation has completed. /// - public override ConfigurationSettingsSnapshot Value => ConfigurationSettingsSnapshot.FromResponse(_operation.GetRawResponse()); + public override ConfigurationSnapshot Value => ConfigurationSnapshot.FromResponse(_operation.GetRawResponse()); /// public override bool HasValue => _operation.HasValue; @@ -69,11 +69,11 @@ public override Response GetRawResponse() public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(s_defaultPollingInterval, cancellationToken); /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) => + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken) diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSettingsSnapshot.Serialization.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshot.Serialization.cs similarity index 87% rename from sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSettingsSnapshot.Serialization.cs rename to sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshot.Serialization.cs index bc5c350465de..cb34821c992c 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSettingsSnapshot.Serialization.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshot.Serialization.cs @@ -8,7 +8,7 @@ namespace Azure.Data.AppConfiguration { - public partial class ConfigurationSettingsSnapshot : IUtf8JsonSerializable + public partial class ConfigurationSnapshot : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -44,12 +44,12 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteEndObject(); } - internal static ConfigurationSettingsSnapshot DeserializeSnapshot(JsonElement element) + internal static ConfigurationSnapshot DeserializeSnapshot(JsonElement element) { Optional name = default; - Optional status = default; + Optional status = default; IList filters = default; - Optional compositionType = default; + Optional compositionType = default; Optional created = default; Optional expires = default; Optional retentionPeriod = default; @@ -71,7 +71,7 @@ internal static ConfigurationSettingsSnapshot DeserializeSnapshot(JsonElement el property.ThrowNonNullablePropertyIsNull(); continue; } - status = new SnapshotStatus(property.Value.GetString()); + status = new ConfigurationSnapshotStatus(property.Value.GetString()); continue; } if (property.NameEquals("filters")) @@ -91,7 +91,7 @@ internal static ConfigurationSettingsSnapshot DeserializeSnapshot(JsonElement el property.ThrowNonNullablePropertyIsNull(); continue; } - compositionType = new CompositionType(property.Value.GetString()); + compositionType = new SnapshotComposition(property.Value.GetString()); continue; } if (property.NameEquals("created")) @@ -165,18 +165,18 @@ internal static ConfigurationSettingsSnapshot DeserializeSnapshot(JsonElement el continue; } } - return new ConfigurationSettingsSnapshot(name.Value, Optional.ToNullable(status), filters, Optional.ToNullable(compositionType), Optional.ToNullable(created), Optional.ToNullable(expires), Optional.ToNullable(retentionPeriod), Optional.ToNullable(size), Optional.ToNullable(itemsCount), Optional.ToDictionary(tags), new ETag(etag.Value)); + return new ConfigurationSnapshot(name.Value, Optional.ToNullable(status), filters, Optional.ToNullable(compositionType), Optional.ToNullable(created), Optional.ToNullable(expires), Optional.ToNullable(retentionPeriod), Optional.ToNullable(size), Optional.ToNullable(itemsCount), Optional.ToDictionary(tags), new ETag(etag.Value)); } // Mapping raw response to model - internal static ConfigurationSettingsSnapshot FromResponse(Response response) + internal static ConfigurationSnapshot FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); return DeserializeSnapshot(document.RootElement); } // Mapping model to raw request - internal static RequestContent ToRequestContent(ConfigurationSettingsSnapshot snapshot) + internal static RequestContent ToRequestContent(ConfigurationSnapshot snapshot) { var content = new Utf8JsonRequestContent(); content.JsonWriter.WriteObjectValue(snapshot); diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSettingsSnapshot.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshot.cs similarity index 86% rename from sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSettingsSnapshot.cs rename to sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshot.cs index ec5f9efba024..544e3088abb8 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSettingsSnapshot.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshot.cs @@ -9,12 +9,12 @@ namespace Azure.Data.AppConfiguration { /// The Snapshot. - public partial class ConfigurationSettingsSnapshot + public partial class ConfigurationSnapshot { /// Initializes a new instance of Snapshot. /// A list of filters used to filter the key-values included in the snapshot. /// is null. - public ConfigurationSettingsSnapshot(IEnumerable filters) + public ConfigurationSnapshot(IEnumerable filters) { Argument.AssertNotNull(filters, nameof(filters)); @@ -30,11 +30,11 @@ public ConfigurationSettingsSnapshot(IEnumerable filters) /// The time that the snapshot was created. /// The time that the snapshot will expire. /// The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions will be used. - /// The size in bytes of the snapshot. + /// The size in bytes of the snapshot. /// The amount of key-values in the snapshot. /// The tags of the snapshot. /// A value representing the current state of the snapshot. - internal ConfigurationSettingsSnapshot(string name, SnapshotStatus? status, IList filters, CompositionType? compositionType, DateTimeOffset? createdOn, DateTimeOffset? expiresOn, long? retentionPeriod, long? size, long? itemCount, IDictionary tags, ETag eTag) + internal ConfigurationSnapshot(string name, ConfigurationSnapshotStatus? status, IList filters, SnapshotComposition? compositionType, DateTimeOffset? createdOn, DateTimeOffset? expiresOn, long? retentionPeriod, long? sizeInBytes, long? itemCount, IDictionary tags, ETag eTag) { Name = name; Status = status; @@ -43,7 +43,7 @@ internal ConfigurationSettingsSnapshot(string name, SnapshotStatus? status, ILis CreatedOn = createdOn; ExpiresOn = expiresOn; _retentionPeriod = retentionPeriod; - Size = size; + SizeInBytes = sizeInBytes; ItemCount = itemCount; Tags = tags; ETag = eTag; @@ -52,11 +52,11 @@ internal ConfigurationSettingsSnapshot(string name, SnapshotStatus? status, ILis /// The name of the snapshot. public string Name { get; } /// The current status of the snapshot. - public SnapshotStatus? Status { get; } + public ConfigurationSnapshotStatus? Status { get; } /// A list of filters used to filter the key-values included in the snapshot. public IList Filters { get; } /// The composition type describes how the key-values within the snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no two key-values containing the same key and label. - public CompositionType? CompositionType { get; set; } + public SnapshotComposition? CompositionType { get; set; } /// The time that the snapshot was created. public DateTimeOffset? CreatedOn { get; } /// The time that the snapshot will expire. @@ -85,7 +85,7 @@ public TimeSpan? RetentionPeriod { } } /// The size in bytes of the snapshot. - public long? Size { get; } + public long? SizeInBytes { get; } /// The amount of key-values in the snapshot. public long? ItemCount { get; } /// The tags of the snapshot. diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshotStatus.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshotStatus.cs new file mode 100644 index 000000000000..2f1e9d8d73f0 --- /dev/null +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/ConfigurationSnapshotStatus.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ComponentModel; + +namespace Azure.Data.AppConfiguration +{ + /// The current status of the snapshot. + public readonly partial struct ConfigurationSnapshotStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConfigurationSnapshotStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "provisioning"; + private const string ReadyValue = "ready"; + private const string ArchivedValue = "archived"; + private const string FailedValue = "failed"; + + /// provisioning. + public static ConfigurationSnapshotStatus Provisioning { get; } = new ConfigurationSnapshotStatus(ProvisioningValue); + /// ready. + public static ConfigurationSnapshotStatus Ready { get; } = new ConfigurationSnapshotStatus(ReadyValue); + /// archived. + public static ConfigurationSnapshotStatus Archived { get; } = new ConfigurationSnapshotStatus(ArchivedValue); + /// failed. + public static ConfigurationSnapshotStatus Failed { get; } = new ConfigurationSnapshotStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ConfigurationSnapshotStatus left, ConfigurationSnapshotStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConfigurationSnapshotStatus left, ConfigurationSnapshotStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ConfigurationSnapshotStatus(string value) => new ConfigurationSnapshotStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConfigurationSnapshotStatus other && Equals(other); + /// + public bool Equals(ConfigurationSnapshotStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/CompositionType.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotComposition.cs similarity index 52% rename from sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/CompositionType.cs rename to sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotComposition.cs index c686ddc47565..9997717ba729 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/CompositionType.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotComposition.cs @@ -7,13 +7,13 @@ namespace Azure.Data.AppConfiguration { /// The composition type describes how the key-values within the snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no two key-values containing the same key and label. - public readonly partial struct CompositionType : IEquatable + public readonly partial struct SnapshotComposition : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public CompositionType(string value) + public SnapshotComposition(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -22,21 +22,21 @@ public CompositionType(string value) private const string KeyLabelValue = "key_label"; /// The 'key' composition type ensures there are no two key-values containing the same key. - public static CompositionType Key { get; } = new CompositionType(KeyValue); + public static SnapshotComposition Key { get; } = new SnapshotComposition(KeyValue); /// The 'key_label' composition type ensures there are no two key-values containing the same key and label. - public static CompositionType KeyLabel { get; } = new CompositionType(KeyLabelValue); - /// Determines if two values are the same. - public static bool operator ==(CompositionType left, CompositionType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CompositionType left, CompositionType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CompositionType(string value) => new CompositionType(value); + public static SnapshotComposition KeyLabel { get; } = new SnapshotComposition(KeyLabelValue); + /// Determines if two values are the same. + public static bool operator ==(SnapshotComposition left, SnapshotComposition right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SnapshotComposition left, SnapshotComposition right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SnapshotComposition(string value) => new SnapshotComposition(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CompositionType other && Equals(other); + public override bool Equals(object obj) => obj is SnapshotComposition other && Equals(other); /// - public bool Equals(CompositionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(SnapshotComposition other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotFields.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotFields.cs index c0b21e8607cd..8f1f7a14e0c9 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotFields.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotFields.cs @@ -27,7 +27,7 @@ public SnapshotFields(string value) private const string CreatedOnValue = "created"; private const string ExpiresOnValue = "expires"; private const string RetentionPeriodValue = "retention_period"; - private const string SizeValue = "size"; + private const string SizeInBytesValue = "size"; private const string ItemCountValue = "items_count"; private const string TagsValue = "tags"; private const string ETagValue = "etag"; @@ -47,7 +47,7 @@ public SnapshotFields(string value) /// retention_period. public static SnapshotFields RetentionPeriod { get; } = new SnapshotFields(RetentionPeriodValue); /// size. - public static SnapshotFields Size { get; } = new SnapshotFields(SizeValue); + public static SnapshotFields SizeInBytes { get; } = new SnapshotFields(SizeInBytesValue); /// items_count. public static SnapshotFields ItemCount { get; } = new SnapshotFields(ItemCountValue); /// tags. diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotSelector.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotSelector.cs new file mode 100644 index 000000000000..b74a125c6739 --- /dev/null +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotSelector.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Data.AppConfiguration +{ + /// + /// is a set of options that allows selecting a filtered set of entities. + /// + public class SnapshotSelector + { + /// + /// Initializes a new instance of . + /// + public SnapshotSelector() + { + Fields = new ChangeTrackingList(); + Status = new ChangeTrackingList(); + } + + /// + /// A filter for the name of the returned snapshots. + /// + public string Name { get; set; } + + /// + /// A list of fields used to specify which fields are included in the returned resource(s). + /// + public IList Fields { get; } + + /// + /// A list of snapshot status used to filter the returned snapshots based on their status property. + /// + public IList Status { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotStatus.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotStatus.cs deleted file mode 100644 index fc914a33fd52..000000000000 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotStatus.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.ComponentModel; - -namespace Azure.Data.AppConfiguration -{ - /// The current status of the snapshot. - public readonly partial struct SnapshotStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SnapshotStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ProvisioningValue = "provisioning"; - private const string ReadyValue = "ready"; - private const string ArchivedValue = "archived"; - private const string FailedValue = "failed"; - - /// provisioning. - public static SnapshotStatus Provisioning { get; } = new SnapshotStatus(ProvisioningValue); - /// ready. - public static SnapshotStatus Ready { get; } = new SnapshotStatus(ReadyValue); - /// archived. - public static SnapshotStatus Archived { get; } = new SnapshotStatus(ArchivedValue); - /// failed. - public static SnapshotStatus Failed { get; } = new SnapshotStatus(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(SnapshotStatus left, SnapshotStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SnapshotStatus left, SnapshotStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SnapshotStatus(string value) => new SnapshotStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SnapshotStatus other && Equals(other); - /// - public bool Equals(SnapshotStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotUpdateParameters.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotUpdateParameters.cs index 7d9b97329e2b..f95673698aaf 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotUpdateParameters.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Models/SnapshotUpdateParameters.cs @@ -12,6 +12,6 @@ public SnapshotUpdateParameters() } /// The desired status of the snapshot. - public SnapshotStatus? Status { get; set; } + public ConfigurationSnapshotStatus? Status { get; set; } } } diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationLiveTests.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationLiveTests.cs index f50b656e30fe..b6f6d9fa1982 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationLiveTests.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationLiveTests.cs @@ -1662,7 +1662,7 @@ public async Task CreateSnapshotUsingAutomaticPolling() await service.AddConfigurationSettingAsync(testSetting); var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(testSetting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = GenerateSnapshotName(); var operation = await service.CreateSnapshotAsync(WaitUntil.Completed, snapshotName, settingsSnapshot); @@ -1689,7 +1689,7 @@ public async Task CreateSnapshotUsingWaitForCompletion() await service.AddConfigurationSettingAsync(testSetting); var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(testSetting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = GenerateSnapshotName(); var operation = await service.CreateSnapshotAsync(WaitUntil.Started, snapshotName, settingsSnapshot); @@ -1717,7 +1717,7 @@ public async Task CreateSnapshotUsingManualPolling() await service.AddConfigurationSettingAsync(testSetting); var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(testSetting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = GenerateSnapshotName(); var operation = await service.CreateSnapshotAsync(WaitUntil.Started, snapshotName, settingsSnapshot); @@ -1753,7 +1753,7 @@ public async Task ArchiveSnapshotStatus() await service.AddConfigurationSettingAsync(testSetting); var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(testSetting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = GenerateSnapshotName(); var operation = await service.CreateSnapshotAsync(WaitUntil.Completed, snapshotName, settingsSnapshot); @@ -1763,9 +1763,9 @@ public async Task ArchiveSnapshotStatus() var retrievedSnapshot = await service.GetSnapshotAsync(snapshotName); ValidateCreatedSnapshot(createdSnapshot, retrievedSnapshot, snapshotName); - ConfigurationSettingsSnapshot archivedSnapshot = await service.ArchiveSnapshotAsync(snapshotName); + ConfigurationSnapshot archivedSnapshot = await service.ArchiveSnapshotAsync(snapshotName); Assert.NotNull(archivedSnapshot); - Assert.AreEqual(SnapshotStatus.Archived, archivedSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Archived, archivedSnapshot.Status); } finally { @@ -1784,7 +1784,7 @@ public async Task RecoverSnapshotStatus() await service.AddConfigurationSettingAsync(testSetting); var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(testSetting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = GenerateSnapshotName(); var operation = await service.CreateSnapshotAsync(WaitUntil.Completed, snapshotName, settingsSnapshot); @@ -1794,13 +1794,13 @@ public async Task RecoverSnapshotStatus() var retrievedSnapshot = await service.GetSnapshotAsync(snapshotName); ValidateCreatedSnapshot(createdSnapshot, retrievedSnapshot, snapshotName); - ConfigurationSettingsSnapshot archivedSnapshot = await service.ArchiveSnapshotAsync(snapshotName); + ConfigurationSnapshot archivedSnapshot = await service.ArchiveSnapshotAsync(snapshotName); Assert.NotNull(archivedSnapshot); - Assert.AreEqual(SnapshotStatus.Archived, archivedSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Archived, archivedSnapshot.Status); - ConfigurationSettingsSnapshot recoveredSnapshot = await service.RecoverSnapshotAsync(snapshotName); + ConfigurationSnapshot recoveredSnapshot = await service.RecoverSnapshotAsync(snapshotName); Assert.NotNull(recoveredSnapshot); - Assert.AreEqual(SnapshotStatus.Ready, recoveredSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Ready, recoveredSnapshot.Status); } finally { @@ -1822,15 +1822,16 @@ public async Task GetSnapshots() var firstSnapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(firstSetting.Key) }); var firstSnapshotName = GenerateSnapshotName("first_snapshot"); - var firstOperation = await service.CreateSnapshotAsync(WaitUntil.Completed, firstSnapshotName, new ConfigurationSettingsSnapshot(firstSnapshotFilter)); + var firstOperation = await service.CreateSnapshotAsync(WaitUntil.Completed, firstSnapshotName, new ConfigurationSnapshot(firstSnapshotFilter)); ValidateCompletedOperation(firstOperation); var secondSnapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(secondSetting.Key) }); var secondSnapshotName = GenerateSnapshotName("second_snapshot"); - var secondOperation = await service.CreateSnapshotAsync(WaitUntil.Completed, secondSnapshotName, new ConfigurationSettingsSnapshot(secondSnapshotFilter)); + var secondOperation = await service.CreateSnapshotAsync(WaitUntil.Completed, secondSnapshotName, new ConfigurationSnapshot(secondSnapshotFilter)); ValidateCompletedOperation(secondOperation); - var snapshots = service.GetSnapshotsAsync(cancellationToken: CancellationToken.None); + var selector = new SnapshotSelector(); + var snapshots = service.GetSnapshotsAsync(selector); var resultsReturned = (await snapshots.ToEnumerableAsync()).Count; Assert.GreaterOrEqual(resultsReturned, 2); } @@ -1841,6 +1842,45 @@ public async Task GetSnapshots() } } + [RecordedTest] + public async Task GetSnapshotsUsingNameFilter() + { + var service = GetClient(); + var firstSetting = new ConfigurationSetting("first_key", "first_value"); + var secondSetting = new ConfigurationSetting("second_key", "second_value"); + + try + { + await service.AddConfigurationSettingAsync(firstSetting); + await service.AddConfigurationSettingAsync(secondSetting); + + var firstSnapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(firstSetting.Key) }); + var firstSnapshotName = GenerateSnapshotName("first_snapshot"); + var firstOperation = await service.CreateSnapshotAsync(WaitUntil.Completed, firstSnapshotName, new ConfigurationSnapshot(firstSnapshotFilter)); + ValidateCompletedOperation(firstOperation); + + var secondSnapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(secondSetting.Key) }); + var secondSnapshotName = GenerateSnapshotName("second_snapshot"); + var secondOperation = await service.CreateSnapshotAsync(WaitUntil.Completed, secondSnapshotName, new ConfigurationSnapshot(secondSnapshotFilter)); + ValidateCompletedOperation(secondOperation); + + var selector = new SnapshotSelector() + { + Name = firstSnapshotName + }; + + ConfigurationSnapshot[] batch = (await service.GetSnapshotsAsync(selector).ToEnumerableAsync()).ToArray(); + + Assert.AreEqual(1, batch.Length); + Assert.AreEqual(firstSnapshotName, batch[0].Name); + } + finally + { + AssertStatus200(await service.DeleteConfigurationSettingAsync(firstSetting.Key, firstSetting.Label)); + AssertStatus200(await service.DeleteConfigurationSettingAsync(secondSetting.Key, secondSetting.Label)); + } + } + [RecordedTest] public async Task GetConfigurationSettingsForSnapshot() { @@ -1853,7 +1893,7 @@ public async Task GetConfigurationSettingsForSnapshot() var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(setting.Key) }); var snapshotName = GenerateSnapshotName(); - var operation = await service.CreateSnapshotAsync(WaitUntil.Completed, snapshotName, new ConfigurationSettingsSnapshot(snapshotFilter)); + var operation = await service.CreateSnapshotAsync(WaitUntil.Completed, snapshotName, new ConfigurationSnapshot(snapshotFilter)); ValidateCompletedOperation(operation); var settingsForSnapshot = service.GetConfigurationSettingsForSnapshotAsync(snapshotName); @@ -1878,7 +1918,7 @@ public async Task UnchangedSnapshotAfterSettingsUpdate() var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(createdSetting.Key) }); var snapshotName = GenerateSnapshotName(); - var operation = await service.CreateSnapshotAsync(WaitUntil.Completed, snapshotName, new ConfigurationSettingsSnapshot(snapshotFilter)); + var operation = await service.CreateSnapshotAsync(WaitUntil.Completed, snapshotName, new ConfigurationSnapshot(snapshotFilter)); ValidateCompletedOperation(operation); setting.Value = "Updated_Value"; @@ -1897,7 +1937,7 @@ public async Task UnchangedSnapshotAfterSettingsUpdate() } } - private void ValidateCreatedSnapshot(ConfigurationSettingsSnapshot createdSnapshot, ConfigurationSettingsSnapshot retrievedSnapshot, string expectedName) + private void ValidateCreatedSnapshot(ConfigurationSnapshot createdSnapshot, ConfigurationSnapshot retrievedSnapshot, string expectedName) { Assert.NotNull(createdSnapshot); Assert.AreEqual(expectedName, createdSnapshot.Name); diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationSettingsSnapshotTest.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationSettingsSnapshotTest.cs index 44a0d111f13f..8cea67110c07 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationSettingsSnapshotTest.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationSettingsSnapshotTest.cs @@ -12,11 +12,11 @@ public class ConfigurationSettingsSnapshotTest [Test] public void SetRetentionPeriodUsingConstructor() { - var settingSnapshot = new ConfigurationSettingsSnapshot( + var settingSnapshot = new ConfigurationSnapshot( "name", - SnapshotStatus.Ready, + ConfigurationSnapshotStatus.Ready, new List(), - new CompositionType(), + new SnapshotComposition(), DateTime.UtcNow, DateTime.UtcNow, 10675199, // retention period @@ -34,7 +34,7 @@ public void SetRetentionPeriodUsingSetter() { List filters = new() { new SnapshotSettingFilter("key", "val") }; - var settingSnapshot = new ConfigurationSettingsSnapshot(filters); + var settingSnapshot = new ConfigurationSnapshot(filters); settingSnapshot.RetentionPeriod = TimeSpan.FromSeconds(10675199); Assert.AreEqual(settingSnapshot.RetentionPeriod, TimeSpan.FromSeconds(10675199)); diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/samples/Sample11_SettingsSnapshot.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/samples/Sample11_SettingsSnapshot.cs index d71cb3d57c86..5c901208294f 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/samples/Sample11_SettingsSnapshot.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/samples/Sample11_SettingsSnapshot.cs @@ -23,8 +23,8 @@ public void CreateSnapshotAutomaticPolling() client.AddConfigurationSetting(setting); #region Snippet:AzConfigSample11_CreateSnapshot_AutomaticPolling - var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter("some_key") }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var snapshotFilter = new List { new SnapshotSettingFilter("some_key") }; + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; #if !SNIPPET @@ -32,11 +32,11 @@ public void CreateSnapshotAutomaticPolling() #endif var operation = client.CreateSnapshot(WaitUntil.Completed, snapshotName, settingsSnapshot); var createdSnapshot = operation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); #endregion - ConfigurationSettingsSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); - Console.WriteLine($"Retrieved configuration setting snapshot: {retrievedSnapshot.Name}, status: {createdSnapshot.Status}"); + ConfigurationSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); + Console.WriteLine($"Retrieved configuration snapshot: {retrievedSnapshot.Name}, status: {createdSnapshot.Status}"); Assert.NotNull(retrievedSnapshot); Assert.AreEqual(createdSnapshot.Name, retrievedSnapshot.Name); @@ -59,8 +59,8 @@ public void CreateSnapshotAutomaticPollingLater() client.AddConfigurationSetting(setting); #region Snippet:AzConfigSample11_CreateSnapshot_AutomaticPollingLater - var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter("some_key") }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var snapshotFilter = new List { new SnapshotSettingFilter("some_key") }; + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; #if !SNIPPET @@ -70,11 +70,11 @@ public void CreateSnapshotAutomaticPollingLater() operation.WaitForCompletion(); var createdSnapshot = operation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); #endregion - ConfigurationSettingsSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); - Console.WriteLine($"Retrieved configuration setting snapshot: {retrievedSnapshot.Name}, status: {createdSnapshot.Status}"); + ConfigurationSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); + Console.WriteLine($"Retrieved configuration snapshot: {retrievedSnapshot.Name}, status: {createdSnapshot.Status}"); Assert.NotNull(retrievedSnapshot); Assert.AreEqual(createdSnapshot.Name, retrievedSnapshot.Name); @@ -97,8 +97,8 @@ public async Task CreateSnapshotManualPolling() client.AddConfigurationSetting(setting); #region Snippet:AzConfigSample11_CreateSnapshot_ManualPolling - var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter("some_key") }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var snapshotFilter = new List { new SnapshotSettingFilter("some_key") }; + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; #if !SNIPPET @@ -114,11 +114,11 @@ public async Task CreateSnapshotManualPolling() } var createdSnapshot = operation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); #endregion - ConfigurationSettingsSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); - Console.WriteLine($"Retrieved configuration setting snapshot: {retrievedSnapshot.Name}, status: {createdSnapshot.Status}"); + ConfigurationSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); + Console.WriteLine($"Retrieved configuration snapshot: {retrievedSnapshot.Name}, status: {createdSnapshot.Status}"); Assert.NotNull(retrievedSnapshot); Assert.AreEqual(createdSnapshot.Name, retrievedSnapshot.Name); @@ -140,21 +140,21 @@ public void GetSnapshot() { client.AddConfigurationSetting(setting); - var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(setting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var snapshotFilter = new List { new SnapshotSettingFilter(setting.Key) }; + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var configSnapshotName = GenerateSnapshotName(); var operation = client.CreateSnapshot(WaitUntil.Completed, configSnapshotName, settingsSnapshot); var createdSnapshot = operation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); #region Snippet:AzConfigSample11_GetSnapshot var snapshotName = "some_snapshot"; #if !SNIPPET snapshotName = configSnapshotName; #endif - ConfigurationSettingsSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); - Console.WriteLine($"Retrieved configuration setting snapshot: {retrievedSnapshot.Name}, status: {retrievedSnapshot.Status}"); + ConfigurationSnapshot retrievedSnapshot = client.GetSnapshot(snapshotName); + Console.WriteLine($"Retrieved configuration snapshot: {retrievedSnapshot.Name}, status: {retrievedSnapshot.Status}"); #endregion Assert.NotNull(retrievedSnapshot); @@ -177,30 +177,30 @@ public void ArchiveSnapshot() { client.AddConfigurationSetting(setting); - var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(setting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var snapshotFilter = new List { new SnapshotSettingFilter(setting.Key) }; + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var configSnapshotName = GenerateSnapshotName(); var operation = client.CreateSnapshot(WaitUntil.Completed, configSnapshotName, settingsSnapshot); var createdSnapshot = operation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); Assert.NotNull(createdSnapshot); Assert.AreEqual(configSnapshotName, createdSnapshot.Name); - Assert.AreEqual(SnapshotStatus.Ready, createdSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Ready, createdSnapshot.Status); #region Snippet:AzConfigSample11_ArchiveSnapshot var snapshotName = "some_snapshot"; #if !SNIPPET snapshotName = configSnapshotName; #endif - ConfigurationSettingsSnapshot archivedSnapshot = client.ArchiveSnapshot(snapshotName); - Console.WriteLine($"Archived configuration setting snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); + ConfigurationSnapshot archivedSnapshot = client.ArchiveSnapshot(snapshotName); + Console.WriteLine($"Archived configuration snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); #endregion Assert.NotNull(archivedSnapshot); - Assert.AreEqual(SnapshotStatus.Archived, archivedSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Archived, archivedSnapshot.Status); } finally { @@ -219,35 +219,35 @@ public void RecoverSnapshot() { client.AddConfigurationSetting(setting); - var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(setting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var snapshotFilter = new List { new SnapshotSettingFilter(setting.Key) }; + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var configSnapshotName = GenerateSnapshotName(); var operation = client.CreateSnapshot(WaitUntil.Completed, configSnapshotName, settingsSnapshot); var createdSnapshot = operation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, status: {createdSnapshot.Status}"); Assert.NotNull(createdSnapshot); Assert.AreEqual(configSnapshotName, createdSnapshot.Name); - Assert.AreEqual(SnapshotStatus.Ready, createdSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Ready, createdSnapshot.Status); - ConfigurationSettingsSnapshot archivedSnapshot = client.ArchiveSnapshot(configSnapshotName); - Console.WriteLine($"Archived configuration setting snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); + ConfigurationSnapshot archivedSnapshot = client.ArchiveSnapshot(configSnapshotName); + Console.WriteLine($"Archived configuration snapshot: {archivedSnapshot.Name}, status: {archivedSnapshot.Status}"); - Assert.AreEqual(SnapshotStatus.Archived, archivedSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Archived, archivedSnapshot.Status); #region Snippet:AzConfigSample11_RecoverSnapshot var snapshotName = "some_snapshot"; #if !SNIPPET snapshotName = configSnapshotName; #endif - ConfigurationSettingsSnapshot recoveredSnapshot = client.RecoverSnapshot(snapshotName); - Console.WriteLine($"Recovered configuration setting snapshot: {recoveredSnapshot.Name}, status: {recoveredSnapshot.Status}"); + ConfigurationSnapshot recoveredSnapshot = client.RecoverSnapshot(snapshotName); + Console.WriteLine($"Recovered configuration snapshot: {recoveredSnapshot.Name}, status: {recoveredSnapshot.Status}"); #endregion Assert.NotNull(recoveredSnapshot); - Assert.AreEqual(SnapshotStatus.Ready, recoveredSnapshot.Status); + Assert.AreEqual(ConfigurationSnapshotStatus.Ready, recoveredSnapshot.Status); } finally { @@ -269,30 +269,30 @@ public void GetSnapshots() client.AddConfigurationSetting(firstSetting); client.AddConfigurationSetting(secondSetting); - var firstSnapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(firstSetting.Key) }); + var firstSnapshotFilter = new List { new SnapshotSettingFilter(firstSetting.Key) }; var firstSnapshotName = GenerateSnapshotName("first_snapshot"); - var firstOperation = client.CreateSnapshot(WaitUntil.Completed, firstSnapshotName, new ConfigurationSettingsSnapshot(firstSnapshotFilter)); + var firstOperation = client.CreateSnapshot(WaitUntil.Completed, firstSnapshotName, new ConfigurationSnapshot(firstSnapshotFilter)); var createdFirstSnapshot = firstOperation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdFirstSnapshot.Name}, status: {createdFirstSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdFirstSnapshot.Name}, status: {createdFirstSnapshot.Status}"); Assert.NotNull(createdFirstSnapshot); Assert.AreEqual(firstSnapshotName, createdFirstSnapshot.Name); - var secondSnapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(secondSetting.Key) }); + var secondSnapshotFilter = new List { new SnapshotSettingFilter(secondSetting.Key) }; var secondSnapshotName = GenerateSnapshotName("second_snapshot"); - var secondOperation = client.CreateSnapshot(WaitUntil.Completed, secondSnapshotName, new ConfigurationSettingsSnapshot(secondSnapshotFilter)); + var secondOperation = client.CreateSnapshot(WaitUntil.Completed, secondSnapshotName, new ConfigurationSnapshot(secondSnapshotFilter)); var createdSecondSnapshot = secondOperation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSecondSnapshot.Name}, status: {createdFirstSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSecondSnapshot.Name}, status: {createdFirstSnapshot.Status}"); Assert.NotNull(createdSecondSnapshot); Assert.AreEqual(secondSnapshotName, createdSecondSnapshot.Name); #region Snippet:AzConfigSample11_GetSnapshots var count = 0; - foreach (var item in client.GetSnapshots()) + foreach (var item in client.GetSnapshots(new SnapshotSelector())) { count++; - Console.WriteLine($"Retrieved configuration setting snapshot: {item.Name}, status {item.Status}"); + Console.WriteLine($"Retrieved configuration snapshot: {item.Name}, status {item.Status}"); } Console.WriteLine($"Total number of snapshots retrieved: {count}"); #endregion @@ -321,8 +321,8 @@ public void GetConfigurationSettingsForSnapshot() var secondSetting = new ConfigurationSetting("second_key", "second_value"); client.AddConfigurationSetting(secondSetting); - var snapshotFilter = new List(new SnapshotSettingFilter[] { new SnapshotSettingFilter(firstSetting.Key), new SnapshotSettingFilter(secondSetting.Key) }); - var settingsSnapshot = new ConfigurationSettingsSnapshot(snapshotFilter); + var snapshotFilter = new List { new SnapshotSettingFilter(firstSetting.Key), new SnapshotSettingFilter(secondSetting.Key) }; + var settingsSnapshot = new ConfigurationSnapshot(snapshotFilter); var snapshotName = "some_snapshot"; #if !SNIPPET @@ -330,7 +330,7 @@ public void GetConfigurationSettingsForSnapshot() #endif var operation = client.CreateSnapshot(WaitUntil.Completed, snapshotName, settingsSnapshot); var createdSnapshot = operation.Value; - Console.WriteLine($"Created configuration setting snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); + Console.WriteLine($"Created configuration snapshot: {createdSnapshot.Name}, Status: {createdSnapshot.Status}"); var count = 0; foreach (var item in client.GetConfigurationSettingsForSnapshot(snapshotName)) From cc54deb83fb10c1cb15e4f7d8a791c50daab62b2 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:33:13 -0700 Subject: [PATCH 29/45] Fix casing on some events (#38674) --- ...zure.Messaging.EventGrid.netstandard2.0.cs | 10 +++--- .../AppConfigurationSnapshotEventData.cs | 15 +++++++++ .../EventGridMqttClientDisconnectionReason.cs | 17 ++++++++++ .../src/Generated/EventGridModelFactory.cs | 18 +++++------ ...ppConfigurationSnapshotCreatedEventData.cs | 4 +-- .../AppConfigurationSnapshotEventData.cs | 8 ++--- ...pConfigurationSnapshotModifiedEventData.cs | 4 +-- .../EventGridMqttClientDisconnectionReason.cs | 4 +-- .../tests/SystemEventTests.cs | 31 +++++++++++++++++++ 9 files changed, 85 insertions(+), 26 deletions(-) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AppConfigurationSnapshotEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridMqttClientDisconnectionReason.cs diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs index e69e10780493..cb342dde6dbf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs @@ -113,9 +113,9 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData ApiManagementUserUpdatedEventData(string resourceUri = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueDeletedEventData(string key = null, string label = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData AppConfigurationKeyValueModifiedEventData(string key = null, string label = null, string etag = null, string syncToken = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string eTag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string eTag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string eTag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind? stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind?), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction?), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null) { throw null; } @@ -1117,7 +1117,7 @@ internal AppConfigurationSnapshotCreatedEventData() { } public partial class AppConfigurationSnapshotEventData { internal AppConfigurationSnapshotEventData() { } - public string Etag { get { throw null; } } + public string ETag { get { throw null; } } public string Name { get { throw null; } } public string SyncToken { get { throw null; } } } @@ -1457,7 +1457,7 @@ internal EventGridMqttClientDeletedEventData() { } public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientError { get { throw null; } } public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ConnectionLost { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason IpForbidden { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason IPForbidden { get { throw null; } } public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason QuotaExceeded { get { throw null; } } public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerError { get { throw null; } } public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AppConfigurationSnapshotEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AppConfigurationSnapshotEventData.cs new file mode 100644 index 000000000000..ae2cb4819227 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AppConfigurationSnapshotEventData.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of snapshot events. + public partial class AppConfigurationSnapshotEventData + { + /// The etag representing the new state of the snapshot. + [CodeGenMember("Etag")] + public string ETag { get; } + } +} \ No newline at end of file diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridMqttClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridMqttClientDisconnectionReason.cs new file mode 100644 index 000000000000..aa921c0dd671 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridMqttClientDisconnectionReason.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Reason for the disconnection of the MQTT client's session. The value could be one of the values in the disconnection reasons table. + public readonly partial struct EventGridMqttClientDisconnectionReason : IEquatable + { + /// The client's IP address is blocked by IP filter or Private links configuration. + [CodeGenMember("IpForbidden")] + public static EventGridMqttClientDisconnectionReason IPForbidden { get; } = + new EventGridMqttClientDisconnectionReason(IPForbiddenValue); + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs index c6d8be9fbfcb..98ce92a4793f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs @@ -1149,32 +1149,32 @@ public static AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueD /// Initializes a new instance of AppConfigurationSnapshotEventData. /// The name of the snapshot. - /// The etag representing the new state of the snapshot. + /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) + public static AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string eTag = null, string syncToken = null) { - return new AppConfigurationSnapshotEventData(name, etag, syncToken); + return new AppConfigurationSnapshotEventData(name, eTag, syncToken); } /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. /// The name of the snapshot. - /// The etag representing the new state of the snapshot. + /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) + public static AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string eTag = null, string syncToken = null) { - return new AppConfigurationSnapshotCreatedEventData(name, etag, syncToken); + return new AppConfigurationSnapshotCreatedEventData(name, eTag, syncToken); } /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. /// The name of the snapshot. - /// The etag representing the new state of the snapshot. + /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) + public static AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string eTag = null, string syncToken = null) { - return new AppConfigurationSnapshotModifiedEventData(name, etag, syncToken); + return new AppConfigurationSnapshotModifiedEventData(name, eTag, syncToken); } /// Initializes a new instance of SignalRServiceClientConnectionConnectedEventData. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs index 3c7cda555e09..4c2ddb52ea6a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs @@ -17,9 +17,9 @@ internal AppConfigurationSnapshotCreatedEventData() /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. /// The name of the snapshot. - /// The etag representing the new state of the snapshot. + /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - internal AppConfigurationSnapshotCreatedEventData(string name, string etag, string syncToken) : base(name, etag, syncToken) + internal AppConfigurationSnapshotCreatedEventData(string name, string eTag, string syncToken) : base(name, eTag, syncToken) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs index 5aaaa39d9d98..00236aa52ff7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs @@ -17,19 +17,17 @@ internal AppConfigurationSnapshotEventData() /// Initializes a new instance of AppConfigurationSnapshotEventData. /// The name of the snapshot. - /// The etag representing the new state of the snapshot. + /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - internal AppConfigurationSnapshotEventData(string name, string etag, string syncToken) + internal AppConfigurationSnapshotEventData(string name, string eTag, string syncToken) { Name = name; - Etag = etag; + ETag = eTag; SyncToken = syncToken; } /// The name of the snapshot. public string Name { get; } - /// The etag representing the new state of the snapshot. - public string Etag { get; } /// The sync token representing the server state after the event. public string SyncToken { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs index 02a7096ba3d2..7187bb306d57 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs @@ -17,9 +17,9 @@ internal AppConfigurationSnapshotModifiedEventData() /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. /// The name of the snapshot. - /// The etag representing the new state of the snapshot. + /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - internal AppConfigurationSnapshotModifiedEventData(string name, string etag, string syncToken) : base(name, etag, syncToken) + internal AppConfigurationSnapshotModifiedEventData(string name, string eTag, string syncToken) : base(name, eTag, syncToken) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs index 81327714b606..b862641c81e7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridMqttClientDisconnectionReason.cs @@ -27,7 +27,7 @@ public EventGridMqttClientDisconnectionReason(string value) private const string ClientErrorValue = "ClientError"; private const string ClientInitiatedDisconnectValue = "ClientInitiatedDisconnect"; private const string ConnectionLostValue = "ConnectionLost"; - private const string IpForbiddenValue = "IpForbidden"; + private const string IPForbiddenValue = "IpForbidden"; private const string QuotaExceededValue = "QuotaExceeded"; private const string ServerErrorValue = "ServerError"; private const string ServerInitiatedDisconnectValue = "ServerInitiatedDisconnect"; @@ -44,8 +44,6 @@ public EventGridMqttClientDisconnectionReason(string value) public static EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ClientInitiatedDisconnectValue); /// The client-server connection is lost. (EXCHANGE ONLINE PROTECTION). public static EventGridMqttClientDisconnectionReason ConnectionLost { get; } = new EventGridMqttClientDisconnectionReason(ConnectionLostValue); - /// The client's IP address is blocked by IP filter or Private links configuration. - public static EventGridMqttClientDisconnectionReason IpForbidden { get; } = new EventGridMqttClientDisconnectionReason(IpForbiddenValue); /// The client exceeded one or more of the throttling limits that resulted in a connection termination by the service. public static EventGridMqttClientDisconnectionReason QuotaExceeded { get; } = new EventGridMqttClientDisconnectionReason(QuotaExceededValue); /// The connection got terminated due to an unexpected server error. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs index 317eeb3c768c..81a3fb9841b1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -19,6 +20,12 @@ public class SystemEventTests "SignalRServiceClientConnectionDisconnected", }; + private static readonly HashSet s_etagCasingExlusions = new() + { + "AppConfigurationKeyValueDeletedEventData", + "AppConfigurationKeyValueModifiedEventData" + }; + [Test] public void MappingContainsAllSystemEvents() { @@ -46,6 +53,30 @@ public void SystemNamesCasedCorrectly() } } + [Test] + public void EventPropertiesCasedCorrectly() + { + foreach (Type systemEvent in Assembly.GetAssembly(typeof(EventGridEvent)).GetTypes().Where(t => t.Name.EndsWith("EventData"))) + { + if (s_etagCasingExlusions.Contains(systemEvent.Name)) + { + continue; + } + + foreach (PropertyInfo propertyInfo in systemEvent.GetProperties()) + { + string name = propertyInfo.Name; + if (name.ToLower() == "etag") + { + if (name != "ETag") + { + Assert.Fail($"{systemEvent}.{name} is not cased correctly. It should be cased as 'ETag'."); + } + } + } + } + } + private void ValidateName(string name) { if (s_casingExclusions.Contains(name)) From c8a51651baf366893b36e8bbfce0fcc2291240e5 Mon Sep 17 00:00:00 2001 From: Alexey Rodionov Date: Wed, 13 Sep 2023 13:22:02 -0700 Subject: [PATCH 30/45] Legacy checkpoint support (#38546) --- .../src/Listeners/EventHubMetricsProvider.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubMetricsProvider.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubMetricsProvider.cs index 2aab89045bdb..52bb424b36fc 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubMetricsProvider.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubMetricsProvider.cs @@ -109,7 +109,8 @@ private EventHubsTriggerMetrics CreateTriggerMetrics(List p // In that case, LastEnqueuedSequenceNumber will be >= 0 if ((partitionProperties.LastEnqueuedSequenceNumber != -1 && partitionProperties.LastEnqueuedSequenceNumber != (checkpoint?.SequenceNumber ?? -1)) - || (checkpoint == null && partitionProperties.LastEnqueuedSequenceNumber >= 0)) + || (checkpoint == null && partitionProperties.LastEnqueuedSequenceNumber >= 0) + || (checkpoint != null && checkpoint.Offset == null && partitionProperties.LastEnqueuedSequenceNumber >= 0)) { long partitionUnprocessedEventCount = GetUnprocessedEventCount(partitionProperties, checkpoint); totalUnprocessedEventCount += partitionUnprocessedEventCount; @@ -157,6 +158,12 @@ private static long GetUnprocessedEventCount(PartitionProperties partitionInfo, return 1; } + // Legacy checkpoint support + if (checkpoint != null && checkpoint.Offset == null && partitionInfo.LastEnqueuedSequenceNumber >= 0) + { + return partitionInfo.LastEnqueuedSequenceNumber + 1; + } + var startingSequenceNumber = checkpoint?.SequenceNumber switch { // There was no checkpoint, use the beginning sequence number - 1, since From db3dbc069b84e28ccefda79af8ced655d8ed0712 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:29:09 -0700 Subject: [PATCH 31/45] Sync eng/common directory with azure-sdk-tools for PR 6895 (#38672) * Add legacy moniker migration logic * Add functionality from Java testing --------- Co-authored-by: Daniel Jurek --- .../Service-Level-Readme-Automation.ps1 | 8 +- .../scripts/Update-DocsMsPackageMonikers.ps1 | 122 ++++++++++++++++++ eng/common/scripts/common.ps1 | 1 + 3 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 eng/common/scripts/Update-DocsMsPackageMonikers.ps1 diff --git a/eng/common/scripts/Service-Level-Readme-Automation.ps1 b/eng/common/scripts/Service-Level-Readme-Automation.ps1 index e7dcbf7bf5fd..a03e78e4e223 100644 --- a/eng/common/scripts/Service-Level-Readme-Automation.ps1 +++ b/eng/common/scripts/Service-Level-Readme-Automation.ps1 @@ -40,7 +40,10 @@ param( [string]$ClientSecret, [Parameter(Mandatory = $false)] - [string]$ReadmeFolderRoot = "docs-ref-services" + [string]$ReadmeFolderRoot = "docs-ref-services", + + [Parameter(Mandatory = $false)] + [array]$Monikers = @('latest', 'preview', 'legacy') ) . $PSScriptRoot/common.ps1 . $PSScriptRoot/Helpers/Service-Level-Readme-Automation-Helpers.ps1 @@ -50,8 +53,7 @@ param( Set-StrictMode -Version 3 $fullMetadata = Get-CSVMetadata -$monikers = @("latest", "preview") -foreach($moniker in $monikers) { +foreach($moniker in $Monikers) { # The onboarded packages return is key-value pair, which key is the package index, and value is the package info from {metadata}.json # E.g. # Key as: @azure/storage-blob diff --git a/eng/common/scripts/Update-DocsMsPackageMonikers.ps1 b/eng/common/scripts/Update-DocsMsPackageMonikers.ps1 new file mode 100644 index 000000000000..f1f282a6b372 --- /dev/null +++ b/eng/common/scripts/Update-DocsMsPackageMonikers.ps1 @@ -0,0 +1,122 @@ +<# +.SYNOPSIS +Move metadata JSON and package-level overview markdown files for deprecated packages to the legacy folder. + +.DESCRIPTION +Move onboarding information to the "legacy" moniker for whose support is "deprecated" in the Metadata CSV. +Only one version of a package can be documented in the "legacy" moniker. If multiple versions are available, +the "latest" version will be used and the "preview" version will be deleted. + +.PARAMETER DocRepoLocation +The location of the target docs repository. +#> + +param( + [Parameter(Mandatory = $true)] + [string] $DocRepoLocation +) + +. (Join-Path $PSScriptRoot common.ps1) + +Set-StrictMode -Version 3 + +function getPackageMetadata($moniker) { + $jsonFiles = Get-ChildItem -Path (Join-Path $DocRepoLocation "metadata/$moniker") -Filter *.json + $metadata = @{} + + foreach ($jsonFile in $jsonFiles) { + $packageMetadata = Get-Content $jsonFile -Raw | ConvertFrom-Json -AsHashtable + $packageIdentity = $packageMetadata.Name + if (Test-Path "Function:$GetPackageIdentity") { + $packageIdentity = &$GetPackageIdentity $packageMetadata + } + + $metadata[$packageIdentity] = @{ File = $jsonFile; Metadata = $packageMetadata } + } + + return $metadata +} + +function getPackageInfoFromLookup($packageIdentity, $version, $lookupTable) { + if ($lookupTable.ContainsKey($packageIdentity)) { + if ($lookupTable[$packageIdentity]['Metadata'].Version -eq $version) { + # Only return if the version matches + return $lookupTable[$packageIdentity] + } + } + + return $null +} + +function moveToLegacy($packageInfo) { + $docsMsMetadata = &$GetDocsMsMetadataForPackageFn -PackageInfo $packageInfo['Metadata'] + + Write-Host "Move to legacy: $($packageInfo['Metadata'].Name)" + $packageInfoPath = $packageInfo['File'] + Move-Item "$($packageInfoPath.Directory)/$($packageInfoPath.BaseName).*" "$DocRepoLocation/metadata/legacy/" -Force + + $readmePath = "$DocRepoLocation/$($docsMsMetadata.PreviewReadMeLocation)/$($docsMsMetadata.DocsMsReadMeName)-readme.md" + if (Test-Path $readmePath) { + Move-Item ` + $readmePath ` + "$DocRepoLocation/$($docsMsMetadata.LegacyReadMeLocation)/" ` + -Force + } +} + +function deletePackageInfo($packageInfo) { + $docsMsMetadata = &$GetDocsMsMetadataForPackageFn -PackageInfo $packageInfo['Metadata'] + + Write-Host "Delete superseded package: $($packageInfo['Metadata'].Name)" + $packageInfoPath = $packageInfo['File'] + Remove-Item "$($packageInfoPath.Directory)/$($packageInfoPath.BaseName).*" -Force + + $readmePath = "$DocRepoLocation/$($docsMsMetadata.PreviewReadMeLocation)/$($docsMsMetadata.DocsMsReadMeName)-readme.md" + if (Test-Path $readmePath) { + Remove-Item $readmePath -Force + } +} + +$metadataLookup = @{ + 'latest' = getPackageMetadata 'latest' + 'preview' = getPackageMetadata 'preview' +} +$deprecatedPackages = (Get-CSVMetadata).Where({ $_.Support -eq 'deprecated' }) + +foreach ($package in $deprecatedPackages) { + $packageIdentity = $package.Package + if (Test-Path "Function:$GetPackageIdentityFromCsvMetadata") { + $packageIdentity = &$GetPackageIdentityFromCsvMetadata $package + } + + $packageInfoPreview = $packageInfoLatest = $null + if ($package.VersionPreview) { + $packageInfoPreview = getPackageInfoFromLookup ` + -packageIdentity $packageIdentity ` + -version $package.VersionPreview ` + -lookupTable $metadataLookup['preview'] + } + + if ($package.VersionGA) { + $packageInfoLatest = getPackageInfoFromLookup ` + -packageIdentity $packageIdentity ` + -version $package.VersionGA ` + -lookupTable $metadataLookup['latest'] + } + + if (!$packageInfoPreview -and !$packageInfoLatest) { + # Nothing to move or delete + continue + } + + if ($packageInfoPreview -and $packageInfoLatest) { + # Delete metadata JSON and package-level overview markdown files for + # the preview version instead of moving both. This mitigates situations + # where the "latest" verison doesn't have a package-level overview + # markdown file and the "preview" version does. + deletePackageInfo $packageInfoPreview + moveToLegacy $packageInfoLatest + } else { + moveToLegacy ($packageInfoPreview ?? $packageInfoLatest) + } +} diff --git a/eng/common/scripts/common.ps1 b/eng/common/scripts/common.ps1 index e6b5f09fe7c8..39d65cdd6818 100644 --- a/eng/common/scripts/common.ps1 +++ b/eng/common/scripts/common.ps1 @@ -67,3 +67,4 @@ $GetEmitterPackageLockPathFn = "Get-${Language}-EmitterPackageLockPath" $SetDocsPackageOnboarding = "Set-${Language}-DocsPackageOnboarding" $GetDocsPackagesAlreadyOnboarded = "Get-${Language}-DocsPackagesAlreadyOnboarded" $GetPackageIdentity = "Get-${Language}-PackageIdentity" +$GetPackageIdentityFromCsvMetadata = "Get-${Language}-PackageIdentityFromCsvMetadata" From 1a1bdd68d0f155d44dc6443cf13a7857a9f4f24a Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Sep 2023 14:15:17 -0700 Subject: [PATCH 32/45] .NET-specific changes: Move deprecated packages to legacy (#36194) * First cut at migrating to legacy moniker * Update-PackageMonikers.ps1 * Refinement * Update docindex.yml for testing * Rename * ToC fixes * Refactor namespace discovery * Remove EnsureNamespaces * Add "legacy" moniker * Undo Service-Level-Readme-Automation.ps1 because it is generating incorrect package paths * Better edge case handling, documentation * Add fixes to service level overview generation * Reset eng/common * docindex changes * Comment cleanup * Fix ToC generation tests * Test cleanup --- eng/pipelines/docindex.yml | 20 +++- eng/scripts/Language-Settings.ps1 | 20 ++++ eng/scripts/docs/Docs-ToC.ps1 | 112 +++++++----------- .../docs/tests/Toc-Generation.Tests.ps1 | 60 ++++------ .../inputs/bundlepackages/azure-dotnet.csv | 2 +- .../Azure.Security.KeyVault.Certificates.json | 18 +++ .../latest/Azure.Security.KeyVault.Keys.json | 14 --- .../Azure.Security.KeyVault.Certificates.json | 4 +- 8 files changed, 123 insertions(+), 127 deletions(-) create mode 100644 eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Certificates.json delete mode 100644 eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Keys.json diff --git a/eng/pipelines/docindex.yml b/eng/pipelines/docindex.yml index 98558d57d089..d775f494e323 100644 --- a/eng/pipelines/docindex.yml +++ b/eng/pipelines/docindex.yml @@ -38,12 +38,22 @@ jobs: Repositories: - Name: $(DocRepoOwner)/$(DocRepoName) WorkingDirectory: $(DocRepoLocation) + # Install the tool for toc step to use - task: NuGetToolInstaller@1 inputs: versionSpec: 6.3.1 - # Call update docs ci script to onboard packages + - template: /eng/common/pipelines/templates/steps/set-default-branch.yml + + - task: Powershell@2 + inputs: + pwsh: true + filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1 + arguments: -DocRepoLocation $(DocRepoLocation) + displayName: Move deprecated packages to legacy moniker + condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true'))) + - task: Powershell@2 inputs: pwsh: true @@ -109,6 +119,14 @@ jobs: displayName: Set package source variable workingDirectory: $(DocRepoLocation) + - task: Powershell@2 + inputs: + pwsh: true + filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1 + arguments: -DocRepoLocation $(DocRepoLocation) + displayName: Move deprecated packages to legacy moniker + condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true'))) + - task: Powershell@2 inputs: pwsh: true diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 9587d24193fb..fed325b0b7bb 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -298,6 +298,7 @@ function Get-dotnet-DocsMsMetadataForPackage($PackageInfo) { DocsMsReadMeName = $readmeName LatestReadMeLocation = 'api/overview/azure/latest' PreviewReadMeLocation = 'api/overview/azure/preview' + LegacyReadMeLocation = 'api/overview/azure/legacy' Suffix = '' } } @@ -494,6 +495,25 @@ function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata) { continue } + if ($matchingPublishedPackage.Support -eq 'deprecated') { + if ($Mode -eq 'legacy') { + + # Select the GA version, if none use the preview version + $updatedVersion = $matchingPublishedPackage.VersionGA.Trim() + if (!$updatedVersion) { + $updatedVersion = $matchingPublishedPackage.VersionPreview.Trim() + } + $package.Versions = @($updatedVersion) + + Write-Host "Add deprecated package to legacy moniker: $($package.Name)" + $outputPackages += $package + } else { + Write-Host "Removing deprecated package: $($package.Name)" + } + + continue + } + $updatedVersion = $matchingPublishedPackage.VersionGA.Trim() if ($Mode -eq 'preview') { $updatedVersion = $matchingPublishedPackage.VersionPreview.Trim() diff --git a/eng/scripts/docs/Docs-ToC.ps1 b/eng/scripts/docs/Docs-ToC.ps1 index 564a4232bb05..a4cc0b1c2707 100644 --- a/eng/scripts/docs/Docs-ToC.ps1 +++ b/eng/scripts/docs/Docs-ToC.ps1 @@ -110,7 +110,10 @@ function Get-dotnet-OnboardedDocsMsPackagesForMoniker ($DocRepoLocation, $monike $onboardingSpec = "$DocRepoLocation/bundlepackages/azure-dotnet.csv" if ("preview" -eq $moniker) { $onboardingSpec = "$DocRepoLocation/bundlepackages/azure-dotnet-preview.csv" + } elseif ('legacy' -eq $moniker) { + $onboardingSpec = "$DocRepoLocation/bundlepackages/azure-dotnet-legacy.csv" } + $onboardedPackages = @{} $packageInfos = Get-DocsCiConfig $onboardingSpec foreach ($packageInfo in $packageInfos) { @@ -147,92 +150,65 @@ function GetPackageReadmeName($packageMetadata) { return $packageLevelReadmeName } +# Defined in common.ps1 +# $GetDocsMsTocDataFn = "Get-${Language}-DocsMsTocData" function Get-dotnet-DocsMsTocData($packageMetadata, $docRepoLocation, $PackageSourceOverride) { $packageLevelReadmeName = GetPackageReadmeName -packageMetadata $packageMetadata $packageTocHeader = GetDocsTocDisplayName $packageMetadata - $children = @() - # Children here combine namespaces in both preview and GA. - if($packageMetadata.VersionPreview) { - $children += Get-Toc-Children -package $packageMetadata.Package -version $packageMetadata.VersionPreview ` - -docRepoLocation $docRepoLocation -folderName "preview" - } - if($packageMetadata.VersionGA) { - $children += Get-Toc-Children -package $packageMetadata.Package -version $packageMetadata.VersionGA ` - -docRepoLocation $docRepoLocation -folderName "latest" - } - $children = @($children | Sort-Object -Unique) + $children = Get-Toc-Children ` + -package $packageMetadata.Package ` + -docRepoLocation $docRepoLocation + if (!$children) { - if ($packageMetadata.VersionPreview) { - LogDebug "Did not find the package namespaces for $($packageMetadata.Package):$($packageMetadata.VersionPreview)" - } - if ($packageMetadata.VersionGA) { - LogDebug "Did not find the package namespaces for $($packageMetadata.Package):$($packageMetadata.VersionGA)" - } + LogWarning "Did not find the package namespaces for $($packageMetadata.Package)" } $output = [PSCustomObject]@{ PackageLevelReadmeHref = "~/api/overview/azure/{moniker}/$packageLevelReadmeName-readme.md" PackageTocHeader = $packageTocHeader - TocChildren = $children + TocChildren = @($children) } return $output } -# This is a helper function to fetch the dotnet package namespaces. -# Here is the major workflow: -# 1. Read the ${package}.json under /metadata folder. If json file exists, Namespaces property exists and version match, return the array. -# 2. If the json file exist but version mismatch, fetch the namespaces from nuget and udpate the json namespaces property. -# 3. If file not found, then fetch namespaces from nuget and create new package.json file with very basic info, like package name, version, namespaces. -function Get-Toc-Children($package, $version, $docRepoLocation, $folderName) { - # Looking for the txt - $packageJsonPath = "$docRepoLocation/metadata/$folderName/$package.json" - $packageJsonObject = [PSCustomObject]@{ - Name = $package - Version = $version - Namespaces = @() - } - # We will download package and parse out namespaces for the following cases. - # 1. Package json file doesn't exist. Create a new json file with $packageJsonObject - # 2. Package json file exists, but no Namespaces property. Add the Namespaces property with right values. - # 3. Both package json file and Namespaces property exist, but the version mismatch. Update the nameapace values. - $jsonExists = Test-Path $packageJsonPath - $namespacesExist = $false - $versionMismatch = $false - $packageJson = $null - # Add backup if no namespaces fetched out from new packages. - $originalNamespaces = @() - # Collect the information and return the booleans of updates or not. - if ($jsonExists) { - $packageJson = Get-Content $packageJsonPath | ConvertFrom-Json - $namespacesExist = $packageJson.PSObject.Members.Name -contains "Namespaces" - if ($namespacesExist) { - # Fallback to original ones if failed to fetch updated namespaces. - $originalNamespaces = $packageJson.Namespaces - } - $versionMismatch = $version -ne $packageJson.Version - } - if ($jsonExists -and $namespacesExist -and !$versionMismatch) { - return $originalNamespaces - } - $namespaces = Fetch-NamespacesFromNupkg -package $package -version $version - if (!$namespaces) { - $namespaces = $originalNamespaces - } - if (!$packageJson) { - $packageJsonObject.Namespaces = $namespaces - $packageJson = ($packageJsonObject | ConvertTo-Json | ConvertFrom-Json) +# This function is called within a loop. To prevent multiple reads of the same +# file data, this uses a script-scoped cache variable. +$script:PackageMetadataJsonLookup = $null +function GetPackageMetadataJsonLookup($docRepoLocation) { + if ($script:PackageMetadataJsonLookup) { + return $script:PackageMetadataJsonLookup } - elseif(!$namespacesExist) { - $packageJson = $packageJson | Add-Member -MemberType NoteProperty -Name Namespaces -Value $namespaces -PassThru + + $script:PackageMetadataJsonLookup = @{} + $packageJsonFiles = Get-ChildItem $docRepoLocation/metadata/ -Filter *.json -Recurse + foreach ($packageJsonFile in $packageJsonFiles) { + $packageJson = Get-Content $packageJsonFile -Raw | ConvertFrom-Json -AsHashtable + + if (!$script:PackageMetadataJsonLookup.ContainsKey($packageJson.Name)) { + $script:PackageMetadataJsonLookup[$packageJson.Name] = @($packageJson) + } else { + $script:PackageMetadataJsonLookup[$packageJson.Name] += $packageJson + } } - else{ - $packageJson.Namespaces = $namespaces + + return $script:PackageMetadataJsonLookup +} + +function Get-Toc-Children($package, $docRepoLocation) { + $packageTable = GetPackageMetadataJsonLookup $docRepoLocation + + $namespaces = @() + if ($packageTable.ContainsKey($package)) { + foreach ($entry in $packageTable[$package]) { + if ($entry.ContainsKey('Namespaces')) { + $namespaces += $entry['Namespaces'] + } + } } - # Keep the json file up to date. - Set-Content $packageJsonPath -Value ($packageJson | ConvertTo-Json) - return $namespaces + + return $namespaces | Sort-Object -Unique } function Get-dotnet-PackageLevelReadme ($packageMetadata) { diff --git a/eng/scripts/docs/tests/Toc-Generation.Tests.ps1 b/eng/scripts/docs/tests/Toc-Generation.Tests.ps1 index edda6ab8f45a..6a661ddc9037 100644 --- a/eng/scripts/docs/tests/Toc-Generation.Tests.ps1 +++ b/eng/scripts/docs/tests/Toc-Generation.Tests.ps1 @@ -9,27 +9,12 @@ Import-Module Pester BeforeAll { . $PSScriptRoot/../Docs-ToC.ps1 . $PSScriptRoot/logging.ps1 - function Backup-File($targetPath, $backupFolder) { - if (!(Test-Path $targetPath)) { - return $null - } - $fileName = (Split-Path $targetPath -leaf) - $backupFile = "$backupFolder/temp-$fileName" - $null = New-Item $backupFile -ItemType "file" -Force - $null = Copy-Item $targetPath -Destination $backupFile - return $backupFile - } - function Reset-File($targetPath, $backupFile) { - if ($backupFile) { - $null = Copy-Item $backupFile -Destination $targetPath - } - } } AfterAll { $tempLocation = (Join-Path ([System.IO.Path]::GetTempPath()) "extractNupkg") - Remove-Item "$tempLocation/*" -Recurse -Force - Remove-Item "$PSScriptRoot/outputs" -Recurse -Force + Remove-Item "$tempLocation/*" -Recurse -Force -ErrorAction Ignore + Remove-Item "$PSScriptRoot/outputs" -Recurse -Force -ErrorAction Ignore } # Test plan: # 1. Tests on Fetch-NamespacesFromNupkg from nuget source. @@ -86,33 +71,28 @@ Describe "Fetch-NamespacesFromNupkg-PublicFeeds" -Tag "UnitTest" { } } -# Test scenarios: -# 1. No package json found. Expect generate and update the json. -# 2. Json exists, but no namespaces. Expect to add new property and update the json -# 3. Json and namespaces exists, but version mismatch. Expect to update to the most recent namespaces. -# 4. Otherwise, return namespaces in json file. Describe "Get-Toc-Children" -Tag "UnitTest" { - # passed cases It "Get toc children from package json" -TestCases @( - @{ package = "Azure.Security.KeyVault.Secrets"; version="4.4.0"; folder="latest"; expectNamespaces = @('Azure.Security.KeyVault.Secrets', 'Microsoft.Extensions.Azure') } - @{ package = "Azure.Security.KeyVault.Certificates"; version="4.3.0-beta.4"; folder="preview"; expectNamespaces = @('Azure.Security.KeyVault.Certificates', 'Microsoft.Extensions.Azure') } - @{ package = "Azure.Security.KeyVault.Keys"; version="4.4.0"; folder="latest"; expectNamespaces = @('Azure.Security.KeyVault.Keys', 'Azure.Security.KeyVault.Keys.Cryptography', 'Microsoft.Extensions.Azure') } + @{ + package = "Azure.Security.KeyVault.Secrets"; + expectNamespaces = @('Azure.Security.KeyVault.Secrets', 'Microsoft.Extensions.Azure') + } ) { - $targetFile = "$PSScriptRoot/inputs/metadata/$folder/$package.json" - $backupFolder = "$PSScriptRoot/outputs" - $backupFile = Backup-File $targetFile $backupFolder - $namespaces = Get-Toc-Children -package $package -version $version -docRepoLocation "$PSScriptRoot/inputs" -folder $folder + $namespaces = Get-Toc-Children ` + -package $package ` + -docRepoLocation "$PSScriptRoot/inputs" $namespaces | Should -Be $expectNamespaces - Reset-File $targetFile $backupFile } - # No json case - It "Get toc children when no package json" -TestCases @( - @{ package = "Azure.Data.AppConfiguration"; version="1.3.0-beta.1"; folder="latest"; expectNamespaces = @('Azure.Data.AppConfiguration', 'Microsoft.Extensions.Azure') } - ) { - $namespaces = Get-Toc-Children -package $package -version $version -docRepoLocation "$PSScriptRoot/inputs" -folder $folder - $namespaces | Should -Be $expectNamespaces - $expectFile = "$PSScriptRoot/inputs/metadata/$folder/$package.json" - (Test-Path $expectFile) | Should -BeTrue - Remove-Item $expectFile + + It "Combines ToC children from each moniker" { + $namespaces = Get-Toc-Children ` + -package 'Azure.Security.KeyVault.Certificates' ` + -docRepoLocation "$PSScriptRoot/inputs" + + $namespaces | Should -be @( + 'Azure.Security.KeyVault.Certificates', + 'Microsoft.Extensions.Azure' + 'Some.New.Namespace' + ) } } \ No newline at end of file diff --git a/eng/scripts/docs/tests/inputs/bundlepackages/azure-dotnet.csv b/eng/scripts/docs/tests/inputs/bundlepackages/azure-dotnet.csv index 69dfb6eb6658..9ad941268765 100644 --- a/eng/scripts/docs/tests/inputs/bundlepackages/azure-dotnet.csv +++ b/eng/scripts/docs/tests/inputs/bundlepackages/azure-dotnet.csv @@ -1,2 +1,2 @@ -azurekeyvaultkeys,[tfm=netstandard2.0]Azure.Security.KeyVault.Keys,4.4.0 +azuresecuritykeyvaultcertificates,[tfm=netstandard2.0]Azure.Security.KeyVault.Certificates,4.2.0 azurekeyvaultsecrets,[tfm=netstandard2.0]Azure.Security.KeyVault.Secrets,4.4.0 \ No newline at end of file diff --git a/eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Certificates.json b/eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Certificates.json new file mode 100644 index 000000000000..07e77401a4a6 --- /dev/null +++ b/eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Certificates.json @@ -0,0 +1,18 @@ +{ + "Name": "Azure.Security.KeyVault.Certificates", + "Version": "4.2.0", + "DevVersion": null, + "DirectoryPath": "sdk/keyvault/Azure.Security.KeyVault.Certificates", + "ServiceDirectory": "keyvault", + "ReadMePath": "sdk/keyvault/Azure.Security.KeyVault.Certificates/README.md", + "ChangeLogPath": "sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md", + "Group": null, + "SdkType": "client", + "IsNewSdk": true, + "ArtifactName": "Azure.Security.KeyVault.Certificates", + "ReleaseStatus": "2022-09-20", + "Namespaces": [ + "Azure.Security.KeyVault.Certificates", + "Microsoft.Extensions.Azure" + ] +} \ No newline at end of file diff --git a/eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Keys.json b/eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Keys.json deleted file mode 100644 index 80aba6c3ed28..000000000000 --- a/eng/scripts/docs/tests/inputs/metadata/latest/Azure.Security.KeyVault.Keys.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "Azure.Security.KeyVault.Keys", - "Version": "4.4.0", - "DevVersion": null, - "DirectoryPath": "sdk/keyvault/Azure.Security.KeyVault.Keys", - "ServiceDirectory": "keyvault", - "ReadMePath": "sdk/keyvault/Azure.Security.KeyVault.Keys/README.md", - "ChangeLogPath": "sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "Azure.Security.KeyVault.Keys", - "ReleaseStatus": "2022-09-20" -} \ No newline at end of file diff --git a/eng/scripts/docs/tests/inputs/metadata/preview/Azure.Security.KeyVault.Certificates.json b/eng/scripts/docs/tests/inputs/metadata/preview/Azure.Security.KeyVault.Certificates.json index 96a04a77a405..4edfa873fd7d 100644 --- a/eng/scripts/docs/tests/inputs/metadata/preview/Azure.Security.KeyVault.Certificates.json +++ b/eng/scripts/docs/tests/inputs/metadata/preview/Azure.Security.KeyVault.Certificates.json @@ -12,8 +12,6 @@ "ArtifactName": "Azure.Security.KeyVault.Certificates", "ReleaseStatus": "2022-09-20", "Namespaces": [ - "Azure.Security.KeyVault.Certificates", - "Microsoft.Extensions.Azure", - "OutOfDate.Namespaces" + "Some.New.Namespace" ] } \ No newline at end of file From d700ef86c9f6c5175fff0e085e497f0e0218b690 Mon Sep 17 00:00:00 2001 From: Anne Thompson Date: Wed, 13 Sep 2023 15:11:24 -0700 Subject: [PATCH 33/45] Remove unused MSBuild properties (#38648) * Remove MSBuild properties * revert personalizer --- .../tests/Azure.AI.Language.Conversations.Tests.csproj | 1 - .../tests/Azure.Core.Experimental.Tests.csproj | 1 - sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj | 1 - sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj | 1 - sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj | 1 - .../src/Azure.Health.Insights.CancerProfiling.csproj | 1 - .../src/Azure.Health.Insights.ClinicalMatching.csproj | 1 - .../Azure.Storage.Common/tests/Azure.Storage.Common.Tests.csproj | 1 - .../src/Azure.Storage.DataMovement.Blobs.csproj | 1 - 9 files changed, 9 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Azure.AI.Language.Conversations.Tests.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Azure.AI.Language.Conversations.Tests.csproj index a69c85e4ca08..e01faf8812d7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Azure.AI.Language.Conversations.Tests.csproj +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Azure.AI.Language.Conversations.Tests.csproj @@ -1,7 +1,6 @@  $(RequiredTargetFrameworks) - true true false diff --git a/sdk/core/Azure.Core.Experimental/tests/Azure.Core.Experimental.Tests.csproj b/sdk/core/Azure.Core.Experimental/tests/Azure.Core.Experimental.Tests.csproj index 7eb4406f4e7a..1b800775cade 100644 --- a/sdk/core/Azure.Core.Experimental/tests/Azure.Core.Experimental.Tests.csproj +++ b/sdk/core/Azure.Core.Experimental/tests/Azure.Core.Experimental.Tests.csproj @@ -1,7 +1,6 @@  $(RequiredTargetFrameworks) - true diff --git a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj index cf58535b30a5..90c075a71ecd 100644 --- a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj +++ b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj @@ -4,7 +4,6 @@ $(RequiredTargetFrameworks) $(DefineConstants);HAS_INTERNALS_VISIBLE_CORE true - true diff --git a/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj b/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj index 690f02d08227..3157f0c06a88 100644 --- a/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj +++ b/sdk/core/Azure.Core/tests/common/Azure.Core.Tests.Common.csproj @@ -1,7 +1,6 @@  $(RequiredTargetFrameworks) - true true true diff --git a/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj b/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj index 3a6fb9509979..12fa5a7a43f6 100644 --- a/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj +++ b/sdk/core/Azure.Core/tests/public/Azure.Core.Tests.Public.csproj @@ -1,7 +1,6 @@  $(RequiredTargetFrameworks) - true true true false diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj index 20d882450ea8..c40d0cb17233 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj @@ -7,7 +7,6 @@ $(RequiredTargetFrameworks) true $(NoWarn);CS1591;AZC0012 - true true diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj index 872ea0cf8aa2..1d984647093a 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj @@ -7,7 +7,6 @@ $(RequiredTargetFrameworks) true $(NoWarn);CS1591;AZC0012 - true true diff --git a/sdk/storage/Azure.Storage.Common/tests/Azure.Storage.Common.Tests.csproj b/sdk/storage/Azure.Storage.Common/tests/Azure.Storage.Common.Tests.csproj index c8fa395f073c..9f666b6004cd 100644 --- a/sdk/storage/Azure.Storage.Common/tests/Azure.Storage.Common.Tests.csproj +++ b/sdk/storage/Azure.Storage.Common/tests/Azure.Storage.Common.Tests.csproj @@ -1,7 +1,6 @@  $(RequiredTargetFrameworks) - true Microsoft Azure.Storage.Common client library tests diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj index a86fbfb8a1b3..c3e0f2723355 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj @@ -1,7 +1,6 @@  $(RequiredTargetFrameworks);net6.0 - true Microsoft Azure.Storage.DataMovement.Blobs client library From 0a7502375061e1609ebda7f637151773d6a80a29 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:43:12 -0700 Subject: [PATCH 34/45] Increment package version after release of Azure.Messaging.EventGrid (#38682) --- sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Messaging.EventGrid.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index 801d9fed1bde..d653ec7e9275 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.19.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.18.0 (2023-09-12) ### Features Added diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj index 0c9c4024cb48..2659882c3b62 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj @@ -2,9 +2,9 @@ This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. Microsoft Azure.Messaging.EventGrid client library - 4.18.0 + 4.19.0-beta.1 - 4.17.0 + 4.18.0 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; $(RequiredTargetFrameworks) true From f22cdb44e9a263ba69a52a4df98636e79f0767bc Mon Sep 17 00:00:00 2001 From: m-nash Date: Wed, 13 Sep 2023 19:00:34 -0700 Subject: [PATCH 35/45] temp fix to release alpha package --- ...erviceCorsSettings.Bicep.Serialization.cs} | 0 ...viceHttpLogsConfig.Bicep.Serialization.cs} | 0 ...AppServicePlanData.Bicep.Serialization.cs} | 0 ...viceSkuDescription.Bicep.Serialization.cs} | 0 ...licationLogsConfig.Bicep.Serialization.cs} | 0 ...PoliciesEntityData.Bicep.Serialization.cs} | 0 ...licationLogsConfig.Bicep.Serialization.cs} | 0 ...stemHttpLogsConfig.Bicep.Serialization.cs} | 0 ...teConfigProperties.Bicep.Serialization.cs} | 0 ...SiteLogsConfigData.Bicep.Serialization.cs} | 0 .../{ => CdkHack}/StringBuilderExtensions.cs | 0 .../WebSiteData.Bicep.Serialization.cs} | 0 .../src/Generated/ApiKeyVaultReferenceData.cs | 4 +- .../src/Generated/AppServicePlanData.cs | 4 +- .../Generated/ArmAppServiceModelFactory.cs | 114 ++++++++++++++++- .../src/Generated/KubeEnvironmentData.cs | 4 +- ...llowedAudiencesValidation.Serialization.cs | 2 +- .../Models/AllowedAudiencesValidation.cs | 2 +- .../ApiKeyVaultReferenceData.Serialization.cs | 4 +- .../ApiManagementConfig.Serialization.cs | 2 +- .../Generated/Models/ApiManagementConfig.cs | 2 +- ...pServiceApiDefinitionInfo.Serialization.cs | 2 +- .../Models/AppServiceApiDefinitionInfo.cs | 2 +- ...viceBlobStorageTokenStore.Serialization.cs | 2 +- .../Models/AppServiceBlobStorageTokenStore.cs | 2 +- .../Generated/Models/AppServiceGithubToken.cs | 29 +++++ ...ServiceHttpSettingsRoutes.Serialization.cs | 2 +- .../Models/AppServiceHttpSettingsRoutes.cs | 2 +- .../AppServicePlanData.Serialization.cs | 4 +- .../AppServiceResource.Serialization.cs | 108 ++++++++++++++++ .../Generated/Models/AppServiceResource.cs | 39 ++++++ ...StaticWebAppsRegistration.Serialization.cs | 2 +- .../AppServiceStaticWebAppsRegistration.cs | 2 +- .../Models/AppserviceGithubTokenRequest.cs | 34 +++++ .../Models/ArmIdWrapper.Serialization.cs | 39 ++++++ .../src/Generated/Models/ArmIdWrapper.cs | 28 ++++ .../Models/CsmMoveResourceEnvelope.cs | 27 ++++ ...tionDescriptionProperties.Serialization.cs | 2 +- .../CsmOperationDescriptionProperties.cs | 2 +- .../DefaultErrorResponse.Serialization.cs | 48 +++++++ .../Generated/Models/DefaultErrorResponse.cs | 28 ++++ ...DefaultErrorResponseError.Serialization.cs | 100 +++++++++++++++ .../Models/DefaultErrorResponseError.cs | 48 +++++++ ...rResponseErrorDetailsItem.Serialization.cs | 66 ++++++++++ .../DefaultErrorResponseErrorDetailsItem.cs | 36 ++++++ .../Models/DetectorMetadata.Serialization.cs | 2 +- .../src/Generated/Models/DetectorMetadata.cs | 2 +- .../Models/ExtendedLocation.Serialization.cs | 50 ++++++++ .../src/Generated/Models/ExtendedLocation.cs | 32 +++++ .../FileSystemTokenStore.Serialization.cs | 2 +- .../Generated/Models/FileSystemTokenStore.cs | 2 +- .../FrontEndConfiguration.Serialization.cs | 2 +- .../Generated/Models/FrontEndConfiguration.cs | 2 +- .../KubeEnvironmentData.Serialization.cs | 4 +- .../Models/LoginRoutes.Serialization.cs | 2 +- .../src/Generated/Models/LoginRoutes.cs | 2 +- .../Models/LoginScopes.Serialization.cs | 2 +- .../src/Generated/Models/LoginScopes.cs | 2 +- .../ManagedServiceIdentity.Serialization.cs | 93 ++++++++++++++ .../Models/ManagedServiceIdentity.cs | 46 +++++++ ...anagedServiceIdentityType.Serialization.cs | 32 +++++ .../Models/ManagedServiceIdentityType.cs | 22 ++++ ...ivateLinkResourcesWrapper.Serialization.cs | 2 +- .../Models/PrivateLinkResourcesWrapper.cs | 2 +- .../Models/ProxyOnlyResource.Serialization.cs | 73 +++++++++++ .../src/Generated/Models/ProxyOnlyResource.cs | 35 +++++ ...PrivateEndpointConnection.Serialization.cs | 4 +- ...EnvelopeRemotePrivateEndpointConnection.cs | 4 +- .../RoutingRuleExperiments.Serialization.cs | 2 +- .../Models/RoutingRuleExperiments.cs | 2 +- .../Models/SitePatchInfo.Serialization.cs | 4 +- .../src/Generated/Models/SitePatchInfo.cs | 4 +- .../Models/StaticSiteData.Serialization.cs | 4 +- ...idedFunctionAppProperties.Serialization.cs | 121 ++++++++++++++++++ ...icSiteUserProvidedFunctionAppProperties.cs | 48 +++++++ .../UserAssignedIdentity.Serialization.cs | 45 +++++++ .../Generated/Models/UserAssignedIdentity.cs | 32 +++++ .../WebAppEnabledConfig.Serialization.cs | 2 +- .../Generated/Models/WebAppEnabledConfig.cs | 2 +- .../Models/WebSiteData.Serialization.cs | 8 +- .../src/Generated/StaticSiteData.cs | 4 +- .../src/Generated/WebSiteData.cs | 6 +- .../src/autorest.md | 1 + 83 files changed, 1428 insertions(+), 68 deletions(-) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/AppServiceCorsSettings.Serialization.cs => CdkHack/AppServiceCorsSettings.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/AppServiceHttpLogsConfig.Serialization.cs => CdkHack/AppServiceHttpLogsConfig.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/AppServicePlanData.Serialization.cs => CdkHack/AppServicePlanData.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/AppServiceSkuDescription.Serialization.cs => CdkHack/AppServiceSkuDescription.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/ApplicationLogsConfig.Serialization.cs => CdkHack/ApplicationLogsConfig.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/CsmPublishingCredentialsPoliciesEntityData.Serialization.cs => CdkHack/CsmPublishingCredentialsPoliciesEntityData.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/FileSystemApplicationLogsConfig.Serialization.cs => CdkHack/FileSystemApplicationLogsConfig.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/FileSystemHttpLogsConfig.Serialization.cs => CdkHack/FileSystemHttpLogsConfig.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/SiteConfigProperties.Serialization.cs => CdkHack/SiteConfigProperties.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/SiteLogsConfigData.Serialization.cs => CdkHack/SiteLogsConfigData.Bicep.Serialization.cs} (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{ => CdkHack}/StringBuilderExtensions.cs (100%) rename sdk/websites/Azure.ResourceManager.AppService/src/{Customization/Models/WebSiteData.Serialization.cs => CdkHack/WebSiteData.Bicep.Serialization.cs} (100%) create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServiceCorsSettings.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServiceCorsSettings.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServiceCorsSettings.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServiceCorsSettings.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServiceHttpLogsConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServiceHttpLogsConfig.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServiceHttpLogsConfig.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServiceHttpLogsConfig.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServicePlanData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServicePlanData.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServicePlanData.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServicePlanData.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServiceSkuDescription.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServiceSkuDescription.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/AppServiceSkuDescription.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/AppServiceSkuDescription.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/ApplicationLogsConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/ApplicationLogsConfig.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/ApplicationLogsConfig.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/ApplicationLogsConfig.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/CsmPublishingCredentialsPoliciesEntityData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/CsmPublishingCredentialsPoliciesEntityData.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/CsmPublishingCredentialsPoliciesEntityData.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/CsmPublishingCredentialsPoliciesEntityData.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/FileSystemApplicationLogsConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/FileSystemApplicationLogsConfig.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/FileSystemApplicationLogsConfig.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/FileSystemApplicationLogsConfig.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/FileSystemHttpLogsConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/FileSystemHttpLogsConfig.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/FileSystemHttpLogsConfig.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/FileSystemHttpLogsConfig.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/SiteConfigProperties.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/SiteConfigProperties.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/SiteConfigProperties.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/SiteConfigProperties.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/SiteLogsConfigData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/SiteLogsConfigData.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/SiteLogsConfigData.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/SiteLogsConfigData.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/StringBuilderExtensions.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/StringBuilderExtensions.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/StringBuilderExtensions.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/StringBuilderExtensions.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/WebSiteData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/WebSiteData.Bicep.Serialization.cs similarity index 100% rename from sdk/websites/Azure.ResourceManager.AppService/src/Customization/Models/WebSiteData.Serialization.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/WebSiteData.Bicep.Serialization.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ApiKeyVaultReferenceData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ApiKeyVaultReferenceData.cs index 643d11e8851e..6f4cee6aa39a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ApiKeyVaultReferenceData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ApiKeyVaultReferenceData.cs @@ -37,7 +37,7 @@ public ApiKeyVaultReferenceData() /// /// /// Kind of resource. - internal ApiKeyVaultReferenceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string reference, ResolveStatus? status, string vaultName, string secretName, string secretVersion, ManagedServiceIdentity identity, string details, ConfigReferenceSource? source, string activeVersion, string kind) : base(id, name, resourceType, systemData) + internal ApiKeyVaultReferenceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string reference, ResolveStatus? status, string vaultName, string secretName, string secretVersion, ResourceManager.Models.ManagedServiceIdentity identity, string details, ConfigReferenceSource? source, string activeVersion, string kind) : base(id, name, resourceType, systemData) { Reference = reference; Status = status; @@ -62,7 +62,7 @@ internal ApiKeyVaultReferenceData(ResourceIdentifier id, string name, ResourceTy /// Gets or sets the secret version. public string SecretVersion { get; set; } /// Managed service identity. - public ManagedServiceIdentity Identity { get; set; } + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } /// Gets or sets the details. public string Details { get; set; } /// Gets or sets the source. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs index c4e3c2d39558..53c42c148ebf 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs @@ -64,7 +64,7 @@ public AppServicePlanData(AzureLocation location) : base(location) /// If <code>false</code>, this App Service Plan will not perform availability zone balancing. /// /// Kind of resource. - internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, ExtendedLocation extendedLocation, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpireOn, DateTimeOffset? freeOfferExpireOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) + internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, Resources.Models.ExtendedLocation extendedLocation, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpireOn, DateTimeOffset? freeOfferExpireOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; ExtendedLocation = extendedLocation; @@ -96,7 +96,7 @@ internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType res /// Description of a SKU for a scalable resource. public AppServiceSkuDescription Sku { get; set; } /// Extended Location. - public ExtendedLocation ExtendedLocation { get; set; } + public Resources.Models.ExtendedLocation ExtendedLocation { get; set; } /// Target worker tier assigned to the App Service plan. public string WorkerTierName { get; set; } /// App Service plan status. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs index 87c034749a91..9566565e055b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs @@ -95,6 +95,22 @@ public static CertificateOrderContact CertificateOrderContact(string email = nul return new CertificateOrderContact(email, nameFirst, nameLast, phone); } + /// Initializes a new instance of AppServiceResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Kind of resource. + /// A new instance for mocking. + public static AppServiceResource AppServiceResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string kind = null) + { + tags ??= new Dictionary(); + + return new AppServiceResource(id, name, resourceType, systemData, tags, location, kind); + } + /// Initializes a new instance of AppServiceCertificateOrderPatch. /// The id. /// The name. @@ -130,6 +146,18 @@ public static AppServiceCertificateOrderPatch AppServiceCertificateOrderPatch(Re return new AppServiceCertificateOrderPatch(id, name, resourceType, systemData, certificates, distinguishedName, domainVerificationToken, validityInYears, keySize, productType, isAutoRenew, provisioningState, status, signedCertificate, csr, intermediate, root, serialNumber, lastCertificateIssuanceOn, expireOn, isPrivateKeyExternal, appServiceCertificateNotRenewableReasons?.ToList(), nextAutoRenewalTimeStamp, contact, kind); } + /// Initializes a new instance of ProxyOnlyResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Kind of resource. + /// A new instance for mocking. + public static ProxyOnlyResource ProxyOnlyResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kind = null) + { + return new ProxyOnlyResource(id, name, resourceType, systemData, kind); + } + /// Initializes a new instance of AppServiceCertificateData. /// The id. /// The name. @@ -328,6 +356,14 @@ public static CsmOperationDisplay CsmOperationDisplay(string provider = null, st return new CsmOperationDisplay(provider, resource, operation, description); } + /// Initializes a new instance of CsmOperationDescriptionProperties. + /// Resource metrics service provided by Microsoft.Insights resource provider. + /// A new instance for mocking. + public static CsmOperationDescriptionProperties CsmOperationDescriptionProperties(ServiceSpecification serviceSpecification = null) + { + return new CsmOperationDescriptionProperties(serviceSpecification); + } + /// Initializes a new instance of ServiceSpecification. /// /// @@ -900,6 +936,14 @@ public static RemotePrivateEndpointConnectionARMResourceData RemotePrivateEndpoi return new RemotePrivateEndpointConnectionARMResourceData(id, name, resourceType, systemData, provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, privateLinkServiceConnectionState, ipAddresses?.ToList(), kind); } + /// Initializes a new instance of ArmIdWrapper. + /// + /// A new instance for mocking. + public static ArmIdWrapper ArmIdWrapper(string id = null) + { + return new ArmIdWrapper(id); + } + /// Initializes a new instance of PrivateLinkConnectionApprovalRequestInfo. /// The id. /// The name. @@ -913,6 +957,16 @@ public static PrivateLinkConnectionApprovalRequestInfo PrivateLinkConnectionAppr return new PrivateLinkConnectionApprovalRequestInfo(id, name, resourceType, systemData, privateLinkServiceConnectionState, kind); } + /// Initializes a new instance of PrivateLinkResourcesWrapper. + /// + /// A new instance for mocking. + public static PrivateLinkResourcesWrapper PrivateLinkResourcesWrapper(IEnumerable value = null) + { + value ??= new List(); + + return new PrivateLinkResourcesWrapper(value?.ToList()); + } + /// Initializes a new instance of AppServicePrivateLinkResourceData. /// The id. /// The name. @@ -977,7 +1031,7 @@ public static AppServicePrivateLinkResourceProperties AppServicePrivateLinkResou /// /// Kind of resource. /// A new instance for mocking. - public static AppServicePlanData AppServicePlanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, ExtendedLocation extendedLocation = null, string workerTierName = null, AppServicePlanStatus? status = null, string subscription = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, int? maximumNumberOfWorkers = null, string geoRegion = null, bool? isPerSiteScaling = null, bool? isElasticScaleEnabled = null, int? maximumElasticWorkerCount = null, int? numberOfSites = null, bool? isSpot = null, DateTimeOffset? spotExpireOn = null, DateTimeOffset? freeOfferExpireOn = null, string resourceGroup = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, int? targetWorkerCount = null, int? targetWorkerSizeId = null, ProvisioningState? provisioningState = null, KubeEnvironmentProfile kubeEnvironmentProfile = null, bool? isZoneRedundant = null, string kind = null) + public static AppServicePlanData AppServicePlanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, Resources.Models.ExtendedLocation extendedLocation = null, string workerTierName = null, AppServicePlanStatus? status = null, string subscription = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, int? maximumNumberOfWorkers = null, string geoRegion = null, bool? isPerSiteScaling = null, bool? isElasticScaleEnabled = null, int? maximumElasticWorkerCount = null, int? numberOfSites = null, bool? isSpot = null, DateTimeOffset? spotExpireOn = null, DateTimeOffset? freeOfferExpireOn = null, string resourceGroup = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, int? targetWorkerCount = null, int? targetWorkerSizeId = null, ProvisioningState? provisioningState = null, KubeEnvironmentProfile kubeEnvironmentProfile = null, bool? isZoneRedundant = null, string kind = null) { tags ??= new Dictionary(); @@ -1004,6 +1058,15 @@ public static KubeEnvironmentProfile KubeEnvironmentProfile(ResourceIdentifier i return new KubeEnvironmentProfile(id, name, resourceType); } + /// Initializes a new instance of ExtendedLocation. + /// Name of extended location. + /// Type of extended location. + /// A new instance for mocking. + public static ExtendedLocation ExtendedLocation(string name = null, string extendedLocationType = null) + { + return new ExtendedLocation(name, extendedLocationType); + } + /// Initializes a new instance of WebSiteData. /// The id. /// The name. @@ -1076,7 +1139,7 @@ public static KubeEnvironmentProfile KubeEnvironmentProfile(ResourceIdentifier i /// /// Kind of resource. /// A new instance for mocking. - public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ExtendedLocation extendedLocation = null, string state = null, IEnumerable hostNames = null, string repositorySiteName = null, AppServiceUsageState? usageState = null, bool? isEnabled = null, IEnumerable enabledHostNames = null, WebSiteAvailabilityState? availabilityState = null, IEnumerable hostNameSslStates = null, ResourceIdentifier appServicePlanId = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, DateTimeOffset? lastModifiedTimeUtc = null, SiteConfigProperties siteConfig = null, IEnumerable trafficManagerHostNames = null, bool? isScmSiteAlsoStopped = null, string targetSwapSlot = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, bool? isClientAffinityEnabled = null, bool? isClientCertEnabled = null, ClientCertMode? clientCertMode = null, string clientCertExclusionPaths = null, bool? isHostNameDisabled = null, string customDomainVerificationId = null, string outboundIPAddresses = null, string possibleOutboundIPAddresses = null, int? containerSize = null, int? dailyMemoryTimeQuota = null, DateTimeOffset? suspendOn = null, int? maxNumberOfWorkers = null, CloningInfo cloningInfo = null, string resourceGroup = null, bool? isDefaultContainer = null, string defaultHostName = null, SlotSwapStatus slotSwapStatus = null, bool? isHttpsOnly = null, RedundancyMode? redundancyMode = null, Guid? inProgressOperationId = null, bool? isStorageAccountRequired = null, string keyVaultReferenceIdentity = null, ResourceIdentifier virtualNetworkSubnetId = null, string kind = null) + public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceManager.Models.ManagedServiceIdentity identity = null, Resources.Models.ExtendedLocation extendedLocation = null, string state = null, IEnumerable hostNames = null, string repositorySiteName = null, AppServiceUsageState? usageState = null, bool? isEnabled = null, IEnumerable enabledHostNames = null, WebSiteAvailabilityState? availabilityState = null, IEnumerable hostNameSslStates = null, ResourceIdentifier appServicePlanId = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, DateTimeOffset? lastModifiedTimeUtc = null, SiteConfigProperties siteConfig = null, IEnumerable trafficManagerHostNames = null, bool? isScmSiteAlsoStopped = null, string targetSwapSlot = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, bool? isClientAffinityEnabled = null, bool? isClientCertEnabled = null, ClientCertMode? clientCertMode = null, string clientCertExclusionPaths = null, bool? isHostNameDisabled = null, string customDomainVerificationId = null, string outboundIPAddresses = null, string possibleOutboundIPAddresses = null, int? containerSize = null, int? dailyMemoryTimeQuota = null, DateTimeOffset? suspendOn = null, int? maxNumberOfWorkers = null, CloningInfo cloningInfo = null, string resourceGroup = null, bool? isDefaultContainer = null, string defaultHostName = null, SlotSwapStatus slotSwapStatus = null, bool? isHttpsOnly = null, RedundancyMode? redundancyMode = null, Guid? inProgressOperationId = null, bool? isStorageAccountRequired = null, string keyVaultReferenceIdentity = null, ResourceIdentifier virtualNetworkSubnetId = null, string kind = null) { tags ??= new Dictionary(); hostNames ??= new List(); @@ -1239,6 +1302,28 @@ public static SlotSwapStatus SlotSwapStatus(DateTimeOffset? timestampUtc = null, return new SlotSwapStatus(timestampUtc, sourceSlotName, destinationSlotName); } + /// Initializes a new instance of ManagedServiceIdentity. + /// Type of managed service identity. + /// Tenant of managed service identity. + /// Principal Id of managed service identity. + /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + /// A new instance for mocking. + public static ManagedServiceIdentity ManagedServiceIdentity(ManagedServiceIdentityType? identityType = null, Guid? tenantId = null, string principalId = null, IDictionary userAssignedIdentities = null) + { + userAssignedIdentities ??= new Dictionary(); + + return new ManagedServiceIdentity(identityType, tenantId, principalId, userAssignedIdentities); + } + + /// Initializes a new instance of UserAssignedIdentity. + /// Principal Id of user assigned identity. + /// Client Id of user assigned identity. + /// A new instance for mocking. + public static UserAssignedIdentity UserAssignedIdentity(string principalId = null, string clientId = null) + { + return new UserAssignedIdentity(principalId, clientId); + } + /// Initializes a new instance of CsmUsageQuota. /// Units of measurement for the quota resource. /// Next reset time for the resource counter. @@ -1660,7 +1745,7 @@ public static AppSnapshot AppSnapshot(ResourceIdentifier id = null, string name /// /// Kind of resource. /// A new instance for mocking. - public static KubeEnvironmentData KubeEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedLocation extendedLocation = null, KubeEnvironmentProvisioningState? provisioningState = null, string deploymentErrors = null, bool? isInternalLoadBalancerEnabled = null, string defaultDomain = null, string staticIP = null, ArcConfiguration arcConfiguration = null, AppLogsConfiguration appLogsConfiguration = null, ResourceIdentifier aksResourceId = null, string kind = null) + public static KubeEnvironmentData KubeEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, Resources.Models.ExtendedLocation extendedLocation = null, KubeEnvironmentProvisioningState? provisioningState = null, string deploymentErrors = null, bool? isInternalLoadBalancerEnabled = null, string defaultDomain = null, string staticIP = null, ArcConfiguration arcConfiguration = null, AppLogsConfiguration appLogsConfiguration = null, ResourceIdentifier aksResourceId = null, string kind = null) { tags ??= new Dictionary(); @@ -2284,7 +2369,7 @@ public static StaticSitesWorkflowPreview StaticSitesWorkflowPreview(ResourceIden /// The provider that submitted the last deployment to the primary environment of the static site. /// Kind of resource. /// A new instance for mocking. - public static StaticSiteData StaticSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, ManagedServiceIdentity identity = null, string defaultHostname = null, Uri repositoryUri = null, string branch = null, IEnumerable customDomains = null, string repositoryToken = null, StaticSiteBuildProperties buildProperties = null, IEnumerable privateEndpointConnections = null, StagingEnvironmentPolicy? stagingEnvironmentPolicy = null, bool? allowConfigFileUpdates = null, StaticSiteTemplate templateProperties = null, string contentDistributionEndpoint = null, string keyVaultReferenceIdentity = null, IEnumerable userProvidedFunctionApps = null, string provider = null, string kind = null) + public static StaticSiteData StaticSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, ResourceManager.Models.ManagedServiceIdentity identity = null, string defaultHostname = null, Uri repositoryUri = null, string branch = null, IEnumerable customDomains = null, string repositoryToken = null, StaticSiteBuildProperties buildProperties = null, IEnumerable privateEndpointConnections = null, StagingEnvironmentPolicy? stagingEnvironmentPolicy = null, bool? allowConfigFileUpdates = null, StaticSiteTemplate templateProperties = null, string contentDistributionEndpoint = null, string keyVaultReferenceIdentity = null, IEnumerable userProvidedFunctionApps = null, string provider = null, string kind = null) { tags ??= new Dictionary(); customDomains ??= new List(); @@ -2309,7 +2394,7 @@ public static StaticSiteData StaticSiteData(ResourceIdentifier id = null, string /// MSI resource. /// Logical Availability Zones the service is hosted in. /// A new instance for mocking. - public static ResponseMessageEnvelopeRemotePrivateEndpointConnection ResponseMessageEnvelopeRemotePrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IReadOnlyDictionary tags = null, AppServiceArmPlan plan = null, RemotePrivateEndpointConnection properties = null, AppServiceSkuDescription sku = null, string status = null, ResponseError error = null, ManagedServiceIdentity identity = null, IEnumerable zones = null) + public static ResponseMessageEnvelopeRemotePrivateEndpointConnection ResponseMessageEnvelopeRemotePrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IReadOnlyDictionary tags = null, AppServiceArmPlan plan = null, RemotePrivateEndpointConnection properties = null, AppServiceSkuDescription sku = null, string status = null, ResponseError error = null, ResourceManager.Models.ManagedServiceIdentity identity = null, IEnumerable zones = null) { tags ??= new Dictionary(); zones ??= new List(); @@ -2635,7 +2720,7 @@ public static StaticSiteResetContent StaticSiteResetContent(ResourceIdentifier i /// /// Kind of resource. /// A new instance for mocking. - public static SitePatchInfo SitePatchInfo(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedServiceIdentity identity = null, string state = null, IEnumerable hostNames = null, string repositorySiteName = null, AppServiceUsageState? usageState = null, bool? isEnabled = null, IEnumerable enabledHostNames = null, WebSiteAvailabilityState? availabilityState = null, IEnumerable hostNameSslStates = null, ResourceIdentifier serverFarmId = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, DateTimeOffset? lastModifiedOn = null, SiteConfigProperties siteConfig = null, IEnumerable trafficManagerHostNames = null, bool? isScmSiteAlsoStopped = null, string targetSwapSlot = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, bool? isClientAffinityEnabled = null, bool? isClientCertEnabled = null, ClientCertMode? clientCertMode = null, string clientCertExclusionPaths = null, bool? isHostNameDisabled = null, string customDomainVerificationId = null, string outboundIPAddresses = null, string possibleOutboundIPAddresses = null, int? containerSize = null, int? dailyMemoryTimeQuota = null, DateTimeOffset? suspendOn = null, int? maxNumberOfWorkers = null, CloningInfo cloningInfo = null, string resourceGroup = null, bool? isDefaultContainer = null, string defaultHostName = null, SlotSwapStatus slotSwapStatus = null, bool? isHttpsOnly = null, RedundancyMode? redundancyMode = null, Guid? inProgressOperationId = null, bool? isStorageAccountRequired = null, string keyVaultReferenceIdentity = null, ResourceIdentifier virtualNetworkSubnetId = null, string kind = null) + public static SitePatchInfo SitePatchInfo(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceManager.Models.ManagedServiceIdentity identity = null, string state = null, IEnumerable hostNames = null, string repositorySiteName = null, AppServiceUsageState? usageState = null, bool? isEnabled = null, IEnumerable enabledHostNames = null, WebSiteAvailabilityState? availabilityState = null, IEnumerable hostNameSslStates = null, ResourceIdentifier serverFarmId = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, DateTimeOffset? lastModifiedOn = null, SiteConfigProperties siteConfig = null, IEnumerable trafficManagerHostNames = null, bool? isScmSiteAlsoStopped = null, string targetSwapSlot = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, bool? isClientAffinityEnabled = null, bool? isClientCertEnabled = null, ClientCertMode? clientCertMode = null, string clientCertExclusionPaths = null, bool? isHostNameDisabled = null, string customDomainVerificationId = null, string outboundIPAddresses = null, string possibleOutboundIPAddresses = null, int? containerSize = null, int? dailyMemoryTimeQuota = null, DateTimeOffset? suspendOn = null, int? maxNumberOfWorkers = null, CloningInfo cloningInfo = null, string resourceGroup = null, bool? isDefaultContainer = null, string defaultHostName = null, SlotSwapStatus slotSwapStatus = null, bool? isHttpsOnly = null, RedundancyMode? redundancyMode = null, Guid? inProgressOperationId = null, bool? isStorageAccountRequired = null, string keyVaultReferenceIdentity = null, ResourceIdentifier virtualNetworkSubnetId = null, string kind = null) { hostNames ??= new List(); enabledHostNames ??= new List(); @@ -3099,7 +3184,7 @@ public static AzureStoragePropertyDictionary AzureStoragePropertyDictionary(Reso /// /// Kind of resource. /// A new instance for mocking. - public static ApiKeyVaultReferenceData ApiKeyVaultReferenceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string reference = null, ResolveStatus? status = null, string vaultName = null, string secretName = null, string secretVersion = null, ManagedServiceIdentity identity = null, string details = null, ConfigReferenceSource? source = null, string activeVersion = null, string kind = null) + public static ApiKeyVaultReferenceData ApiKeyVaultReferenceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string reference = null, ResolveStatus? status = null, string vaultName = null, string secretName = null, string secretVersion = null, ResourceManager.Models.ManagedServiceIdentity identity = null, string details = null, ConfigReferenceSource? source = null, string activeVersion = null, string kind = null) { return new ApiKeyVaultReferenceData(id, name, resourceType, systemData, reference, status, vaultName, secretName, secretVersion, identity, details, source, activeVersion, kind); } @@ -3917,5 +4002,20 @@ public static WebJobData WebJobData(ResourceIdentifier id = null, string name = return new WebJobData(id, name, resourceType, systemData, runCommand, uri, extraInfoUri, webJobType, error, isUsingSdk, settings, kind); } + + /// Initializes a new instance of StaticSiteUserProvidedFunctionAppProperties. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource id of the function app registered with the static site. + /// The region of the function app registered with the static site. + /// The date and time on which the function app was registered with the static site. + /// Kind of resource. + /// A new instance for mocking. + public static StaticSiteUserProvidedFunctionAppProperties StaticSiteUserProvidedFunctionAppProperties(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string functionAppResourceId = null, string functionAppRegion = null, DateTimeOffset? createdOn = null, string kind = null) + { + return new StaticSiteUserProvidedFunctionAppProperties(id, name, resourceType, systemData, functionAppResourceId, functionAppRegion, createdOn, kind); + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs index ffcc2b1480c1..c0ea55bdfb21 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs @@ -50,7 +50,7 @@ public KubeEnvironmentData(AzureLocation location) : base(location) /// /// /// Kind of resource. - internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedLocation extendedLocation, KubeEnvironmentProvisioningState? provisioningState, string deploymentErrors, bool? isInternalLoadBalancerEnabled, string defaultDomain, string staticIP, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, ResourceIdentifier aksResourceId, string kind) : base(id, name, resourceType, systemData, tags, location) + internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, Resources.Models.ExtendedLocation extendedLocation, KubeEnvironmentProvisioningState? provisioningState, string deploymentErrors, bool? isInternalLoadBalancerEnabled, string defaultDomain, string staticIP, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, ResourceIdentifier aksResourceId, string kind) : base(id, name, resourceType, systemData, tags, location) { ExtendedLocation = extendedLocation; ProvisioningState = provisioningState; @@ -65,7 +65,7 @@ internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType re } /// Extended Location. - public ExtendedLocation ExtendedLocation { get; set; } + public Resources.Models.ExtendedLocation ExtendedLocation { get; set; } /// Provisioning state of the Kubernetes Environment. public KubeEnvironmentProvisioningState? ProvisioningState { get; } /// Any errors that occurred during deployment or deployment validation. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs index 30158f5a74aa..220d08a58941 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class AllowedAudiencesValidation : IUtf8JsonSerializable + public partial class AllowedAudiencesValidation : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs index c6e64c73463e..ccdf100f58bb 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the Allowed Audiences validation flow. - internal partial class AllowedAudiencesValidation + public partial class AllowedAudiencesValidation { /// Initializes a new instance of AllowedAudiencesValidation. public AllowedAudiencesValidation() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiKeyVaultReferenceData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiKeyVaultReferenceData.Serialization.cs index 20901f2b9083..195608493c9b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiKeyVaultReferenceData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiKeyVaultReferenceData.Serialization.cs @@ -89,7 +89,7 @@ internal static ApiKeyVaultReferenceData DeserializeApiKeyVaultReferenceData(Jso Optional vaultName = default; Optional secretName = default; Optional secretVersion = default; - Optional identityType = default; + Optional identityType = default; Optional details = default; Optional source = default; Optional activeVersion = default; @@ -168,7 +168,7 @@ internal static ApiKeyVaultReferenceData DeserializeApiKeyVaultReferenceData(Jso { continue; } - identityType = JsonSerializer.Deserialize(property0.Value.GetRawText()); + identityType = JsonSerializer.Deserialize(property0.Value.GetRawText()); continue; } if (property0.NameEquals("details"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs index 0e1286786ed5..2c50b8dc2bd6 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class ApiManagementConfig : IUtf8JsonSerializable + public partial class ApiManagementConfig : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs index 77f409c619be..2483039c3a9f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Azure API management (APIM) configuration linked to the app. - internal partial class ApiManagementConfig + public partial class ApiManagementConfig { /// Initializes a new instance of ApiManagementConfig. public ApiManagementConfig() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs index 2af7e3e68f79..8f627b93cacf 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class AppServiceApiDefinitionInfo : IUtf8JsonSerializable + public partial class AppServiceApiDefinitionInfo : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs index ad93cad6482e..72307ace8764 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Information about the formal API definition for the app. - internal partial class AppServiceApiDefinitionInfo + public partial class AppServiceApiDefinitionInfo { /// Initializes a new instance of AppServiceApiDefinitionInfo. public AppServiceApiDefinitionInfo() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs index c862c5aac6e0..7bebe161fab8 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class AppServiceBlobStorageTokenStore : IUtf8JsonSerializable + public partial class AppServiceBlobStorageTokenStore : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs index 84fb25b00bec..a52339e9c312 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the storage of the tokens if blob storage is used. - internal partial class AppServiceBlobStorageTokenStore + public partial class AppServiceBlobStorageTokenStore { /// Initializes a new instance of AppServiceBlobStorageTokenStore. public AppServiceBlobStorageTokenStore() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs new file mode 100644 index 000000000000..884fba01ba97 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppService.Models +{ + /// Github access token for Appservice CLI github integration. + internal partial class AppServiceGithubToken + { + /// Initializes a new instance of AppServiceGithubToken. + internal AppServiceGithubToken() + { + } + + /// Github access token for Appservice CLI github integration. + public string AccessToken { get; } + /// Scope of the github access token. + public string Scope { get; } + /// token type. + public string TokenType { get; } + /// True if valid github token received, False otherwise. + public bool? GotToken { get; } + /// Error message if unable to get token. + public string ErrorMessage { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs index 588328d36489..e074696142dd 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class AppServiceHttpSettingsRoutes : IUtf8JsonSerializable + public partial class AppServiceHttpSettingsRoutes : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs index a361d22d39e0..d941c4314b96 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the paths HTTP requests. - internal partial class AppServiceHttpSettingsRoutes + public partial class AppServiceHttpSettingsRoutes { /// Initializes a new instance of AppServiceHttpSettingsRoutes. public AppServiceHttpSettingsRoutes() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs index ca07066cd9c1..1d17bcc10789 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs @@ -164,7 +164,7 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele return null; } Optional sku = default; - Optional extendedLocation = default; + Optional extendedLocation = default; Optional kind = default; Optional> tags = default; AzureLocation location = default; @@ -211,7 +211,7 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele { continue; } - extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); + extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("kind"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs new file mode 100644 index 000000000000..4e6380d8170a --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class AppServiceResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WriteEndObject(); + } + + internal static AppServiceResource DeserializeAppServiceResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + } + return new AppServiceResource(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, kind.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs new file mode 100644 index 000000000000..996824d0aea5 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Azure resource. This resource is tracked in Azure Resource Manager. + public partial class AppServiceResource : TrackedResourceData + { + /// Initializes a new instance of AppServiceResource. + /// The location. + public AppServiceResource(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of AppServiceResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Kind of resource. + internal AppServiceResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string kind) : base(id, name, resourceType, systemData, tags, location) + { + Kind = kind; + } + + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs index 13c12cb31e6f..f9bf0f33452e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class AppServiceStaticWebAppsRegistration : IUtf8JsonSerializable + public partial class AppServiceStaticWebAppsRegistration : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs index 0737bac19d5b..69de99c5cc38 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the registration for the Azure Static Web Apps provider. - internal partial class AppServiceStaticWebAppsRegistration + public partial class AppServiceStaticWebAppsRegistration { /// Initializes a new instance of AppServiceStaticWebAppsRegistration. public AppServiceStaticWebAppsRegistration() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs new file mode 100644 index 000000000000..d8467125ce9c --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Appservice Github token request content. + internal partial class AppserviceGithubTokenRequest + { + /// Initializes a new instance of AppserviceGithubTokenRequest. + /// Code string to exchange for Github Access token. + /// State string used for verification. + /// or is null. + internal AppserviceGithubTokenRequest(string code, string state) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(state, nameof(state)); + + Code = code; + State = state; + } + + /// Code string to exchange for Github Access token. + public string Code { get; } + /// State string used for verification. + public string State { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs new file mode 100644 index 000000000000..20a3be28f2a0 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class ArmIdWrapper : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static ArmIdWrapper DeserializeArmIdWrapper(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + } + return new ArmIdWrapper(id.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs new file mode 100644 index 000000000000..c2d7c801d9f6 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppService.Models +{ + /// A wrapper for an ARM resource id. + public partial class ArmIdWrapper + { + /// Initializes a new instance of ArmIdWrapper. + public ArmIdWrapper() + { + } + + /// Initializes a new instance of ArmIdWrapper. + /// + internal ArmIdWrapper(string id) + { + Id = id; + } + + /// Gets the id. + public string Id { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs new file mode 100644 index 000000000000..74a35252b24b --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Object with a list of the resources that need to be moved and the resource group they should be moved to. + internal partial class CsmMoveResourceEnvelope + { + /// Initializes a new instance of CsmMoveResourceEnvelope. + internal CsmMoveResourceEnvelope() + { + Resources = new ChangeTrackingList(); + } + + /// Gets the target resource group. + public string TargetResourceGroup { get; } + /// Gets the resources. + public IReadOnlyList Resources { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs index 9560793ea487..19fffca6cfe9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class CsmOperationDescriptionProperties + public partial class CsmOperationDescriptionProperties { internal static CsmOperationDescriptionProperties DeserializeCsmOperationDescriptionProperties(JsonElement element) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs index 81255913015f..98ef73176446 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Properties available for a Microsoft.Web resource provider operation. - internal partial class CsmOperationDescriptionProperties + public partial class CsmOperationDescriptionProperties { /// Initializes a new instance of CsmOperationDescriptionProperties. internal CsmOperationDescriptionProperties() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs new file mode 100644 index 000000000000..0534d9e36e80 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Xml.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + internal partial class DefaultErrorResponse + { + internal static DefaultErrorResponse DeserializeDefaultErrorResponse(XElement element) + { + DefaultErrorResponseError error = default; + if (element.Element("error") is XElement errorElement) + { + error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(errorElement); + } + return new DefaultErrorResponse(error); + } + + internal static DefaultErrorResponse DeserializeDefaultErrorResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(property.Value); + continue; + } + } + return new DefaultErrorResponse(error.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs new file mode 100644 index 000000000000..a26bc7f468a9 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppService.Models +{ + /// App Service error response. + internal partial class DefaultErrorResponse + { + /// Initializes a new instance of DefaultErrorResponse. + internal DefaultErrorResponse() + { + } + + /// Initializes a new instance of DefaultErrorResponse. + /// Error model. + internal DefaultErrorResponse(DefaultErrorResponseError error) + { + Error = error; + } + + /// Error model. + public DefaultErrorResponseError Error { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs new file mode 100644 index 000000000000..f3881a505f62 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using System.Xml.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + internal partial class DefaultErrorResponseError + { + internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(XElement element) + { + string code = default; + string message = default; + string target = default; + string innererror = default; + IReadOnlyList details = default; + if (element.Element("code") is XElement codeElement) + { + code = (string)codeElement; + } + if (element.Element("message") is XElement messageElement) + { + message = (string)messageElement; + } + if (element.Element("target") is XElement targetElement) + { + target = (string)targetElement; + } + if (element.Element("innererror") is XElement innererrorElement) + { + innererror = (string)innererrorElement; + } + var array = new List(); + foreach (var e in element.Elements("DefaultErrorResponseErrorDetailsItem")) + { + array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(e)); + } + details = array; + return new DefaultErrorResponseError(code, message, target, details, innererror); + } + + internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional target = default; + Optional> details = default; + Optional innererror = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(item)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + innererror = property.Value.GetString(); + continue; + } + } + return new DefaultErrorResponseError(code.Value, message.Value, target.Value, Optional.ToList(details), innererror.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs new file mode 100644 index 000000000000..8e4255410218 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Error model. + internal partial class DefaultErrorResponseError + { + /// Initializes a new instance of DefaultErrorResponseError. + internal DefaultErrorResponseError() + { + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of DefaultErrorResponseError. + /// Standardized string to programmatically identify the error. + /// Detailed error description and debugging information. + /// Detailed error description and debugging information. + /// + /// More information to debug error. + internal DefaultErrorResponseError(string code, string message, string target, IReadOnlyList details, string innererror) + { + Code = code; + Message = message; + Target = target; + Details = details; + Innererror = innererror; + } + + /// Standardized string to programmatically identify the error. + public string Code { get; } + /// Detailed error description and debugging information. + public string Message { get; } + /// Detailed error description and debugging information. + public string Target { get; } + /// Gets the details. + public IReadOnlyList Details { get; } + /// More information to debug error. + public string Innererror { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs new file mode 100644 index 000000000000..a22348eec094 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Xml.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + internal partial class DefaultErrorResponseErrorDetailsItem + { + internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(XElement element) + { + string code = default; + string message = default; + string target = default; + if (element.Element("code") is XElement codeElement) + { + code = (string)codeElement; + } + if (element.Element("message") is XElement messageElement) + { + message = (string)messageElement; + } + if (element.Element("target") is XElement targetElement) + { + target = (string)targetElement; + } + return new DefaultErrorResponseErrorDetailsItem(code, message, target); + } + + internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional target = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + } + return new DefaultErrorResponseErrorDetailsItem(code.Value, message.Value, target.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs new file mode 100644 index 000000000000..d8c3ced0f26f --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppService.Models +{ + /// Detailed errors. + internal partial class DefaultErrorResponseErrorDetailsItem + { + /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. + internal DefaultErrorResponseErrorDetailsItem() + { + } + + /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. + /// Standardized string to programmatically identify the error. + /// Detailed error description and debugging information. + /// Detailed error description and debugging information. + internal DefaultErrorResponseErrorDetailsItem(string code, string message, string target) + { + Code = code; + Message = message; + Target = target; + } + + /// Standardized string to programmatically identify the error. + public string Code { get; } + /// Detailed error description and debugging information. + public string Message { get; } + /// Detailed error description and debugging information. + public string Target { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs index 7d2ccea93c04..5c59f4bdfaba 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class DetectorMetadata : IUtf8JsonSerializable + public partial class DetectorMetadata : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs index 244890ec62b2..e81e21ab378b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The DetectorMetadata. - internal partial class DetectorMetadata + public partial class DetectorMetadata { /// Initializes a new instance of DetectorMetadata. public DetectorMetadata() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs new file mode 100644 index 000000000000..ab302bcfb1f7 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class ExtendedLocation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WriteEndObject(); + } + + internal static ExtendedLocation DeserializeExtendedLocation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + } + return new ExtendedLocation(name.Value, type.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs new file mode 100644 index 000000000000..1d18f6691c84 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppService.Models +{ + /// Extended Location. + public partial class ExtendedLocation + { + /// Initializes a new instance of ExtendedLocation. + public ExtendedLocation() + { + } + + /// Initializes a new instance of ExtendedLocation. + /// Name of extended location. + /// Type of extended location. + internal ExtendedLocation(string name, string extendedLocationType) + { + Name = name; + ExtendedLocationType = extendedLocationType; + } + + /// Name of extended location. + public string Name { get; set; } + /// Type of extended location. + public string ExtendedLocationType { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs index f554eac011bf..25e558074e87 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class FileSystemTokenStore : IUtf8JsonSerializable + public partial class FileSystemTokenStore : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs index 671bb4e0379a..0bde28a2db50 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the storage of the tokens if a file system is used. - internal partial class FileSystemTokenStore + public partial class FileSystemTokenStore { /// Initializes a new instance of FileSystemTokenStore. public FileSystemTokenStore() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs index 5c4b6288df23..08d1474e16b0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class FrontEndConfiguration : IUtf8JsonSerializable + public partial class FrontEndConfiguration : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs index 1573d681dd82..3c96c797835e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The FrontEndConfiguration. - internal partial class FrontEndConfiguration + public partial class FrontEndConfiguration { /// Initializes a new instance of FrontEndConfiguration. public FrontEndConfiguration() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/KubeEnvironmentData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/KubeEnvironmentData.Serialization.cs index 433339638f41..46b04d578904 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/KubeEnvironmentData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/KubeEnvironmentData.Serialization.cs @@ -79,7 +79,7 @@ internal static KubeEnvironmentData DeserializeKubeEnvironmentData(JsonElement e { return null; } - Optional extendedLocation = default; + Optional extendedLocation = default; Optional kind = default; Optional> tags = default; AzureLocation location = default; @@ -103,7 +103,7 @@ internal static KubeEnvironmentData DeserializeKubeEnvironmentData(JsonElement e { continue; } - extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); + extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("kind"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs index 6dbf5597dbd8..772809f8b4f9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class LoginRoutes : IUtf8JsonSerializable + public partial class LoginRoutes : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs index fd8d3d8fc1b9..e1d2d591571f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The routes that specify the endpoints used for login and logout requests. - internal partial class LoginRoutes + public partial class LoginRoutes { /// Initializes a new instance of LoginRoutes. public LoginRoutes() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs index 87d33a0f85a9..9f32c524be1b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class LoginScopes : IUtf8JsonSerializable + public partial class LoginScopes : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs index 78e413fd0929..fd9e1b28cce9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the login flow, including the scopes that should be requested. - internal partial class LoginScopes + public partial class LoginScopes { /// Initializes a new instance of LoginScopes. public LoginScopes() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs new file mode 100644 index 000000000000..7ed398bcf0e0 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class ManagedServiceIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(IdentityType.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional type = default; + Optional tenantId = default; + Optional principalId = default; + Optional> userAssignedIdentities = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString().ToManagedServiceIdentityType(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("principalId"u8)) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + } + return new ManagedServiceIdentity(Optional.ToNullable(type), Optional.ToNullable(tenantId), principalId.Value, Optional.ToDictionary(userAssignedIdentities)); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs new file mode 100644 index 000000000000..abe36248138d --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Managed service identity. + public partial class ManagedServiceIdentity + { + /// Initializes a new instance of ManagedServiceIdentity. + public ManagedServiceIdentity() + { + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of ManagedServiceIdentity. + /// Type of managed service identity. + /// Tenant of managed service identity. + /// Principal Id of managed service identity. + /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + internal ManagedServiceIdentity(ManagedServiceIdentityType? identityType, Guid? tenantId, string principalId, IDictionary userAssignedIdentities) + { + IdentityType = identityType; + TenantId = tenantId; + PrincipalId = principalId; + UserAssignedIdentities = userAssignedIdentities; + } + + /// Type of managed service identity. + public ManagedServiceIdentityType? IdentityType { get; set; } + /// Tenant of managed service identity. + public Guid? TenantId { get; } + /// Principal Id of managed service identity. + public string PrincipalId { get; } + /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs new file mode 100644 index 000000000000..234ab35667fd --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.AppService.Models +{ + internal static partial class ManagedServiceIdentityTypeExtensions + { + public static string ToSerialString(this ManagedServiceIdentityType value) => value switch + { + ManagedServiceIdentityType.None => "None", + ManagedServiceIdentityType.SystemAssigned => "SystemAssigned", + ManagedServiceIdentityType.UserAssigned => "UserAssigned", + ManagedServiceIdentityType.SystemAssignedUserAssigned => "SystemAssigned, UserAssigned", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value.") + }; + + public static ManagedServiceIdentityType ToManagedServiceIdentityType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return ManagedServiceIdentityType.None; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "SystemAssigned")) return ManagedServiceIdentityType.SystemAssigned; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "UserAssigned")) return ManagedServiceIdentityType.UserAssigned; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "SystemAssigned, UserAssigned")) return ManagedServiceIdentityType.SystemAssignedUserAssigned; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value."); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..5f15c804228e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppService.Models +{ + /// Type of managed service identity. + public enum ManagedServiceIdentityType + { + /// None. + None, + /// SystemAssigned. + SystemAssigned, + /// UserAssigned. + UserAssigned, + /// SystemAssigned, UserAssigned. + SystemAssignedUserAssigned + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs index a3116bbe43c9..6aa179a8cc19 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class PrivateLinkResourcesWrapper + public partial class PrivateLinkResourcesWrapper { internal static PrivateLinkResourcesWrapper DeserializePrivateLinkResourcesWrapper(JsonElement element) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs index 9de27492a6d1..39ce5a16b59b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Wrapper for a collection of private link resources. - internal partial class PrivateLinkResourcesWrapper + public partial class PrivateLinkResourcesWrapper { /// Initializes a new instance of PrivateLinkResourcesWrapper. /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs new file mode 100644 index 000000000000..a8627389ddc2 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class ProxyOnlyResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + writer.WriteEndObject(); + } + + internal static ProxyOnlyResource DeserializeProxyOnlyResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + } + return new ProxyOnlyResource(id, name, type, systemData.Value, kind.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs new file mode 100644 index 000000000000..bbbc5306e517 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + public partial class ProxyOnlyResource : ResourceData + { + /// Initializes a new instance of ProxyOnlyResource. + public ProxyOnlyResource() + { + } + + /// Initializes a new instance of ProxyOnlyResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Kind of resource. + internal ProxyOnlyResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kind) : base(id, name, resourceType, systemData) + { + Kind = kind; + } + + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs index 36639431eaa9..10b4fc835bbc 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs @@ -28,7 +28,7 @@ internal static ResponseMessageEnvelopeRemotePrivateEndpointConnection Deseriali Optional sku = default; Optional status = default; Optional error = default; - Optional identity = default; + Optional identity = default; Optional> zones = default; ResourceIdentifier id = default; string name = default; @@ -106,7 +106,7 @@ internal static ResponseMessageEnvelopeRemotePrivateEndpointConnection Deseriali { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("zones"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs index e4bec42d0545..0f73c24e5a45 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs @@ -36,7 +36,7 @@ internal ResponseMessageEnvelopeRemotePrivateEndpointConnection() /// Azure-AsyncOperation Error info. /// MSI resource. /// Logical Availability Zones the service is hosted in. - internal ResponseMessageEnvelopeRemotePrivateEndpointConnection(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IReadOnlyDictionary tags, AppServiceArmPlan plan, RemotePrivateEndpointConnection properties, AppServiceSkuDescription sku, string status, ResponseError error, ManagedServiceIdentity identity, IReadOnlyList zones) : base(id, name, resourceType, systemData) + internal ResponseMessageEnvelopeRemotePrivateEndpointConnection(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IReadOnlyDictionary tags, AppServiceArmPlan plan, RemotePrivateEndpointConnection properties, AppServiceSkuDescription sku, string status, ResponseError error, ResourceManager.Models.ManagedServiceIdentity identity, IReadOnlyList zones) : base(id, name, resourceType, systemData) { Location = location; Tags = tags; @@ -64,7 +64,7 @@ internal ResponseMessageEnvelopeRemotePrivateEndpointConnection(ResourceIdentifi /// Azure-AsyncOperation Error info. public ResponseError Error { get; } /// MSI resource. - public ManagedServiceIdentity Identity { get; } + public ResourceManager.Models.ManagedServiceIdentity Identity { get; } /// Logical Availability Zones the service is hosted in. public IReadOnlyList Zones { get; } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs index 51cd084e0c7c..5ab1c8e5eb96 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class RoutingRuleExperiments : IUtf8JsonSerializable + public partial class RoutingRuleExperiments : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs index 69f2ac624f8c..4b1773d49db3 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Routing rules in production experiments. - internal partial class RoutingRuleExperiments + public partial class RoutingRuleExperiments { /// Initializes a new instance of RoutingRuleExperiments. public RoutingRuleExperiments() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.Serialization.cs index ae2a71a17ea1..26be8b878bc8 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.Serialization.cs @@ -160,7 +160,7 @@ internal static SitePatchInfo DeserializeSitePatchInfo(JsonElement element) { return null; } - Optional identity = default; + Optional identity = default; Optional kind = default; ResourceIdentifier id = default; string name = default; @@ -215,7 +215,7 @@ internal static SitePatchInfo DeserializeSitePatchInfo(JsonElement element) { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("kind"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.cs index aa2e0732cbf5..eeac0b2c8e45 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SitePatchInfo.cs @@ -92,7 +92,7 @@ public SitePatchInfo() /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} /// /// Kind of resource. - internal SitePatchInfo(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ManagedServiceIdentity identity, string state, IReadOnlyList hostNames, string repositorySiteName, AppServiceUsageState? usageState, bool? isEnabled, IReadOnlyList enabledHostNames, WebSiteAvailabilityState? availabilityState, IList hostNameSslStates, ResourceIdentifier serverFarmId, bool? isReserved, bool? isXenon, bool? isHyperV, DateTimeOffset? lastModifiedOn, SiteConfigProperties siteConfig, IReadOnlyList trafficManagerHostNames, bool? isScmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? isClientAffinityEnabled, bool? isClientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? isHostNameDisabled, string customDomainVerificationId, string outboundIPAddresses, string possibleOutboundIPAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendOn, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? isHttpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? isStorageAccountRequired, string keyVaultReferenceIdentity, ResourceIdentifier virtualNetworkSubnetId, string kind) : base(id, name, resourceType, systemData) + internal SitePatchInfo(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceManager.Models.ManagedServiceIdentity identity, string state, IReadOnlyList hostNames, string repositorySiteName, AppServiceUsageState? usageState, bool? isEnabled, IReadOnlyList enabledHostNames, WebSiteAvailabilityState? availabilityState, IList hostNameSslStates, ResourceIdentifier serverFarmId, bool? isReserved, bool? isXenon, bool? isHyperV, DateTimeOffset? lastModifiedOn, SiteConfigProperties siteConfig, IReadOnlyList trafficManagerHostNames, bool? isScmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? isClientAffinityEnabled, bool? isClientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? isHostNameDisabled, string customDomainVerificationId, string outboundIPAddresses, string possibleOutboundIPAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendOn, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? isHttpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? isStorageAccountRequired, string keyVaultReferenceIdentity, ResourceIdentifier virtualNetworkSubnetId, string kind) : base(id, name, resourceType, systemData) { Identity = identity; State = state; @@ -140,7 +140,7 @@ internal SitePatchInfo(ResourceIdentifier id, string name, ResourceType resource } /// Managed service identity. - public ManagedServiceIdentity Identity { get; set; } + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } /// Current state of the app. public string State { get; } /// Hostnames associated with the app. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteData.Serialization.cs index f9299c0b11cc..6126a1d6ace4 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteData.Serialization.cs @@ -95,7 +95,7 @@ internal static StaticSiteData DeserializeStaticSiteData(JsonElement element) return null; } Optional sku = default; - Optional identity = default; + Optional identity = default; Optional kind = default; Optional> tags = default; AzureLocation location = default; @@ -134,7 +134,7 @@ internal static StaticSiteData DeserializeStaticSiteData(JsonElement element) { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("kind"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs new file mode 100644 index 000000000000..ce05ba603529 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class StaticSiteUserProvidedFunctionAppProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(FunctionAppResourceId)) + { + writer.WritePropertyName("functionAppResourceId"u8); + writer.WriteStringValue(FunctionAppResourceId); + } + if (Optional.IsDefined(FunctionAppRegion)) + { + writer.WritePropertyName("functionAppRegion"u8); + writer.WriteStringValue(FunctionAppRegion); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteUserProvidedFunctionAppProperties DeserializeStaticSiteUserProvidedFunctionAppProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional functionAppResourceId = default; + Optional functionAppRegion = default; + Optional createdOn = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("functionAppResourceId"u8)) + { + functionAppResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("functionAppRegion"u8)) + { + functionAppRegion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdOn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + } + return new StaticSiteUserProvidedFunctionAppProperties(id, name, type, systemData.Value, functionAppResourceId.Value, functionAppRegion.Value, Optional.ToNullable(createdOn), kind.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs new file mode 100644 index 000000000000..b074a1832368 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + /// A static site user provided function. + public partial class StaticSiteUserProvidedFunctionAppProperties : ResourceData + { + /// Initializes a new instance of StaticSiteUserProvidedFunctionAppProperties. + public StaticSiteUserProvidedFunctionAppProperties() + { + } + + /// Initializes a new instance of StaticSiteUserProvidedFunctionAppProperties. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource id of the function app registered with the static site. + /// The region of the function app registered with the static site. + /// The date and time on which the function app was registered with the static site. + /// Kind of resource. + internal StaticSiteUserProvidedFunctionAppProperties(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string functionAppResourceId, string functionAppRegion, DateTimeOffset? createdOn, string kind) : base(id, name, resourceType, systemData) + { + FunctionAppResourceId = functionAppResourceId; + FunctionAppRegion = functionAppRegion; + CreatedOn = createdOn; + Kind = kind; + } + + /// The resource id of the function app registered with the static site. + public string FunctionAppResourceId { get; set; } + /// The region of the function app registered with the static site. + public string FunctionAppRegion { get; set; } + /// The date and time on which the function app was registered with the static site. + public DateTimeOffset? CreatedOn { get; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs new file mode 100644 index 000000000000..dbbd425ec66d --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class UserAssignedIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static UserAssignedIdentity DeserializeUserAssignedIdentity(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional principalId = default; + Optional clientId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId"u8)) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + } + return new UserAssignedIdentity(principalId.Value, clientId.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..353047be3eab --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppService.Models +{ + /// User Assigned identity. + public partial class UserAssignedIdentity + { + /// Initializes a new instance of UserAssignedIdentity. + public UserAssignedIdentity() + { + } + + /// Initializes a new instance of UserAssignedIdentity. + /// Principal Id of user assigned identity. + /// Client Id of user assigned identity. + internal UserAssignedIdentity(string principalId, string clientId) + { + PrincipalId = principalId; + ClientId = clientId; + } + + /// Principal Id of user assigned identity. + public string PrincipalId { get; } + /// Client Id of user assigned identity. + public string ClientId { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs index e7c33aaa4fc1..26b8425a0996 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - internal partial class WebAppEnabledConfig : IUtf8JsonSerializable + public partial class WebAppEnabledConfig : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs index ecbd8e17e4ff..3cb3f8aabdb4 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Enabled configuration. - internal partial class WebAppEnabledConfig + public partial class WebAppEnabledConfig { /// Initializes a new instance of WebAppEnabledConfig. public WebAppEnabledConfig() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebSiteData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebSiteData.Serialization.cs index b1c9aa74be6e..51a770ae2fe4 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebSiteData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebSiteData.Serialization.cs @@ -194,8 +194,8 @@ internal static WebSiteData DeserializeWebSiteData(JsonElement element) { return null; } - Optional identity = default; - Optional extendedLocation = default; + Optional identity = default; + Optional extendedLocation = default; Optional kind = default; Optional> tags = default; AzureLocation location = default; @@ -252,7 +252,7 @@ internal static WebSiteData DeserializeWebSiteData(JsonElement element) { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("extendedLocation"u8)) @@ -261,7 +261,7 @@ internal static WebSiteData DeserializeWebSiteData(JsonElement element) { continue; } - extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); + extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("kind"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteData.cs index 17b7d3f59ad5..7c9d24cba3c2 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteData.cs @@ -52,7 +52,7 @@ public StaticSiteData(AzureLocation location) : base(location) /// User provided function apps registered with the static site. /// The provider that submitted the last deployment to the primary environment of the static site. /// Kind of resource. - internal StaticSiteData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, ManagedServiceIdentity identity, string defaultHostname, Uri repositoryUri, string branch, IReadOnlyList customDomains, string repositoryToken, StaticSiteBuildProperties buildProperties, IReadOnlyList privateEndpointConnections, StagingEnvironmentPolicy? stagingEnvironmentPolicy, bool? allowConfigFileUpdates, StaticSiteTemplate templateProperties, string contentDistributionEndpoint, string keyVaultReferenceIdentity, IReadOnlyList userProvidedFunctionApps, string provider, string kind) : base(id, name, resourceType, systemData, tags, location) + internal StaticSiteData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, ResourceManager.Models.ManagedServiceIdentity identity, string defaultHostname, Uri repositoryUri, string branch, IReadOnlyList customDomains, string repositoryToken, StaticSiteBuildProperties buildProperties, IReadOnlyList privateEndpointConnections, StagingEnvironmentPolicy? stagingEnvironmentPolicy, bool? allowConfigFileUpdates, StaticSiteTemplate templateProperties, string contentDistributionEndpoint, string keyVaultReferenceIdentity, IReadOnlyList userProvidedFunctionApps, string provider, string kind) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Identity = identity; @@ -76,7 +76,7 @@ internal StaticSiteData(ResourceIdentifier id, string name, ResourceType resourc /// Description of a SKU for a scalable resource. public AppServiceSkuDescription Sku { get; set; } /// Managed service identity. - public ManagedServiceIdentity Identity { get; set; } + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } /// The default autogenerated hostname for the static site. public string DefaultHostname { get; } /// URL for the repository of the static site. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteData.cs index 3617a21a32e4..02edbbd68acc 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteData.cs @@ -101,7 +101,7 @@ public WebSiteData(AzureLocation location) : base(location) /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} /// /// Kind of resource. - internal WebSiteData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, ExtendedLocation extendedLocation, string state, IReadOnlyList hostNames, string repositorySiteName, AppServiceUsageState? usageState, bool? isEnabled, IReadOnlyList enabledHostNames, WebSiteAvailabilityState? availabilityState, IList hostNameSslStates, ResourceIdentifier appServicePlanId, bool? isReserved, bool? isXenon, bool? isHyperV, DateTimeOffset? lastModifiedTimeUtc, SiteConfigProperties siteConfig, IReadOnlyList trafficManagerHostNames, bool? isScmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? isClientAffinityEnabled, bool? isClientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? isHostNameDisabled, string customDomainVerificationId, string outboundIPAddresses, string possibleOutboundIPAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendOn, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? isHttpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? isStorageAccountRequired, string keyVaultReferenceIdentity, ResourceIdentifier virtualNetworkSubnetId, string kind) : base(id, name, resourceType, systemData, tags, location) + internal WebSiteData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ResourceManager.Models.ManagedServiceIdentity identity, Resources.Models.ExtendedLocation extendedLocation, string state, IReadOnlyList hostNames, string repositorySiteName, AppServiceUsageState? usageState, bool? isEnabled, IReadOnlyList enabledHostNames, WebSiteAvailabilityState? availabilityState, IList hostNameSslStates, ResourceIdentifier appServicePlanId, bool? isReserved, bool? isXenon, bool? isHyperV, DateTimeOffset? lastModifiedTimeUtc, SiteConfigProperties siteConfig, IReadOnlyList trafficManagerHostNames, bool? isScmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? isClientAffinityEnabled, bool? isClientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? isHostNameDisabled, string customDomainVerificationId, string outboundIPAddresses, string possibleOutboundIPAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendOn, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? isHttpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? isStorageAccountRequired, string keyVaultReferenceIdentity, ResourceIdentifier virtualNetworkSubnetId, string kind) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; ExtendedLocation = extendedLocation; @@ -150,9 +150,9 @@ internal WebSiteData(ResourceIdentifier id, string name, ResourceType resourceTy } /// Managed service identity. - public ManagedServiceIdentity Identity { get; set; } + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } /// Extended Location. - public ExtendedLocation ExtendedLocation { get; set; } + public Resources.Models.ExtendedLocation ExtendedLocation { get; set; } /// Current state of the app. public string State { get; } /// Hostnames associated with the app. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md index 421aaa55830a..1d2725aa48e0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md +++ b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md @@ -20,6 +20,7 @@ skip-csproj: true modelerfour: flatten-payloads: false deserialize-null-collection-as-null-value: true +unreferenced-types-handling: KeepAll # mgmt-debug: # show-serialized-names: true From 441a9ad8505007295f6eaa3ff8ff449d23ba47c1 Mon Sep 17 00:00:00 2001 From: m-nash Date: Wed, 13 Sep 2023 19:20:09 -0700 Subject: [PATCH 36/45] update api --- ...sourceManager.AppService.netstandard2.0.cs | 194 +++++++++++++++++- 1 file changed, 184 insertions(+), 10 deletions(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs index 771f9238c995..648cbb408b87 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs @@ -597,7 +597,7 @@ protected AppServicePlanCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class AppServicePlanData : Azure.ResourceManager.Models.TrackedResourceData + public partial class AppServicePlanData : Azure.ResourceManager.Models.TrackedResourceData, Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public AppServicePlanData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } @@ -625,6 +625,10 @@ public AppServicePlanData(Azure.Core.AzureLocation location) : base (default(Azu public int? TargetWorkerCount { get { throw null; } set { } } public int? TargetWorkerSizeId { get { throw null; } set { } } public string WorkerTierName { get { throw null; } set { } } + Azure.ResourceManager.AppService.AppServicePlanData Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.AppServicePlanData Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class AppServicePlanHybridConnectionNamespaceRelayCollection : Azure.ResourceManager.ArmCollection { @@ -869,11 +873,15 @@ public ContinuousWebJobData() { } public System.Uri Uri { get { throw null; } set { } } public Azure.ResourceManager.AppService.Models.WebJobType? WebJobType { get { throw null; } set { } } } - public partial class CsmPublishingCredentialsPoliciesEntityData : Azure.ResourceManager.Models.ResourceData + public partial class CsmPublishingCredentialsPoliciesEntityData : Azure.ResourceManager.Models.ResourceData, Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public CsmPublishingCredentialsPoliciesEntityData() { } public bool? Allow { get { throw null; } set { } } public string Kind { get { throw null; } set { } } + Azure.ResourceManager.AppService.CsmPublishingCredentialsPoliciesEntityData Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.CsmPublishingCredentialsPoliciesEntityData Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class DeletedSiteCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -1989,7 +1997,7 @@ protected SiteInstanceResource() { } public virtual System.Threading.Tasks.Task> GetSiteInstanceProcessAsync(string processId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppService.SiteInstanceProcessCollection GetSiteInstanceProcesses() { throw null; } } - public partial class SiteLogsConfigData : Azure.ResourceManager.Models.ResourceData + public partial class SiteLogsConfigData : Azure.ResourceManager.Models.ResourceData, Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public SiteLogsConfigData() { } public Azure.ResourceManager.AppService.Models.ApplicationLogsConfig ApplicationLogs { get { throw null; } set { } } @@ -1997,6 +2005,10 @@ public SiteLogsConfigData() { } public bool? IsDetailedErrorMessagesEnabled { get { throw null; } set { } } public bool? IsFailedRequestsTracingEnabled { get { throw null; } set { } } public string Kind { get { throw null; } set { } } + Azure.ResourceManager.AppService.SiteLogsConfigData Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.SiteLogsConfigData Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class SiteNetworkConfigResource : Azure.ResourceManager.ArmResource { @@ -3275,7 +3287,7 @@ protected WebSiteContinuousWebJobResource() { } public virtual Azure.Response StopContinuousWebJob(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopContinuousWebJobAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public partial class WebSiteData : Azure.ResourceManager.Models.TrackedResourceData + public partial class WebSiteData : Azure.ResourceManager.Models.TrackedResourceData, Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public WebSiteData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } public Azure.Core.ResourceIdentifier AppServicePlanId { get { throw null; } set { } } @@ -3322,6 +3334,10 @@ public WebSiteData(Azure.Core.AzureLocation location) : base (default(Azure.Core public System.Collections.Generic.IReadOnlyList TrafficManagerHostNames { get { throw null; } } public Azure.ResourceManager.AppService.Models.AppServiceUsageState? UsageState { get { throw null; } } public Azure.Core.ResourceIdentifier VirtualNetworkSubnetId { get { throw null; } set { } } + Azure.ResourceManager.AppService.WebSiteData Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.WebSiteData Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class WebSiteExtensionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -4366,6 +4382,11 @@ public AbnormalTimePeriod() { } public System.Collections.Generic.IList Solutions { get { throw null; } } public System.DateTimeOffset? StartOn { get { throw null; } set { } } } + public partial class AllowedAudiencesValidation + { + public AllowedAudiencesValidation() { } + public System.Collections.Generic.IList AllowedAudiences { get { throw null; } } + } public partial class AnalysisDetectorEvidences { public AnalysisDetectorEvidences() { } @@ -4375,6 +4396,11 @@ public AnalysisDetectorEvidences() { } public System.Collections.Generic.IList Metrics { get { throw null; } } public string Source { get { throw null; } set { } } } + public partial class ApiManagementConfig + { + public ApiManagementConfig() { } + public string Id { get { throw null; } set { } } + } public partial class AppCertificatePatch : Azure.ResourceManager.Models.ResourceData { public AppCertificatePatch() { } @@ -4410,12 +4436,16 @@ internal AppInsightsWebAppStackSettings() { } public bool? IsDefaultOff { get { throw null; } } public bool? IsSupported { get { throw null; } } } - public partial class ApplicationLogsConfig + public partial class ApplicationLogsConfig : Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public ApplicationLogsConfig() { } public Azure.ResourceManager.AppService.Models.AppServiceBlobStorageApplicationLogsConfig AzureBlobStorage { get { throw null; } set { } } public Azure.ResourceManager.AppService.Models.AppServiceTableStorageApplicationLogsConfig AzureTableStorage { get { throw null; } set { } } public Azure.ResourceManager.AppService.Models.WebAppLogLevel? FileSystemLevel { get { throw null; } set { } } + Azure.ResourceManager.AppService.Models.ApplicationLogsConfig Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.Models.ApplicationLogsConfig Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class ApplicationStack { @@ -4490,6 +4520,11 @@ public AppServiceAadValidation() { } public Azure.ResourceManager.AppService.Models.DefaultAuthorizationPolicy DefaultAuthorizationPolicy { get { throw null; } set { } } public Azure.ResourceManager.AppService.Models.JwtClaimChecks JwtClaimChecks { get { throw null; } set { } } } + public partial class AppServiceApiDefinitionInfo + { + public AppServiceApiDefinitionInfo() { } + public System.Uri Uri { get { throw null; } set { } } + } public partial class AppServiceAppleProvider { public AppServiceAppleProvider() { } @@ -4537,6 +4572,11 @@ public AppServiceBlobStorageHttpLogsConfig() { } public int? RetentionInDays { get { throw null; } set { } } public System.Uri SasUri { get { throw null; } set { } } } + public partial class AppServiceBlobStorageTokenStore + { + public AppServiceBlobStorageTokenStore() { } + public string SasUrlSettingName { get { throw null; } set { } } + } public partial class AppServiceCertificateDetails { internal AppServiceCertificateDetails() { } @@ -4625,11 +4665,15 @@ public AppServiceConfigurationDictionary() { } public string Kind { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } } - public partial class AppServiceCorsSettings + public partial class AppServiceCorsSettings : Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public AppServiceCorsSettings() { } public System.Collections.Generic.IList AllowedOrigins { get { throw null; } } public bool? IsCredentialsSupported { get { throw null; } set { } } + Azure.ResourceManager.AppService.Models.AppServiceCorsSettings Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.Models.AppServiceCorsSettings Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class AppServiceDatabaseBackupSetting { @@ -4871,11 +4915,15 @@ public enum AppServiceHostType Standard = 0, Repository = 1, } - public partial class AppServiceHttpLogsConfig + public partial class AppServiceHttpLogsConfig : Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public AppServiceHttpLogsConfig() { } public Azure.ResourceManager.AppService.Models.AppServiceBlobStorageHttpLogsConfig AzureBlobStorage { get { throw null; } set { } } public Azure.ResourceManager.AppService.Models.FileSystemHttpLogsConfig FileSystem { get { throw null; } set { } } + Azure.ResourceManager.AppService.Models.AppServiceHttpLogsConfig Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.Models.AppServiceHttpLogsConfig Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class AppServiceHttpSettings { @@ -4884,6 +4932,11 @@ public AppServiceHttpSettings() { } public bool? IsHttpsRequired { get { throw null; } set { } } public string RoutesApiPrefix { get { throw null; } set { } } } + public partial class AppServiceHttpSettingsRoutes + { + public AppServiceHttpSettingsRoutes() { } + public string ApiPrefix { get { throw null; } set { } } + } public partial class AppServiceIdentityProviders { public AppServiceIdentityProviders() { } @@ -5046,6 +5099,11 @@ public AppServiceRecommendation() { } public System.DateTimeOffset? StartOn { get { throw null; } set { } } public System.Collections.Generic.IList States { get { throw null; } } } + public partial class AppServiceResource : Azure.ResourceManager.Models.TrackedResourceData + { + public AppServiceResource(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public string Kind { get { throw null; } set { } } + } public enum AppServiceResourceType { Website = 0, @@ -5067,7 +5125,7 @@ public AppServiceSkuCapacity() { } public int? Minimum { get { throw null; } set { } } public string ScaleType { get { throw null; } set { } } } - public partial class AppServiceSkuDescription + public partial class AppServiceSkuDescription : Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public AppServiceSkuDescription() { } public System.Collections.Generic.IList Capabilities { get { throw null; } } @@ -5078,6 +5136,10 @@ public AppServiceSkuDescription() { } public string Size { get { throw null; } set { } } public Azure.ResourceManager.AppService.Models.AppServiceSkuCapacity SkuCapacity { get { throw null; } set { } } public string Tier { get { throw null; } set { } } + Azure.ResourceManager.AppService.Models.AppServiceSkuDescription Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.Models.AppServiceSkuDescription Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AppServiceSkuName : System.IEquatable @@ -5120,6 +5182,11 @@ public AppServiceStaticWebAppsProvider() { } public bool? IsEnabled { get { throw null; } set { } } public string RegistrationClientId { get { throw null; } set { } } } + public partial class AppServiceStaticWebAppsRegistration + { + public AppServiceStaticWebAppsRegistration() { } + public string ClientId { get { throw null; } set { } } + } public partial class AppServiceStatusInfo { public AppServiceStatusInfo() { } @@ -5349,6 +5416,7 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.AppServicePrivateLinkResourceData AppServicePrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.AppServicePrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServicePrivateLinkResourceProperties AppServicePrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServiceRecommendation AppServiceRecommendation(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.Guid? recommendationId = default(System.Guid?), Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.AppService.Models.ResourceScopeType? resourceScope = default(Azure.ResourceManager.AppService.Models.ResourceScopeType?), string ruleName = null, string displayName = null, string message = null, Azure.ResourceManager.AppService.Models.NotificationLevel? level = default(Azure.ResourceManager.AppService.Models.NotificationLevel?), Azure.ResourceManager.AppService.Models.RecommendationChannel? channels = default(Azure.ResourceManager.AppService.Models.RecommendationChannel?), System.Collections.Generic.IEnumerable categoryTags = null, string actionName = null, int? enabled = default(int?), System.Collections.Generic.IEnumerable states = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.DateTimeOffset? nextNotificationOn = default(System.DateTimeOffset?), System.DateTimeOffset? notificationExpirationOn = default(System.DateTimeOffset?), System.DateTimeOffset? notifiedOn = default(System.DateTimeOffset?), double? score = default(double?), bool? isDynamic = default(bool?), string extensionName = null, string bladeName = null, string forwardLink = null, string kind = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.AppServiceResource AppServiceResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServiceSkuResult AppServiceSkuResult(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IEnumerable skus = null) { throw null; } public static Azure.ResourceManager.AppService.AppServiceSourceControlData AppServiceSourceControlData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string token = null, string tokenSecret = null, string refreshToken = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServiceStorageAccessInfo AppServiceStorageAccessInfo(Azure.ResourceManager.AppService.Models.AppServiceStorageType? storageType = default(Azure.ResourceManager.AppService.Models.AppServiceStorageType?), string accountName = null, string shareName = null, string accessKey = null, string mountPath = null, Azure.ResourceManager.AppService.Models.AppServiceStorageAccountState? state = default(Azure.ResourceManager.AppService.Models.AppServiceStorageAccountState?)) { throw null; } @@ -5362,6 +5430,7 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.AppServiceVirtualNetworkValidationContent AppServiceVirtualNetworkValidationContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string vnetResourceGroup = null, string vnetName = null, string vnetSubnetName = null, Azure.Core.ResourceIdentifier subnetResourceId = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.AppServiceWorkerPoolData AppServiceWorkerPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.AppServiceSkuDescription sku = null, int? workerSizeId = default(int?), Azure.ResourceManager.AppService.Models.ComputeModeOption? computeMode = default(Azure.ResourceManager.AppService.Models.ComputeModeOption?), string workerSize = null, int? workerCount = default(int?), System.Collections.Generic.IEnumerable instanceNames = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppSnapshot AppSnapshot(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string time = null, string kind = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.ArmIdWrapper ArmIdWrapper(string id = null) { throw null; } public static Azure.ResourceManager.AppService.AseV3NetworkingConfigurationData AseV3NetworkingConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable windowsOutboundIPAddresses = null, System.Collections.Generic.IEnumerable linuxOutboundIPAddresses = null, System.Collections.Generic.IEnumerable externalInboundIPAddresses = null, System.Collections.Generic.IEnumerable internalInboundIPAddresses = null, bool? allowNewPrivateEndpointConnections = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AzureStoragePropertyDictionary AzureStoragePropertyDictionary(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary properties = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CertificateOrderAction CertificateOrderAction(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.CertificateOrderActionType? actionType = default(Azure.ResourceManager.AppService.Models.CertificateOrderActionType?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string kind = null) { throw null; } @@ -5369,6 +5438,7 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.ConnectionStringDictionary ConnectionStringDictionary(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary properties = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.ContinuousWebJobData ContinuousWebJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.ContinuousWebJobStatus? status = default(Azure.ResourceManager.AppService.Models.ContinuousWebJobStatus?), string detailedStatus = null, System.Uri logUri = null, string runCommand = null, System.Uri uri = null, System.Uri extraInfoUri = null, Azure.ResourceManager.AppService.Models.WebJobType? webJobType = default(Azure.ResourceManager.AppService.Models.WebJobType?), string error = null, bool? isUsingSdk = default(bool?), System.Collections.Generic.IDictionary settings = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CsmOperationDescription CsmOperationDescription(string name = null, bool? isDataAction = default(bool?), Azure.ResourceManager.AppService.Models.CsmOperationDisplay display = null, string origin = null, Azure.ResourceManager.AppService.Models.ServiceSpecification csmOperationDescriptionServiceSpecification = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.CsmOperationDescriptionProperties CsmOperationDescriptionProperties(Azure.ResourceManager.AppService.Models.ServiceSpecification serviceSpecification = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CsmOperationDisplay CsmOperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) { throw null; } public static Azure.ResourceManager.AppService.CsmPublishingCredentialsPoliciesEntityData CsmPublishingCredentialsPoliciesEntityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? allow = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CsmUsageQuota CsmUsageQuota(string unit = null, System.DateTimeOffset? nextResetOn = default(System.DateTimeOffset?), long? currentValue = default(long?), long? limit = default(long?), Azure.ResourceManager.AppService.Models.LocalizableString name = null) { throw null; } @@ -5387,6 +5457,7 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.DomainAvailabilityCheckResult DomainAvailabilityCheckResult(string name = null, bool? isAvailable = default(bool?), Azure.ResourceManager.AppService.Models.AppServiceDomainType? domainType = default(Azure.ResourceManager.AppService.Models.AppServiceDomainType?)) { throw null; } public static Azure.ResourceManager.AppService.Models.DomainControlCenterSsoRequestInfo DomainControlCenterSsoRequestInfo(System.Uri uri = null, string postParameterKey = null, string postParameterValue = null) { throw null; } public static Azure.ResourceManager.AppService.DomainOwnershipIdentifierData DomainOwnershipIdentifierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string ownershipId = null, string kind = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.ExtendedLocation ExtendedLocation(string name = null, string extendedLocationType = null) { throw null; } public static Azure.ResourceManager.AppService.Models.FunctionAppHostKeys FunctionAppHostKeys(string masterKey = null, System.Collections.Generic.IReadOnlyDictionary functionKeys = null, System.Collections.Generic.IReadOnlyDictionary systemKeys = null) { throw null; } public static Azure.ResourceManager.AppService.Models.FunctionAppMajorVersion FunctionAppMajorVersion(string displayText = null, string value = null, System.Collections.Generic.IEnumerable minorVersions = null) { throw null; } public static Azure.ResourceManager.AppService.Models.FunctionAppMinorVersion FunctionAppMinorVersion(string displayText = null, string value = null, Azure.ResourceManager.AppService.Models.FunctionAppRuntimes stackSettings = null) { throw null; } @@ -5411,6 +5482,7 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.LinuxJavaContainerSettings LinuxJavaContainerSettings(string java11Runtime = null, string java8Runtime = null, bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTimeOffset? endOfLifeOn = default(System.DateTimeOffset?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) { throw null; } public static Azure.ResourceManager.AppService.Models.LocalizableString LocalizableString(string value = null, string localizedValue = null) { throw null; } public static Azure.ResourceManager.AppService.Models.LogSpecification LogSpecification(string name = null, string displayName = null, System.TimeSpan? blobDuration = default(System.TimeSpan?), string logFilterPattern = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.ManagedServiceIdentity ManagedServiceIdentity(Azure.ResourceManager.AppService.Models.ManagedServiceIdentityType? identityType = default(Azure.ResourceManager.AppService.Models.ManagedServiceIdentityType?), System.Guid? tenantId = default(System.Guid?), string principalId = null, System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.AppService.Models.MetricAvailability MetricAvailability(string timeGrain = null, System.TimeSpan? blobDuration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.AppService.Models.MetricDimension MetricDimension(string name = null, string displayName = null, string internalName = null, bool? isToBeExportedForShoebox = default(bool?)) { throw null; } public static Azure.ResourceManager.AppService.Models.MetricSpecification MetricSpecification(string name = null, string displayName = null, string displayDescription = null, string unit = null, string aggregationType = null, bool? isInstanceLevelAggregationSupported = default(bool?), bool? isRegionalMdmAccountEnabled = default(bool?), string sourceMdmAccount = null, string sourceMdmNamespace = null, string metricFilterPattern = null, bool? fillGapWithZero = default(bool?), bool? isInternal = default(bool?), System.Collections.Generic.IEnumerable dimensions = null, string category = null, System.Collections.Generic.IEnumerable availabilities = null, System.Collections.Generic.IEnumerable supportedTimeGrainTypes = null, System.Collections.Generic.IEnumerable supportedAggregationTypes = null) { throw null; } @@ -5427,9 +5499,11 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.PremierAddOnPatchResource PremierAddOnPatchResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string sku = null, string product = null, string vendor = null, string marketplacePublisher = null, string marketplaceOffer = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.PrivateAccessData PrivateAccessData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isEnabled = default(bool?), System.Collections.Generic.IEnumerable virtualNetworks = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.PrivateLinkConnectionApprovalRequestInfo PrivateLinkConnectionApprovalRequestInfo(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.PrivateLinkConnectionState privateLinkServiceConnectionState = null, string kind = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.PrivateLinkResourcesWrapper PrivateLinkResourcesWrapper(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.ResourceManager.AppService.ProcessInfoData ProcessInfoData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? identifier = default(int?), string deploymentName = null, string href = null, string minidump = null, bool? isProfileRunning = default(bool?), bool? isIisProfileRunning = default(bool?), double? iisProfileTimeoutInSeconds = default(double?), string parent = null, System.Collections.Generic.IEnumerable children = null, System.Collections.Generic.IEnumerable threads = null, System.Collections.Generic.IEnumerable openFileHandles = null, System.Collections.Generic.IEnumerable modules = null, string fileName = null, string commandLine = null, string userName = null, int? handleCount = default(int?), int? moduleCount = default(int?), int? threadCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string totalCpuTime = null, string userCpuTime = null, string privilegedCpuTime = null, long? workingSet = default(long?), long? peakWorkingSet = default(long?), long? privateMemory = default(long?), long? virtualMemory = default(long?), long? peakVirtualMemory = default(long?), long? pagedSystemMemory = default(long?), long? nonPagedSystemMemory = default(long?), long? pagedMemory = default(long?), long? peakPagedMemory = default(long?), System.DateTimeOffset? timeStamp = default(System.DateTimeOffset?), System.Collections.Generic.IDictionary environmentVariables = null, bool? isScmSite = default(bool?), bool? isWebjob = default(bool?), string description = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.ProcessModuleInfoData ProcessModuleInfoData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string baseAddress = null, string fileName = null, string href = null, string filePath = null, int? moduleMemorySize = default(int?), string fileVersion = null, string fileDescription = null, string product = null, string productVersion = null, bool? isDebug = default(bool?), string language = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.ProcessThreadInfo ProcessThreadInfo(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? identifier = default(int?), string href = null, string process = null, string startAddress = null, int? currentPriority = default(int?), string priorityLevel = null, int? basePriority = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string totalProcessorTime = null, string userProcessorTime = null, string state = null, string waitReason = null, string kind = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.ProxyOnlyResource ProxyOnlyResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.PublicCertificateData PublicCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, byte[] blob = null, Azure.ResourceManager.AppService.Models.PublicCertificateLocation? publicCertificateLocation = default(Azure.ResourceManager.AppService.Models.PublicCertificateLocation?), string thumbprintString = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.PublishingUserData PublishingUserData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string publishingUserName = null, string publishingPassword = null, string publishingPasswordHash = null, string publishingPasswordHashSalt = null, System.Uri scmUri = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.RecommendationRuleData RecommendationRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string recommendationName = null, string displayName = null, string message = null, System.Guid? recommendationId = default(System.Guid?), string description = null, string actionName = null, Azure.ResourceManager.AppService.Models.NotificationLevel? level = default(Azure.ResourceManager.AppService.Models.NotificationLevel?), Azure.ResourceManager.AppService.Models.RecommendationChannel? channels = default(Azure.ResourceManager.AppService.Models.RecommendationChannel?), System.Collections.Generic.IEnumerable categoryTags = null, bool? isDynamic = default(bool?), string extensionName = null, string bladeName = null, string forwardLink = null, string kind = null) { throw null; } @@ -5479,6 +5553,7 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.StaticSiteUserInvitationContent StaticSiteUserInvitationContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string domain = null, string provider = null, string userDetails = null, string roles = null, int? numHoursToExpiration = default(int?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StaticSiteUserInvitationResult StaticSiteUserInvitationResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.Uri invitationUri = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.StaticSiteUserProvidedFunctionAppData StaticSiteUserProvidedFunctionAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier functionAppResourceId = null, string functionAppRegion = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string kind = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.StaticSiteUserProvidedFunctionAppProperties StaticSiteUserProvidedFunctionAppProperties(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string functionAppResourceId = null, string functionAppRegion = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StaticSiteZipDeployment StaticSiteZipDeployment(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Uri appZipUri = null, System.Uri apiZipUri = null, string deploymentTitle = null, string provider = null, string functionLanguage = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StorageMigrationContent StorageMigrationContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string azurefilesConnectionString = null, string azurefilesShare = null, bool? switchSiteAfterMigration = default(bool?), bool? blockWriteAccessToSite = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StorageMigrationResult StorageMigrationResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string operationId = null, string kind = null) { throw null; } @@ -5487,6 +5562,7 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.TopLevelDomainData TopLevelDomainData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isDomainPrivacySupported = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.TriggeredJobHistoryData TriggeredJobHistoryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable runs = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.TriggeredWebJobData TriggeredWebJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.TriggeredJobRun latestRun = null, System.Uri historyUri = null, System.Uri schedulerLogsUri = null, string runCommand = null, System.Uri uri = null, System.Uri extraInfoUri = null, Azure.ResourceManager.AppService.Models.WebJobType? webJobType = default(Azure.ResourceManager.AppService.Models.WebJobType?), string error = null, bool? isUsingSdk = default(bool?), System.Collections.Generic.IDictionary settings = null, string kind = null) { throw null; } + public static Azure.ResourceManager.AppService.Models.UserAssignedIdentity UserAssignedIdentity(string principalId = null, string clientId = null) { throw null; } public static Azure.ResourceManager.AppService.Models.ValidateResponseError ValidateResponseError(string code = null, string message = null) { throw null; } public static Azure.ResourceManager.AppService.Models.VirtualNetworkValidationFailureDetails VirtualNetworkValidationFailureDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string message = null, bool? isFailed = default(bool?), System.Collections.Generic.IEnumerable failedTests = null, System.Collections.Generic.IEnumerable warnings = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.VirtualNetworkValidationTestFailure VirtualNetworkValidationTestFailure(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string testName = null, string details = null, string kind = null) { throw null; } @@ -5510,6 +5586,11 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.WebSiteInstanceStatusData WebSiteInstanceStatusData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.SiteRuntimeState? state = default(Azure.ResourceManager.AppService.Models.SiteRuntimeState?), System.Uri statusUri = null, System.Uri detectorUri = null, System.Uri consoleUri = null, string healthCheckUrlString = null, System.Collections.Generic.IDictionary containers = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.WindowsJavaContainerSettings WindowsJavaContainerSettings(string javaContainer = null, string javaContainerVersion = null, bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTimeOffset? endOfLifeOn = default(System.DateTimeOffset?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) { throw null; } } + public partial class ArmIdWrapper + { + public ArmIdWrapper() { } + public string Id { get { throw null; } } + } public enum ArtifactStorageType { LocalNode = 0, @@ -5841,6 +5922,11 @@ internal CsmOperationDescription() { } public string Name { get { throw null; } } public string Origin { get { throw null; } } } + public partial class CsmOperationDescriptionProperties + { + internal CsmOperationDescriptionProperties() { } + public Azure.ResourceManager.AppService.Models.ServiceSpecification ServiceSpecification { get { throw null; } } + } public partial class CsmOperationDisplay { internal CsmOperationDisplay() { } @@ -6019,6 +6105,11 @@ public enum DetectorIssueType PlatformIssue = 6, Other = 7, } + public partial class DetectorMetadata + { + public DetectorMetadata() { } + public Azure.ResourceManager.AppService.Models.DetectorDataSource DataSource { get { throw null; } set { } } + } public partial class DetectorSupportTopic { internal DetectorSupportTopic() { } @@ -6184,12 +6275,27 @@ public DomainRecommendationSearchContent() { } public string Keywords { get { throw null; } set { } } public int? MaxDomainRecommendations { get { throw null; } set { } } } - public partial class FileSystemHttpLogsConfig + public partial class ExtendedLocation + { + public ExtendedLocation() { } + public string ExtendedLocationType { get { throw null; } } + public string Name { get { throw null; } set { } } + } + public partial class FileSystemHttpLogsConfig : Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public FileSystemHttpLogsConfig() { } public bool? IsEnabled { get { throw null; } set { } } public int? RetentionInDays { get { throw null; } set { } } public int? RetentionInMb { get { throw null; } set { } } + Azure.ResourceManager.AppService.Models.FileSystemHttpLogsConfig Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.Models.FileSystemHttpLogsConfig Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + } + public partial class FileSystemTokenStore + { + public FileSystemTokenStore() { } + public string Directory { get { throw null; } set { } } } public enum ForwardProxyConvention { @@ -6197,6 +6303,11 @@ public enum ForwardProxyConvention Standard = 1, Custom = 2, } + public partial class FrontEndConfiguration + { + public FrontEndConfiguration() { } + public Azure.ResourceManager.AppService.Models.FrontEndServiceType? Kind { get { throw null; } set { } } + } public enum FrontEndServiceType { NodePort = 0, @@ -6523,6 +6634,16 @@ public LoginFlowNonceSettings() { } public string NonceExpirationInterval { get { throw null; } set { } } public bool? ValidateNonce { get { throw null; } set { } } } + public partial class LoginRoutes + { + public LoginRoutes() { } + public string LogoutEndpoint { get { throw null; } set { } } + } + public partial class LoginScopes + { + public LoginScopes() { } + public System.Collections.Generic.IList Scopes { get { throw null; } } + } public partial class LogSpecification { internal LogSpecification() { } @@ -6536,6 +6657,21 @@ public enum ManagedPipelineMode Integrated = 0, Classic = 1, } + public partial class ManagedServiceIdentity + { + public ManagedServiceIdentity() { } + public Azure.ResourceManager.AppService.Models.ManagedServiceIdentityType? IdentityType { get { throw null; } set { } } + public string PrincipalId { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + } + public enum ManagedServiceIdentityType + { + None = 0, + SystemAssigned = 1, + UserAssigned = 2, + SystemAssignedUserAssigned = 3, + } public partial class MetricAvailability { internal MetricAvailability() { } @@ -6707,6 +6843,11 @@ public PrivateLinkConnectionState() { } public string Description { get { throw null; } set { } } public string Status { get { throw null; } set { } } } + public partial class PrivateLinkResourcesWrapper + { + internal PrivateLinkResourcesWrapper() { } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } public partial class ProcessThreadInfo : Azure.ResourceManager.Models.ResourceData { public ProcessThreadInfo() { } @@ -6772,6 +6913,11 @@ public enum ProvisioningState InProgress = 3, Deleting = 4, } + public partial class ProxyOnlyResource : Azure.ResourceManager.Models.ResourceData + { + public ProxyOnlyResource() { } + public string Kind { get { throw null; } set { } } + } public enum PublicCertificateLocation { Unknown = 0, @@ -6984,6 +7130,11 @@ public RestoreRequestInfo() { } public string SiteName { get { throw null; } set { } } public System.Uri StorageAccountUri { get { throw null; } set { } } } + public partial class RoutingRuleExperiments + { + public RoutingRuleExperiments() { } + public System.Collections.Generic.IList RampUpRules { get { throw null; } } + } public partial class SampleUtterance { public SampleUtterance() { } @@ -7096,7 +7247,7 @@ internal SiteCloneabilityCriterion() { } public string Description { get { throw null; } } public string Name { get { throw null; } } } - public partial class SiteConfigProperties + public partial class SiteConfigProperties : Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public SiteConfigProperties() { } public string AcrUserManagedIdentityId { get { throw null; } set { } } @@ -7166,6 +7317,10 @@ public SiteConfigProperties() { } public string WebsiteTimeZone { get { throw null; } set { } } public string WindowsFxVersion { get { throw null; } set { } } public int? XManagedServiceIdentityId { get { throw null; } set { } } + Azure.ResourceManager.AppService.Models.SiteConfigProperties Azure.Core.Serialization.IModelJsonSerializable.Deserialize(ref System.Text.Json.Utf8JsonReader reader, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + void Azure.Core.Serialization.IModelJsonSerializable.Serialize(System.Text.Json.Utf8JsonWriter writer, Azure.Core.Serialization.ModelSerializerOptions options) { } + Azure.ResourceManager.AppService.Models.SiteConfigProperties Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } + System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } public partial class SiteConfigPropertiesDictionary { @@ -7505,6 +7660,14 @@ public StaticSiteUserInvitationResult() { } public System.Uri InvitationUri { get { throw null; } } public string Kind { get { throw null; } set { } } } + public partial class StaticSiteUserProvidedFunctionAppProperties : Azure.ResourceManager.Models.ResourceData + { + public StaticSiteUserProvidedFunctionAppProperties() { } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string FunctionAppRegion { get { throw null; } set { } } + public string FunctionAppResourceId { get { throw null; } set { } } + public string Kind { get { throw null; } set { } } + } public partial class StaticSiteZipDeployment : Azure.ResourceManager.Models.ResourceData { public StaticSiteZipDeployment() { } @@ -7601,6 +7764,12 @@ public enum UnauthenticatedClientActionV2 Return401 = 2, Return403 = 3, } + public partial class UserAssignedIdentity + { + public UserAssignedIdentity() { } + public string ClientId { get { throw null; } } + public string PrincipalId { get { throw null; } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ValidateResourceType : System.IEquatable { @@ -7704,6 +7873,11 @@ public WebAppCookieExpiration() { } public Azure.ResourceManager.AppService.Models.CookieExpirationConvention? Convention { get { throw null; } set { } } public string TimeToExpiration { get { throw null; } set { } } } + public partial class WebAppEnabledConfig + { + public WebAppEnabledConfig() { } + public bool? Enabled { get { throw null; } set { } } + } public partial class WebAppKeyInfo { public WebAppKeyInfo() { } From 46862104c8d19a48bf82ded1c7ca4e4a5eb89373 Mon Sep 17 00:00:00 2001 From: m-nash Date: Wed, 13 Sep 2023 20:23:15 -0700 Subject: [PATCH 37/45] update code to not add new types --- .../KeyVaultData.Bicep.Serialization.cs | 58 +++++++++ .../KeyVaultSecretData.Bicep.Serialization.cs | 52 ++++++++ .../{ => CdkHack}/StringBuilderExtensions.cs | 0 .../Models/KeyVaultData.Serialization.cs | 50 +------- .../KeyVaultSecretData.Serialization.cs | 41 +----- .../src/CdkHack/TempInternals.cs | 42 ++++++ .../Generated/Models/AppServiceGithubToken.cs | 29 ----- .../AppServiceResource.Serialization.cs | 108 ---------------- .../Generated/Models/AppServiceResource.cs | 39 ------ .../Models/AppserviceGithubTokenRequest.cs | 34 ----- .../Models/ArmIdWrapper.Serialization.cs | 39 ------ .../src/Generated/Models/ArmIdWrapper.cs | 28 ---- .../Models/CsmMoveResourceEnvelope.cs | 27 ---- .../DefaultErrorResponse.Serialization.cs | 48 ------- .../Generated/Models/DefaultErrorResponse.cs | 28 ---- ...DefaultErrorResponseError.Serialization.cs | 100 --------------- .../Models/DefaultErrorResponseError.cs | 48 ------- ...rResponseErrorDetailsItem.Serialization.cs | 66 ---------- .../DefaultErrorResponseErrorDetailsItem.cs | 36 ------ .../Models/ExtendedLocation.Serialization.cs | 50 -------- .../src/Generated/Models/ExtendedLocation.cs | 32 ----- .../ManagedServiceIdentity.Serialization.cs | 93 -------------- .../Models/ManagedServiceIdentity.cs | 46 ------- ...anagedServiceIdentityType.Serialization.cs | 32 ----- .../Models/ProxyOnlyResource.Serialization.cs | 73 ----------- .../src/Generated/Models/ProxyOnlyResource.cs | 35 ----- ...idedFunctionAppProperties.Serialization.cs | 121 ------------------ ...icSiteUserProvidedFunctionAppProperties.cs | 48 ------- .../UserAssignedIdentity.Serialization.cs | 45 ------- .../Generated/Models/UserAssignedIdentity.cs | 32 ----- 30 files changed, 158 insertions(+), 1322 deletions(-) create mode 100644 sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultData.Bicep.Serialization.cs create mode 100644 sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultSecretData.Bicep.Serialization.cs rename sdk/keyvault/Azure.ResourceManager.KeyVault/src/{ => CdkHack}/StringBuilderExtensions.cs (100%) create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultData.Bicep.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultData.Bicep.Serialization.cs new file mode 100644 index 000000000000..81d003dffa1a --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultData.Bicep.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.Core.Serialization; + +namespace Azure.ResourceManager.KeyVault +{ + public partial class KeyVaultData : IModelJsonSerializable + { + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => ((IUtf8JsonSerializable)this).Write(writer); + + KeyVaultData IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultData(document.RootElement); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) => (options.Format.ToString()) switch + { + "J" or "W" => ModelSerializer.SerializeCore(this, options), + "bicep" => SerializeBicep(options), + _ => throw new FormatException($"Unsupported format {options.Format}") + }; + + KeyVaultData IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var document = JsonDocument.Parse(data); + return DeserializeKeyVaultData(document.RootElement); + } + + private BinaryData SerializeBicep(ModelSerializerOptions options) + { + var sb = new StringBuilder(); + sb.AppendLine($" name: '{Name}'"); + sb.AppendLine($" location: '{Location}'"); + if (Optional.IsCollectionDefined(Tags) && Tags.Count > 0) + { + sb.AppendLine($" tags: {{"); + foreach (var kv in Tags) + { + sb.AppendLine($" '{kv.Key}': '{kv.Value}'"); + } + sb.AppendLine($" }}"); + } + sb.Append($" properties: "); + sb.AppendChildObject(Properties, options); + return BinaryData.FromString(sb.ToString()); + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultSecretData.Bicep.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultSecretData.Bicep.Serialization.cs new file mode 100644 index 000000000000..7a13f2e0e386 --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/KeyVaultSecretData.Bicep.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.Core.Serialization; +using Azure.ResourceManager.KeyVault.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.KeyVault +{ + public partial class KeyVaultSecretData : IModelJsonSerializable + { + void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => ((IUtf8JsonSerializable)this).Write(writer); + + KeyVaultSecretData IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultSecretData(document.RootElement); + } + + BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) => (options.Format.ToString()) switch + { + "J" or "W" => ModelSerializer.SerializeCore(this, options), + "bicep" => SerializeBicep(options), + _ => throw new FormatException($"Unsupported format {options.Format}") + }; + + KeyVaultSecretData IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) + { + using var document = JsonDocument.Parse(data); + return DeserializeKeyVaultSecretData(document.RootElement); + } + + private BinaryData SerializeBicep(ModelSerializerOptions options) + { + var sb = new StringBuilder(); + sb.AppendLine($" name: '{Name}'"); + sb.AppendLine($" properties: {{"); + sb.AppendChildObject(Properties, options, spaces: 4); + sb.AppendLine($" }}"); + return BinaryData.FromString(sb.ToString()); + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/StringBuilderExtensions.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/StringBuilderExtensions.cs similarity index 100% rename from sdk/keyvault/Azure.ResourceManager.KeyVault/src/StringBuilderExtensions.cs rename to sdk/keyvault/Azure.ResourceManager.KeyVault/src/CdkHack/StringBuilderExtensions.cs diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultData.Serialization.cs index 6914f0def94f..b66160c3f167 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultData.Serialization.cs @@ -17,11 +17,9 @@ namespace Azure.ResourceManager.KeyVault { - public partial class KeyVaultData : IUtf8JsonSerializable, IModelJsonSerializable + public partial class KeyVaultData : IUtf8JsonSerializable { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions); - - private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("properties"u8); @@ -42,10 +40,8 @@ private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) writer.WriteEndObject(); } - internal static KeyVaultData DeserializeKeyVaultData(JsonElement element, ModelSerializerOptions options = default) + internal static KeyVaultData DeserializeKeyVaultData(JsonElement element) { - options ??= ModelSerializerOptions.DefaultWireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -110,45 +106,5 @@ internal static KeyVaultData DeserializeKeyVaultData(JsonElement element, ModelS } return new KeyVaultData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, properties); } - - void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); - - KeyVaultData IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) - { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultData(document.RootElement, options); - } - - BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) => (options.Format.ToString()) switch - { - "J" or "W" => ModelSerializer.SerializeCore(this, options), - "bicep" => SerializeBicep(options), - _ => throw new FormatException($"Unsupported format {options.Format}") - }; - - KeyVaultData IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) - { - using var document = JsonDocument.Parse(data); - return DeserializeKeyVaultData(document.RootElement, options); - } - - private BinaryData SerializeBicep(ModelSerializerOptions options) - { - var sb = new StringBuilder(); - sb.AppendLine($" name: '{Name}'"); - sb.AppendLine($" location: '{Location}'"); - if (Optional.IsCollectionDefined(Tags) && Tags.Count > 0) - { - sb.AppendLine($" tags: {{"); - foreach (var kv in Tags) - { - sb.AppendLine($" '{kv.Key}': '{kv.Value}'"); - } - sb.AppendLine($" }}"); - } - sb.Append($" properties: "); - sb.AppendChildObject(Properties, options); - return BinaryData.FromString(sb.ToString()); - } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultSecretData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultSecretData.Serialization.cs index 6a6a5f08081e..75b2a1d28a71 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultSecretData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultSecretData.Serialization.cs @@ -16,11 +16,9 @@ namespace Azure.ResourceManager.KeyVault { - public partial class KeyVaultSecretData : IUtf8JsonSerializable, IModelJsonSerializable + public partial class KeyVaultSecretData : IUtf8JsonSerializable { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => Serialize(writer, ModelSerializerOptions.DefaultWireOptions); - - private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("properties"u8); @@ -28,10 +26,8 @@ private void Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) writer.WriteEndObject(); } - internal static KeyVaultSecretData DeserializeKeyVaultSecretData(JsonElement element, ModelSerializerOptions options = default) + internal static KeyVaultSecretData DeserializeKeyVaultSecretData(JsonElement element) { - options ??= ModelSerializerOptions.DefaultWireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,36 +96,5 @@ internal static KeyVaultSecretData DeserializeKeyVaultSecretData(JsonElement ele } return new KeyVaultSecretData(id, name, type, systemData.Value, properties, Optional.ToNullable(location), Optional.ToDictionary(tags)); } - - void IModelJsonSerializable.Serialize(Utf8JsonWriter writer, ModelSerializerOptions options) => Serialize(writer, options); - - KeyVaultSecretData IModelJsonSerializable.Deserialize(ref Utf8JsonReader reader, ModelSerializerOptions options) - { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultSecretData(document.RootElement, options); - } - - BinaryData IModelSerializable.Serialize(ModelSerializerOptions options) => (options.Format.ToString()) switch - { - "J" or "W" => ModelSerializer.SerializeCore(this, options), - "bicep" => SerializeBicep(options), - _ => throw new FormatException($"Unsupported format {options.Format}") - }; - - KeyVaultSecretData IModelSerializable.Deserialize(BinaryData data, ModelSerializerOptions options) - { - using var document = JsonDocument.Parse(data); - return DeserializeKeyVaultSecretData(document.RootElement, options); - } - - private BinaryData SerializeBicep(ModelSerializerOptions options) - { - var sb = new StringBuilder(); - sb.AppendLine($" name: '{Name}'"); - sb.AppendLine($" properties: {{"); - sb.AppendChildObject(Properties, options, spaces: 4); - sb.AppendLine($" }}"); - return BinaryData.FromString(sb.ToString()); - } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs new file mode 100644 index 000000000000..8931281b7f62 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +//This file is needed because we had to turn off the post processor which makes a bunch of types public. + +using Azure.Core; + +[assembly: CodeGenSuppressType("ArmIdWrapper")] +[assembly: CodeGenSuppressType("AppServiceGithubToken")] +[assembly: CodeGenSuppressType("AppServiceResource")] +[assembly: CodeGenSuppressType("AppserviceGithubTokenRequest")] +[assembly: CodeGenSuppressType("CsmMoveResourceEnvelope")] +[assembly: CodeGenSuppressType("DefaultErrorResponse")] +[assembly: CodeGenSuppressType("DefaultErrorResponseError")] +[assembly: CodeGenSuppressType("DefaultErrorResponseErrorDetailsItem")] +[assembly: CodeGenSuppressType("ExtendedLocation")] +[assembly: CodeGenSuppressType("ManagedServiceIdentity")] +[assembly: CodeGenSuppressType("ManagedServiceIdentityTypeExtensions")] +[assembly: CodeGenSuppressType("ProxyOnlyResource")] +[assembly: CodeGenSuppressType("StaticSiteUserProvidedFunctionAppProperties")] +[assembly: CodeGenSuppressType("UserAssignedIdentity")] + +namespace Azure.ResourceManager.AppService.CdkHack +{ +#pragma warning disable SA1402 // File may only contain a single type + internal partial class AllowedAudiencesValidation { } + internal partial class ApiManagementConfig { } + internal partial class AppServiceApiDefinitionInfo { } + internal partial class AppServiceBlobStorageTokenStore { } + internal partial class AppServiceHttpSettingsRoutes { } + internal partial class AppServiceStaticWebAppsRegistration { } + internal partial class CsmOperationDescriptionProperties { } + internal partial class DetectorMetadata { } + internal partial class FileSystemTokenStore { } + internal partial class FrontEndConfiguration { } + internal partial class LoginRoutes { } + internal partial class LoginScopes { } + internal partial class PrivateLinkResourcesWrapper { } + internal partial class RoutingRuleExperiments { } + internal partial class WebAppEnabledConfig { } +#pragma warning restore SA1402 // File may only contain a single type +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs deleted file mode 100644 index 884fba01ba97..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceGithubToken.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppService.Models -{ - /// Github access token for Appservice CLI github integration. - internal partial class AppServiceGithubToken - { - /// Initializes a new instance of AppServiceGithubToken. - internal AppServiceGithubToken() - { - } - - /// Github access token for Appservice CLI github integration. - public string AccessToken { get; } - /// Scope of the github access token. - public string Scope { get; } - /// token type. - public string TokenType { get; } - /// True if valid github token received, False otherwise. - public bool? GotToken { get; } - /// Error message if unable to get token. - public string ErrorMessage { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs deleted file mode 100644 index 4e6380d8170a..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.Serialization.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - public partial class AppServiceResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - writer.WriteEndObject(); - } - - internal static AppServiceResource DeserializeAppServiceResource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kind = default; - Optional> tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new AppServiceResource(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, kind.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs deleted file mode 100644 index 996824d0aea5..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceResource.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - /// Azure resource. This resource is tracked in Azure Resource Manager. - public partial class AppServiceResource : TrackedResourceData - { - /// Initializes a new instance of AppServiceResource. - /// The location. - public AppServiceResource(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of AppServiceResource. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Kind of resource. - internal AppServiceResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string kind) : base(id, name, resourceType, systemData, tags, location) - { - Kind = kind; - } - - /// Kind of resource. - public string Kind { get; set; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs deleted file mode 100644 index d8467125ce9c..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppserviceGithubTokenRequest.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - /// Appservice Github token request content. - internal partial class AppserviceGithubTokenRequest - { - /// Initializes a new instance of AppserviceGithubTokenRequest. - /// Code string to exchange for Github Access token. - /// State string used for verification. - /// or is null. - internal AppserviceGithubTokenRequest(string code, string state) - { - Argument.AssertNotNull(code, nameof(code)); - Argument.AssertNotNull(state, nameof(state)); - - Code = code; - State = state; - } - - /// Code string to exchange for Github Access token. - public string Code { get; } - /// State string used for verification. - public string State { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs deleted file mode 100644 index 20a3be28f2a0..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - public partial class ArmIdWrapper : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static ArmIdWrapper DeserializeArmIdWrapper(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional id = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - } - return new ArmIdWrapper(id.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs deleted file mode 100644 index c2d7c801d9f6..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ArmIdWrapper.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppService.Models -{ - /// A wrapper for an ARM resource id. - public partial class ArmIdWrapper - { - /// Initializes a new instance of ArmIdWrapper. - public ArmIdWrapper() - { - } - - /// Initializes a new instance of ArmIdWrapper. - /// - internal ArmIdWrapper(string id) - { - Id = id; - } - - /// Gets the id. - public string Id { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs deleted file mode 100644 index 74a35252b24b..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmMoveResourceEnvelope.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - /// Object with a list of the resources that need to be moved and the resource group they should be moved to. - internal partial class CsmMoveResourceEnvelope - { - /// Initializes a new instance of CsmMoveResourceEnvelope. - internal CsmMoveResourceEnvelope() - { - Resources = new ChangeTrackingList(); - } - - /// Gets the target resource group. - public string TargetResourceGroup { get; } - /// Gets the resources. - public IReadOnlyList Resources { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs deleted file mode 100644 index 0534d9e36e80..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.Serialization.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Xml.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - internal partial class DefaultErrorResponse - { - internal static DefaultErrorResponse DeserializeDefaultErrorResponse(XElement element) - { - DefaultErrorResponseError error = default; - if (element.Element("error") is XElement errorElement) - { - error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(errorElement); - } - return new DefaultErrorResponse(error); - } - - internal static DefaultErrorResponse DeserializeDefaultErrorResponse(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(property.Value); - continue; - } - } - return new DefaultErrorResponse(error.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs deleted file mode 100644 index a26bc7f468a9..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponse.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppService.Models -{ - /// App Service error response. - internal partial class DefaultErrorResponse - { - /// Initializes a new instance of DefaultErrorResponse. - internal DefaultErrorResponse() - { - } - - /// Initializes a new instance of DefaultErrorResponse. - /// Error model. - internal DefaultErrorResponse(DefaultErrorResponseError error) - { - Error = error; - } - - /// Error model. - public DefaultErrorResponseError Error { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs deleted file mode 100644 index f3881a505f62..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using System.Xml.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - internal partial class DefaultErrorResponseError - { - internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(XElement element) - { - string code = default; - string message = default; - string target = default; - string innererror = default; - IReadOnlyList details = default; - if (element.Element("code") is XElement codeElement) - { - code = (string)codeElement; - } - if (element.Element("message") is XElement messageElement) - { - message = (string)messageElement; - } - if (element.Element("target") is XElement targetElement) - { - target = (string)targetElement; - } - if (element.Element("innererror") is XElement innererrorElement) - { - innererror = (string)innererrorElement; - } - var array = new List(); - foreach (var e in element.Elements("DefaultErrorResponseErrorDetailsItem")) - { - array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(e)); - } - details = array; - return new DefaultErrorResponseError(code, message, target, details, innererror); - } - - internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional code = default; - Optional message = default; - Optional target = default; - Optional> details = default; - Optional innererror = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("target"u8)) - { - target = property.Value.GetString(); - continue; - } - if (property.NameEquals("details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(item)); - } - details = array; - continue; - } - if (property.NameEquals("innererror"u8)) - { - innererror = property.Value.GetString(); - continue; - } - } - return new DefaultErrorResponseError(code.Value, message.Value, target.Value, Optional.ToList(details), innererror.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs deleted file mode 100644 index 8e4255410218..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseError.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - /// Error model. - internal partial class DefaultErrorResponseError - { - /// Initializes a new instance of DefaultErrorResponseError. - internal DefaultErrorResponseError() - { - Details = new ChangeTrackingList(); - } - - /// Initializes a new instance of DefaultErrorResponseError. - /// Standardized string to programmatically identify the error. - /// Detailed error description and debugging information. - /// Detailed error description and debugging information. - /// - /// More information to debug error. - internal DefaultErrorResponseError(string code, string message, string target, IReadOnlyList details, string innererror) - { - Code = code; - Message = message; - Target = target; - Details = details; - Innererror = innererror; - } - - /// Standardized string to programmatically identify the error. - public string Code { get; } - /// Detailed error description and debugging information. - public string Message { get; } - /// Detailed error description and debugging information. - public string Target { get; } - /// Gets the details. - public IReadOnlyList Details { get; } - /// More information to debug error. - public string Innererror { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs deleted file mode 100644 index a22348eec094..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Xml.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - internal partial class DefaultErrorResponseErrorDetailsItem - { - internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(XElement element) - { - string code = default; - string message = default; - string target = default; - if (element.Element("code") is XElement codeElement) - { - code = (string)codeElement; - } - if (element.Element("message") is XElement messageElement) - { - message = (string)messageElement; - } - if (element.Element("target") is XElement targetElement) - { - target = (string)targetElement; - } - return new DefaultErrorResponseErrorDetailsItem(code, message, target); - } - - internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional code = default; - Optional message = default; - Optional target = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("target"u8)) - { - target = property.Value.GetString(); - continue; - } - } - return new DefaultErrorResponseErrorDetailsItem(code.Value, message.Value, target.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs deleted file mode 100644 index d8c3ced0f26f..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppService.Models -{ - /// Detailed errors. - internal partial class DefaultErrorResponseErrorDetailsItem - { - /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. - internal DefaultErrorResponseErrorDetailsItem() - { - } - - /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. - /// Standardized string to programmatically identify the error. - /// Detailed error description and debugging information. - /// Detailed error description and debugging information. - internal DefaultErrorResponseErrorDetailsItem(string code, string message, string target) - { - Code = code; - Message = message; - Target = target; - } - - /// Standardized string to programmatically identify the error. - public string Code { get; } - /// Detailed error description and debugging information. - public string Message { get; } - /// Detailed error description and debugging information. - public string Target { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs deleted file mode 100644 index ab302bcfb1f7..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - public partial class ExtendedLocation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - writer.WriteEndObject(); - } - - internal static ExtendedLocation DeserializeExtendedLocation(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional name = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - } - return new ExtendedLocation(name.Value, type.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs deleted file mode 100644 index 1d18f6691c84..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExtendedLocation.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppService.Models -{ - /// Extended Location. - public partial class ExtendedLocation - { - /// Initializes a new instance of ExtendedLocation. - public ExtendedLocation() - { - } - - /// Initializes a new instance of ExtendedLocation. - /// Name of extended location. - /// Type of extended location. - internal ExtendedLocation(string name, string extendedLocationType) - { - Name = name; - ExtendedLocationType = extendedLocationType; - } - - /// Name of extended location. - public string Name { get; set; } - /// Type of extended location. - public string ExtendedLocationType { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs deleted file mode 100644 index 7ed398bcf0e0..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - public partial class ManagedServiceIdentity : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IdentityType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(IdentityType.Value.ToSerialString()); - } - if (Optional.IsCollectionDefined(UserAssignedIdentities)) - { - writer.WritePropertyName("userAssignedIdentities"u8); - writer.WriteStartObject(); - foreach (var item in UserAssignedIdentities) - { - writer.WritePropertyName(item.Key); - JsonSerializer.Serialize(writer, item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - Optional tenantId = default; - Optional principalId = default; - Optional> userAssignedIdentities = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = property.Value.GetString().ToManagedServiceIdentityType(); - continue; - } - if (property.NameEquals("tenantId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("principalId"u8)) - { - principalId = property.Value.GetString(); - continue; - } - if (property.NameEquals("userAssignedIdentities"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); - } - userAssignedIdentities = dictionary; - continue; - } - } - return new ManagedServiceIdentity(Optional.ToNullable(type), Optional.ToNullable(tenantId), principalId.Value, Optional.ToDictionary(userAssignedIdentities)); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs deleted file mode 100644 index abe36248138d..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentity.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - /// Managed service identity. - public partial class ManagedServiceIdentity - { - /// Initializes a new instance of ManagedServiceIdentity. - public ManagedServiceIdentity() - { - UserAssignedIdentities = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of ManagedServiceIdentity. - /// Type of managed service identity. - /// Tenant of managed service identity. - /// Principal Id of managed service identity. - /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - internal ManagedServiceIdentity(ManagedServiceIdentityType? identityType, Guid? tenantId, string principalId, IDictionary userAssignedIdentities) - { - IdentityType = identityType; - TenantId = tenantId; - PrincipalId = principalId; - UserAssignedIdentities = userAssignedIdentities; - } - - /// Type of managed service identity. - public ManagedServiceIdentityType? IdentityType { get; set; } - /// Tenant of managed service identity. - public Guid? TenantId { get; } - /// Principal Id of managed service identity. - public string PrincipalId { get; } - /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - public IDictionary UserAssignedIdentities { get; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs deleted file mode 100644 index 234ab35667fd..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.AppService.Models -{ - internal static partial class ManagedServiceIdentityTypeExtensions - { - public static string ToSerialString(this ManagedServiceIdentityType value) => value switch - { - ManagedServiceIdentityType.None => "None", - ManagedServiceIdentityType.SystemAssigned => "SystemAssigned", - ManagedServiceIdentityType.UserAssigned => "UserAssigned", - ManagedServiceIdentityType.SystemAssignedUserAssigned => "SystemAssigned, UserAssigned", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value.") - }; - - public static ManagedServiceIdentityType ToManagedServiceIdentityType(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return ManagedServiceIdentityType.None; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "SystemAssigned")) return ManagedServiceIdentityType.SystemAssigned; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "UserAssigned")) return ManagedServiceIdentityType.UserAssigned; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "SystemAssigned, UserAssigned")) return ManagedServiceIdentityType.SystemAssignedUserAssigned; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value."); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs deleted file mode 100644 index a8627389ddc2..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.Serialization.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - public partial class ProxyOnlyResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - writer.WriteEndObject(); - } - - internal static ProxyOnlyResource DeserializeProxyOnlyResource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new ProxyOnlyResource(id, name, type, systemData.Value, kind.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs deleted file mode 100644 index bbbc5306e517..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ProxyOnlyResource.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - /// Azure proxy only resource. This resource is not tracked by Azure Resource Manager. - public partial class ProxyOnlyResource : ResourceData - { - /// Initializes a new instance of ProxyOnlyResource. - public ProxyOnlyResource() - { - } - - /// Initializes a new instance of ProxyOnlyResource. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Kind of resource. - internal ProxyOnlyResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kind) : base(id, name, resourceType, systemData) - { - Kind = kind; - } - - /// Kind of resource. - public string Kind { get; set; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs deleted file mode 100644 index ce05ba603529..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - public partial class StaticSiteUserProvidedFunctionAppProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(FunctionAppResourceId)) - { - writer.WritePropertyName("functionAppResourceId"u8); - writer.WriteStringValue(FunctionAppResourceId); - } - if (Optional.IsDefined(FunctionAppRegion)) - { - writer.WritePropertyName("functionAppRegion"u8); - writer.WriteStringValue(FunctionAppRegion); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteUserProvidedFunctionAppProperties DeserializeStaticSiteUserProvidedFunctionAppProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional functionAppResourceId = default; - Optional functionAppRegion = default; - Optional createdOn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("functionAppResourceId"u8)) - { - functionAppResourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("functionAppRegion"u8)) - { - functionAppRegion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("createdOn"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createdOn = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } - } - return new StaticSiteUserProvidedFunctionAppProperties(id, name, type, systemData.Value, functionAppResourceId.Value, functionAppRegion.Value, Optional.ToNullable(createdOn), kind.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs deleted file mode 100644 index b074a1832368..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteUserProvidedFunctionAppProperties.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.AppService.Models -{ - /// A static site user provided function. - public partial class StaticSiteUserProvidedFunctionAppProperties : ResourceData - { - /// Initializes a new instance of StaticSiteUserProvidedFunctionAppProperties. - public StaticSiteUserProvidedFunctionAppProperties() - { - } - - /// Initializes a new instance of StaticSiteUserProvidedFunctionAppProperties. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The resource id of the function app registered with the static site. - /// The region of the function app registered with the static site. - /// The date and time on which the function app was registered with the static site. - /// Kind of resource. - internal StaticSiteUserProvidedFunctionAppProperties(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string functionAppResourceId, string functionAppRegion, DateTimeOffset? createdOn, string kind) : base(id, name, resourceType, systemData) - { - FunctionAppResourceId = functionAppResourceId; - FunctionAppRegion = functionAppRegion; - CreatedOn = createdOn; - Kind = kind; - } - - /// The resource id of the function app registered with the static site. - public string FunctionAppResourceId { get; set; } - /// The region of the function app registered with the static site. - public string FunctionAppRegion { get; set; } - /// The date and time on which the function app was registered with the static site. - public DateTimeOffset? CreatedOn { get; } - /// Kind of resource. - public string Kind { get; set; } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs deleted file mode 100644 index dbbd425ec66d..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - public partial class UserAssignedIdentity : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static UserAssignedIdentity DeserializeUserAssignedIdentity(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional principalId = default; - Optional clientId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("principalId"u8)) - { - principalId = property.Value.GetString(); - continue; - } - if (property.NameEquals("clientId"u8)) - { - clientId = property.Value.GetString(); - continue; - } - } - return new UserAssignedIdentity(principalId.Value, clientId.Value); - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs deleted file mode 100644 index 353047be3eab..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UserAssignedIdentity.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppService.Models -{ - /// User Assigned identity. - public partial class UserAssignedIdentity - { - /// Initializes a new instance of UserAssignedIdentity. - public UserAssignedIdentity() - { - } - - /// Initializes a new instance of UserAssignedIdentity. - /// Principal Id of user assigned identity. - /// Client Id of user assigned identity. - internal UserAssignedIdentity(string principalId, string clientId) - { - PrincipalId = principalId; - ClientId = clientId; - } - - /// Principal Id of user assigned identity. - public string PrincipalId { get; } - /// Client Id of user assigned identity. - public string ClientId { get; } - } -} From 66e5a08645afc19ae7d125f205b4956b4b7f2ae1 Mon Sep 17 00:00:00 2001 From: m-nash Date: Wed, 13 Sep 2023 20:40:27 -0700 Subject: [PATCH 38/45] update code to internalize types --- .../src/CdkHack/TempInternals.cs | 4 +- .../Generated/ArmAppServiceModelFactory.cs | 269 ------------------ ...llowedAudiencesValidation.Serialization.cs | 2 +- .../Models/AllowedAudiencesValidation.cs | 2 +- .../ApiManagementConfig.Serialization.cs | 2 +- .../Generated/Models/ApiManagementConfig.cs | 2 +- ...pServiceApiDefinitionInfo.Serialization.cs | 2 +- .../Models/AppServiceApiDefinitionInfo.cs | 2 +- ...viceBlobStorageTokenStore.Serialization.cs | 2 +- .../Models/AppServiceBlobStorageTokenStore.cs | 2 +- ...ServiceHttpSettingsRoutes.Serialization.cs | 2 +- .../Models/AppServiceHttpSettingsRoutes.cs | 2 +- ...StaticWebAppsRegistration.Serialization.cs | 2 +- .../AppServiceStaticWebAppsRegistration.cs | 2 +- ...tionDescriptionProperties.Serialization.cs | 2 +- .../CsmOperationDescriptionProperties.cs | 2 +- .../Models/DetectorMetadata.Serialization.cs | 2 +- .../src/Generated/Models/DetectorMetadata.cs | 2 +- .../FileSystemTokenStore.Serialization.cs | 2 +- .../Generated/Models/FileSystemTokenStore.cs | 2 +- .../FrontEndConfiguration.Serialization.cs | 2 +- .../Generated/Models/FrontEndConfiguration.cs | 2 +- .../Models/LoginRoutes.Serialization.cs | 2 +- .../src/Generated/Models/LoginRoutes.cs | 2 +- .../Models/LoginScopes.Serialization.cs | 2 +- .../src/Generated/Models/LoginScopes.cs | 2 +- .../Models/ManagedServiceIdentityType.cs | 22 -- ...ivateLinkResourcesWrapper.Serialization.cs | 2 +- .../Models/PrivateLinkResourcesWrapper.cs | 2 +- .../RoutingRuleExperiments.Serialization.cs | 2 +- .../Models/RoutingRuleExperiments.cs | 2 +- .../WebAppEnabledConfig.Serialization.cs | 2 +- .../Generated/Models/WebAppEnabledConfig.cs | 2 +- 33 files changed, 33 insertions(+), 322 deletions(-) delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs index 8931281b7f62..b240093b818c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs @@ -19,8 +19,9 @@ [assembly: CodeGenSuppressType("ProxyOnlyResource")] [assembly: CodeGenSuppressType("StaticSiteUserProvidedFunctionAppProperties")] [assembly: CodeGenSuppressType("UserAssignedIdentity")] +[assembly: CodeGenSuppressType("ManagedServiceIdentityType")] -namespace Azure.ResourceManager.AppService.CdkHack +namespace Azure.ResourceManager.AppService.Models { #pragma warning disable SA1402 // File may only contain a single type internal partial class AllowedAudiencesValidation { } @@ -38,5 +39,6 @@ internal partial class LoginScopes { } internal partial class PrivateLinkResourcesWrapper { } internal partial class RoutingRuleExperiments { } internal partial class WebAppEnabledConfig { } + internal partial class PrivateLinkResourcesWrapper { } #pragma warning restore SA1402 // File may only contain a single type } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs index 9566565e055b..c293be4ca467 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs @@ -333,18 +333,6 @@ public static DataProviderKeyValuePair DataProviderKeyValuePair(string key = nul return new DataProviderKeyValuePair(key, value); } - /// Initializes a new instance of CsmOperationDescription. - /// - /// - /// Meta data about operation used for display in portal. - /// - /// Properties available for a Microsoft.Web resource provider operation. - /// A new instance for mocking. - public static CsmOperationDescription CsmOperationDescription(string name = null, bool? isDataAction = null, CsmOperationDisplay display = null, string origin = null, ServiceSpecification csmOperationDescriptionServiceSpecification = null) - { - return new CsmOperationDescription(name, isDataAction, display, origin, csmOperationDescriptionServiceSpecification != null ? new CsmOperationDescriptionProperties(csmOperationDescriptionServiceSpecification) : null); - } - /// Initializes a new instance of CsmOperationDisplay. /// /// @@ -356,14 +344,6 @@ public static CsmOperationDisplay CsmOperationDisplay(string provider = null, st return new CsmOperationDisplay(provider, resource, operation, description); } - /// Initializes a new instance of CsmOperationDescriptionProperties. - /// Resource metrics service provided by Microsoft.Insights resource provider. - /// A new instance for mocking. - public static CsmOperationDescriptionProperties CsmOperationDescriptionProperties(ServiceSpecification serviceSpecification = null) - { - return new CsmOperationDescriptionProperties(serviceSpecification); - } - /// Initializes a new instance of ServiceSpecification. /// /// @@ -957,16 +937,6 @@ public static PrivateLinkConnectionApprovalRequestInfo PrivateLinkConnectionAppr return new PrivateLinkConnectionApprovalRequestInfo(id, name, resourceType, systemData, privateLinkServiceConnectionState, kind); } - /// Initializes a new instance of PrivateLinkResourcesWrapper. - /// - /// A new instance for mocking. - public static PrivateLinkResourcesWrapper PrivateLinkResourcesWrapper(IEnumerable value = null) - { - value ??= new List(); - - return new PrivateLinkResourcesWrapper(value?.ToList()); - } - /// Initializes a new instance of AppServicePrivateLinkResourceData. /// The id. /// The name. @@ -1150,103 +1120,6 @@ public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name return new WebSiteData(id, name, resourceType, systemData, tags, location, identity, extendedLocation, state, hostNames?.ToList(), repositorySiteName, usageState, isEnabled, enabledHostNames?.ToList(), availabilityState, hostNameSslStates?.ToList(), appServicePlanId, isReserved, isXenon, isHyperV, lastModifiedTimeUtc, siteConfig, trafficManagerHostNames?.ToList(), isScmSiteAlsoStopped, targetSwapSlot, hostingEnvironmentProfile, isClientAffinityEnabled, isClientCertEnabled, clientCertMode, clientCertExclusionPaths, isHostNameDisabled, customDomainVerificationId, outboundIPAddresses, possibleOutboundIPAddresses, containerSize, dailyMemoryTimeQuota, suspendOn, maxNumberOfWorkers, cloningInfo, resourceGroup, isDefaultContainer, defaultHostName, slotSwapStatus, isHttpsOnly, redundancyMode, inProgressOperationId, isStorageAccountRequired, keyVaultReferenceIdentity, virtualNetworkSubnetId, kind); } - /// Initializes a new instance of SiteConfigProperties. - /// Number of workers. - /// Default documents. - /// .NET Framework version. - /// Version of PHP. - /// Version of Python. - /// Version of Node.js. - /// Version of PowerShell. - /// Linux App Framework and version. - /// Xenon App Framework and version. - /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. - /// Request tracing expiration time. - /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. - /// Remote debugging version. - /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. - /// Flag to use Managed Identity Creds for ACR pull. - /// If using user managed identity, the user managed identity ClientId. - /// HTTP logs directory size limit. - /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. - /// Publishing user name. - /// Application settings. - /// Connection strings. - /// Site MachineKey. - /// Handler mappings. - /// Document root. - /// SCM type. - /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. - /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. - /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. - /// Java version. - /// Java container. - /// Java container version. - /// App command line to launch. - /// Managed pipeline mode. - /// Virtual applications. - /// Site load balancing. - /// This is work around for polymorphic types. - /// Site limits. - /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. - /// Auto Heal rules. - /// Tracing options. - /// Virtual Network name. - /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. - /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. - /// Cross-Origin Resource Sharing (CORS) settings. - /// Push endpoint settings. - /// Information about the formal API definition for the app. - /// Azure API management settings linked to the app. - /// Auto-swap slot name. - /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. - /// Managed Service Identity Id. - /// Explicit Managed Service Identity Id. - /// Identity to use for Key Vault Reference authentication. - /// IP security restrictions for main. - /// IP security restrictions for scm. - /// IP security restrictions for scm to use main. - /// Http20Enabled: configures a web site to allow clients to connect over http2.0. - /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. - /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. - /// State of FTP / FTPS service. - /// - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans - /// - /// - /// Maximum number of workers that a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium Plans - /// - /// Health check path. - /// - /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but will instead call to the - /// runtime to get scale status. - /// - /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - /// - /// Number of minimum instance count for a site - /// This setting only applies to the Elastic Plans - /// - /// List of Azure Storage Accounts. - /// Property to allow or block all public traffic. - /// A new instance for mocking. - public static SiteConfigProperties SiteConfigProperties(int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, IEnumerable scmIPSecurityRestrictions = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null) - { - defaultDocuments ??= new List(); - appSettings ??= new List(); - connectionStrings ??= new List(); - handlerMappings ??= new List(); - virtualApplications ??= new List(); - experimentsRampUpRules ??= new List(); - ipSecurityRestrictions ??= new List(); - scmIPSecurityRestrictions ??= new List(); - azureStorageAccounts ??= new Dictionary(); - - return new SiteConfigProperties(numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), scmIPSecurityRestrictions?.ToList(), allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess); - } - /// Initializes a new instance of SiteMachineKey. /// MachineKey validation. /// Validation key. @@ -1682,30 +1555,6 @@ public static DetectorDefinitionResourceData DetectorDefinitionResourceData(Reso return new DetectorDefinitionResourceData(id, name, resourceType, systemData, displayName, description, rank, isEnabled, kind); } - /// Initializes a new instance of DiagnosticDetectorResponse. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Start time of the period. - /// End time of the period. - /// Flag representing Issue was detected. - /// Detector's definition. - /// Metrics provided by the detector. - /// List of Correlated events found by the detector. - /// Additional Data that detector wants to send. - /// Meta Data. - /// Kind of resource. - /// A new instance for mocking. - public static DiagnosticDetectorResponse DiagnosticDetectorResponse(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, bool? issueDetected = null, DetectorDefinition detectorDefinition = null, IEnumerable metrics = null, IEnumerable abnormalTimePeriods = null, IEnumerable> data = null, DetectorDataSource dataSource = null, string kind = null) - { - metrics ??= new List(); - abnormalTimePeriods ??= new List(); - data ??= new List>(); - - return new DiagnosticDetectorResponse(id, name, resourceType, systemData, startOn, endOn, issueDetected, detectorDefinition, metrics?.ToList(), abnormalTimePeriods?.ToList(), data?.ToList(), dataSource != null ? new DetectorMetadata(dataSource) : null, kind); - } - /// Initializes a new instance of AppSnapshot. /// The id. /// The name. @@ -2860,108 +2709,6 @@ public static CsmPublishingCredentialsPoliciesEntityData CsmPublishingCredential return new CsmPublishingCredentialsPoliciesEntityData(id, name, resourceType, systemData, allow, kind); } - /// Initializes a new instance of SiteConfigData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Number of workers. - /// Default documents. - /// .NET Framework version. - /// Version of PHP. - /// Version of Python. - /// Version of Node.js. - /// Version of PowerShell. - /// Linux App Framework and version. - /// Xenon App Framework and version. - /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. - /// Request tracing expiration time. - /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. - /// Remote debugging version. - /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. - /// Flag to use Managed Identity Creds for ACR pull. - /// If using user managed identity, the user managed identity ClientId. - /// HTTP logs directory size limit. - /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. - /// Publishing user name. - /// Application settings. - /// Connection strings. - /// Site MachineKey. - /// Handler mappings. - /// Document root. - /// SCM type. - /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. - /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. - /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. - /// Java version. - /// Java container. - /// Java container version. - /// App command line to launch. - /// Managed pipeline mode. - /// Virtual applications. - /// Site load balancing. - /// This is work around for polymorphic types. - /// Site limits. - /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. - /// Auto Heal rules. - /// Tracing options. - /// Virtual Network name. - /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. - /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. - /// Cross-Origin Resource Sharing (CORS) settings. - /// Push endpoint settings. - /// Information about the formal API definition for the app. - /// Azure API management settings linked to the app. - /// Auto-swap slot name. - /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. - /// Managed Service Identity Id. - /// Explicit Managed Service Identity Id. - /// Identity to use for Key Vault Reference authentication. - /// IP security restrictions for main. - /// IP security restrictions for scm. - /// IP security restrictions for scm to use main. - /// Http20Enabled: configures a web site to allow clients to connect over http2.0. - /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. - /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. - /// State of FTP / FTPS service. - /// - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans - /// - /// - /// Maximum number of workers that a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium Plans - /// - /// Health check path. - /// - /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but will instead call to the - /// runtime to get scale status. - /// - /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - /// - /// Number of minimum instance count for a site - /// This setting only applies to the Elastic Plans - /// - /// List of Azure Storage Accounts. - /// Property to allow or block all public traffic. - /// Kind of resource. - /// A new instance for mocking. - public static SiteConfigData SiteConfigData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, IEnumerable scmIPSecurityRestrictions = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null, string kind = null) - { - defaultDocuments ??= new List(); - appSettings ??= new List(); - connectionStrings ??= new List(); - handlerMappings ??= new List(); - virtualApplications ??= new List(); - experimentsRampUpRules ??= new List(); - ipSecurityRestrictions ??= new List(); - scmIPSecurityRestrictions ??= new List(); - azureStorageAccounts ??= new Dictionary(); - - return new SiteConfigData(id, name, resourceType, systemData, numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), scmIPSecurityRestrictions?.ToList(), allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess, kind); - } - /// Initializes a new instance of SiteAuthSettings. /// The id. /// The name. @@ -3204,22 +2951,6 @@ public static ConnectionStringDictionary ConnectionStringDictionary(ResourceIden return new ConnectionStringDictionary(id, name, resourceType, systemData, properties, kind); } - /// Initializes a new instance of SiteLogsConfigData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Application logs configuration. - /// HTTP logs configuration. - /// Failed requests tracing configuration. - /// Detailed error messages configuration. - /// Kind of resource. - /// A new instance for mocking. - public static SiteLogsConfigData SiteLogsConfigData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ApplicationLogsConfig applicationLogs = null, AppServiceHttpLogsConfig httpLogs = null, bool? isFailedRequestsTracingEnabled = null, bool? isDetailedErrorMessagesEnabled = null, string kind = null) - { - return new SiteLogsConfigData(id, name, resourceType, systemData, applicationLogs, httpLogs, isFailedRequestsTracingEnabled != null ? new WebAppEnabledConfig(isFailedRequestsTracingEnabled) : null, isDetailedErrorMessagesEnabled != null ? new WebAppEnabledConfig(isDetailedErrorMessagesEnabled) : null, kind); - } - /// Initializes a new instance of SlotConfigNamesResourceData. /// The id. /// The name. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs index 220d08a58941..30158f5a74aa 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class AllowedAudiencesValidation : IUtf8JsonSerializable + internal partial class AllowedAudiencesValidation : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs index ccdf100f58bb..c6e64c73463e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AllowedAudiencesValidation.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the Allowed Audiences validation flow. - public partial class AllowedAudiencesValidation + internal partial class AllowedAudiencesValidation { /// Initializes a new instance of AllowedAudiencesValidation. public AllowedAudiencesValidation() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs index 2c50b8dc2bd6..0e1286786ed5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class ApiManagementConfig : IUtf8JsonSerializable + internal partial class ApiManagementConfig : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs index 2483039c3a9f..77f409c619be 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ApiManagementConfig.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Azure API management (APIM) configuration linked to the app. - public partial class ApiManagementConfig + internal partial class ApiManagementConfig { /// Initializes a new instance of ApiManagementConfig. public ApiManagementConfig() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs index 8f627b93cacf..2af7e3e68f79 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class AppServiceApiDefinitionInfo : IUtf8JsonSerializable + internal partial class AppServiceApiDefinitionInfo : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs index 72307ace8764..ad93cad6482e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceApiDefinitionInfo.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Information about the formal API definition for the app. - public partial class AppServiceApiDefinitionInfo + internal partial class AppServiceApiDefinitionInfo { /// Initializes a new instance of AppServiceApiDefinitionInfo. public AppServiceApiDefinitionInfo() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs index 7bebe161fab8..c862c5aac6e0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class AppServiceBlobStorageTokenStore : IUtf8JsonSerializable + internal partial class AppServiceBlobStorageTokenStore : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs index a52339e9c312..84fb25b00bec 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceBlobStorageTokenStore.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the storage of the tokens if blob storage is used. - public partial class AppServiceBlobStorageTokenStore + internal partial class AppServiceBlobStorageTokenStore { /// Initializes a new instance of AppServiceBlobStorageTokenStore. public AppServiceBlobStorageTokenStore() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs index e074696142dd..588328d36489 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class AppServiceHttpSettingsRoutes : IUtf8JsonSerializable + internal partial class AppServiceHttpSettingsRoutes : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs index d941c4314b96..a361d22d39e0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceHttpSettingsRoutes.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the paths HTTP requests. - public partial class AppServiceHttpSettingsRoutes + internal partial class AppServiceHttpSettingsRoutes { /// Initializes a new instance of AppServiceHttpSettingsRoutes. public AppServiceHttpSettingsRoutes() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs index f9bf0f33452e..13c12cb31e6f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class AppServiceStaticWebAppsRegistration : IUtf8JsonSerializable + internal partial class AppServiceStaticWebAppsRegistration : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs index 69de99c5cc38..0737bac19d5b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceStaticWebAppsRegistration.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the registration for the Azure Static Web Apps provider. - public partial class AppServiceStaticWebAppsRegistration + internal partial class AppServiceStaticWebAppsRegistration { /// Initializes a new instance of AppServiceStaticWebAppsRegistration. public AppServiceStaticWebAppsRegistration() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs index 19fffca6cfe9..9560793ea487 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class CsmOperationDescriptionProperties + internal partial class CsmOperationDescriptionProperties { internal static CsmOperationDescriptionProperties DeserializeCsmOperationDescriptionProperties(JsonElement element) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs index 98ef73176446..81255913015f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmOperationDescriptionProperties.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Properties available for a Microsoft.Web resource provider operation. - public partial class CsmOperationDescriptionProperties + internal partial class CsmOperationDescriptionProperties { /// Initializes a new instance of CsmOperationDescriptionProperties. internal CsmOperationDescriptionProperties() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs index 5c59f4bdfaba..7d2ccea93c04 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class DetectorMetadata : IUtf8JsonSerializable + internal partial class DetectorMetadata : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs index e81e21ab378b..244890ec62b2 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DetectorMetadata.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The DetectorMetadata. - public partial class DetectorMetadata + internal partial class DetectorMetadata { /// Initializes a new instance of DetectorMetadata. public DetectorMetadata() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs index 25e558074e87..f554eac011bf 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class FileSystemTokenStore : IUtf8JsonSerializable + internal partial class FileSystemTokenStore : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs index 0bde28a2db50..671bb4e0379a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FileSystemTokenStore.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the storage of the tokens if a file system is used. - public partial class FileSystemTokenStore + internal partial class FileSystemTokenStore { /// Initializes a new instance of FileSystemTokenStore. public FileSystemTokenStore() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs index 08d1474e16b0..5c4b6288df23 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class FrontEndConfiguration : IUtf8JsonSerializable + internal partial class FrontEndConfiguration : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs index 3c96c797835e..1573d681dd82 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FrontEndConfiguration.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The FrontEndConfiguration. - public partial class FrontEndConfiguration + internal partial class FrontEndConfiguration { /// Initializes a new instance of FrontEndConfiguration. public FrontEndConfiguration() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs index 772809f8b4f9..6dbf5597dbd8 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class LoginRoutes : IUtf8JsonSerializable + internal partial class LoginRoutes : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs index e1d2d591571f..fd8d3d8fc1b9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginRoutes.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The routes that specify the endpoints used for login and logout requests. - public partial class LoginRoutes + internal partial class LoginRoutes { /// Initializes a new instance of LoginRoutes. public LoginRoutes() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs index 9f32c524be1b..87d33a0f85a9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class LoginScopes : IUtf8JsonSerializable + internal partial class LoginScopes : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs index fd9e1b28cce9..78e413fd0929 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/LoginScopes.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { /// The configuration settings of the login flow, including the scopes that should be requested. - public partial class LoginScopes + internal partial class LoginScopes { /// Initializes a new instance of LoginScopes. public LoginScopes() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs deleted file mode 100644 index 5f15c804228e..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ManagedServiceIdentityType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppService.Models -{ - /// Type of managed service identity. - public enum ManagedServiceIdentityType - { - /// None. - None, - /// SystemAssigned. - SystemAssigned, - /// UserAssigned. - UserAssigned, - /// SystemAssigned, UserAssigned. - SystemAssignedUserAssigned - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs index 6aa179a8cc19..a3116bbe43c9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class PrivateLinkResourcesWrapper + internal partial class PrivateLinkResourcesWrapper { internal static PrivateLinkResourcesWrapper DeserializePrivateLinkResourcesWrapper(JsonElement element) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs index 39ce5a16b59b..9de27492a6d1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/PrivateLinkResourcesWrapper.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Wrapper for a collection of private link resources. - public partial class PrivateLinkResourcesWrapper + internal partial class PrivateLinkResourcesWrapper { /// Initializes a new instance of PrivateLinkResourcesWrapper. /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs index 5ab1c8e5eb96..51cd084e0c7c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class RoutingRuleExperiments : IUtf8JsonSerializable + internal partial class RoutingRuleExperiments : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs index 4b1773d49db3..69f2ac624f8c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RoutingRuleExperiments.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Routing rules in production experiments. - public partial class RoutingRuleExperiments + internal partial class RoutingRuleExperiments { /// Initializes a new instance of RoutingRuleExperiments. public RoutingRuleExperiments() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs index 26b8425a0996..e7c33aaa4fc1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.AppService.Models { - public partial class WebAppEnabledConfig : IUtf8JsonSerializable + internal partial class WebAppEnabledConfig : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs index 3cb3f8aabdb4..ecbd8e17e4ff 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WebAppEnabledConfig.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.AppService.Models { /// Enabled configuration. - public partial class WebAppEnabledConfig + internal partial class WebAppEnabledConfig { /// Initializes a new instance of WebAppEnabledConfig. public WebAppEnabledConfig() From 71d07ea1d689f9813ef60466a68b4c2416a51996 Mon Sep 17 00:00:00 2001 From: m-nash Date: Wed, 13 Sep 2023 20:56:37 -0700 Subject: [PATCH 39/45] make model factory customer for now --- .../ArmAppServiceModelFactory.cs | 305 +++++++++++++----- .../src/CdkHack/TempInternals.cs | 3 + 2 files changed, 234 insertions(+), 74 deletions(-) rename sdk/websites/Azure.ResourceManager.AppService/src/{Generated => CdkHack}/ArmAppServiceModelFactory.cs (91%) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/ArmAppServiceModelFactory.cs similarity index 91% rename from sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/ArmAppServiceModelFactory.cs index c293be4ca467..730d699df646 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/ArmAppServiceModelFactory.cs @@ -95,22 +95,6 @@ public static CertificateOrderContact CertificateOrderContact(string email = nul return new CertificateOrderContact(email, nameFirst, nameLast, phone); } - /// Initializes a new instance of AppServiceResource. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Kind of resource. - /// A new instance for mocking. - public static AppServiceResource AppServiceResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string kind = null) - { - tags ??= new Dictionary(); - - return new AppServiceResource(id, name, resourceType, systemData, tags, location, kind); - } - /// Initializes a new instance of AppServiceCertificateOrderPatch. /// The id. /// The name. @@ -146,18 +130,6 @@ public static AppServiceCertificateOrderPatch AppServiceCertificateOrderPatch(Re return new AppServiceCertificateOrderPatch(id, name, resourceType, systemData, certificates, distinguishedName, domainVerificationToken, validityInYears, keySize, productType, isAutoRenew, provisioningState, status, signedCertificate, csr, intermediate, root, serialNumber, lastCertificateIssuanceOn, expireOn, isPrivateKeyExternal, appServiceCertificateNotRenewableReasons?.ToList(), nextAutoRenewalTimeStamp, contact, kind); } - /// Initializes a new instance of ProxyOnlyResource. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Kind of resource. - /// A new instance for mocking. - public static ProxyOnlyResource ProxyOnlyResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kind = null) - { - return new ProxyOnlyResource(id, name, resourceType, systemData, kind); - } - /// Initializes a new instance of AppServiceCertificateData. /// The id. /// The name. @@ -916,14 +888,6 @@ public static RemotePrivateEndpointConnectionARMResourceData RemotePrivateEndpoi return new RemotePrivateEndpointConnectionARMResourceData(id, name, resourceType, systemData, provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, privateLinkServiceConnectionState, ipAddresses?.ToList(), kind); } - /// Initializes a new instance of ArmIdWrapper. - /// - /// A new instance for mocking. - public static ArmIdWrapper ArmIdWrapper(string id = null) - { - return new ArmIdWrapper(id); - } - /// Initializes a new instance of PrivateLinkConnectionApprovalRequestInfo. /// The id. /// The name. @@ -1028,15 +992,6 @@ public static KubeEnvironmentProfile KubeEnvironmentProfile(ResourceIdentifier i return new KubeEnvironmentProfile(id, name, resourceType); } - /// Initializes a new instance of ExtendedLocation. - /// Name of extended location. - /// Type of extended location. - /// A new instance for mocking. - public static ExtendedLocation ExtendedLocation(string name = null, string extendedLocationType = null) - { - return new ExtendedLocation(name, extendedLocationType); - } - /// Initializes a new instance of WebSiteData. /// The id. /// The name. @@ -1175,28 +1130,6 @@ public static SlotSwapStatus SlotSwapStatus(DateTimeOffset? timestampUtc = null, return new SlotSwapStatus(timestampUtc, sourceSlotName, destinationSlotName); } - /// Initializes a new instance of ManagedServiceIdentity. - /// Type of managed service identity. - /// Tenant of managed service identity. - /// Principal Id of managed service identity. - /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// A new instance for mocking. - public static ManagedServiceIdentity ManagedServiceIdentity(ManagedServiceIdentityType? identityType = null, Guid? tenantId = null, string principalId = null, IDictionary userAssignedIdentities = null) - { - userAssignedIdentities ??= new Dictionary(); - - return new ManagedServiceIdentity(identityType, tenantId, principalId, userAssignedIdentities); - } - - /// Initializes a new instance of UserAssignedIdentity. - /// Principal Id of user assigned identity. - /// Client Id of user assigned identity. - /// A new instance for mocking. - public static UserAssignedIdentity UserAssignedIdentity(string principalId = null, string clientId = null) - { - return new UserAssignedIdentity(principalId, clientId); - } - /// Initializes a new instance of CsmUsageQuota. /// Units of measurement for the quota resource. /// Next reset time for the resource counter. @@ -3734,19 +3667,243 @@ public static WebJobData WebJobData(ResourceIdentifier id = null, string name = return new WebJobData(id, name, resourceType, systemData, runCommand, uri, extraInfoUri, webJobType, error, isUsingSdk, settings, kind); } - /// Initializes a new instance of StaticSiteUserProvidedFunctionAppProperties. + /// Initializes a new instance of SiteConfigProperties. + /// Number of workers. + /// Default documents. + /// .NET Framework version. + /// Version of PHP. + /// Version of Python. + /// Version of Node.js. + /// Version of PowerShell. + /// Linux App Framework and version. + /// Xenon App Framework and version. + /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. + /// Request tracing expiration time. + /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. + /// Remote debugging version. + /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. + /// Flag to use Managed Identity Creds for ACR pull. + /// If using user managed identity, the user managed identity ClientId. + /// HTTP logs directory size limit. + /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. + /// Publishing user name. + /// Application settings. + /// Connection strings. + /// Site MachineKey. + /// Handler mappings. + /// Document root. + /// SCM type. + /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. + /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. + /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. + /// Java version. + /// Java container. + /// Java container version. + /// App command line to launch. + /// Managed pipeline mode. + /// Virtual applications. + /// Site load balancing. + /// This is work around for polymorphic types. + /// Site limits. + /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. + /// Auto Heal rules. + /// Tracing options. + /// Virtual Network name. + /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. + /// Cross-Origin Resource Sharing (CORS) settings. + /// Push endpoint settings. + /// Information about the formal API definition for the app. + /// Azure API management settings linked to the app. + /// Auto-swap slot name. + /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. + /// Managed Service Identity Id. + /// Explicit Managed Service Identity Id. + /// Identity to use for Key Vault Reference authentication. + /// IP security restrictions for main. + /// IP security restrictions for scm. + /// IP security restrictions for scm to use main. + /// Http20Enabled: configures a web site to allow clients to connect over http2.0. + /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. + /// State of FTP / FTPS service. + /// + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans + /// + /// + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium Plans + /// + /// Health check path. + /// + /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but will instead call to the + /// runtime to get scale status. + /// + /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + /// + /// Number of minimum instance count for a site + /// This setting only applies to the Elastic Plans + /// + /// List of Azure Storage Accounts. + /// Property to allow or block all public traffic. + /// A new instance for mocking. + public static SiteConfigProperties SiteConfigProperties(int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, IEnumerable scmIPSecurityRestrictions = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null) + { + defaultDocuments ??= new List(); + appSettings ??= new List(); + connectionStrings ??= new List(); + handlerMappings ??= new List(); + virtualApplications ??= new List(); + experimentsRampUpRules ??= new List(); + ipSecurityRestrictions ??= new List(); + scmIPSecurityRestrictions ??= new List(); + azureStorageAccounts ??= new Dictionary(); + + return new SiteConfigProperties(numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), scmIPSecurityRestrictions?.ToList(), allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess); + } + + /// Initializes a new instance of SiteConfigData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Number of workers. + /// Default documents. + /// .NET Framework version. + /// Version of PHP. + /// Version of Python. + /// Version of Node.js. + /// Version of PowerShell. + /// Linux App Framework and version. + /// Xenon App Framework and version. + /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. + /// Request tracing expiration time. + /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. + /// Remote debugging version. + /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. + /// Flag to use Managed Identity Creds for ACR pull. + /// If using user managed identity, the user managed identity ClientId. + /// HTTP logs directory size limit. + /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. + /// Publishing user name. + /// Application settings. + /// Connection strings. + /// Site MachineKey. + /// Handler mappings. + /// Document root. + /// SCM type. + /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. + /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. + /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. + /// Java version. + /// Java container. + /// Java container version. + /// App command line to launch. + /// Managed pipeline mode. + /// Virtual applications. + /// Site load balancing. + /// This is work around for polymorphic types. + /// Site limits. + /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. + /// Auto Heal rules. + /// Tracing options. + /// Virtual Network name. + /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. + /// Cross-Origin Resource Sharing (CORS) settings. + /// Push endpoint settings. + /// Information about the formal API definition for the app. + /// Azure API management settings linked to the app. + /// Auto-swap slot name. + /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. + /// Managed Service Identity Id. + /// Explicit Managed Service Identity Id. + /// Identity to use for Key Vault Reference authentication. + /// IP security restrictions for main. + /// IP security restrictions for scm. + /// IP security restrictions for scm to use main. + /// Http20Enabled: configures a web site to allow clients to connect over http2.0. + /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. + /// State of FTP / FTPS service. + /// + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans + /// + /// + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium Plans + /// + /// Health check path. + /// + /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but will instead call to the + /// runtime to get scale status. + /// + /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + /// + /// Number of minimum instance count for a site + /// This setting only applies to the Elastic Plans + /// + /// List of Azure Storage Accounts. + /// Property to allow or block all public traffic. + /// Kind of resource. + /// A new instance for mocking. + public static SiteConfigData SiteConfigData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, IEnumerable scmIPSecurityRestrictions = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null, string kind = null) + { + defaultDocuments ??= new List(); + appSettings ??= new List(); + connectionStrings ??= new List(); + handlerMappings ??= new List(); + virtualApplications ??= new List(); + experimentsRampUpRules ??= new List(); + ipSecurityRestrictions ??= new List(); + scmIPSecurityRestrictions ??= new List(); + azureStorageAccounts ??= new Dictionary(); + + return new SiteConfigData(id, name, resourceType, systemData, numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), scmIPSecurityRestrictions?.ToList(), allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess, kind); + } + + /// Initializes a new instance of SiteLogsConfigData. /// The id. /// The name. /// The resourceType. /// The systemData. - /// The resource id of the function app registered with the static site. - /// The region of the function app registered with the static site. - /// The date and time on which the function app was registered with the static site. + /// Application logs configuration. + /// HTTP logs configuration. + /// Failed requests tracing configuration. + /// Detailed error messages configuration. + /// Kind of resource. + /// A new instance for mocking. + public static SiteLogsConfigData SiteLogsConfigData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ApplicationLogsConfig applicationLogs = null, AppServiceHttpLogsConfig httpLogs = null, bool? isFailedRequestsTracingEnabled = null, bool? isDetailedErrorMessagesEnabled = null, string kind = null) + { + return new SiteLogsConfigData(id, name, resourceType, systemData, applicationLogs, httpLogs, isFailedRequestsTracingEnabled != null ? new WebAppEnabledConfig(isFailedRequestsTracingEnabled) : null, isDetailedErrorMessagesEnabled != null ? new WebAppEnabledConfig(isDetailedErrorMessagesEnabled) : null, kind); + } + + /// Initializes a new instance of DiagnosticDetectorResponse. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Start time of the period. + /// End time of the period. + /// Flag representing Issue was detected. + /// Detector's definition. + /// Metrics provided by the detector. + /// List of Correlated events found by the detector. + /// Additional Data that detector wants to send. + /// Meta Data. /// Kind of resource. - /// A new instance for mocking. - public static StaticSiteUserProvidedFunctionAppProperties StaticSiteUserProvidedFunctionAppProperties(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string functionAppResourceId = null, string functionAppRegion = null, DateTimeOffset? createdOn = null, string kind = null) + /// A new instance for mocking. + public static DiagnosticDetectorResponse DiagnosticDetectorResponse(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, bool? issueDetected = null, DetectorDefinition detectorDefinition = null, IEnumerable metrics = null, IEnumerable abnormalTimePeriods = null, IEnumerable> data = null, DetectorDataSource dataSource = null, string kind = null) { - return new StaticSiteUserProvidedFunctionAppProperties(id, name, resourceType, systemData, functionAppResourceId, functionAppRegion, createdOn, kind); + metrics ??= new List(); + abnormalTimePeriods ??= new List(); + data ??= new List>(); + + return new DiagnosticDetectorResponse(id, name, resourceType, systemData, startOn, endOn, issueDetected, detectorDefinition, metrics?.ToList(), abnormalTimePeriods?.ToList(), data?.ToList(), dataSource != null ? new DetectorMetadata(dataSource) : null, kind); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs index b240093b818c..d8f59ddde4c2 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/CdkHack/TempInternals.cs @@ -3,7 +3,9 @@ //This file is needed because we had to turn off the post processor which makes a bunch of types public. +using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.Models; [assembly: CodeGenSuppressType("ArmIdWrapper")] [assembly: CodeGenSuppressType("AppServiceGithubToken")] @@ -20,6 +22,7 @@ [assembly: CodeGenSuppressType("StaticSiteUserProvidedFunctionAppProperties")] [assembly: CodeGenSuppressType("UserAssignedIdentity")] [assembly: CodeGenSuppressType("ManagedServiceIdentityType")] +[assembly: CodeGenSuppressType("ArmAppServiceModelFactory")] namespace Azure.ResourceManager.AppService.Models { From 8304552ee52a171b4f7a2e8396cb991b7a0ea8ca Mon Sep 17 00:00:00 2001 From: m-nash Date: Wed, 13 Sep 2023 21:04:33 -0700 Subject: [PATCH 40/45] update api --- ...sourceManager.AppService.netstandard2.0.cs | 135 ------------------ 1 file changed, 135 deletions(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs index 648cbb408b87..e53fe36c5ce8 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs @@ -4382,11 +4382,6 @@ public AbnormalTimePeriod() { } public System.Collections.Generic.IList Solutions { get { throw null; } } public System.DateTimeOffset? StartOn { get { throw null; } set { } } } - public partial class AllowedAudiencesValidation - { - public AllowedAudiencesValidation() { } - public System.Collections.Generic.IList AllowedAudiences { get { throw null; } } - } public partial class AnalysisDetectorEvidences { public AnalysisDetectorEvidences() { } @@ -4396,11 +4391,6 @@ public AnalysisDetectorEvidences() { } public System.Collections.Generic.IList Metrics { get { throw null; } } public string Source { get { throw null; } set { } } } - public partial class ApiManagementConfig - { - public ApiManagementConfig() { } - public string Id { get { throw null; } set { } } - } public partial class AppCertificatePatch : Azure.ResourceManager.Models.ResourceData { public AppCertificatePatch() { } @@ -4520,11 +4510,6 @@ public AppServiceAadValidation() { } public Azure.ResourceManager.AppService.Models.DefaultAuthorizationPolicy DefaultAuthorizationPolicy { get { throw null; } set { } } public Azure.ResourceManager.AppService.Models.JwtClaimChecks JwtClaimChecks { get { throw null; } set { } } } - public partial class AppServiceApiDefinitionInfo - { - public AppServiceApiDefinitionInfo() { } - public System.Uri Uri { get { throw null; } set { } } - } public partial class AppServiceAppleProvider { public AppServiceAppleProvider() { } @@ -4572,11 +4557,6 @@ public AppServiceBlobStorageHttpLogsConfig() { } public int? RetentionInDays { get { throw null; } set { } } public System.Uri SasUri { get { throw null; } set { } } } - public partial class AppServiceBlobStorageTokenStore - { - public AppServiceBlobStorageTokenStore() { } - public string SasUrlSettingName { get { throw null; } set { } } - } public partial class AppServiceCertificateDetails { internal AppServiceCertificateDetails() { } @@ -4932,11 +4912,6 @@ public AppServiceHttpSettings() { } public bool? IsHttpsRequired { get { throw null; } set { } } public string RoutesApiPrefix { get { throw null; } set { } } } - public partial class AppServiceHttpSettingsRoutes - { - public AppServiceHttpSettingsRoutes() { } - public string ApiPrefix { get { throw null; } set { } } - } public partial class AppServiceIdentityProviders { public AppServiceIdentityProviders() { } @@ -5099,11 +5074,6 @@ public AppServiceRecommendation() { } public System.DateTimeOffset? StartOn { get { throw null; } set { } } public System.Collections.Generic.IList States { get { throw null; } } } - public partial class AppServiceResource : Azure.ResourceManager.Models.TrackedResourceData - { - public AppServiceResource(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } - public string Kind { get { throw null; } set { } } - } public enum AppServiceResourceType { Website = 0, @@ -5182,11 +5152,6 @@ public AppServiceStaticWebAppsProvider() { } public bool? IsEnabled { get { throw null; } set { } } public string RegistrationClientId { get { throw null; } set { } } } - public partial class AppServiceStaticWebAppsRegistration - { - public AppServiceStaticWebAppsRegistration() { } - public string ClientId { get { throw null; } set { } } - } public partial class AppServiceStatusInfo { public AppServiceStatusInfo() { } @@ -5416,7 +5381,6 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.AppServicePrivateLinkResourceData AppServicePrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.AppServicePrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServicePrivateLinkResourceProperties AppServicePrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServiceRecommendation AppServiceRecommendation(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.Guid? recommendationId = default(System.Guid?), Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.AppService.Models.ResourceScopeType? resourceScope = default(Azure.ResourceManager.AppService.Models.ResourceScopeType?), string ruleName = null, string displayName = null, string message = null, Azure.ResourceManager.AppService.Models.NotificationLevel? level = default(Azure.ResourceManager.AppService.Models.NotificationLevel?), Azure.ResourceManager.AppService.Models.RecommendationChannel? channels = default(Azure.ResourceManager.AppService.Models.RecommendationChannel?), System.Collections.Generic.IEnumerable categoryTags = null, string actionName = null, int? enabled = default(int?), System.Collections.Generic.IEnumerable states = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.DateTimeOffset? nextNotificationOn = default(System.DateTimeOffset?), System.DateTimeOffset? notificationExpirationOn = default(System.DateTimeOffset?), System.DateTimeOffset? notifiedOn = default(System.DateTimeOffset?), double? score = default(double?), bool? isDynamic = default(bool?), string extensionName = null, string bladeName = null, string forwardLink = null, string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.AppServiceResource AppServiceResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServiceSkuResult AppServiceSkuResult(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IEnumerable skus = null) { throw null; } public static Azure.ResourceManager.AppService.AppServiceSourceControlData AppServiceSourceControlData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string token = null, string tokenSecret = null, string refreshToken = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppServiceStorageAccessInfo AppServiceStorageAccessInfo(Azure.ResourceManager.AppService.Models.AppServiceStorageType? storageType = default(Azure.ResourceManager.AppService.Models.AppServiceStorageType?), string accountName = null, string shareName = null, string accessKey = null, string mountPath = null, Azure.ResourceManager.AppService.Models.AppServiceStorageAccountState? state = default(Azure.ResourceManager.AppService.Models.AppServiceStorageAccountState?)) { throw null; } @@ -5430,15 +5394,12 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.AppServiceVirtualNetworkValidationContent AppServiceVirtualNetworkValidationContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string vnetResourceGroup = null, string vnetName = null, string vnetSubnetName = null, Azure.Core.ResourceIdentifier subnetResourceId = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.AppServiceWorkerPoolData AppServiceWorkerPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.AppServiceSkuDescription sku = null, int? workerSizeId = default(int?), Azure.ResourceManager.AppService.Models.ComputeModeOption? computeMode = default(Azure.ResourceManager.AppService.Models.ComputeModeOption?), string workerSize = null, int? workerCount = default(int?), System.Collections.Generic.IEnumerable instanceNames = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AppSnapshot AppSnapshot(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string time = null, string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.ArmIdWrapper ArmIdWrapper(string id = null) { throw null; } public static Azure.ResourceManager.AppService.AseV3NetworkingConfigurationData AseV3NetworkingConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable windowsOutboundIPAddresses = null, System.Collections.Generic.IEnumerable linuxOutboundIPAddresses = null, System.Collections.Generic.IEnumerable externalInboundIPAddresses = null, System.Collections.Generic.IEnumerable internalInboundIPAddresses = null, bool? allowNewPrivateEndpointConnections = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.AzureStoragePropertyDictionary AzureStoragePropertyDictionary(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary properties = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CertificateOrderAction CertificateOrderAction(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.CertificateOrderActionType? actionType = default(Azure.ResourceManager.AppService.Models.CertificateOrderActionType?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CertificateOrderContact CertificateOrderContact(string email = null, string nameFirst = null, string nameLast = null, string phone = null) { throw null; } public static Azure.ResourceManager.AppService.Models.ConnectionStringDictionary ConnectionStringDictionary(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary properties = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.ContinuousWebJobData ContinuousWebJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.ContinuousWebJobStatus? status = default(Azure.ResourceManager.AppService.Models.ContinuousWebJobStatus?), string detailedStatus = null, System.Uri logUri = null, string runCommand = null, System.Uri uri = null, System.Uri extraInfoUri = null, Azure.ResourceManager.AppService.Models.WebJobType? webJobType = default(Azure.ResourceManager.AppService.Models.WebJobType?), string error = null, bool? isUsingSdk = default(bool?), System.Collections.Generic.IDictionary settings = null, string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.CsmOperationDescription CsmOperationDescription(string name = null, bool? isDataAction = default(bool?), Azure.ResourceManager.AppService.Models.CsmOperationDisplay display = null, string origin = null, Azure.ResourceManager.AppService.Models.ServiceSpecification csmOperationDescriptionServiceSpecification = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.CsmOperationDescriptionProperties CsmOperationDescriptionProperties(Azure.ResourceManager.AppService.Models.ServiceSpecification serviceSpecification = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CsmOperationDisplay CsmOperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) { throw null; } public static Azure.ResourceManager.AppService.CsmPublishingCredentialsPoliciesEntityData CsmPublishingCredentialsPoliciesEntityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? allow = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.CsmUsageQuota CsmUsageQuota(string unit = null, System.DateTimeOffset? nextResetOn = default(System.DateTimeOffset?), long? currentValue = default(long?), long? limit = default(long?), Azure.ResourceManager.AppService.Models.LocalizableString name = null) { throw null; } @@ -5457,7 +5418,6 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.DomainAvailabilityCheckResult DomainAvailabilityCheckResult(string name = null, bool? isAvailable = default(bool?), Azure.ResourceManager.AppService.Models.AppServiceDomainType? domainType = default(Azure.ResourceManager.AppService.Models.AppServiceDomainType?)) { throw null; } public static Azure.ResourceManager.AppService.Models.DomainControlCenterSsoRequestInfo DomainControlCenterSsoRequestInfo(System.Uri uri = null, string postParameterKey = null, string postParameterValue = null) { throw null; } public static Azure.ResourceManager.AppService.DomainOwnershipIdentifierData DomainOwnershipIdentifierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string ownershipId = null, string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.ExtendedLocation ExtendedLocation(string name = null, string extendedLocationType = null) { throw null; } public static Azure.ResourceManager.AppService.Models.FunctionAppHostKeys FunctionAppHostKeys(string masterKey = null, System.Collections.Generic.IReadOnlyDictionary functionKeys = null, System.Collections.Generic.IReadOnlyDictionary systemKeys = null) { throw null; } public static Azure.ResourceManager.AppService.Models.FunctionAppMajorVersion FunctionAppMajorVersion(string displayText = null, string value = null, System.Collections.Generic.IEnumerable minorVersions = null) { throw null; } public static Azure.ResourceManager.AppService.Models.FunctionAppMinorVersion FunctionAppMinorVersion(string displayText = null, string value = null, Azure.ResourceManager.AppService.Models.FunctionAppRuntimes stackSettings = null) { throw null; } @@ -5482,7 +5442,6 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.LinuxJavaContainerSettings LinuxJavaContainerSettings(string java11Runtime = null, string java8Runtime = null, bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTimeOffset? endOfLifeOn = default(System.DateTimeOffset?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) { throw null; } public static Azure.ResourceManager.AppService.Models.LocalizableString LocalizableString(string value = null, string localizedValue = null) { throw null; } public static Azure.ResourceManager.AppService.Models.LogSpecification LogSpecification(string name = null, string displayName = null, System.TimeSpan? blobDuration = default(System.TimeSpan?), string logFilterPattern = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.ManagedServiceIdentity ManagedServiceIdentity(Azure.ResourceManager.AppService.Models.ManagedServiceIdentityType? identityType = default(Azure.ResourceManager.AppService.Models.ManagedServiceIdentityType?), System.Guid? tenantId = default(System.Guid?), string principalId = null, System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.AppService.Models.MetricAvailability MetricAvailability(string timeGrain = null, System.TimeSpan? blobDuration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.AppService.Models.MetricDimension MetricDimension(string name = null, string displayName = null, string internalName = null, bool? isToBeExportedForShoebox = default(bool?)) { throw null; } public static Azure.ResourceManager.AppService.Models.MetricSpecification MetricSpecification(string name = null, string displayName = null, string displayDescription = null, string unit = null, string aggregationType = null, bool? isInstanceLevelAggregationSupported = default(bool?), bool? isRegionalMdmAccountEnabled = default(bool?), string sourceMdmAccount = null, string sourceMdmNamespace = null, string metricFilterPattern = null, bool? fillGapWithZero = default(bool?), bool? isInternal = default(bool?), System.Collections.Generic.IEnumerable dimensions = null, string category = null, System.Collections.Generic.IEnumerable availabilities = null, System.Collections.Generic.IEnumerable supportedTimeGrainTypes = null, System.Collections.Generic.IEnumerable supportedAggregationTypes = null) { throw null; } @@ -5499,11 +5458,9 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.PremierAddOnPatchResource PremierAddOnPatchResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string sku = null, string product = null, string vendor = null, string marketplacePublisher = null, string marketplaceOffer = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.PrivateAccessData PrivateAccessData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isEnabled = default(bool?), System.Collections.Generic.IEnumerable virtualNetworks = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.PrivateLinkConnectionApprovalRequestInfo PrivateLinkConnectionApprovalRequestInfo(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.PrivateLinkConnectionState privateLinkServiceConnectionState = null, string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.PrivateLinkResourcesWrapper PrivateLinkResourcesWrapper(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.ResourceManager.AppService.ProcessInfoData ProcessInfoData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? identifier = default(int?), string deploymentName = null, string href = null, string minidump = null, bool? isProfileRunning = default(bool?), bool? isIisProfileRunning = default(bool?), double? iisProfileTimeoutInSeconds = default(double?), string parent = null, System.Collections.Generic.IEnumerable children = null, System.Collections.Generic.IEnumerable threads = null, System.Collections.Generic.IEnumerable openFileHandles = null, System.Collections.Generic.IEnumerable modules = null, string fileName = null, string commandLine = null, string userName = null, int? handleCount = default(int?), int? moduleCount = default(int?), int? threadCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string totalCpuTime = null, string userCpuTime = null, string privilegedCpuTime = null, long? workingSet = default(long?), long? peakWorkingSet = default(long?), long? privateMemory = default(long?), long? virtualMemory = default(long?), long? peakVirtualMemory = default(long?), long? pagedSystemMemory = default(long?), long? nonPagedSystemMemory = default(long?), long? pagedMemory = default(long?), long? peakPagedMemory = default(long?), System.DateTimeOffset? timeStamp = default(System.DateTimeOffset?), System.Collections.Generic.IDictionary environmentVariables = null, bool? isScmSite = default(bool?), bool? isWebjob = default(bool?), string description = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.ProcessModuleInfoData ProcessModuleInfoData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string baseAddress = null, string fileName = null, string href = null, string filePath = null, int? moduleMemorySize = default(int?), string fileVersion = null, string fileDescription = null, string product = null, string productVersion = null, bool? isDebug = default(bool?), string language = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.ProcessThreadInfo ProcessThreadInfo(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? identifier = default(int?), string href = null, string process = null, string startAddress = null, int? currentPriority = default(int?), string priorityLevel = null, int? basePriority = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string totalProcessorTime = null, string userProcessorTime = null, string state = null, string waitReason = null, string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.ProxyOnlyResource ProxyOnlyResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.PublicCertificateData PublicCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, byte[] blob = null, Azure.ResourceManager.AppService.Models.PublicCertificateLocation? publicCertificateLocation = default(Azure.ResourceManager.AppService.Models.PublicCertificateLocation?), string thumbprintString = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.PublishingUserData PublishingUserData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string publishingUserName = null, string publishingPassword = null, string publishingPasswordHash = null, string publishingPasswordHashSalt = null, System.Uri scmUri = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.RecommendationRuleData RecommendationRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string recommendationName = null, string displayName = null, string message = null, System.Guid? recommendationId = default(System.Guid?), string description = null, string actionName = null, Azure.ResourceManager.AppService.Models.NotificationLevel? level = default(Azure.ResourceManager.AppService.Models.NotificationLevel?), Azure.ResourceManager.AppService.Models.RecommendationChannel? channels = default(Azure.ResourceManager.AppService.Models.RecommendationChannel?), System.Collections.Generic.IEnumerable categoryTags = null, bool? isDynamic = default(bool?), string extensionName = null, string bladeName = null, string forwardLink = null, string kind = null) { throw null; } @@ -5553,7 +5510,6 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.Models.StaticSiteUserInvitationContent StaticSiteUserInvitationContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string domain = null, string provider = null, string userDetails = null, string roles = null, int? numHoursToExpiration = default(int?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StaticSiteUserInvitationResult StaticSiteUserInvitationResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.Uri invitationUri = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.StaticSiteUserProvidedFunctionAppData StaticSiteUserProvidedFunctionAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier functionAppResourceId = null, string functionAppRegion = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.StaticSiteUserProvidedFunctionAppProperties StaticSiteUserProvidedFunctionAppProperties(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string functionAppResourceId = null, string functionAppRegion = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StaticSiteZipDeployment StaticSiteZipDeployment(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Uri appZipUri = null, System.Uri apiZipUri = null, string deploymentTitle = null, string provider = null, string functionLanguage = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StorageMigrationContent StorageMigrationContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string azurefilesConnectionString = null, string azurefilesShare = null, bool? switchSiteAfterMigration = default(bool?), bool? blockWriteAccessToSite = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.StorageMigrationResult StorageMigrationResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string operationId = null, string kind = null) { throw null; } @@ -5562,7 +5518,6 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.TopLevelDomainData TopLevelDomainData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isDomainPrivacySupported = default(bool?), string kind = null) { throw null; } public static Azure.ResourceManager.AppService.TriggeredJobHistoryData TriggeredJobHistoryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable runs = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.TriggeredWebJobData TriggeredWebJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.TriggeredJobRun latestRun = null, System.Uri historyUri = null, System.Uri schedulerLogsUri = null, string runCommand = null, System.Uri uri = null, System.Uri extraInfoUri = null, Azure.ResourceManager.AppService.Models.WebJobType? webJobType = default(Azure.ResourceManager.AppService.Models.WebJobType?), string error = null, bool? isUsingSdk = default(bool?), System.Collections.Generic.IDictionary settings = null, string kind = null) { throw null; } - public static Azure.ResourceManager.AppService.Models.UserAssignedIdentity UserAssignedIdentity(string principalId = null, string clientId = null) { throw null; } public static Azure.ResourceManager.AppService.Models.ValidateResponseError ValidateResponseError(string code = null, string message = null) { throw null; } public static Azure.ResourceManager.AppService.Models.VirtualNetworkValidationFailureDetails VirtualNetworkValidationFailureDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string message = null, bool? isFailed = default(bool?), System.Collections.Generic.IEnumerable failedTests = null, System.Collections.Generic.IEnumerable warnings = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.VirtualNetworkValidationTestFailure VirtualNetworkValidationTestFailure(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string testName = null, string details = null, string kind = null) { throw null; } @@ -5586,11 +5541,6 @@ public static partial class ArmAppServiceModelFactory public static Azure.ResourceManager.AppService.WebSiteInstanceStatusData WebSiteInstanceStatusData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppService.Models.SiteRuntimeState? state = default(Azure.ResourceManager.AppService.Models.SiteRuntimeState?), System.Uri statusUri = null, System.Uri detectorUri = null, System.Uri consoleUri = null, string healthCheckUrlString = null, System.Collections.Generic.IDictionary containers = null, string kind = null) { throw null; } public static Azure.ResourceManager.AppService.Models.WindowsJavaContainerSettings WindowsJavaContainerSettings(string javaContainer = null, string javaContainerVersion = null, bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTimeOffset? endOfLifeOn = default(System.DateTimeOffset?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) { throw null; } } - public partial class ArmIdWrapper - { - public ArmIdWrapper() { } - public string Id { get { throw null; } } - } public enum ArtifactStorageType { LocalNode = 0, @@ -5922,11 +5872,6 @@ internal CsmOperationDescription() { } public string Name { get { throw null; } } public string Origin { get { throw null; } } } - public partial class CsmOperationDescriptionProperties - { - internal CsmOperationDescriptionProperties() { } - public Azure.ResourceManager.AppService.Models.ServiceSpecification ServiceSpecification { get { throw null; } } - } public partial class CsmOperationDisplay { internal CsmOperationDisplay() { } @@ -6105,11 +6050,6 @@ public enum DetectorIssueType PlatformIssue = 6, Other = 7, } - public partial class DetectorMetadata - { - public DetectorMetadata() { } - public Azure.ResourceManager.AppService.Models.DetectorDataSource DataSource { get { throw null; } set { } } - } public partial class DetectorSupportTopic { internal DetectorSupportTopic() { } @@ -6275,12 +6215,6 @@ public DomainRecommendationSearchContent() { } public string Keywords { get { throw null; } set { } } public int? MaxDomainRecommendations { get { throw null; } set { } } } - public partial class ExtendedLocation - { - public ExtendedLocation() { } - public string ExtendedLocationType { get { throw null; } } - public string Name { get { throw null; } set { } } - } public partial class FileSystemHttpLogsConfig : Azure.Core.Serialization.IModelJsonSerializable, Azure.Core.Serialization.IModelSerializable { public FileSystemHttpLogsConfig() { } @@ -6292,22 +6226,12 @@ public FileSystemHttpLogsConfig() { } Azure.ResourceManager.AppService.Models.FileSystemHttpLogsConfig Azure.Core.Serialization.IModelSerializable.Deserialize(System.BinaryData data, Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } System.BinaryData Azure.Core.Serialization.IModelSerializable.Serialize(Azure.Core.Serialization.ModelSerializerOptions options) { throw null; } } - public partial class FileSystemTokenStore - { - public FileSystemTokenStore() { } - public string Directory { get { throw null; } set { } } - } public enum ForwardProxyConvention { NoProxy = 0, Standard = 1, Custom = 2, } - public partial class FrontEndConfiguration - { - public FrontEndConfiguration() { } - public Azure.ResourceManager.AppService.Models.FrontEndServiceType? Kind { get { throw null; } set { } } - } public enum FrontEndServiceType { NodePort = 0, @@ -6634,16 +6558,6 @@ public LoginFlowNonceSettings() { } public string NonceExpirationInterval { get { throw null; } set { } } public bool? ValidateNonce { get { throw null; } set { } } } - public partial class LoginRoutes - { - public LoginRoutes() { } - public string LogoutEndpoint { get { throw null; } set { } } - } - public partial class LoginScopes - { - public LoginScopes() { } - public System.Collections.Generic.IList Scopes { get { throw null; } } - } public partial class LogSpecification { internal LogSpecification() { } @@ -6657,21 +6571,6 @@ public enum ManagedPipelineMode Integrated = 0, Classic = 1, } - public partial class ManagedServiceIdentity - { - public ManagedServiceIdentity() { } - public Azure.ResourceManager.AppService.Models.ManagedServiceIdentityType? IdentityType { get { throw null; } set { } } - public string PrincipalId { get { throw null; } } - public System.Guid? TenantId { get { throw null; } } - public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } - } - public enum ManagedServiceIdentityType - { - None = 0, - SystemAssigned = 1, - UserAssigned = 2, - SystemAssignedUserAssigned = 3, - } public partial class MetricAvailability { internal MetricAvailability() { } @@ -6843,11 +6742,6 @@ public PrivateLinkConnectionState() { } public string Description { get { throw null; } set { } } public string Status { get { throw null; } set { } } } - public partial class PrivateLinkResourcesWrapper - { - internal PrivateLinkResourcesWrapper() { } - public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } - } public partial class ProcessThreadInfo : Azure.ResourceManager.Models.ResourceData { public ProcessThreadInfo() { } @@ -6913,11 +6807,6 @@ public enum ProvisioningState InProgress = 3, Deleting = 4, } - public partial class ProxyOnlyResource : Azure.ResourceManager.Models.ResourceData - { - public ProxyOnlyResource() { } - public string Kind { get { throw null; } set { } } - } public enum PublicCertificateLocation { Unknown = 0, @@ -7130,11 +7019,6 @@ public RestoreRequestInfo() { } public string SiteName { get { throw null; } set { } } public System.Uri StorageAccountUri { get { throw null; } set { } } } - public partial class RoutingRuleExperiments - { - public RoutingRuleExperiments() { } - public System.Collections.Generic.IList RampUpRules { get { throw null; } } - } public partial class SampleUtterance { public SampleUtterance() { } @@ -7660,14 +7544,6 @@ public StaticSiteUserInvitationResult() { } public System.Uri InvitationUri { get { throw null; } } public string Kind { get { throw null; } set { } } } - public partial class StaticSiteUserProvidedFunctionAppProperties : Azure.ResourceManager.Models.ResourceData - { - public StaticSiteUserProvidedFunctionAppProperties() { } - public System.DateTimeOffset? CreatedOn { get { throw null; } } - public string FunctionAppRegion { get { throw null; } set { } } - public string FunctionAppResourceId { get { throw null; } set { } } - public string Kind { get { throw null; } set { } } - } public partial class StaticSiteZipDeployment : Azure.ResourceManager.Models.ResourceData { public StaticSiteZipDeployment() { } @@ -7764,12 +7640,6 @@ public enum UnauthenticatedClientActionV2 Return401 = 2, Return403 = 3, } - public partial class UserAssignedIdentity - { - public UserAssignedIdentity() { } - public string ClientId { get { throw null; } } - public string PrincipalId { get { throw null; } } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ValidateResourceType : System.IEquatable { @@ -7873,11 +7743,6 @@ public WebAppCookieExpiration() { } public Azure.ResourceManager.AppService.Models.CookieExpirationConvention? Convention { get { throw null; } set { } } public string TimeToExpiration { get { throw null; } set { } } } - public partial class WebAppEnabledConfig - { - public WebAppEnabledConfig() { } - public bool? Enabled { get { throw null; } set { } } - } public partial class WebAppKeyInfo { public WebAppKeyInfo() { } From 9ef59058a070db4b5a1f4a33b686b3ec91126408 Mon Sep 17 00:00:00 2001 From: "Matthew Meadows (Rango the Dog)" Date: Wed, 13 Sep 2023 21:43:24 -0700 Subject: [PATCH 41/45] [Document Translation] Fix Document Translation README.md links (#38593) * Fix Document Translation README.md links * Remove extra whitespace and remove en-us from links * Revert mocking link change * Remove duplicate URL --------- Co-authored-by: Rango Meadows --- sdk/translation/Azure.AI.Translation.Document/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/translation/Azure.AI.Translation.Document/README.md b/sdk/translation/Azure.AI.Translation.Document/README.md index 913a427b0569..e40d6ee87627 100644 --- a/sdk/translation/Azure.AI.Translation.Document/README.md +++ b/sdk/translation/Azure.AI.Translation.Document/README.md @@ -455,12 +455,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [documenttranslation_nuget_package]: https://www.nuget.org/packages/Azure.AI.Translation.Document [documenttranslation_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/translation/Azure.AI.Translation.Document/samples/README.md [documenttranslation_rest_api]: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/TranslatorText/stable/v1.0/TranslatorBatch.json -[custom_domain_endpoint]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/how-to-guides/use-rest-api-programmatically?tabs=csharp#retrieve-your-key-and-custom-domain-endpoint +[custom_domain_endpoint]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-rest-api?pivots=programming-language-csharp#what-is-the-custom-domain-endpoint [single_service]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=singleservice%2Cwindows [azure_portal_create_DT_resource]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation [cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli [dotnet_lro]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt -[source_containers]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/get-started-with-document-translation?tabs=csharp#create-your-azure-blob-storage-containers +[source_containers]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-rest-api?pivots=programming-language-csharp#create-azure-blob-storage-containers [custom_model]: https://docs.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model [glossary]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats [sas_token]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-your-sas-tokens-with-azure-storage-explorer From 8fa7955ac9cd1cf2c124f7d387ef07c2c5a53387 Mon Sep 17 00:00:00 2001 From: Wei Hu Date: Thu, 14 Sep 2023 14:31:11 +0800 Subject: [PATCH 42/45] Prepare release for AppService (#38696) --- .../Azure.ResourceManager.AppService/CHANGELOG.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md index 140d72133e7f..e36e31dc09cd 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md +++ b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md @@ -1,17 +1,11 @@ # Release History -## 1.1.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes +## 1.1.0-beta.3 (2023-09-14) ### Bugs Fixed - Due to `HealthCheckUri` not being a valid URI, add a new property `HealthCheckUriString` to replace it in order to fix the URI format issue. -### Other Changes - ## 1.1.0-beta.2 (2023-09-06) ### Bugs Fixed From b415af0602c8b3a3cd7ea404e020a72ed8bb15ed Mon Sep 17 00:00:00 2001 From: JialinXin Date: Thu, 14 Sep 2023 22:54:54 +0800 Subject: [PATCH 43/45] [WebPubSub] Increase isolated package version and fix a few issues (#38692) * Increase isolated process package. * Fix title --- .../CHANGELOG.md | 5 +++++ ...rosoft.Azure.Functions.Worker.Extensions.WebPubSub.csproj | 2 +- .../src/Properties/AssemblyInfo.cs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/CHANGELOG.md index a26ea9711f50..5f28162e52da 100644 --- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/CHANGELOG.md @@ -1,5 +1,10 @@ # Release History +## 1.7.0-beta.1 (2023-09-15) + +### Bugs Fixed +- Increase depend package to fix secondary key and multiple hosts validation issue. + ## 1.5.0-beta.1 (2023-04-27) ### Features Added diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub.csproj b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub.csproj index ce3597392d9f..3fd22951d61f 100644 --- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub.csproj +++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub.csproj @@ -6,7 +6,7 @@ $(RequiredTargetFrameworks) annotations - 1.5.0-beta.1 + 1.7.0-beta.1 $(NoWarn);AZC0001;CA2227 true diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Properties/AssemblyInfo.cs b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Properties/AssemblyInfo.cs index 1b174ec93fce..b134cd684feb 100644 --- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Properties/AssemblyInfo.cs +++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Properties/AssemblyInfo.cs @@ -3,4 +3,4 @@ using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; -[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.WebPubSub", "1.5.0")] +[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.WebPubSub", "1.7.0")] From 7f267723e231e064015c5f98cb9e332dbbabc584 Mon Sep 17 00:00:00 2001 From: Alexey Rodionov Date: Thu, 14 Sep 2023 08:32:11 -0700 Subject: [PATCH 44/45] Fixing scaler provider initialization pattern (#38673) --- .../Config/EventHubWebJobsBuilderExtensions.cs | 17 +++-------------- .../Config/ServiceBusHostBuilderExtensions.cs | 17 +++-------------- .../StorageQueuesWebJobsBuilderExtensions.cs | 17 +++-------------- 3 files changed, 9 insertions(+), 42 deletions(-) diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Config/EventHubWebJobsBuilderExtensions.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Config/EventHubWebJobsBuilderExtensions.cs index ea86003d8bb1..d8d817dac687 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Config/EventHubWebJobsBuilderExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Config/EventHubWebJobsBuilderExtensions.cs @@ -94,20 +94,9 @@ public static IWebJobsBuilder AddEventHubs(this IWebJobsBuilder builder, Action< internal static IWebJobsBuilder AddEventHubsScaleForTrigger(this IWebJobsBuilder builder, TriggerMetadata triggerMetadata) { - IServiceProvider serviceProvider = null; - Lazy scalerProvider = new Lazy(() => new EventHubsScalerProvider(serviceProvider, triggerMetadata)); - - builder.Services.AddSingleton(resolvedServiceProvider => - { - serviceProvider = serviceProvider ?? resolvedServiceProvider; - return scalerProvider.Value; - }); - - builder.Services.AddSingleton(resolvedServiceProvider => - { - serviceProvider = serviceProvider ?? resolvedServiceProvider; - return scalerProvider.Value; - }); + builder.Services.AddSingleton(serviceProvider => new EventHubsScalerProvider(serviceProvider, triggerMetadata)); + builder.Services.AddSingleton(serviceProvider => serviceProvider.GetRequiredService()); + builder.Services.AddSingleton(serviceProvider => serviceProvider.GetRequiredService()); return builder; } diff --git a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Config/ServiceBusHostBuilderExtensions.cs b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Config/ServiceBusHostBuilderExtensions.cs index 2134c993c75e..a4a710617f04 100644 --- a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Config/ServiceBusHostBuilderExtensions.cs +++ b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Config/ServiceBusHostBuilderExtensions.cs @@ -108,20 +108,9 @@ public static IWebJobsBuilder AddServiceBus(this IWebJobsBuilder builder, Action internal static IWebJobsBuilder AddServiceBusScaleForTrigger(this IWebJobsBuilder builder, TriggerMetadata triggerMetadata) { - IServiceProvider serviceProvider = null; - Lazy scalerProvider = new Lazy(() => new ServiceBusScalerProvider(serviceProvider, triggerMetadata)); - - builder.Services.AddSingleton(resolvedServiceProvider => - { - serviceProvider = serviceProvider ?? resolvedServiceProvider; - return scalerProvider.Value; - }); - - builder.Services.AddSingleton(resolvedServiceProvider => - { - serviceProvider = serviceProvider ?? resolvedServiceProvider; - return scalerProvider.Value; - }); + builder.Services.AddSingleton(serviceProvider => new ServiceBusScalerProvider(serviceProvider, triggerMetadata)); + builder.Services.AddSingleton(serviceProvider => serviceProvider.GetRequiredService()); + builder.Services.AddSingleton(serviceProvider => serviceProvider.GetRequiredService()); return builder; } diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/StorageQueuesWebJobsBuilderExtensions.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/StorageQueuesWebJobsBuilderExtensions.cs index 57d85a61aae4..3fd8b9a905c0 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/StorageQueuesWebJobsBuilderExtensions.cs +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/StorageQueuesWebJobsBuilderExtensions.cs @@ -74,20 +74,9 @@ public static IWebJobsBuilder AddAzureStorageQueues(this IWebJobsBuilder builder /// public static IWebJobsBuilder AddAzureStorageQueuesScaleForTrigger(this IWebJobsBuilder builder, TriggerMetadata triggerMetadata) { - IServiceProvider serviceProvider = null; - Lazy scalerProvider = new Lazy(() => new QueueScalerProvider(serviceProvider, triggerMetadata)); - - builder.Services.AddSingleton(resolvedServiceProvider => - { - serviceProvider = serviceProvider ?? resolvedServiceProvider; - return scalerProvider.Value; - }); - - builder.Services.AddSingleton(resolvedServiceProvider => - { - serviceProvider = serviceProvider ?? resolvedServiceProvider; - return scalerProvider.Value; - }); + builder.Services.AddSingleton(serviceProvider => new QueueScalerProvider(serviceProvider, triggerMetadata)); + builder.Services.AddSingleton(serviceProvider => serviceProvider.GetRequiredService()); + builder.Services.AddSingleton(serviceProvider => serviceProvider.GetRequiredService()); return builder; } From 9deaf30866169248f34765798ca92f1a70a591a4 Mon Sep 17 00:00:00 2001 From: Jocelyn <41338290+jaschrep-msft@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:32:35 -0400 Subject: [PATCH 45/45] src, test, and samples projects for DataMovement.Files.Shares (#38678) * src, test, and samples projects for DataMovement.Files.Shares * placeholder readme * remove shared source * more csproj * blank changelog --- .../BreakingChanges.txt | 0 .../CHANGELOG.md | 9 ++ .../README.md | 131 ++++++++++++++++++ ...Movement.Files.Shares.Samples.Tests.csproj | 35 +++++ ...e.Storage.DataMovement.Files.Shares.csproj | 39 ++++++ ...age.DataMovement.Files.Shares.Tests.csproj | 29 ++++ sdk/storage/Azure.Storage.sln | 18 +++ 7 files changed, 261 insertions(+) create mode 100644 sdk/storage/Azure.Storage.DataMovement.Files.Shares/BreakingChanges.txt create mode 100644 sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md create mode 100644 sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md create mode 100644 sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Azure.Storage.DataMovement.Files.Shares.Samples.Tests.csproj create mode 100644 sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj create mode 100644 sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BreakingChanges.txt b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BreakingChanges.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md new file mode 100644 index 000000000000..a08605b7158a --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md @@ -0,0 +1,9 @@ +# Release History + +## 12.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md new file mode 100644 index 000000000000..0fdc0b361017 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md @@ -0,0 +1,131 @@ +# Azure Storage Data Movement File Shares client library for .NET + +> Server Version: 2020-04-08, 2020-02-10, 2019-12-12, 2019-07-07, and 2020-02-02 + +Azure Storage is a Microsoft-managed service providing cloud storage that is +highly available, secure, durable, scalable, and redundant. Azure Storage +includes Azure Blobs (objects), Azure Data Lake Storage Gen2, Azure Files, +and Azure Queues. + +The Azure Storage Data Movement library is optimized for uploading, downloading and +copying customer data. + +The Azure.Storage.DataMovement.Files.Shares library provides infrastructure shared by the other +Azure Storage client libraries. + +[Source code][source] | [Package (NuGet)][package] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs] + +## Getting started + +### Install the package + +Install the Azure Storage client library for .NET you'd like to use with +[NuGet][nuget] and the `Azure.Storage.DataMovement.Files.Shares` client library will be included: + +```dotnetcli +dotnet add package Azure.Storage.DataMovement --prerelease +dotnet add package Azure.Storage.DataMovement.Files.Shares --prerelease +``` + +### Prerequisites + +You need an [Azure subscription][azure_sub] and a +[Storage Account][storage_account_docs] to use this package. + +To create a new Storage Account, you can use the [Azure Portal][storage_account_create_portal], +[Azure PowerShell][storage_account_create_ps], or the [Azure CLI][storage_account_create_cli]. +Here's an example using the Azure CLI: + +```Powershell +az storage account create --name MyStorageAccount --resource-group MyResourceGroup --location westus --sku Standard_LRS +``` + +### Authenticate the client +The Azure.Storage.DataMovement.Files.Shares library uses clients from the Azure.Storage.Files.Shares package to communicate with the Azure File Storage service. For more information see the Azure.Storage.Files.Shares [authentication documentation](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares#authenticate-the-client). + +## Key concepts + +The Azure Storage Common client library contains shared infrastructure like +[authentication credentials][auth_credentials] and [RequestFailedException][RequestFailedException]. + +### Thread safety +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +This section demonstrates usage of Data Movement for interacting with blob storage. + + +### Initializing File Storage `StorageResource` + +***TODO*** + +### Upload + +***TODO*** + +### Download + +***TODO*** + +### File Copy + +***TODO*** + +## Troubleshooting + +***TODO*** + +## Next steps + +***TODO*** + +## Contributing + +See the [Storage CONTRIBUTING.md][storage_contrib] for details on building, +testing, and contributing to these libraries. + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. For +details, visit [cla.microsoft.com][cla]. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. +For more information see the [Code of Conduct FAQ][coc_faq] +or contact [opencode@microsoft.com][coc_contact] with any +additional questions or comments. + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Common%2FREADME.png) + + +[source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Common/src +[package]: https://www.nuget.org/packages/Azure.Storage.Common/ +[docs]: https://docs.microsoft.com/dotnet/api/azure.storage +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/ +[product_docs]: https://docs.microsoft.com/azure/storage/ +[nuget]: https://www.nuget.org/ +[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/dotnet/ +[RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/common-rest-api-error-codes +[samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs/samples +[storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md +[cla]: https://cla.microsoft.com +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Azure.Storage.DataMovement.Files.Shares.Samples.Tests.csproj b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Azure.Storage.DataMovement.Files.Shares.Samples.Tests.csproj new file mode 100644 index 000000000000..e50b5044f2a6 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Azure.Storage.DataMovement.Files.Shares.Samples.Tests.csproj @@ -0,0 +1,35 @@ + + + $(RequiredTargetFrameworks) + Microsoft Azure.Storage.DataMovement.Files.Shares client library samples + false + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj new file mode 100644 index 000000000000..a2e444e50928 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj @@ -0,0 +1,39 @@ + + + $(RequiredTargetFrameworks);net6.0 + true + + + Microsoft Azure.Storage.DataMovement.Blobs client library + 12.0.0-beta.1 + FileDataMovementSDK;$(DefineConstants) + Microsoft Azure Storage DataMovement, DataMovement, Microsoft, Azure, StorageScalable, azureofficial + + This client library enables working with the Microsoft Azure Storage services which include the blob and file services for storing binary and text data, and the queue service for storing messages that may be accessed by a client. + For this release see notes - https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blob.DataMovement/README.md and https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blob.DataMovement/CHANGELOG.md + in addition to the breaking changes https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blob.DataMovement/BreakingChanges.txt + Microsoft Azure Storage quickstarts and tutorials - https://docs.microsoft.com/en-us/azure/storage/ + Microsoft Azure Storage REST API Reference - https://docs.microsoft.com/en-us/rest/api/storageservices/ + + true + Azure.Storage.DataMovement.Files.Shares + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj new file mode 100644 index 000000000000..e3712cbcf546 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj @@ -0,0 +1,29 @@ + + + $(RequiredTargetFrameworks) + Microsoft Azure.Storage.DataMovement.Files.Shareas client library tests + BlobDataMovementSDK;$(DefineConstants) + false + + + + DMBlobs + + + + + + + + + + PreserveNewest + + + + + + PreserveNewest + + + diff --git a/sdk/storage/Azure.Storage.sln b/sdk/storage/Azure.Storage.sln index a1e3472b8ae0..d1ab9ccc2e62 100644 --- a/sdk/storage/Azure.Storage.sln +++ b/sdk/storage/Azure.Storage.sln @@ -155,6 +155,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.DataMovement. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.Files.DataLake.Perf", "Azure.Storage.Files.DataLake\perf\Azure.Storage.Files.DataLake.Perf\Azure.Storage.Files.DataLake.Perf.csproj", "{0323A01E-E360-4D22-B1F4-15FD2DB39437}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.DataMovement.Files.Shares", "Azure.Storage.DataMovement.Files.Shares\src\Azure.Storage.DataMovement.Files.Shares.csproj", "{D3FFA4E3-4DDE-4496-9907-6CCCC315A8A2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.DataMovement.Files.Shares.Tests", "Azure.Storage.DataMovement.Files.Shares\tests\Azure.Storage.DataMovement.Files.Shares.Tests.csproj", "{4F45B7CD-8A15-4B95-8A57-B6E8A4DD8B02}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.DataMovement.Files.Shares.Samples.Tests", "Azure.Storage.DataMovement.Files.Shares\samples\Azure.Storage.DataMovement.Files.Shares.Samples.Tests.csproj", "{A564BB94-1867-4D43-98AB-F3C38E9AFA30}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -333,6 +339,18 @@ Global {0323A01E-E360-4D22-B1F4-15FD2DB39437}.Debug|Any CPU.Build.0 = Debug|Any CPU {0323A01E-E360-4D22-B1F4-15FD2DB39437}.Release|Any CPU.ActiveCfg = Release|Any CPU {0323A01E-E360-4D22-B1F4-15FD2DB39437}.Release|Any CPU.Build.0 = Release|Any CPU + {D3FFA4E3-4DDE-4496-9907-6CCCC315A8A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3FFA4E3-4DDE-4496-9907-6CCCC315A8A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3FFA4E3-4DDE-4496-9907-6CCCC315A8A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3FFA4E3-4DDE-4496-9907-6CCCC315A8A2}.Release|Any CPU.Build.0 = Release|Any CPU + {4F45B7CD-8A15-4B95-8A57-B6E8A4DD8B02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F45B7CD-8A15-4B95-8A57-B6E8A4DD8B02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F45B7CD-8A15-4B95-8A57-B6E8A4DD8B02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F45B7CD-8A15-4B95-8A57-B6E8A4DD8B02}.Release|Any CPU.Build.0 = Release|Any CPU + {A564BB94-1867-4D43-98AB-F3C38E9AFA30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A564BB94-1867-4D43-98AB-F3C38E9AFA30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A564BB94-1867-4D43-98AB-F3C38E9AFA30}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A564BB94-1867-4D43-98AB-F3C38E9AFA30}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE