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 ef9e62807832..e69de29bb2d1 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 @@ -1,272 +0,0 @@ -namespace Azure.ResourceManager.ServiceLinker -{ - public partial class LinkerResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected LinkerResource() { } - public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string linkerName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetConfigurations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - 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 - { - protected LinkerResourceCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string linkerName, Azure.ResourceManager.ServiceLinker.LinkerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string linkerName, Azure.ResourceManager.ServiceLinker.LinkerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class LinkerResourceData : Azure.ResourceManager.Models.ResourceData - { - public LinkerResourceData() { } - public Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo AuthInfo { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } set { } } - public string ProvisioningState { get { throw null; } } - public string Scope { get { throw null; } set { } } - public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } - } - public static partial class ServiceLinkerExtensions - { - public static Azure.ResourceManager.ServiceLinker.LinkerResource GetLinkerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Response GetLinkerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetLinkerResource(this Azure.ResourceManager.ArmResource armResource, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetLinkerResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetLinkerResourceAsync(this Azure.ResourceManager.ArmResource armResource, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } - public static Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources(this Azure.ResourceManager.ArmResource armResource) { throw null; } - } -} -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public abstract partial class AuthBaseInfo - { - protected AuthBaseInfo() { } - } - public partial class AzureKeyVaultProperties : Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties - { - public AzureKeyVaultProperties() { } - public bool? DoesConnectAsKubernetesCsiDriver { get { throw null; } set { } } - } - public abstract partial class AzureResourceBaseProperties - { - protected AzureResourceBaseProperties() { } - } - public partial class AzureResourceInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo - { - public AzureResourceInfo() { } - public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties ResourceProperties { get { throw null; } set { } } - } - public partial class ConfluentBootstrapServerInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo - { - public ConfluentBootstrapServerInfo() { } - public string Endpoint { get { throw null; } set { } } - } - public partial class ConfluentSchemaRegistryInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo - { - public ConfluentSchemaRegistryInfo() { } - public string Endpoint { get { throw null; } set { } } - } - public partial class KeyVaultSecretReferenceSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo - { - public KeyVaultSecretReferenceSecretInfo() { } - public string Name { get { throw null; } set { } } - public string Version { get { throw null; } set { } } - } - public partial class KeyVaultSecretUriSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo - { - 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; - private readonly int _dummyPrimitive; - public LinkerClientType(string value) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Django { get { throw null; } } - 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 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; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Python { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Ruby { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType SpringBoot { get { throw null; } } - public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType 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.LinkerClientType left, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType right) { throw null; } - public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerClientType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType left, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType right) { throw null; } - public override string ToString() { throw null; } - } - public partial class LinkerResourcePatch - { - public LinkerResourcePatch() { } - public Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo AuthInfo { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } set { } } - public string ProvisioningState { get { throw null; } } - public string Scope { get { throw null; } set { } } - public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } - 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() { } - public string Value { get { throw null; } set { } } - } - public partial class SecretAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo - { - public SecretAuthInfo() { } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo SecretInfo { get { throw null; } set { } } - } - public abstract partial class SecretBaseInfo - { - protected SecretBaseInfo() { } - } - public partial class ServicePrincipalCertificateAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo - { - public ServicePrincipalCertificateAuthInfo(string clientId, System.Guid principalId, string certificate) { } - public string Certificate { get { throw null; } set { } } - public string ClientId { get { throw null; } set { } } - public System.Guid PrincipalId { get { throw null; } set { } } - } - public partial class ServicePrincipalSecretAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo - { - public ServicePrincipalSecretAuthInfo(string clientId, System.Guid principalId, string secret) { } - public string ClientId { get { throw null; } set { } } - public System.Guid PrincipalId { get { throw null; } set { } } - public string Secret { get { throw null; } set { } } - } - public partial class SourceConfiguration - { - internal SourceConfiguration() { } - public string Name { get { throw null; } } - public string Value { get { throw null; } } - } - public partial class SourceConfigurationResult - { - internal SourceConfigurationResult() { } - public System.Collections.Generic.IReadOnlyList Configurations { get { throw null; } } - } - public partial class SystemAssignedIdentityAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo - { - public SystemAssignedIdentityAuthInfo() { } - } - public abstract partial class TargetServiceBaseInfo - { - protected TargetServiceBaseInfo() { } - } - public partial class UserAssignedIdentityAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo - { - public UserAssignedIdentityAuthInfo() { } - public string ClientId { get { throw null; } set { } } - public string SubscriptionId { get { throw null; } set { } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct VnetSolutionType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public VnetSolutionType(string value) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType PrivateLink { get { throw null; } } - public static Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType ServiceEndpoint { get { throw null; } } - public bool Equals(Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType 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.VnetSolutionType left, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType right) { throw null; } - public static implicit operator Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType left, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType right) { throw null; } - public override string ToString() { throw null; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 940967455699..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of LinkerResources in the ArmResource. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public virtual LinkerResourceCollection GetLinkerResources() - { - return GetCachedClient(Client => new LinkerResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs deleted file mode 100644 index e0493729ac4a..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// A class to add extension methods to Azure.ResourceManager.ServiceLinker. - public static partial class ServiceLinkerExtensions - { - private static ArmResourceExtensionClient GetExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - } - ); - } - - private static ArmResourceExtensionClient GetExtensionClient(ArmResource armResource) - { - return armResource.GetCachedClient((client) => - { - return new ArmResourceExtensionClient(client, armResource.Id); - } - ); - } - - /// Gets a collection of LinkerResources in the ArmResource. - /// The instance the method will execute against. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public static LinkerResourceCollection GetLinkerResources(this ArmResource armResource) - { - return GetExtensionClient(armResource).GetLinkerResources(); - } - - /// Gets a collection of LinkerResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public static LinkerResourceCollection GetLinkerResources(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetLinkerResources(); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetLinkerResourceAsync(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) - { - return await armResource.GetLinkerResources().GetAsync(linkerName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetLinkerResourceAsync(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) - { - return await client.GetLinkerResources(scope).GetAsync(linkerName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetLinkerResource(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) - { - return armResource.GetLinkerResources().Get(linkerName, cancellationToken); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetLinkerResource(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) - { - return client.GetLinkerResources(scope).Get(linkerName, cancellationToken); - } - - #region LinkerResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static LinkerResource GetLinkerResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - LinkerResource.ValidateResourceId(id); - return new LinkerResource(client, id); - } - ); - } - #endregion - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs deleted file mode 100644 index 7eea8b5c8ace..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs +++ /dev/null @@ -1,426 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.ServiceLinker.Models; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// - /// A Class representing a LinkerResource along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetLinkerResource method. - /// Otherwise you can get one from its parent resource using the GetLinkerResource method. - /// - public partial class LinkerResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string linkerName) - { - var resourceId = $"{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _linkerResourceLinkerClientDiagnostics; - private readonly LinkerRestOperations _linkerResourceLinkerRestClient; - private readonly LinkerResourceData _data; - - /// Initializes a new instance of the class for mocking. - protected LinkerResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal LinkerResource(ArmClient client, LinkerResourceData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal LinkerResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _linkerResourceLinkerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string linkerResourceLinkerApiVersion); - _linkerResourceLinkerRestClient = new LinkerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, linkerResourceLinkerApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ServiceLinker/linkers"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual LinkerResourceData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Get"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Get"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Get(Id.Parent, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Delete - /// - /// - /// - /// 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 DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Delete"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ServiceLinkerArmOperation(_linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Delete - /// - /// - /// - /// 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 Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Delete"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var operation = new ServiceLinkerArmOperation(_linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Operation to update an existing link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Update - /// - /// - /// - /// 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. - /// Linker details. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Update"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.UpdateAsync(Id.Parent, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Operation to update an existing link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Update - /// - /// - /// - /// 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. - /// Linker details. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Update"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Update(Id.Parent, Id.Name, patch, cancellationToken); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - 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 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. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations - /// - /// - /// Operation Id - /// Linker_ListConfigurations - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetConfigurationsAsync(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.GetConfigurations"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.ListConfigurationsAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// list source configurations for a linker. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations - /// - /// - /// Operation Id - /// Linker_ListConfigurations - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetConfigurations(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.GetConfigurations"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.ListConfigurations(Id.Parent, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs deleted file mode 100644 index 66d9fa20e470..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetLinkerResources method from an instance of . - /// - public partial class LinkerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _linkerResourceLinkerClientDiagnostics; - private readonly LinkerRestOperations _linkerResourceLinkerRestClient; - - /// Initializes a new instance of the class for mocking. - protected LinkerResourceCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal LinkerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _linkerResourceLinkerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", LinkerResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(LinkerResource.ResourceType, out string linkerResourceLinkerApiVersion); - _linkerResourceLinkerRestClient = new LinkerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, linkerResourceLinkerApiVersion); - } - - /// - /// Create or update linker resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_CreateOrUpdate - /// - /// - /// - /// 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 name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.CreateOrUpdateAsync(Id, linkerName, data, cancellationToken).ConfigureAwait(false); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateCreateOrUpdateRequest(Id, linkerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update linker resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_CreateOrUpdate - /// - /// - /// - /// 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 name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.CreateOrUpdate(Id, linkerName, data, cancellationToken); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateCreateOrUpdateRequest(Id, linkerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Get"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.GetAsync(Id, linkerName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Get"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Get(Id, linkerName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns list of Linkers which connects to the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers - /// - /// - /// Operation Id - /// Linker_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _linkerResourceLinkerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _linkerResourceLinkerRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LinkerResource(Client, LinkerResourceData.DeserializeLinkerResourceData(e)), _linkerResourceLinkerClientDiagnostics, Pipeline, "LinkerResourceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Returns list of Linkers which connects to the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers - /// - /// - /// Operation Id - /// Linker_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _linkerResourceLinkerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _linkerResourceLinkerRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LinkerResource(Client, LinkerResourceData.DeserializeLinkerResourceData(e)), _linkerResourceLinkerClientDiagnostics, Pipeline, "LinkerResourceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Exists"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.GetAsync(Id, linkerName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Exists"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Get(Id, linkerName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs deleted file mode 100644 index 7cbfd762dde8..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.ServiceLinker.Models; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// A class representing the LinkerResource data model. - public partial class LinkerResourceData : ResourceData - { - /// Initializes a new instance of LinkerResourceData. - public LinkerResourceData() - { - } - - /// Initializes a new instance of LinkerResourceData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// The target service properties - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// - /// The authentication type. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// The application client type. - /// The provisioning state. - /// The VNet solution. - /// An option to store secret value in secure place. - /// connection scope in source service. - internal LinkerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolution vnetSolution, LinkerSecretStore secretStore, string scope) : base(id, name, resourceType, systemData) - { - TargetService = targetService; - AuthInfo = authInfo; - ClientType = clientType; - ProvisioningState = provisioningState; - VnetSolution = vnetSolution; - SecretStore = secretStore; - Scope = scope; - } - - /// - /// The target service properties - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public TargetServiceBaseInfo TargetService { get; set; } - /// - /// The authentication type. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - public AuthBaseInfo AuthInfo { get; set; } - /// The application client type. - public LinkerClientType? ClientType { get; set; } - /// The provisioning state. - public string ProvisioningState { get; } - /// The VNet solution. - internal VnetSolution VnetSolution { get; set; } - /// Type of VNet solution. - public VnetSolutionType? SolutionType - { - get => VnetSolution is null ? default : VnetSolution.SolutionType; - set - { - if (VnetSolution is null) - VnetSolution = new VnetSolution(); - VnetSolution.SolutionType = value; - } - } - - /// An option to store secret value in secure place. - internal LinkerSecretStore SecretStore { get; set; } - /// The key vault id to store secret. - public ResourceIdentifier SecretStoreKeyVaultId - { - get => SecretStore is null ? default : SecretStore.KeyVaultId; - set - { - if (SecretStore is null) - SecretStore = new LinkerSecretStore(); - SecretStore.KeyVaultId = value; - } - } - - /// connection scope in source service. - public string Scope { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerResourceOperationSource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerResourceOperationSource.cs deleted file mode 100644 index 8a16516e879d..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerResourceOperationSource.cs +++ /dev/null @@ -1,40 +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; - -namespace Azure.ResourceManager.ServiceLinker -{ - internal class LinkerResourceOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal LinkerResourceOperationSource(ArmClient client) - { - _client = client; - } - - LinkerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return new LinkerResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return new LinkerResource(_client, data); - } - } -} 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 66c447e2baa3..000000000000 --- 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/LongRunningOperation/ServiceLinkerArmOperation.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperation.cs deleted file mode 100644 index d6eb009367de..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperation.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceLinker -{ -#pragma warning disable SA1649 // File name should match first type name - internal class ServiceLinkerArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name - { - private readonly OperationInternal _operation; - - /// Initializes a new instance of ServiceLinkerArmOperation for mocking. - protected ServiceLinkerArmOperation() - { - } - - internal ServiceLinkerArmOperation(Response response) - { - _operation = OperationInternal.Succeeded(response); - } - - internal ServiceLinkerArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia) - { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia); - _operation = new OperationInternal(clientDiagnostics, nextLinkOperation, response, "ServiceLinkerArmOperation", fallbackStrategy: new ExponentialDelayStrategy()); - } - - /// -#pragma warning disable CA1822 - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override string Id => throw new NotImplementedException(); -#pragma warning restore CA1822 - - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// - public override Response GetRawResponse() => _operation.RawResponse; - - /// - public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - - /// - public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - - /// - public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); - - /// - public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); - - /// - public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); - - /// - public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperationOfT.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperationOfT.cs deleted file mode 100644 index 8c44b6bd62ac..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperationOfT.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceLinker -{ -#pragma warning disable SA1649 // File name should match first type name - internal class ServiceLinkerArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name - { - private readonly OperationInternal _operation; - - /// Initializes a new instance of ServiceLinkerArmOperation for mocking. - protected ServiceLinkerArmOperation() - { - } - - internal ServiceLinkerArmOperation(Response response) - { - _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); - } - - internal ServiceLinkerArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia) - { - var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia); - _operation = new OperationInternal(clientDiagnostics, nextLinkOperation, response, "ServiceLinkerArmOperation", fallbackStrategy: new ExponentialDelayStrategy()); - } - - /// -#pragma warning disable CA1822 - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override string Id => throw new NotImplementedException(); -#pragma warning restore CA1822 - - /// - public override T Value => _operation.Value; - - /// - public override bool HasValue => _operation.HasValue; - - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// - public override Response GetRawResponse() => _operation.RawResponse; - - /// - public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - - /// - public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - - /// - public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); - - /// - public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.Serialization.cs deleted file mode 100644 index 553891f6e1de..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.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.ServiceLinker.Models -{ - public partial class AuthBaseInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("authType"u8); - writer.WriteStringValue(AuthType.ToString()); - writer.WriteEndObject(); - } - - internal static AuthBaseInfo DeserializeAuthBaseInfo(JsonElement element) - { - if (element.TryGetProperty("authType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "secret": return SecretAuthInfo.DeserializeSecretAuthInfo(element); - case "servicePrincipalCertificate": return ServicePrincipalCertificateAuthInfo.DeserializeServicePrincipalCertificateAuthInfo(element); - case "servicePrincipalSecret": return ServicePrincipalSecretAuthInfo.DeserializeServicePrincipalSecretAuthInfo(element); - case "systemAssignedIdentity": return SystemAssignedIdentityAuthInfo.DeserializeSystemAssignedIdentityAuthInfo(element); - case "userAssignedIdentity": return UserAssignedIdentityAuthInfo.DeserializeUserAssignedIdentityAuthInfo(element); - } - } - return UnknownAuthInfoBase.DeserializeUnknownAuthInfoBase(element); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.cs deleted file mode 100644 index 7969875c9374..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// - /// The authentication info - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - public abstract partial class AuthBaseInfo - { - /// Initializes a new instance of AuthBaseInfo. - protected AuthBaseInfo() - { - } - - /// Initializes a new instance of AuthBaseInfo. - /// The authentication type. - internal AuthBaseInfo(LinkerAuthType authType) - { - AuthType = authType; - } - - /// The authentication type. - internal LinkerAuthType AuthType { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.Serialization.cs deleted file mode 100644 index c17e6317ce87..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.Serialization.cs +++ /dev/null @@ -1,60 +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 AzureKeyVaultProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(DoesConnectAsKubernetesCsiDriver)) - { - if (DoesConnectAsKubernetesCsiDriver != null) - { - writer.WritePropertyName("connectAsKubernetesCsiDriver"u8); - writer.WriteBooleanValue(DoesConnectAsKubernetesCsiDriver.Value); - } - else - { - writer.WriteNull("connectAsKubernetesCsiDriver"); - } - } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AzureResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static AzureKeyVaultProperties DeserializeAzureKeyVaultProperties(JsonElement element) - { - Optional connectAsKubernetesCsiDriver = default; - AzureResourceType type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connectAsKubernetesCsiDriver"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connectAsKubernetesCsiDriver = null; - continue; - } - connectAsKubernetesCsiDriver = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new AzureResourceType(property.Value.GetString()); - continue; - } - } - return new AzureKeyVaultProperties(type, Optional.ToNullable(connectAsKubernetesCsiDriver)); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.cs deleted file mode 100644 index 799c92e5f2f8..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The resource properties when type is Azure Key Vault. - public partial class AzureKeyVaultProperties : AzureResourceBaseProperties - { - /// Initializes a new instance of AzureKeyVaultProperties. - public AzureKeyVaultProperties() - { - AzureResourceType = AzureResourceType.KeyVault; - } - - /// Initializes a new instance of AzureKeyVaultProperties. - /// The azure resource type. - /// True if connect via Kubernetes CSI Driver. - internal AzureKeyVaultProperties(AzureResourceType azureResourceType, bool? doesConnectAsKubernetesCsiDriver) : base(azureResourceType) - { - DoesConnectAsKubernetesCsiDriver = doesConnectAsKubernetesCsiDriver; - AzureResourceType = azureResourceType; - } - - /// True if connect via Kubernetes CSI Driver. - public bool? DoesConnectAsKubernetesCsiDriver { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.Serialization.cs deleted file mode 100644 index 61010b74632a..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.Serialization.cs +++ /dev/null @@ -1,35 +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 AzureResourceBaseProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AzureResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static AzureResourceBaseProperties DeserializeAzureResourceBaseProperties(JsonElement element) - { - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "KeyVault": return AzureKeyVaultProperties.DeserializeAzureKeyVaultProperties(element); - } - } - return UnknownAzureResourcePropertiesBase.DeserializeUnknownAzureResourcePropertiesBase(element); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.cs deleted file mode 100644 index bd03086731ff..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// - /// The azure resource properties - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public abstract partial class AzureResourceBaseProperties - { - /// Initializes a new instance of AzureResourceBaseProperties. - protected AzureResourceBaseProperties() - { - } - - /// Initializes a new instance of AzureResourceBaseProperties. - /// The azure resource type. - internal AzureResourceBaseProperties(AzureResourceType azureResourceType) - { - AzureResourceType = azureResourceType; - } - - /// The azure resource type. - internal AzureResourceType AzureResourceType { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.Serialization.cs deleted file mode 100644 index 6cf158d90f9f..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.Serialization.cs +++ /dev/null @@ -1,76 +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 AzureResourceInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(ResourceProperties)) - { - if (ResourceProperties != null) - { - writer.WritePropertyName("resourceProperties"u8); - writer.WriteObjectValue(ResourceProperties); - } - else - { - writer.WriteNull("resourceProperties"); - } - } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TargetServiceType.ToString()); - writer.WriteEndObject(); - } - - internal static AzureResourceInfo DeserializeAzureResourceInfo(JsonElement element) - { - Optional id = default; - Optional resourceProperties = default; - TargetServiceType type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceProperties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - resourceProperties = null; - continue; - } - resourceProperties = AzureResourceBaseProperties.DeserializeAzureResourceBaseProperties(property.Value); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new TargetServiceType(property.Value.GetString()); - continue; - } - } - return new AzureResourceInfo(type, id.Value, resourceProperties.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs deleted file mode 100644 index ce42250fd104..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The azure resource info when target service type is AzureResource. - public partial class AzureResourceInfo : TargetServiceBaseInfo - { - /// Initializes a new instance of AzureResourceInfo. - public AzureResourceInfo() - { - TargetServiceType = TargetServiceType.AzureResource; - } - - /// Initializes a new instance of AzureResourceInfo. - /// The target service type. - /// The Id of azure resource. - /// - /// The azure resource connection related properties. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - internal AzureResourceInfo(TargetServiceType targetServiceType, ResourceIdentifier id, AzureResourceBaseProperties resourceProperties) : base(targetServiceType) - { - Id = id; - ResourceProperties = resourceProperties; - TargetServiceType = targetServiceType; - } - - /// The Id of azure resource. - public ResourceIdentifier Id { get; set; } - /// - /// The azure resource connection related properties. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public AzureResourceBaseProperties ResourceProperties { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceType.cs deleted file mode 100644 index 423a86b8181c..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceType.cs +++ /dev/null @@ -1,48 +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 azure resource type. - internal readonly partial struct AzureResourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AzureResourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string KeyVaultValue = "KeyVault"; - - /// KeyVault. - public static AzureResourceType KeyVault { get; } = new AzureResourceType(KeyVaultValue); - /// Determines if two values are the same. - public static bool operator ==(AzureResourceType left, AzureResourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AzureResourceType left, AzureResourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AzureResourceType(string value) => new AzureResourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AzureResourceType other && Equals(other); - /// - public bool Equals(AzureResourceType 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/Models/ConfluentBootstrapServerInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.Serialization.cs deleted file mode 100644 index 91313d2e5d34..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.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 Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class ConfluentBootstrapServerInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Endpoint)) - { - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint); - } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TargetServiceType.ToString()); - writer.WriteEndObject(); - } - - internal static ConfluentBootstrapServerInfo DeserializeConfluentBootstrapServerInfo(JsonElement element) - { - Optional endpoint = default; - TargetServiceType type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("endpoint"u8)) - { - endpoint = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new TargetServiceType(property.Value.GetString()); - continue; - } - } - return new ConfluentBootstrapServerInfo(type, endpoint.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.cs deleted file mode 100644 index b8cc37b27bd7..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The service properties when target service type is ConfluentBootstrapServer. - public partial class ConfluentBootstrapServerInfo : TargetServiceBaseInfo - { - /// Initializes a new instance of ConfluentBootstrapServerInfo. - public ConfluentBootstrapServerInfo() - { - TargetServiceType = TargetServiceType.ConfluentBootstrapServer; - } - - /// Initializes a new instance of ConfluentBootstrapServerInfo. - /// The target service type. - /// The endpoint of service. - internal ConfluentBootstrapServerInfo(TargetServiceType targetServiceType, string endpoint) : base(targetServiceType) - { - Endpoint = endpoint; - TargetServiceType = targetServiceType; - } - - /// The endpoint of service. - public string Endpoint { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.Serialization.cs deleted file mode 100644 index e4bfa89779eb..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.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 Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class ConfluentSchemaRegistryInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Endpoint)) - { - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint); - } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TargetServiceType.ToString()); - writer.WriteEndObject(); - } - - internal static ConfluentSchemaRegistryInfo DeserializeConfluentSchemaRegistryInfo(JsonElement element) - { - Optional endpoint = default; - TargetServiceType type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("endpoint"u8)) - { - endpoint = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new TargetServiceType(property.Value.GetString()); - continue; - } - } - return new ConfluentSchemaRegistryInfo(type, endpoint.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.cs deleted file mode 100644 index 699a58cb040f..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The service properties when target service type is ConfluentSchemaRegistry. - public partial class ConfluentSchemaRegistryInfo : TargetServiceBaseInfo - { - /// Initializes a new instance of ConfluentSchemaRegistryInfo. - public ConfluentSchemaRegistryInfo() - { - TargetServiceType = TargetServiceType.ConfluentSchemaRegistry; - } - - /// Initializes a new instance of ConfluentSchemaRegistryInfo. - /// The target service type. - /// The endpoint of service. - internal ConfluentSchemaRegistryInfo(TargetServiceType targetServiceType, string endpoint) : base(targetServiceType) - { - Endpoint = endpoint; - TargetServiceType = targetServiceType; - } - - /// The endpoint of service. - public string Endpoint { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.Serialization.cs deleted file mode 100644 index 658c5a65c9bb..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.Serialization.cs +++ /dev/null @@ -1,71 +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 KeyVaultSecretReferenceSecretInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Version)) - { - if (Version != null) - { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - } - else - { - writer.WriteNull("version"); - } - } - writer.WritePropertyName("secretType"u8); - writer.WriteStringValue(SecretType.ToString()); - writer.WriteEndObject(); - } - - internal static KeyVaultSecretReferenceSecretInfo DeserializeKeyVaultSecretReferenceSecretInfo(JsonElement element) - { - Optional name = default; - Optional version = default; - LinkerSecretType secretType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("version"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - version = null; - continue; - } - version = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretType"u8)) - { - secretType = new LinkerSecretType(property.Value.GetString()); - continue; - } - } - return new KeyVaultSecretReferenceSecretInfo(secretType, name.Value, version.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.cs deleted file mode 100644 index e9181f566cf1..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The secret info when type is keyVaultSecretReference. It's for scenario that user provides a secret stored in user's keyvault and source is Azure Kubernetes. The key Vault's resource id is linked to secretStore.keyVaultId. - public partial class KeyVaultSecretReferenceSecretInfo : SecretBaseInfo - { - /// Initializes a new instance of KeyVaultSecretReferenceSecretInfo. - public KeyVaultSecretReferenceSecretInfo() - { - SecretType = LinkerSecretType.KeyVaultSecretReference; - } - - /// Initializes a new instance of KeyVaultSecretReferenceSecretInfo. - /// The secret type. - /// Name of the Key Vault secret. - /// Version of the Key Vault secret. - internal KeyVaultSecretReferenceSecretInfo(LinkerSecretType secretType, string name, string version) : base(secretType) - { - Name = name; - Version = version; - SecretType = secretType; - } - - /// Name of the Key Vault secret. - public string Name { get; set; } - /// Version of the Key Vault secret. - public string Version { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.Serialization.cs deleted file mode 100644 index 1b3d369a937d..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.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 Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class KeyVaultSecretUriSecretInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStringValue(Value); - } - writer.WritePropertyName("secretType"u8); - writer.WriteStringValue(SecretType.ToString()); - writer.WriteEndObject(); - } - - internal static KeyVaultSecretUriSecretInfo DeserializeKeyVaultSecretUriSecretInfo(JsonElement element) - { - Optional value = default; - LinkerSecretType secretType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretType"u8)) - { - secretType = new LinkerSecretType(property.Value.GetString()); - continue; - } - } - return new KeyVaultSecretUriSecretInfo(secretType, value.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.cs deleted file mode 100644 index 15254bae0702..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The secret info when type is keyVaultSecretUri. It's for scenario that user provides a secret stored in user's keyvault and source is Web App, Spring Cloud or Container App. - public partial class KeyVaultSecretUriSecretInfo : SecretBaseInfo - { - /// Initializes a new instance of KeyVaultSecretUriSecretInfo. - public KeyVaultSecretUriSecretInfo() - { - SecretType = LinkerSecretType.KeyVaultSecretUri; - } - - /// Initializes a new instance of KeyVaultSecretUriSecretInfo. - /// The secret type. - /// URI to the keyvault secret. - internal KeyVaultSecretUriSecretInfo(LinkerSecretType secretType, string value) : base(secretType) - { - Value = value; - SecretType = secretType; - } - - /// URI to the keyvault secret. - public string Value { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs deleted file mode 100644 index 3a51fc6d3dfb..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs +++ /dev/null @@ -1,60 +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 authentication type. - public readonly partial struct LinkerAuthType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LinkerAuthType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SystemAssignedIdentityValue = "systemAssignedIdentity"; - private const string UserAssignedIdentityValue = "userAssignedIdentity"; - private const string ServicePrincipalSecretValue = "servicePrincipalSecret"; - private const string ServicePrincipalCertificateValue = "servicePrincipalCertificate"; - private const string SecretValue = "secret"; - - /// systemAssignedIdentity. - public static LinkerAuthType SystemAssignedIdentity { get; } = new LinkerAuthType(SystemAssignedIdentityValue); - /// userAssignedIdentity. - public static LinkerAuthType UserAssignedIdentity { get; } = new LinkerAuthType(UserAssignedIdentityValue); - /// servicePrincipalSecret. - public static LinkerAuthType ServicePrincipalSecret { get; } = new LinkerAuthType(ServicePrincipalSecretValue); - /// servicePrincipalCertificate. - public static LinkerAuthType ServicePrincipalCertificate { get; } = new LinkerAuthType(ServicePrincipalCertificateValue); - /// secret. - public static LinkerAuthType Secret { get; } = new LinkerAuthType(SecretValue); - /// Determines if two values are the same. - public static bool operator ==(LinkerAuthType left, LinkerAuthType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LinkerAuthType left, LinkerAuthType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LinkerAuthType(string value) => new LinkerAuthType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LinkerAuthType other && Equals(other); - /// - public bool Equals(LinkerAuthType 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/Models/LinkerClientType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs deleted file mode 100644 index ddc43894541f..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs +++ /dev/null @@ -1,75 +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 application client type. - public readonly partial struct LinkerClientType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LinkerClientType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "none"; - private const string DotnetValue = "dotnet"; - private const string JavaValue = "java"; - private const string PythonValue = "python"; - private const string GoValue = "go"; - private const string PhpValue = "php"; - private const string RubyValue = "ruby"; - private const string DjangoValue = "django"; - private const string NodejsValue = "nodejs"; - private const string SpringBootValue = "springBoot"; - - /// none. - public static LinkerClientType None { get; } = new LinkerClientType(NoneValue); - /// dotnet. - public static LinkerClientType Dotnet { get; } = new LinkerClientType(DotnetValue); - /// java. - public static LinkerClientType Java { get; } = new LinkerClientType(JavaValue); - /// python. - public static LinkerClientType Python { get; } = new LinkerClientType(PythonValue); - /// go. - public static LinkerClientType Go { get; } = new LinkerClientType(GoValue); - /// php. - public static LinkerClientType Php { get; } = new LinkerClientType(PhpValue); - /// ruby. - public static LinkerClientType Ruby { get; } = new LinkerClientType(RubyValue); - /// django. - public static LinkerClientType Django { get; } = new LinkerClientType(DjangoValue); - /// nodejs. - public static LinkerClientType Nodejs { get; } = new LinkerClientType(NodejsValue); - /// springBoot. - public static LinkerClientType SpringBoot { get; } = new LinkerClientType(SpringBootValue); - /// 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. - public static bool operator !=(LinkerClientType left, LinkerClientType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LinkerClientType(string value) => new LinkerClientType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LinkerClientType other && Equals(other); - /// - public bool Equals(LinkerClientType 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/Models/LinkerList.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs deleted file mode 100644 index d767815508d6..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs +++ /dev/null @@ -1,52 +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.ServiceLinker; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - internal partial class LinkerList - { - internal static LinkerList DeserializeLinkerList(JsonElement element) - { - Optional nextLink = default; - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - nextLink = null; - continue; - } - nextLink = property.Value.GetString(); - continue; - } - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(LinkerResourceData.DeserializeLinkerResourceData(item)); - } - value = array; - continue; - } - } - return new LinkerList(nextLink.Value, Optional.ToList(value)); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs deleted file mode 100644 index 4e843472b087..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs +++ /dev/null @@ -1,37 +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.ServiceLinker; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The list of Linker. - internal partial class LinkerList - { - /// Initializes a new instance of LinkerList. - internal LinkerList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of LinkerList. - /// The link used to get the next page of Linker list. - /// The list of Linkers. - internal LinkerList(string nextLink, IReadOnlyList value) - { - NextLink = nextLink; - Value = value; - } - - /// The link used to get the next page of Linker list. - public string NextLink { get; } - /// The list of Linkers. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourceData.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourceData.Serialization.cs deleted file mode 100644 index 4273cca44a80..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourceData.Serialization.cs +++ /dev/null @@ -1,198 +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; -using Azure.ResourceManager.ServiceLinker.Models; - -namespace Azure.ResourceManager.ServiceLinker -{ - public partial class LinkerResourceData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(TargetService)) - { - writer.WritePropertyName("targetService"u8); - writer.WriteObjectValue(TargetService); - } - if (Optional.IsDefined(AuthInfo)) - { - writer.WritePropertyName("authInfo"u8); - writer.WriteObjectValue(AuthInfo); - } - if (Optional.IsDefined(ClientType)) - { - writer.WritePropertyName("clientType"u8); - writer.WriteStringValue(ClientType.Value.ToString()); - } - if (Optional.IsDefined(VnetSolution)) - { - if (VnetSolution != null) - { - writer.WritePropertyName("vNetSolution"u8); - writer.WriteObjectValue(VnetSolution); - } - else - { - writer.WriteNull("vNetSolution"); - } - } - if (Optional.IsDefined(SecretStore)) - { - if (SecretStore != null) - { - writer.WritePropertyName("secretStore"u8); - writer.WriteObjectValue(SecretStore); - } - else - { - writer.WriteNull("secretStore"); - } - } - if (Optional.IsDefined(Scope)) - { - if (Scope != null) - { - writer.WritePropertyName("scope"u8); - writer.WriteStringValue(Scope); - } - else - { - writer.WriteNull("scope"); - } - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static LinkerResourceData DeserializeLinkerResourceData(JsonElement element) - { - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional targetService = default; - Optional authInfo = default; - Optional clientType = default; - Optional provisioningState = default; - Optional vnetSolution = default; - Optional secretStore = default; - Optional scope = default; - foreach (var property in element.EnumerateObject()) - { - 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) - { - property.ThrowNonNullablePropertyIsNull(); - 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("targetService"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - targetService = TargetServiceBaseInfo.DeserializeTargetServiceBaseInfo(property0.Value); - continue; - } - if (property0.NameEquals("authInfo"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - authInfo = AuthBaseInfo.DeserializeAuthBaseInfo(property0.Value); - continue; - } - if (property0.NameEquals("clientType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientType = new LinkerClientType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vNetSolution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - vnetSolution = null; - continue; - } - vnetSolution = VnetSolution.DeserializeVnetSolution(property0.Value); - continue; - } - if (property0.NameEquals("secretStore"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - secretStore = null; - continue; - } - secretStore = LinkerSecretStore.DeserializeLinkerSecretStore(property0.Value); - continue; - } - if (property0.NameEquals("scope"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - scope = null; - continue; - } - scope = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new LinkerResourceData(id, name, type, systemData.Value, targetService.Value, authInfo.Value, Optional.ToNullable(clientType), provisioningState.Value, vnetSolution.Value, secretStore.Value, scope.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs deleted file mode 100644 index 00c4c6548608..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs +++ /dev/null @@ -1,75 +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 LinkerResourcePatch : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(TargetService)) - { - writer.WritePropertyName("targetService"u8); - writer.WriteObjectValue(TargetService); - } - if (Optional.IsDefined(AuthInfo)) - { - writer.WritePropertyName("authInfo"u8); - writer.WriteObjectValue(AuthInfo); - } - if (Optional.IsDefined(ClientType)) - { - writer.WritePropertyName("clientType"u8); - writer.WriteStringValue(ClientType.Value.ToString()); - } - if (Optional.IsDefined(VnetSolution)) - { - if (VnetSolution != null) - { - writer.WritePropertyName("vNetSolution"u8); - writer.WriteObjectValue(VnetSolution); - } - else - { - writer.WriteNull("vNetSolution"); - } - } - if (Optional.IsDefined(SecretStore)) - { - if (SecretStore != null) - { - writer.WritePropertyName("secretStore"u8); - writer.WriteObjectValue(SecretStore); - } - else - { - writer.WriteNull("secretStore"); - } - } - if (Optional.IsDefined(Scope)) - { - if (Scope != null) - { - writer.WritePropertyName("scope"u8); - writer.WriteStringValue(Scope); - } - else - { - writer.WriteNull("scope"); - } - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs deleted file mode 100644 index e5936827dbb5..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// A linker to be updated. - public partial class LinkerResourcePatch - { - /// Initializes a new instance of LinkerResourcePatch. - public LinkerResourcePatch() - { - } - - /// - /// The target service properties - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public TargetServiceBaseInfo TargetService { get; set; } - /// - /// The authentication type. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - public AuthBaseInfo AuthInfo { get; set; } - /// The application client type. - public LinkerClientType? ClientType { get; set; } - /// The provisioning state. - public string ProvisioningState { get; } - /// The VNet solution. - internal VnetSolution VnetSolution { get; set; } - /// Type of VNet solution. - public VnetSolutionType? SolutionType - { - get => VnetSolution is null ? default : VnetSolution.SolutionType; - set - { - if (VnetSolution is null) - VnetSolution = new VnetSolution(); - VnetSolution.SolutionType = value; - } - } - - /// An option to store secret value in secure place. - internal LinkerSecretStore SecretStore { get; set; } - /// The key vault id to store secret. - public ResourceIdentifier SecretStoreKeyVaultId - { - get => SecretStore is null ? default : SecretStore.KeyVaultId; - set - { - if (SecretStore is null) - SecretStore = new LinkerSecretStore(); - SecretStore.KeyVaultId = value; - } - } - - /// connection scope in source service. - public string Scope { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.Serialization.cs deleted file mode 100644 index ee8bcc013027..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.Serialization.cs +++ /dev/null @@ -1,52 +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 -{ - internal partial class LinkerSecretStore : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(KeyVaultId)) - { - if (KeyVaultId != null) - { - writer.WritePropertyName("keyVaultId"u8); - writer.WriteStringValue(KeyVaultId); - } - else - { - writer.WriteNull("keyVaultId"); - } - } - writer.WriteEndObject(); - } - - internal static LinkerSecretStore DeserializeLinkerSecretStore(JsonElement element) - { - Optional keyVaultId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyVaultId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - keyVaultId = null; - continue; - } - keyVaultId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - } - return new LinkerSecretStore(keyVaultId.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs deleted file mode 100644 index 073ae9ae1f2f..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// An option to store secret value in secure place. - internal partial class LinkerSecretStore - { - /// Initializes a new instance of LinkerSecretStore. - public LinkerSecretStore() - { - } - - /// Initializes a new instance of LinkerSecretStore. - /// The key vault id to store secret. - internal LinkerSecretStore(ResourceIdentifier keyVaultId) - { - KeyVaultId = keyVaultId; - } - - /// The key vault id to store secret. - public ResourceIdentifier KeyVaultId { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretType.cs deleted file mode 100644 index a712b9c0a7ca..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretType.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 secret type. - internal readonly partial struct LinkerSecretType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LinkerSecretType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RawValueValue = "rawValue"; - private const string KeyVaultSecretUriValue = "keyVaultSecretUri"; - private const string KeyVaultSecretReferenceValue = "keyVaultSecretReference"; - - /// rawValue. - public static LinkerSecretType RawValue { get; } = new LinkerSecretType(RawValueValue); - /// keyVaultSecretUri. - public static LinkerSecretType KeyVaultSecretUri { get; } = new LinkerSecretType(KeyVaultSecretUriValue); - /// keyVaultSecretReference. - public static LinkerSecretType KeyVaultSecretReference { get; } = new LinkerSecretType(KeyVaultSecretReferenceValue); - /// Determines if two values are the same. - public static bool operator ==(LinkerSecretType left, LinkerSecretType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LinkerSecretType left, LinkerSecretType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LinkerSecretType(string value) => new LinkerSecretType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LinkerSecretType other && Equals(other); - /// - public bool Equals(LinkerSecretType 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/Models/LinkerValidateOperationResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.Serialization.cs deleted file mode 100644 index c6666beb9fcc..000000000000 --- 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 95f57de14b2d..000000000000 --- 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 bc6ce0ea8b14..000000000000 --- 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 1c11354019eb..000000000000 --- 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 edec3f3a92a8..000000000000 --- 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/Models/RawValueSecretInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.Serialization.cs deleted file mode 100644 index e244762191c0..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.Serialization.cs +++ /dev/null @@ -1,60 +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 RawValueSecretInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Value)) - { - if (Value != null) - { - writer.WritePropertyName("value"u8); - writer.WriteStringValue(Value); - } - else - { - writer.WriteNull("value"); - } - } - writer.WritePropertyName("secretType"u8); - writer.WriteStringValue(SecretType.ToString()); - writer.WriteEndObject(); - } - - internal static RawValueSecretInfo DeserializeRawValueSecretInfo(JsonElement element) - { - Optional value = default; - LinkerSecretType secretType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - value = null; - continue; - } - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretType"u8)) - { - secretType = new LinkerSecretType(property.Value.GetString()); - continue; - } - } - return new RawValueSecretInfo(secretType, value.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.cs deleted file mode 100644 index 8642b1c062fd..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The secret info when type is rawValue. It's for scenarios that user input the secret. - public partial class RawValueSecretInfo : SecretBaseInfo - { - /// Initializes a new instance of RawValueSecretInfo. - public RawValueSecretInfo() - { - SecretType = LinkerSecretType.RawValue; - } - - /// Initializes a new instance of RawValueSecretInfo. - /// The secret type. - /// The actual value of the secret. - internal RawValueSecretInfo(LinkerSecretType secretType, string value) : base(secretType) - { - Value = value; - SecretType = secretType; - } - - /// The actual value of the secret. - public string Value { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.Serialization.cs deleted file mode 100644 index 6d48d91688df..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.Serialization.cs +++ /dev/null @@ -1,83 +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 SecretAuthInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - if (Name != null) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - else - { - writer.WriteNull("name"); - } - } - if (Optional.IsDefined(SecretInfo)) - { - if (SecretInfo != null) - { - writer.WritePropertyName("secretInfo"u8); - writer.WriteObjectValue(SecretInfo); - } - else - { - writer.WriteNull("secretInfo"); - } - } - writer.WritePropertyName("authType"u8); - writer.WriteStringValue(AuthType.ToString()); - writer.WriteEndObject(); - } - - internal static SecretAuthInfo DeserializeSecretAuthInfo(JsonElement element) - { - Optional name = default; - Optional secretInfo = default; - LinkerAuthType authType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - name = null; - continue; - } - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretInfo = null; - continue; - } - secretInfo = SecretBaseInfo.DeserializeSecretBaseInfo(property.Value); - continue; - } - if (property.NameEquals("authType"u8)) - { - authType = new LinkerAuthType(property.Value.GetString()); - continue; - } - } - return new SecretAuthInfo(authType, name.Value, secretInfo.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs deleted file mode 100644 index 61f0a0c16250..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The authentication info when authType is secret. - public partial class SecretAuthInfo : AuthBaseInfo - { - /// Initializes a new instance of SecretAuthInfo. - public SecretAuthInfo() - { - AuthType = LinkerAuthType.Secret; - } - - /// Initializes a new instance of SecretAuthInfo. - /// The authentication type. - /// Username or account name for secret auth. - /// - /// Password or key vault secret for secret auth. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - internal SecretAuthInfo(LinkerAuthType authType, string name, SecretBaseInfo secretInfo) : base(authType) - { - Name = name; - SecretInfo = secretInfo; - AuthType = authType; - } - - /// Username or account name for secret auth. - public string Name { get; set; } - /// - /// Password or key vault secret for secret auth. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public SecretBaseInfo SecretInfo { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretBaseInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretBaseInfo.Serialization.cs deleted file mode 100644 index 9fea31ebc1f0..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretBaseInfo.Serialization.cs +++ /dev/null @@ -1,37 +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 SecretBaseInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("secretType"u8); - writer.WriteStringValue(SecretType.ToString()); - writer.WriteEndObject(); - } - - internal static SecretBaseInfo DeserializeSecretBaseInfo(JsonElement element) - { - if (element.TryGetProperty("secretType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "keyVaultSecretReference": return KeyVaultSecretReferenceSecretInfo.DeserializeKeyVaultSecretReferenceSecretInfo(element); - case "keyVaultSecretUri": return KeyVaultSecretUriSecretInfo.DeserializeKeyVaultSecretUriSecretInfo(element); - case "rawValue": return RawValueSecretInfo.DeserializeRawValueSecretInfo(element); - } - } - return UnknownSecretInfoBase.DeserializeUnknownSecretInfoBase(element); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretBaseInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretBaseInfo.cs deleted file mode 100644 index c2bcf6e97828..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretBaseInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// - /// The secret info - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class SecretBaseInfo - { - /// Initializes a new instance of SecretBaseInfo. - protected SecretBaseInfo() - { - } - - /// Initializes a new instance of SecretBaseInfo. - /// The secret type. - internal SecretBaseInfo(LinkerSecretType secretType) - { - SecretType = secretType; - } - - /// The secret type. - internal LinkerSecretType SecretType { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.Serialization.cs deleted file mode 100644 index 445cb768d917..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.Serialization.cs +++ /dev/null @@ -1,62 +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; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class ServicePrincipalCertificateAuthInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId); - writer.WritePropertyName("principalId"u8); - writer.WriteStringValue(PrincipalId); - writer.WritePropertyName("certificate"u8); - writer.WriteStringValue(Certificate); - writer.WritePropertyName("authType"u8); - writer.WriteStringValue(AuthType.ToString()); - writer.WriteEndObject(); - } - - internal static ServicePrincipalCertificateAuthInfo DeserializeServicePrincipalCertificateAuthInfo(JsonElement element) - { - string clientId = default; - Guid principalId = default; - string certificate = default; - LinkerAuthType authType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("clientId"u8)) - { - clientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("principalId"u8)) - { - principalId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("certificate"u8)) - { - certificate = property.Value.GetString(); - continue; - } - if (property.NameEquals("authType"u8)) - { - authType = new LinkerAuthType(property.Value.GetString()); - continue; - } - } - return new ServicePrincipalCertificateAuthInfo(authType, clientId, principalId, certificate); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs deleted file mode 100644 index b63d6738afaf..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The authentication info when authType is servicePrincipal certificate. - public partial class ServicePrincipalCertificateAuthInfo : AuthBaseInfo - { - /// Initializes a new instance of ServicePrincipalCertificateAuthInfo. - /// Application clientId for servicePrincipal auth. - /// Principal Id for servicePrincipal auth. - /// ServicePrincipal certificate for servicePrincipal auth. - /// or is null. - public ServicePrincipalCertificateAuthInfo(string clientId, Guid principalId, string certificate) - { - Argument.AssertNotNull(clientId, nameof(clientId)); - Argument.AssertNotNull(certificate, nameof(certificate)); - - ClientId = clientId; - PrincipalId = principalId; - Certificate = certificate; - AuthType = LinkerAuthType.ServicePrincipalCertificate; - } - - /// Initializes a new instance of ServicePrincipalCertificateAuthInfo. - /// The authentication type. - /// Application clientId for servicePrincipal auth. - /// Principal Id for servicePrincipal auth. - /// ServicePrincipal certificate for servicePrincipal auth. - internal ServicePrincipalCertificateAuthInfo(LinkerAuthType authType, string clientId, Guid principalId, string certificate) : base(authType) - { - ClientId = clientId; - PrincipalId = principalId; - Certificate = certificate; - AuthType = authType; - } - - /// Application clientId for servicePrincipal auth. - public string ClientId { get; set; } - /// Principal Id for servicePrincipal auth. - public Guid PrincipalId { get; set; } - /// ServicePrincipal certificate for servicePrincipal auth. - public string Certificate { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.Serialization.cs deleted file mode 100644 index 111dd7d52273..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.Serialization.cs +++ /dev/null @@ -1,62 +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; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class ServicePrincipalSecretAuthInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId); - writer.WritePropertyName("principalId"u8); - writer.WriteStringValue(PrincipalId); - writer.WritePropertyName("secret"u8); - writer.WriteStringValue(Secret); - writer.WritePropertyName("authType"u8); - writer.WriteStringValue(AuthType.ToString()); - writer.WriteEndObject(); - } - - internal static ServicePrincipalSecretAuthInfo DeserializeServicePrincipalSecretAuthInfo(JsonElement element) - { - string clientId = default; - Guid principalId = default; - string secret = default; - LinkerAuthType authType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("clientId"u8)) - { - clientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("principalId"u8)) - { - principalId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("secret"u8)) - { - secret = property.Value.GetString(); - continue; - } - if (property.NameEquals("authType"u8)) - { - authType = new LinkerAuthType(property.Value.GetString()); - continue; - } - } - return new ServicePrincipalSecretAuthInfo(authType, clientId, principalId, secret); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs deleted file mode 100644 index 8063a0fc111c..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The authentication info when authType is servicePrincipal secret. - public partial class ServicePrincipalSecretAuthInfo : AuthBaseInfo - { - /// Initializes a new instance of ServicePrincipalSecretAuthInfo. - /// ServicePrincipal application clientId for servicePrincipal auth. - /// Principal Id for servicePrincipal auth. - /// Secret for servicePrincipal auth. - /// or is null. - public ServicePrincipalSecretAuthInfo(string clientId, Guid principalId, string secret) - { - Argument.AssertNotNull(clientId, nameof(clientId)); - Argument.AssertNotNull(secret, nameof(secret)); - - ClientId = clientId; - PrincipalId = principalId; - Secret = secret; - AuthType = LinkerAuthType.ServicePrincipalSecret; - } - - /// Initializes a new instance of ServicePrincipalSecretAuthInfo. - /// The authentication type. - /// ServicePrincipal application clientId for servicePrincipal auth. - /// Principal Id for servicePrincipal auth. - /// Secret for servicePrincipal auth. - internal ServicePrincipalSecretAuthInfo(LinkerAuthType authType, string clientId, Guid principalId, string secret) : base(authType) - { - ClientId = clientId; - PrincipalId = principalId; - Secret = secret; - AuthType = authType; - } - - /// ServicePrincipal application clientId for servicePrincipal auth. - public string ClientId { get; set; } - /// Principal Id for servicePrincipal auth. - public Guid PrincipalId { get; set; } - /// Secret for servicePrincipal auth. - public string Secret { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.Serialization.cs deleted file mode 100644 index d802ca409900..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.Serialization.cs +++ /dev/null @@ -1,40 +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 SourceConfiguration - { - internal static SourceConfiguration DeserializeSourceConfiguration(JsonElement element) - { - Optional name = default; - Optional value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - value = null; - continue; - } - value = property.Value.GetString(); - continue; - } - } - return new SourceConfiguration(name.Value, value.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.cs deleted file mode 100644 index 396d332ecaf5..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// A configuration item for source resource. - public partial class SourceConfiguration - { - /// Initializes a new instance of SourceConfiguration. - internal SourceConfiguration() - { - } - - /// Initializes a new instance of SourceConfiguration. - /// The name of setting. - /// The value of setting. - internal SourceConfiguration(string name, string value) - { - Name = name; - Value = value; - } - - /// The name of setting. - public string Name { get; } - /// The value of setting. - public string Value { get; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfigurationResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfigurationResult.Serialization.cs deleted file mode 100644 index 62e1da5f9779..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfigurationResult.Serialization.cs +++ /dev/null @@ -1,40 +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; - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - public partial class SourceConfigurationResult - { - internal static SourceConfigurationResult DeserializeSourceConfigurationResult(JsonElement element) - { - Optional> configurations = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("configurations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SourceConfiguration.DeserializeSourceConfiguration(item)); - } - configurations = array; - continue; - } - } - return new SourceConfigurationResult(Optional.ToList(configurations)); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfigurationResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfigurationResult.cs deleted file mode 100644 index 850c548c48c3..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfigurationResult.cs +++ /dev/null @@ -1,32 +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.ServiceLinker.Models -{ - /// Configurations for source resource, include appSettings, connectionString and serviceBindings. - public partial class SourceConfigurationResult - { - /// Initializes a new instance of SourceConfigurationResult. - internal SourceConfigurationResult() - { - Configurations = new ChangeTrackingList(); - } - - /// Initializes a new instance of SourceConfigurationResult. - /// The configuration properties for source resource. - internal SourceConfigurationResult(IReadOnlyList configurations) - { - Configurations = configurations; - } - - /// The configuration properties for source resource. - public IReadOnlyList Configurations { get; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.Serialization.cs deleted file mode 100644 index cea0ab5691ae..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.Serialization.cs +++ /dev/null @@ -1,37 +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 SystemAssignedIdentityAuthInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("authType"u8); - writer.WriteStringValue(AuthType.ToString()); - writer.WriteEndObject(); - } - - internal static SystemAssignedIdentityAuthInfo DeserializeSystemAssignedIdentityAuthInfo(JsonElement element) - { - LinkerAuthType authType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("authType"u8)) - { - authType = new LinkerAuthType(property.Value.GetString()); - continue; - } - } - return new SystemAssignedIdentityAuthInfo(authType); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs deleted file mode 100644 index 3a457f39f30f..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The authentication info when authType is systemAssignedIdentity. - public partial class SystemAssignedIdentityAuthInfo : AuthBaseInfo - { - /// Initializes a new instance of SystemAssignedIdentityAuthInfo. - public SystemAssignedIdentityAuthInfo() - { - AuthType = LinkerAuthType.SystemAssignedIdentity; - } - - /// Initializes a new instance of SystemAssignedIdentityAuthInfo. - /// The authentication type. - internal SystemAssignedIdentityAuthInfo(LinkerAuthType authType) : base(authType) - { - AuthType = authType; - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.Serialization.cs deleted file mode 100644 index 1a7836c2987d..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.Serialization.cs +++ /dev/null @@ -1,37 +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 TargetServiceBaseInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TargetServiceType.ToString()); - writer.WriteEndObject(); - } - - internal static TargetServiceBaseInfo DeserializeTargetServiceBaseInfo(JsonElement element) - { - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureResource": return AzureResourceInfo.DeserializeAzureResourceInfo(element); - case "ConfluentBootstrapServer": return ConfluentBootstrapServerInfo.DeserializeConfluentBootstrapServerInfo(element); - case "ConfluentSchemaRegistry": return ConfluentSchemaRegistryInfo.DeserializeConfluentSchemaRegistryInfo(element); - } - } - return UnknownTargetServiceBase.DeserializeUnknownTargetServiceBase(element); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.cs deleted file mode 100644 index d76e3788322e..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// - /// The target service properties - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class TargetServiceBaseInfo - { - /// Initializes a new instance of TargetServiceBaseInfo. - protected TargetServiceBaseInfo() - { - } - - /// Initializes a new instance of TargetServiceBaseInfo. - /// The target service type. - internal TargetServiceBaseInfo(TargetServiceType targetServiceType) - { - TargetServiceType = targetServiceType; - } - - /// The target service type. - internal TargetServiceType TargetServiceType { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceType.cs deleted file mode 100644 index 3f4b6d0cc99d..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceType.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 target service type. - internal readonly partial struct TargetServiceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TargetServiceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureResourceValue = "AzureResource"; - private const string ConfluentBootstrapServerValue = "ConfluentBootstrapServer"; - private const string ConfluentSchemaRegistryValue = "ConfluentSchemaRegistry"; - - /// AzureResource. - public static TargetServiceType AzureResource { get; } = new TargetServiceType(AzureResourceValue); - /// ConfluentBootstrapServer. - public static TargetServiceType ConfluentBootstrapServer { get; } = new TargetServiceType(ConfluentBootstrapServerValue); - /// ConfluentSchemaRegistry. - public static TargetServiceType ConfluentSchemaRegistry { get; } = new TargetServiceType(ConfluentSchemaRegistryValue); - /// Determines if two values are the same. - public static bool operator ==(TargetServiceType left, TargetServiceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TargetServiceType left, TargetServiceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TargetServiceType(string value) => new TargetServiceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TargetServiceType other && Equals(other); - /// - public bool Equals(TargetServiceType 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/Models/UnknownAuthInfoBase.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.Serialization.cs deleted file mode 100644 index 30dbb46bd350..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.Serialization.cs +++ /dev/null @@ -1,37 +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 -{ - internal partial class UnknownAuthInfoBase : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("authType"u8); - writer.WriteStringValue(AuthType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownAuthInfoBase DeserializeUnknownAuthInfoBase(JsonElement element) - { - LinkerAuthType authType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("authType"u8)) - { - authType = new LinkerAuthType(property.Value.GetString()); - continue; - } - } - return new UnknownAuthInfoBase(authType); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.cs deleted file mode 100644 index dfdff8da0bfd..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The UnknownAuthInfoBase. - internal partial class UnknownAuthInfoBase : AuthBaseInfo - { - /// Initializes a new instance of UnknownAuthInfoBase. - /// The authentication type. - internal UnknownAuthInfoBase(LinkerAuthType authType) : base(authType) - { - AuthType = authType; - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAzureResourcePropertiesBase.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAzureResourcePropertiesBase.Serialization.cs deleted file mode 100644 index 4db1f29a3106..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAzureResourcePropertiesBase.Serialization.cs +++ /dev/null @@ -1,37 +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 -{ - internal partial class UnknownAzureResourcePropertiesBase : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AzureResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownAzureResourcePropertiesBase DeserializeUnknownAzureResourcePropertiesBase(JsonElement element) - { - AzureResourceType type = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = new AzureResourceType(property.Value.GetString()); - continue; - } - } - return new UnknownAzureResourcePropertiesBase(type); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAzureResourcePropertiesBase.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAzureResourcePropertiesBase.cs deleted file mode 100644 index 56bd4a80ffc5..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAzureResourcePropertiesBase.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The UnknownAzureResourcePropertiesBase. - internal partial class UnknownAzureResourcePropertiesBase : AzureResourceBaseProperties - { - /// Initializes a new instance of UnknownAzureResourcePropertiesBase. - /// The azure resource type. - internal UnknownAzureResourcePropertiesBase(AzureResourceType azureResourceType) : base(azureResourceType) - { - AzureResourceType = azureResourceType; - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownSecretInfoBase.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownSecretInfoBase.Serialization.cs deleted file mode 100644 index c1a4a392b232..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownSecretInfoBase.Serialization.cs +++ /dev/null @@ -1,37 +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 -{ - internal partial class UnknownSecretInfoBase : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("secretType"u8); - writer.WriteStringValue(SecretType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownSecretInfoBase DeserializeUnknownSecretInfoBase(JsonElement element) - { - LinkerSecretType secretType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("secretType"u8)) - { - secretType = new LinkerSecretType(property.Value.GetString()); - continue; - } - } - return new UnknownSecretInfoBase(secretType); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownSecretInfoBase.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownSecretInfoBase.cs deleted file mode 100644 index dc49ffa3bd9a..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownSecretInfoBase.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The UnknownSecretInfoBase. - internal partial class UnknownSecretInfoBase : SecretBaseInfo - { - /// Initializes a new instance of UnknownSecretInfoBase. - /// The secret type. - internal UnknownSecretInfoBase(LinkerSecretType secretType) : base(secretType) - { - SecretType = secretType; - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownTargetServiceBase.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownTargetServiceBase.Serialization.cs deleted file mode 100644 index 04f44c641726..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownTargetServiceBase.Serialization.cs +++ /dev/null @@ -1,37 +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 -{ - internal partial class UnknownTargetServiceBase : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TargetServiceType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownTargetServiceBase DeserializeUnknownTargetServiceBase(JsonElement element) - { - TargetServiceType type = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = new TargetServiceType(property.Value.GetString()); - continue; - } - } - return new UnknownTargetServiceBase(type); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownTargetServiceBase.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownTargetServiceBase.cs deleted file mode 100644 index b75a440675b9..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownTargetServiceBase.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The UnknownTargetServiceBase. - internal partial class UnknownTargetServiceBase : TargetServiceBaseInfo - { - /// Initializes a new instance of UnknownTargetServiceBase. - /// The target service type. - internal UnknownTargetServiceBase(TargetServiceType targetServiceType) : base(targetServiceType) - { - TargetServiceType = targetServiceType; - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.Serialization.cs deleted file mode 100644 index 1b19c450beeb..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.Serialization.cs +++ /dev/null @@ -1,59 +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 UserAssignedIdentityAuthInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId); - } - if (Optional.IsDefined(SubscriptionId)) - { - writer.WritePropertyName("subscriptionId"u8); - writer.WriteStringValue(SubscriptionId); - } - writer.WritePropertyName("authType"u8); - writer.WriteStringValue(AuthType.ToString()); - writer.WriteEndObject(); - } - - internal static UserAssignedIdentityAuthInfo DeserializeUserAssignedIdentityAuthInfo(JsonElement element) - { - Optional clientId = default; - Optional subscriptionId = default; - LinkerAuthType authType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("clientId"u8)) - { - clientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("subscriptionId"u8)) - { - subscriptionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("authType"u8)) - { - authType = new LinkerAuthType(property.Value.GetString()); - continue; - } - } - return new UserAssignedIdentityAuthInfo(authType, clientId.Value, subscriptionId.Value); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs deleted file mode 100644 index c5cb3a6aef2c..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The authentication info when authType is userAssignedIdentity. - public partial class UserAssignedIdentityAuthInfo : AuthBaseInfo - { - /// Initializes a new instance of UserAssignedIdentityAuthInfo. - public UserAssignedIdentityAuthInfo() - { - AuthType = LinkerAuthType.UserAssignedIdentity; - } - - /// Initializes a new instance of UserAssignedIdentityAuthInfo. - /// The authentication type. - /// Client Id for userAssignedIdentity. - /// Subscription id for userAssignedIdentity. - internal UserAssignedIdentityAuthInfo(LinkerAuthType authType, string clientId, string subscriptionId) : base(authType) - { - ClientId = clientId; - SubscriptionId = subscriptionId; - AuthType = authType; - } - - /// Client Id for userAssignedIdentity. - public string ClientId { get; set; } - /// Subscription id for userAssignedIdentity. - public string SubscriptionId { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.Serialization.cs deleted file mode 100644 index 38cf841f0368..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.Serialization.cs +++ /dev/null @@ -1,52 +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 -{ - internal partial class VnetSolution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SolutionType)) - { - if (SolutionType != null) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SolutionType.Value.ToString()); - } - else - { - writer.WriteNull("type"); - } - } - writer.WriteEndObject(); - } - - internal static VnetSolution DeserializeVnetSolution(JsonElement element) - { - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - type = null; - continue; - } - type = new VnetSolutionType(property.Value.GetString()); - continue; - } - } - return new VnetSolution(Optional.ToNullable(type)); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs deleted file mode 100644 index 9dcab8722e0a..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ServiceLinker.Models -{ - /// The VNet solution for linker. - internal partial class VnetSolution - { - /// Initializes a new instance of VnetSolution. - public VnetSolution() - { - } - - /// Initializes a new instance of VnetSolution. - /// Type of VNet solution. - internal VnetSolution(VnetSolutionType? solutionType) - { - SolutionType = solutionType; - } - - /// Type of VNet solution. - public VnetSolutionType? SolutionType { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolutionType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolutionType.cs deleted file mode 100644 index 41430f6571d1..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolutionType.cs +++ /dev/null @@ -1,51 +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 -{ - /// Type of VNet solution. - public readonly partial struct VnetSolutionType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public VnetSolutionType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ServiceEndpointValue = "serviceEndpoint"; - private const string PrivateLinkValue = "privateLink"; - - /// serviceEndpoint. - public static VnetSolutionType ServiceEndpoint { get; } = new VnetSolutionType(ServiceEndpointValue); - /// privateLink. - public static VnetSolutionType PrivateLink { get; } = new VnetSolutionType(PrivateLinkValue); - /// Determines if two values are the same. - public static bool operator ==(VnetSolutionType left, VnetSolutionType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(VnetSolutionType left, VnetSolutionType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator VnetSolutionType(string value) => new VnetSolutionType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is VnetSolutionType other && Equals(other); - /// - public bool Equals(VnetSolutionType 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 deleted file mode 100644 index 7c449a18fdf9..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs +++ /dev/null @@ -1,595 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ServiceLinker.Models; - -namespace Azure.ResourceManager.ServiceLinker -{ - internal partial class LinkerRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of LinkerRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public LinkerRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Returns list of Linkers which connects to the resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - LinkerList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LinkerList.DeserializeLinkerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns list of Linkers which connects to the resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The cancellation token to use. - /// is null. - public Response List(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - LinkerList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LinkerList.DeserializeLinkerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceUri, string linkerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - 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.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Returns Linker resource for a given name. - /// 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> GetAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateGetRequest(resourceUri, linkerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - LinkerResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((LinkerResourceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns Linker resource for a given name. - /// 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 Get(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateGetRequest(resourceUri, linkerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - LinkerResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((LinkerResourceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string linkerName, LinkerResourceData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - 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.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create or update linker resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string resourceUri, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(resourceUri, linkerName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update linker resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceUri, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(resourceUri, linkerName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceUri, string linkerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - 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.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete 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 DeleteAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateDeleteRequest(resourceUri, linkerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete 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 Delete(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateDeleteRequest(resourceUri, linkerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string resourceUri, string linkerName, LinkerResourcePatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - 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.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Operation to update an existing link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string resourceUri, string linkerName, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(resourceUri, linkerName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Operation to update an existing link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response Update(string resourceUri, string linkerName, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(resourceUri, linkerName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - 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(); - 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("/listConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// list source configurations for a linker. - /// 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> ListConfigurationsAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateListConfigurationsRequest(resourceUri, linkerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SourceConfigurationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// list source configurations for a linker. - /// 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 ListConfigurations(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateListConfigurationsRequest(resourceUri, linkerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SourceConfigurationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Returns list of Linkers which connects to the resource. - /// The URL to the next page of results. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The cancellation token to use. - /// or is null. - public async Task> ListNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListNextPageRequest(nextLink, resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - LinkerList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LinkerList.DeserializeLinkerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns list of Linkers which connects to the resource. - /// The URL to the next page of results. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The cancellation token to use. - /// or is null. - public Response ListNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListNextPageRequest(nextLink, resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - LinkerList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LinkerList.DeserializeLinkerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md index 8ab4b19dc22b..75d8e386202f 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