diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs index ef9e628078329..a3716f1d57f9a 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs @@ -15,8 +15,6 @@ protected LinkerResource() { } public virtual System.Threading.Tasks.Task> GetConfigurationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Validate(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class LinkerResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -98,27 +96,6 @@ public KeyVaultSecretUriSecretInfo() { } public string Value { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct LinkerAuthType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public LinkerAuthType(string value) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType Secret { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType ServicePrincipalCertificate { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType ServicePrincipalSecret { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType SystemAssignedIdentity { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType UserAssignedIdentity { get { throw null; } } - public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType 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.ResourceManager.ServiceLinker.Models.LinkerAuthType left, Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType right) { throw null; } - public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType left, Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LinkerClientType : System.IEquatable { private readonly object _dummy; @@ -128,6 +105,7 @@ public KeyVaultSecretUriSecretInfo() { } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Dotnet { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Go { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Java { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType KafkaSpringBoot { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Nodejs { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType None { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Php { get { throw null; } } @@ -155,48 +133,6 @@ public LinkerResourcePatch() { } public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } } - public partial class LinkerValidateOperationResult - { - internal LinkerValidateOperationResult() { } - public Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? AuthType { get { throw null; } } - public bool? IsConnectionAvailable { get { throw null; } } - public string LinkerName { get { throw null; } } - public System.DateTimeOffset? ReportEndOn { get { throw null; } } - public System.DateTimeOffset? ReportStartOn { get { throw null; } } - public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } - public Azure.Core.ResourceIdentifier SourceId { get { throw null; } } - public string Status { get { throw null; } } - public Azure.Core.ResourceIdentifier TargetId { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ValidationDetail { get { throw null; } } - } - public partial class LinkerValidationResultItemInfo - { - internal LinkerValidationResultItemInfo() { } - public string Description { get { throw null; } } - public string ErrorCode { get { throw null; } } - public string ErrorMessage { get { throw null; } } - public string Name { get { throw null; } } - public Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus? Result { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct LinkerValidationResultStatus : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public LinkerValidationResultStatus(string value) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus Failure { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus Success { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus Warning { get { throw null; } } - public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus 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.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus left, Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus right) { throw null; } - public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus left, Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus right) { throw null; } - public override string ToString() { throw null; } - } public partial class RawValueSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo { public RawValueSecretInfo() { } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs index 7eea8b5c8aceb..0c0052b66a3aa 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs @@ -295,74 +295,6 @@ public virtual ArmOperation Update(WaitUntil waitUntil, LinkerRe } } - /// - /// Validate a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker - /// - /// - /// Operation Id - /// Linker_Validate - /// - /// - /// - /// 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. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> ValidateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Validate"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.ValidateAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ServiceLinkerArmOperation(new LinkerValidateOperationResultOperationSource(), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateValidateRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Validate a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker - /// - /// - /// Operation Id - /// Linker_Validate - /// - /// - /// - /// 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. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Validate(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Validate"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Validate(Id.Parent, Id.Name, cancellationToken); - var operation = new ServiceLinkerArmOperation(new LinkerValidateOperationResultOperationSource(), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateValidateRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// list source configurations for a linker. /// diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerValidateOperationResultOperationSource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerValidateOperationResultOperationSource.cs deleted file mode 100644 index 66c447e2baa3a..0000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerValidateOperationResultOperationSource.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager.ServiceLinker.Models; - -namespace Azure.ResourceManager.ServiceLinker -{ - internal class LinkerValidateOperationResultOperationSource : IOperationSource - { - LinkerValidateOperationResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return LinkerValidateOperationResult.DeserializeLinkerValidateOperationResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return LinkerValidateOperationResult.DeserializeLinkerValidateOperationResult(document.RootElement); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs index 3a51fc6d3dfb5..7144118515fac 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { /// The authentication type. - public readonly partial struct LinkerAuthType : IEquatable + internal readonly partial struct LinkerAuthType : IEquatable { private readonly string _value; diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs index ddc43894541f3..0eb06984d2c9b 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs @@ -32,6 +32,7 @@ public LinkerClientType(string value) private const string DjangoValue = "django"; private const string NodejsValue = "nodejs"; private const string SpringBootValue = "springBoot"; + private const string KafkaSpringBootValue = "kafka-springBoot"; /// none. public static LinkerClientType None { get; } = new LinkerClientType(NoneValue); @@ -53,6 +54,8 @@ public LinkerClientType(string value) public static LinkerClientType Nodejs { get; } = new LinkerClientType(NodejsValue); /// springBoot. public static LinkerClientType SpringBoot { get; } = new LinkerClientType(SpringBootValue); + /// kafka-springBoot. + public static LinkerClientType KafkaSpringBoot { get; } = new LinkerClientType(KafkaSpringBootValue); /// Determines if two values are the same. public static bool operator ==(LinkerClientType left, LinkerClientType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.Serialization.cs deleted file mode 100644 index c6666beb9fcc7..0000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.Serialization.cs +++ /dev/null @@ -1,152 +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; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class LinkerValidateOperationResult - { - internal static LinkerValidateOperationResult DeserializeLinkerValidateOperationResult(JsonElement element) - { - Optional resourceId = default; - Optional status = default; - Optional linkerName = default; - Optional isConnectionAvailable = default; - Optional reportStartTimeUtc = default; - Optional reportEndTimeUtc = default; - Optional sourceId = default; - Optional targetId = default; - Optional authType = default; - Optional> validationDetail = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - resourceId = null; - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - status = null; - continue; - } - status = property.Value.GetString(); - 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("linkerName"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - linkerName = null; - continue; - } - linkerName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isConnectionAvailable"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - isConnectionAvailable = null; - continue; - } - isConnectionAvailable = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("reportStartTimeUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - reportStartTimeUtc = null; - continue; - } - reportStartTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("reportEndTimeUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - reportEndTimeUtc = null; - continue; - } - reportEndTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("sourceId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - sourceId = null; - continue; - } - sourceId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("targetId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - targetId = null; - continue; - } - targetId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("authType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - authType = null; - continue; - } - authType = new LinkerAuthType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("validationDetail"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - validationDetail = null; - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(LinkerValidationResultItemInfo.DeserializeLinkerValidationResultItemInfo(item)); - } - validationDetail = array; - continue; - } - } - continue; - } - } - return new LinkerValidateOperationResult(resourceId.Value, status.Value, linkerName.Value, Optional.ToNullable(isConnectionAvailable), Optional.ToNullable(reportStartTimeUtc), Optional.ToNullable(reportEndTimeUtc), sourceId.Value, targetId.Value, Optional.ToNullable(authType), Optional.ToList(validationDetail)); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.cs deleted file mode 100644 index 95f57de14b2d5..0000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.cs +++ /dev/null @@ -1,69 +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; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The validation operation result for a linker. - public partial class LinkerValidateOperationResult - { - /// Initializes a new instance of LinkerValidateOperationResult. - internal LinkerValidateOperationResult() - { - ValidationDetail = new ChangeTrackingList(); - } - - /// Initializes a new instance of LinkerValidateOperationResult. - /// Validated linker id. - /// Validation operation status. - /// The linker name. - /// A boolean value indicating whether the connection is available or not. - /// The start time of the validation report. - /// The end time of the validation report. - /// The resource id of the linker source application. - /// The resource Id of target service. - /// The authentication type. - /// The detail of validation result. - internal LinkerValidateOperationResult(ResourceIdentifier resourceId, string status, string linkerName, bool? isConnectionAvailable, DateTimeOffset? reportStartOn, DateTimeOffset? reportEndOn, ResourceIdentifier sourceId, ResourceIdentifier targetId, LinkerAuthType? authType, IReadOnlyList validationDetail) - { - ResourceId = resourceId; - Status = status; - LinkerName = linkerName; - IsConnectionAvailable = isConnectionAvailable; - ReportStartOn = reportStartOn; - ReportEndOn = reportEndOn; - SourceId = sourceId; - TargetId = targetId; - AuthType = authType; - ValidationDetail = validationDetail; - } - - /// Validated linker id. - public ResourceIdentifier ResourceId { get; } - /// Validation operation status. - public string Status { get; } - /// The linker name. - public string LinkerName { get; } - /// A boolean value indicating whether the connection is available or not. - public bool? IsConnectionAvailable { get; } - /// The start time of the validation report. - public DateTimeOffset? ReportStartOn { get; } - /// The end time of the validation report. - public DateTimeOffset? ReportEndOn { get; } - /// The resource id of the linker source application. - public ResourceIdentifier SourceId { get; } - /// The resource Id of target service. - public ResourceIdentifier TargetId { get; } - /// The authentication type. - public LinkerAuthType? AuthType { get; } - /// The detail of validation result. - public IReadOnlyList ValidationDetail { get; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.Serialization.cs deleted file mode 100644 index bc6ce0ea8b14b..0000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.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; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class LinkerValidationResultItemInfo - { - internal static LinkerValidationResultItemInfo DeserializeLinkerValidationResultItemInfo(JsonElement element) - { - Optional name = default; - Optional description = default; - Optional result = default; - Optional errorMessage = default; - Optional errorCode = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - description = null; - continue; - } - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("result"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - result = null; - continue; - } - result = new LinkerValidationResultStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("errorMessage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - errorMessage = null; - continue; - } - errorMessage = property.Value.GetString(); - continue; - } - if (property.NameEquals("errorCode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - errorCode = null; - continue; - } - errorCode = property.Value.GetString(); - continue; - } - } - return new LinkerValidationResultItemInfo(name.Value, description.Value, Optional.ToNullable(result), errorMessage.Value, errorCode.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.cs deleted file mode 100644 index 1c11354019ebf..0000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The validation item for a linker. - public partial class LinkerValidationResultItemInfo - { - /// Initializes a new instance of LinkerValidationResultItemInfo. - internal LinkerValidationResultItemInfo() - { - } - - /// Initializes a new instance of LinkerValidationResultItemInfo. - /// The validation item name. - /// The display name of validation item. - /// The result of validation. - /// The error message of validation result. - /// The error code of validation result. - internal LinkerValidationResultItemInfo(string name, string description, LinkerValidationResultStatus? result, string errorMessage, string errorCode) - { - Name = name; - Description = description; - Result = result; - ErrorMessage = errorMessage; - ErrorCode = errorCode; - } - - /// The validation item name. - public string Name { get; } - /// The display name of validation item. - public string Description { get; } - /// The result of validation. - public LinkerValidationResultStatus? Result { get; } - /// The error message of validation result. - public string ErrorMessage { get; } - /// The error code of validation result. - public string ErrorCode { get; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultStatus.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultStatus.cs deleted file mode 100644 index edec3f3a92a86..0000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultStatus.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The result of validation. - public readonly partial struct LinkerValidationResultStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LinkerValidationResultStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SuccessValue = "success"; - private const string FailureValue = "failure"; - private const string WarningValue = "warning"; - - /// success. - public static LinkerValidationResultStatus Success { get; } = new LinkerValidationResultStatus(SuccessValue); - /// failure. - public static LinkerValidationResultStatus Failure { get; } = new LinkerValidationResultStatus(FailureValue); - /// warning. - public static LinkerValidationResultStatus Warning { get; } = new LinkerValidationResultStatus(WarningValue); - /// Determines if two values are the same. - public static bool operator ==(LinkerValidationResultStatus left, LinkerValidationResultStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LinkerValidationResultStatus left, LinkerValidationResultStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LinkerValidationResultStatus(string value) => new LinkerValidationResultStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LinkerValidationResultStatus other && Equals(other); - /// - public bool Equals(LinkerValidationResultStatus 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/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs index 7c449a18fdf9e..08dedb8a1d3cb 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs @@ -33,7 +33,7 @@ public LinkerRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -388,71 +388,6 @@ public Response Update(string resourceUri, string linkerName, LinkerResourcePatc } } - internal HttpMessage CreateValidateRequest(string resourceUri, string linkerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendPath("/validateLinker", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Validate a link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task ValidateAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateValidateRequest(resourceUri, linkerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Validate a link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Validate(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateValidateRequest(resourceUri, linkerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal HttpMessage CreateListConfigurationsRequest(string resourceUri, string linkerName) { var message = _pipeline.CreateMessage(); diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md index 8ab4b19dc22b8..75d8e386202f3 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: false csharp: true library-name: ServiceLinker namespace: Azure.ResourceManager.ServiceLinker -require: https://github.com/Azure/azure-rest-api-specs/blob/42ca0236ef14093f5aff0694efa34d5594e814a0/specification/servicelinker/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true