diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.net8.0.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.net8.0.cs index b1abb1b31b18..936099024980 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.net8.0.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.net8.0.cs @@ -15,6 +15,8 @@ protected LinkerResource() { } 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 GenerateConfigurations(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GenerateConfigurationsAsync(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, 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; } @@ -51,11 +53,17 @@ public partial class LinkerResourceData : Azure.ResourceManager.Models.ResourceD 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 Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo ConfigurationInfo { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution PublicNetworkSolution { get { throw null; } set { } } public string Scope { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore SecretStore { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolution VnetSolution { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.LinkerResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -63,6 +71,56 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ServiceLinkerDryrunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceLinkerDryrunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dryrunName, 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 dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dryrunName, 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 ServiceLinkerDryrunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceLinkerDryrunData() { } + public System.Collections.Generic.IReadOnlyList OperationPreviews { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent Parameters { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrerequisiteResults { get { throw null; } } + public string ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServiceLinkerDryrunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceLinkerDryrunResource() { } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string dryrunName) { 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; } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch 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.ServiceLinkerDryrunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class ServiceLinkerExtensions { public static Azure.ResourceManager.ServiceLinker.LinkerResource GetLinkerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -72,6 +130,98 @@ public static partial class ServiceLinkerExtensions 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; } + public static Azure.Pageable GetServiceLinkerConfigurationNames(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetServiceLinkerConfigurationNamesAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetServiceLinkerDaprConfigurations(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetServiceLinkerDaprConfigurationsAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetServiceLinkerDryrun(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetServiceLinkerDryrunAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunResource GetServiceLinkerDryrunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunCollection GetServiceLinkerDryruns(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetServiceLinkerLocationConnector(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetServiceLinkerLocationConnectorAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorResource GetServiceLinkerLocationConnectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorCollection GetServiceLinkerLocationConnectors(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location) { throw null; } + public static Azure.Response GetServiceLinkerLocationDryrun(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetServiceLinkerLocationDryrunAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource GetServiceLinkerLocationDryrunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunCollection GetServiceLinkerLocationDryruns(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location) { throw null; } + } + public partial class ServiceLinkerLocationConnectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceLinkerLocationConnectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectorName, 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 connectorName, Azure.ResourceManager.ServiceLinker.LinkerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectorName, 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 connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectorName, 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 ServiceLinkerLocationConnectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceLinkerLocationConnectorResource() { } + public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, Azure.Core.AzureLocation location, string connectorName) { 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 GenerateConfigurations(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GenerateConfigurationsAsync(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, 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; } + Azure.ResourceManager.ServiceLinker.LinkerResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.LinkerResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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 ServiceLinkerLocationDryrunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceLinkerLocationDryrunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dryrunName, 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 dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dryrunName, 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 ServiceLinkerLocationDryrunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceLinkerLocationDryrunResource() { } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, Azure.Core.AzureLocation location, string dryrunName) { 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; } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch 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.ServiceLinkerDryrunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.ServiceLinker.Mocking @@ -83,6 +233,14 @@ protected MockableServiceLinkerArmClient() { } public virtual Azure.Response GetLinkerResource(Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetLinkerResourceAsync(Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Pageable GetServiceLinkerDaprConfigurations(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetServiceLinkerDaprConfigurationsAsync(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetServiceLinkerDryrun(Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceLinkerDryrunAsync(Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunResource GetServiceLinkerDryrunResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunCollection GetServiceLinkerDryruns(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorResource GetServiceLinkerLocationConnectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource GetServiceLinkerLocationDryrunResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableServiceLinkerArmResource : Azure.ResourceManager.ArmResource { @@ -91,21 +249,65 @@ protected MockableServiceLinkerArmResource() { } public virtual System.Threading.Tasks.Task> GetLinkerResourceAsync(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources() { throw null; } } + public partial class MockableServiceLinkerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableServiceLinkerResourceGroupResource() { } + public virtual Azure.Response GetServiceLinkerLocationConnector(Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceLinkerLocationConnectorAsync(Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorCollection GetServiceLinkerLocationConnectors(Azure.Core.AzureLocation location) { throw null; } + public virtual Azure.Response GetServiceLinkerLocationDryrun(Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceLinkerLocationDryrunAsync(Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunCollection GetServiceLinkerLocationDryruns(Azure.Core.AzureLocation location) { throw null; } + } + public partial class MockableServiceLinkerTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableServiceLinkerTenantResource() { } + public virtual Azure.Pageable GetServiceLinkerConfigurationNames(string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetServiceLinkerConfigurationNamesAsync(string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.ServiceLinker.Models { + public partial class AccessKeyInfoBase : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccessKeyInfoBase() { } + public System.Collections.Generic.IList Permissions { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AccessKeyInfoBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AccessKeyInfoBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmServiceLinkerModelFactory { - public static Azure.ResourceManager.ServiceLinker.LinkerResourceData LinkerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType = default(Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType?), Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch LinkerResourcePatch(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType = default(Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType?), Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult BasicErrorDryrunPrerequisiteResult(string code = null, string message = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem DaprConfigurationResourceItem(string targetType = null, Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? authType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType?), Azure.ResourceManager.ServiceLinker.Models.DaprProperties daprProperties = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties(string version = null, string componentType = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null, string runtimeVersion = null, Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection? bindingComponentDirection = default(Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection?)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview DryrunOperationPreview(string name = null, Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType? operationType = default(Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType?), string description = null, string action = null, string scope = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationName LinkerConfigurationName(string value = null, string description = null, bool? isRequired = default(bool?)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationNameItem LinkerConfigurationNameItem(string targetService = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? authType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType?), Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType? secretType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType?), Azure.ResourceManager.ServiceLinker.Models.DaprProperties daprProperties = null, System.Collections.Generic.IEnumerable names = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.LinkerResourceData LinkerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolution vnetSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore secretStore = null, string scope = null, Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution publicNetworkSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo configurationInfo = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceLinker.LinkerResourceData LinkerResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType, string provisioningState, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType, Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch LinkerResourcePatch(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolution vnetSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore secretStore = null, string scope = null, Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution publicNetworkSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo configurationInfo = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch LinkerResourcePatch(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType, string provisioningState, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType, Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } public static Azure.ResourceManager.ServiceLinker.Models.LinkerValidateOperationResult LinkerValidateOperationResult(Azure.Core.ResourceIdentifier resourceId = null, string status = null, string linkerName = null, bool? isConnectionAvailable = default(bool?), System.DateTimeOffset? reportStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? reportEndOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceId = null, Azure.Core.ResourceIdentifier targetId = null, Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? authType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType?), System.Collections.Generic.IEnumerable validationDetail = null) { throw null; } public static Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultItemInfo LinkerValidationResultItemInfo(string name = null, string description = null, Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus? result = default(Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus?), string errorMessage = null, string errorCode = null) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.SourceConfiguration SourceConfiguration(string name = null, string value = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult PermissionsMissingDryrunPrerequisiteResult(string scope = null, System.Collections.Generic.IEnumerable permissions = null, string recommendedRole = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunContent ServiceLinkerCreateOrUpdateDryrunContent(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolution vnetSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore secretStore = null, string scope = null, Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution publicNetworkSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo configurationInfo = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData ServiceLinkerDryrunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent parameters = null, System.Collections.Generic.IEnumerable prerequisiteResults = null, System.Collections.Generic.IEnumerable operationPreviews = null, string provisioningState = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch ServiceLinkerDryrunPatch(Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent parameters = null, System.Collections.Generic.IEnumerable prerequisiteResults = null, System.Collections.Generic.IEnumerable operationPreviews = null, string provisioningState = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceLinker.Models.SourceConfiguration SourceConfiguration(string name, string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.SourceConfiguration SourceConfiguration(string name = null, string value = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType? configType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType?), string keyVaultReferenceIdentity = null, string description = null) { throw null; } public static Azure.ResourceManager.ServiceLinker.Models.SourceConfigurationResult SourceConfigurationResult(System.Collections.Generic.IEnumerable configurations = null) { throw null; } } public abstract partial class AuthBaseInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected AuthBaseInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode? AuthMode { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -113,6 +315,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureAppConfigProperties : Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureAppConfigProperties() { } + public bool? ConnectWithKubernetesExtension { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AzureAppConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AzureAppConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AzureKeyVaultProperties : Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AzureKeyVaultProperties() { } @@ -146,6 +359,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BasicErrorDryrunPrerequisiteResult : Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BasicErrorDryrunPrerequisiteResult() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConfluentBootstrapServerInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConfluentBootstrapServerInfo() { } @@ -168,6 +393,144 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DaprBindingComponentDirection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DaprBindingComponentDirection(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection Input { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection Output { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection 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.DaprBindingComponentDirection left, Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection left, Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DaprConfigurationResourceItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DaprConfigurationResourceItem() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? AuthType { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties { get { throw null; } } + public string TargetType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprMetadata() { } + public string Description { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired? Required { get { throw null; } set { } } + public string SecretRef { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DaprMetadataRequired : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DaprMetadataRequired(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired False { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired True { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired 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.DaprMetadataRequired left, Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired left, Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DaprProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprProperties() { } + public Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection? BindingComponentDirection { get { throw null; } } + public string ComponentType { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public string RuntimeVersion { get { throw null; } } + public System.Collections.Generic.IList Scopes { get { throw null; } } + public string SecretStoreComponent { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DryrunOperationPreview : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DryrunOperationPreview() { } + public string Action { get { throw null; } } + public string Description { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType? OperationType { get { throw null; } } + public string Scope { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DryrunPrerequisiteResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DryrunPrerequisiteResult() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DryrunPreviewOperationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DryrunPreviewOperationType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType ConfigAuth { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType ConfigConnection { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType ConfigNetwork { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType 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.DryrunPreviewOperationType left, Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType left, Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EasyAuthMicrosoftEntraIdAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EasyAuthMicrosoftEntraIdAuthInfo() { } + public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public string Secret { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.EasyAuthMicrosoftEntraIdAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.EasyAuthMicrosoftEntraIdAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class KeyVaultSecretReferenceSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public KeyVaultSecretReferenceSecretInfo() { } @@ -197,10 +560,13 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write private readonly object _dummy; private readonly int _dummyPrimitive; public LinkerAuthType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType AccessKey { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType EasyAuthMicrosoftEntraId { get { 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 UserAccount { 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)] @@ -218,10 +584,13 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write private readonly object _dummy; private readonly int _dummyPrimitive; public LinkerClientType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Dapr { get { 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 JmsSpringBoot { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType KafkaSpringBoot { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Nodejs { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType None { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Php { get { throw null; } } @@ -238,16 +607,148 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write 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 LinkerConfigurationInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerConfigurationInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType? Action { get { throw null; } set { } } + public System.Collections.Generic.IDictionary AdditionalConfigurations { get { throw null; } } + public System.Collections.Generic.IDictionary AdditionalConnectionStringProperties { get { throw null; } } + public string AppConfigurationId { get { throw null; } set { } } + public System.Collections.Generic.IDictionary CustomizedKeys { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkerConfigurationName : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LinkerConfigurationName() { } + public string Description { get { throw null; } } + public bool? IsRequired { get { throw null; } } + public string Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationName System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationName System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkerConfigurationNameItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LinkerConfigurationNameItem() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? AuthType { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Names { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType? SecretType { get { throw null; } } + public string TargetService { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationNameItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationNameItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerConfigurationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerConfigurationType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType Default { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType KeyVaultSecret { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType 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.LinkerConfigurationType left, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType left, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerDeleteOrUpdateBehavior : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerDeleteOrUpdateBehavior(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior Default { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior ForcedCleanup { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior 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.LinkerDeleteOrUpdateBehavior left, Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior left, Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LinkerFirewallRules : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerFirewallRules() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType? AzureServices { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType? CallerClientIP { get { throw null; } set { } } + public System.Collections.Generic.IList IPRanges { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerFirewallRules System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerFirewallRules System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerKeyVaultSecretSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerKeyVaultSecretSourceType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType KeyVaultSecret { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType RawValue { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType 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.LinkerKeyVaultSecretSourceType left, Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType left, Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LinkerPublicNetworkSolution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerPublicNetworkSolution() { } + public Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType? Action { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerFirewallRules FirewallRules { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class LinkerResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { 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 Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo ConfigurationInfo { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution PublicNetworkSolution { get { throw null; } set { } } public string Scope { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore SecretStore { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolution VnetSolution { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -255,6 +756,61 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class LinkerSecretStore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerSecretStore() { } + public Azure.Core.ResourceIdentifier KeyVaultId { get { throw null; } set { } } + public string KeyVaultSecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkerTargetFabricPlatform : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerTargetFabricPlatform() { } + public string Endpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerTargetFabricPlatform System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerTargetFabricPlatform System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerTargetServiceFirewallRulesAllowType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerTargetServiceFirewallRulesAllowType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType False { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType True { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType 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.LinkerTargetServiceFirewallRulesAllowType left, Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType left, Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LinkerUserAccountAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerUserAccountAuthInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public string UserName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerUserAccountAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerUserAccountAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class LinkerValidateOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal LinkerValidateOperationResult() { } @@ -309,6 +865,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 PermissionsMissingDryrunPrerequisiteResult : Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PermissionsMissingDryrunPrerequisiteResult() { } + public System.Collections.Generic.IReadOnlyList Permissions { get { throw null; } } + public string RecommendedRole { get { throw null; } } + public string Scope { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class RawValueSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RawValueSecretInfo() { } @@ -342,12 +911,86 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SelfHostedServer : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SelfHostedServer() { } + public string Endpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.SelfHostedServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.SelfHostedServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ServiceLinkerAuthMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ServiceLinkerAuthMode(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode OptInAllAuth { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode OptOutAllAuth { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode 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.ServiceLinkerAuthMode left, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode left, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ServiceLinkerCreateOrUpdateDryrunContent : Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceLinkerCreateOrUpdateDryrunContent() { } + public Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo AuthInfo { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo ConfigurationInfo { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution PublicNetworkSolution { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore SecretStore { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolution VnetSolution { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ServiceLinkerDryrunContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ServiceLinkerDryrunContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServiceLinkerDryrunPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceLinkerDryrunPatch() { } + public System.Collections.Generic.IReadOnlyList OperationPreviews { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent Parameters { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrerequisiteResults { get { throw null; } } + public string ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ServicePrincipalCertificateAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ServicePrincipalCertificateAuthInfo(string clientId, System.Guid principalId, string certificate) { } public string Certificate { get { throw null; } set { } } public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } public System.Guid PrincipalId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalCertificateAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -359,8 +1002,11 @@ public partial class ServicePrincipalSecretAuthInfo : Azure.ResourceManager.Serv { public ServicePrincipalSecretAuthInfo(string clientId, System.Guid principalId, string secret) { } public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } public System.Guid PrincipalId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } public string Secret { get { throw null; } set { } } + public string UserName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalSecretAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -368,9 +1014,31 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SourceApplicationConfigurationActionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SourceApplicationConfigurationActionType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType Enable { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType Internal { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType OptOut { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType 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.SourceApplicationConfigurationActionType left, Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType left, Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SourceConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SourceConfiguration() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType? ConfigType { get { throw null; } } + public string Description { get { throw null; } } + public string KeyVaultReferenceIdentity { get { throw null; } } public string Name { get { throw null; } } public string Value { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -394,6 +1062,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class SystemAssignedIdentityAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SystemAssignedIdentityAuthInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public string UserName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.SystemAssignedIdentityAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -401,6 +1072,27 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TargetServiceAccessKeyPermission : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TargetServiceAccessKeyPermission(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Listen { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Manage { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Read { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Send { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Write { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission 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.TargetServiceAccessKeyPermission left, Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission left, Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission right) { throw null; } + public override string ToString() { throw null; } + } public abstract partial class TargetServiceBaseInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected TargetServiceBaseInfo() { } @@ -415,7 +1107,10 @@ public partial class UserAssignedIdentityAuthInfo : Azure.ResourceManager.Servic { public UserAssignedIdentityAuthInfo() { } public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } public string SubscriptionId { get { throw null; } set { } } + public string UserName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -423,6 +1118,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VnetSolution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VnetSolution() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.VnetSolution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.VnetSolution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VnetSolutionType : System.IEquatable { 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 b1abb1b31b18..936099024980 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs @@ -15,6 +15,8 @@ protected LinkerResource() { } 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 GenerateConfigurations(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GenerateConfigurationsAsync(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, 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; } @@ -51,11 +53,17 @@ public partial class LinkerResourceData : Azure.ResourceManager.Models.ResourceD 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 Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo ConfigurationInfo { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution PublicNetworkSolution { get { throw null; } set { } } public string Scope { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore SecretStore { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolution VnetSolution { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.LinkerResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -63,6 +71,56 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ServiceLinkerDryrunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceLinkerDryrunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dryrunName, 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 dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dryrunName, 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 ServiceLinkerDryrunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceLinkerDryrunData() { } + public System.Collections.Generic.IReadOnlyList OperationPreviews { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent Parameters { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrerequisiteResults { get { throw null; } } + public string ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServiceLinkerDryrunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceLinkerDryrunResource() { } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string dryrunName) { 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; } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch 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.ServiceLinkerDryrunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class ServiceLinkerExtensions { public static Azure.ResourceManager.ServiceLinker.LinkerResource GetLinkerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -72,6 +130,98 @@ public static partial class ServiceLinkerExtensions 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; } + public static Azure.Pageable GetServiceLinkerConfigurationNames(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetServiceLinkerConfigurationNamesAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetServiceLinkerDaprConfigurations(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetServiceLinkerDaprConfigurationsAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetServiceLinkerDryrun(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetServiceLinkerDryrunAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunResource GetServiceLinkerDryrunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunCollection GetServiceLinkerDryruns(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetServiceLinkerLocationConnector(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetServiceLinkerLocationConnectorAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorResource GetServiceLinkerLocationConnectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorCollection GetServiceLinkerLocationConnectors(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location) { throw null; } + public static Azure.Response GetServiceLinkerLocationDryrun(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetServiceLinkerLocationDryrunAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource GetServiceLinkerLocationDryrunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunCollection GetServiceLinkerLocationDryruns(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location) { throw null; } + } + public partial class ServiceLinkerLocationConnectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceLinkerLocationConnectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectorName, 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 connectorName, Azure.ResourceManager.ServiceLinker.LinkerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectorName, 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 connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectorName, 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 ServiceLinkerLocationConnectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceLinkerLocationConnectorResource() { } + public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, Azure.Core.AzureLocation location, string connectorName) { 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 GenerateConfigurations(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GenerateConfigurationsAsync(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo info = null, 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; } + Azure.ResourceManager.ServiceLinker.LinkerResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.LinkerResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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 ServiceLinkerLocationDryrunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceLinkerLocationDryrunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dryrunName, Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dryrunName, 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 dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dryrunName, 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 ServiceLinkerLocationDryrunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceLinkerLocationDryrunResource() { } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, Azure.Core.AzureLocation location, string dryrunName) { 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; } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch 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.ServiceLinkerDryrunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.ServiceLinker.Mocking @@ -83,6 +233,14 @@ protected MockableServiceLinkerArmClient() { } public virtual Azure.Response GetLinkerResource(Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetLinkerResourceAsync(Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Pageable GetServiceLinkerDaprConfigurations(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetServiceLinkerDaprConfigurationsAsync(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetServiceLinkerDryrun(Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceLinkerDryrunAsync(Azure.Core.ResourceIdentifier scope, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunResource GetServiceLinkerDryrunResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunCollection GetServiceLinkerDryruns(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorResource GetServiceLinkerLocationConnectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource GetServiceLinkerLocationDryrunResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableServiceLinkerArmResource : Azure.ResourceManager.ArmResource { @@ -91,21 +249,65 @@ protected MockableServiceLinkerArmResource() { } public virtual System.Threading.Tasks.Task> GetLinkerResourceAsync(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources() { throw null; } } + public partial class MockableServiceLinkerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableServiceLinkerResourceGroupResource() { } + public virtual Azure.Response GetServiceLinkerLocationConnector(Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceLinkerLocationConnectorAsync(Azure.Core.AzureLocation location, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationConnectorCollection GetServiceLinkerLocationConnectors(Azure.Core.AzureLocation location) { throw null; } + public virtual Azure.Response GetServiceLinkerLocationDryrun(Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceLinkerLocationDryrunAsync(Azure.Core.AzureLocation location, string dryrunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunCollection GetServiceLinkerLocationDryruns(Azure.Core.AzureLocation location) { throw null; } + } + public partial class MockableServiceLinkerTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableServiceLinkerTenantResource() { } + public virtual Azure.Pageable GetServiceLinkerConfigurationNames(string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetServiceLinkerConfigurationNamesAsync(string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.ServiceLinker.Models { + public partial class AccessKeyInfoBase : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccessKeyInfoBase() { } + public System.Collections.Generic.IList Permissions { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AccessKeyInfoBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AccessKeyInfoBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmServiceLinkerModelFactory { - public static Azure.ResourceManager.ServiceLinker.LinkerResourceData LinkerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType = default(Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType?), Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch LinkerResourcePatch(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType = default(Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType?), Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult BasicErrorDryrunPrerequisiteResult(string code = null, string message = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem DaprConfigurationResourceItem(string targetType = null, Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? authType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType?), Azure.ResourceManager.ServiceLinker.Models.DaprProperties daprProperties = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties(string version = null, string componentType = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null, string runtimeVersion = null, Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection? bindingComponentDirection = default(Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection?)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview DryrunOperationPreview(string name = null, Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType? operationType = default(Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType?), string description = null, string action = null, string scope = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationName LinkerConfigurationName(string value = null, string description = null, bool? isRequired = default(bool?)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationNameItem LinkerConfigurationNameItem(string targetService = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? authType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType?), Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType? secretType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType?), Azure.ResourceManager.ServiceLinker.Models.DaprProperties daprProperties = null, System.Collections.Generic.IEnumerable names = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.LinkerResourceData LinkerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolution vnetSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore secretStore = null, string scope = null, Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution publicNetworkSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo configurationInfo = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceLinker.LinkerResourceData LinkerResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType, string provisioningState, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType, Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch LinkerResourcePatch(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolution vnetSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore secretStore = null, string scope = null, Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution publicNetworkSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo configurationInfo = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch LinkerResourcePatch(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType, string provisioningState, Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? solutionType, Azure.Core.ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) { throw null; } public static Azure.ResourceManager.ServiceLinker.Models.LinkerValidateOperationResult LinkerValidateOperationResult(Azure.Core.ResourceIdentifier resourceId = null, string status = null, string linkerName = null, bool? isConnectionAvailable = default(bool?), System.DateTimeOffset? reportStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? reportEndOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceId = null, Azure.Core.ResourceIdentifier targetId = null, Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? authType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType?), System.Collections.Generic.IEnumerable validationDetail = null) { throw null; } public static Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultItemInfo LinkerValidationResultItemInfo(string name = null, string description = null, Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus? result = default(Azure.ResourceManager.ServiceLinker.Models.LinkerValidationResultStatus?), string errorMessage = null, string errorCode = null) { throw null; } - public static Azure.ResourceManager.ServiceLinker.Models.SourceConfiguration SourceConfiguration(string name = null, string value = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult PermissionsMissingDryrunPrerequisiteResult(string scope = null, System.Collections.Generic.IEnumerable permissions = null, string recommendedRole = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunContent ServiceLinkerCreateOrUpdateDryrunContent(Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo targetService = null, Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo authInfo = null, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? clientType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType?), string provisioningState = null, Azure.ResourceManager.ServiceLinker.Models.VnetSolution vnetSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore secretStore = null, string scope = null, Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution publicNetworkSolution = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo configurationInfo = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.ServiceLinkerDryrunData ServiceLinkerDryrunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent parameters = null, System.Collections.Generic.IEnumerable prerequisiteResults = null, System.Collections.Generic.IEnumerable operationPreviews = null, string provisioningState = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch ServiceLinkerDryrunPatch(Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent parameters = null, System.Collections.Generic.IEnumerable prerequisiteResults = null, System.Collections.Generic.IEnumerable operationPreviews = null, string provisioningState = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceLinker.Models.SourceConfiguration SourceConfiguration(string name, string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.SourceConfiguration SourceConfiguration(string name = null, string value = null, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType? configType = default(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType?), string keyVaultReferenceIdentity = null, string description = null) { throw null; } public static Azure.ResourceManager.ServiceLinker.Models.SourceConfigurationResult SourceConfigurationResult(System.Collections.Generic.IEnumerable configurations = null) { throw null; } } public abstract partial class AuthBaseInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected AuthBaseInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode? AuthMode { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -113,6 +315,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureAppConfigProperties : Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureAppConfigProperties() { } + public bool? ConnectWithKubernetesExtension { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AzureAppConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.AzureAppConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AzureKeyVaultProperties : Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AzureKeyVaultProperties() { } @@ -146,6 +359,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BasicErrorDryrunPrerequisiteResult : Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BasicErrorDryrunPrerequisiteResult() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConfluentBootstrapServerInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConfluentBootstrapServerInfo() { } @@ -168,6 +393,144 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DaprBindingComponentDirection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DaprBindingComponentDirection(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection Input { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection Output { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection 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.DaprBindingComponentDirection left, Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection left, Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DaprConfigurationResourceItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DaprConfigurationResourceItem() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? AuthType { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties { get { throw null; } } + public string TargetType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprMetadata() { } + public string Description { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired? Required { get { throw null; } set { } } + public string SecretRef { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DaprMetadataRequired : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DaprMetadataRequired(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired False { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired True { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired 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.DaprMetadataRequired left, Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired left, Azure.ResourceManager.ServiceLinker.Models.DaprMetadataRequired right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DaprProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprProperties() { } + public Azure.ResourceManager.ServiceLinker.Models.DaprBindingComponentDirection? BindingComponentDirection { get { throw null; } } + public string ComponentType { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public string RuntimeVersion { get { throw null; } } + public System.Collections.Generic.IList Scopes { get { throw null; } } + public string SecretStoreComponent { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DaprProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DryrunOperationPreview : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DryrunOperationPreview() { } + public string Action { get { throw null; } } + public string Description { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType? OperationType { get { throw null; } } + public string Scope { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DryrunPrerequisiteResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DryrunPrerequisiteResult() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DryrunPreviewOperationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DryrunPreviewOperationType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType ConfigAuth { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType ConfigConnection { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType ConfigNetwork { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType 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.DryrunPreviewOperationType left, Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType left, Azure.ResourceManager.ServiceLinker.Models.DryrunPreviewOperationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EasyAuthMicrosoftEntraIdAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EasyAuthMicrosoftEntraIdAuthInfo() { } + public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public string Secret { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.EasyAuthMicrosoftEntraIdAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.EasyAuthMicrosoftEntraIdAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class KeyVaultSecretReferenceSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public KeyVaultSecretReferenceSecretInfo() { } @@ -197,10 +560,13 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write private readonly object _dummy; private readonly int _dummyPrimitive; public LinkerAuthType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType AccessKey { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType EasyAuthMicrosoftEntraId { get { 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 UserAccount { 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)] @@ -218,10 +584,13 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write private readonly object _dummy; private readonly int _dummyPrimitive; public LinkerClientType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Dapr { get { 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 JmsSpringBoot { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType KafkaSpringBoot { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Nodejs { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType None { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Php { get { throw null; } } @@ -238,16 +607,148 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write 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 LinkerConfigurationInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerConfigurationInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType? Action { get { throw null; } set { } } + public System.Collections.Generic.IDictionary AdditionalConfigurations { get { throw null; } } + public System.Collections.Generic.IDictionary AdditionalConnectionStringProperties { get { throw null; } } + public string AppConfigurationId { get { throw null; } set { } } + public System.Collections.Generic.IDictionary CustomizedKeys { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkerConfigurationName : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LinkerConfigurationName() { } + public string Description { get { throw null; } } + public bool? IsRequired { get { throw null; } } + public string Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationName System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationName System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkerConfigurationNameItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LinkerConfigurationNameItem() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerAuthType? AuthType { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.DaprProperties DaprProperties { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Names { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType? SecretType { get { throw null; } } + public string TargetService { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationNameItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationNameItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerConfigurationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerConfigurationType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType Default { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType KeyVaultSecret { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType 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.LinkerConfigurationType left, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType left, Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerDeleteOrUpdateBehavior : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerDeleteOrUpdateBehavior(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior Default { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior ForcedCleanup { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior 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.LinkerDeleteOrUpdateBehavior left, Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior left, Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LinkerFirewallRules : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerFirewallRules() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType? AzureServices { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType? CallerClientIP { get { throw null; } set { } } + public System.Collections.Generic.IList IPRanges { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerFirewallRules System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerFirewallRules System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerKeyVaultSecretSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerKeyVaultSecretSourceType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType KeyVaultSecret { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType RawValue { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType 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.LinkerKeyVaultSecretSourceType left, Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType left, Azure.ResourceManager.ServiceLinker.Models.LinkerKeyVaultSecretSourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LinkerPublicNetworkSolution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerPublicNetworkSolution() { } + public Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType? Action { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerFirewallRules FirewallRules { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class LinkerResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { 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 Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo ConfigurationInfo { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution PublicNetworkSolution { get { throw null; } set { } } public string Scope { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore SecretStore { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolution VnetSolution { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -255,6 +756,61 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class LinkerSecretStore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerSecretStore() { } + public Azure.Core.ResourceIdentifier KeyVaultId { get { throw null; } set { } } + public string KeyVaultSecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkerTargetFabricPlatform : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerTargetFabricPlatform() { } + public string Endpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerTargetFabricPlatform System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerTargetFabricPlatform System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LinkerTargetServiceFirewallRulesAllowType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkerTargetServiceFirewallRulesAllowType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType False { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType True { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType 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.LinkerTargetServiceFirewallRulesAllowType left, Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType left, Azure.ResourceManager.ServiceLinker.Models.LinkerTargetServiceFirewallRulesAllowType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LinkerUserAccountAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkerUserAccountAuthInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public string UserName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerUserAccountAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.LinkerUserAccountAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class LinkerValidateOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal LinkerValidateOperationResult() { } @@ -309,6 +865,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 PermissionsMissingDryrunPrerequisiteResult : Azure.ResourceManager.ServiceLinker.Models.DryrunPrerequisiteResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PermissionsMissingDryrunPrerequisiteResult() { } + public System.Collections.Generic.IReadOnlyList Permissions { get { throw null; } } + public string RecommendedRole { get { throw null; } } + public string Scope { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class RawValueSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RawValueSecretInfo() { } @@ -342,12 +911,86 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SelfHostedServer : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SelfHostedServer() { } + public string Endpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.SelfHostedServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.SelfHostedServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ServiceLinkerAuthMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ServiceLinkerAuthMode(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode OptInAllAuth { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode OptOutAllAuth { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode 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.ServiceLinkerAuthMode left, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode left, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerAuthMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ServiceLinkerCreateOrUpdateDryrunContent : Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceLinkerCreateOrUpdateDryrunContent() { } + public Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo AuthInfo { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationInfo ConfigurationInfo { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerPublicNetworkSolution PublicNetworkSolution { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerSecretStore SecretStore { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolution VnetSolution { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ServiceLinkerDryrunContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ServiceLinkerDryrunContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServiceLinkerDryrunPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceLinkerDryrunPatch() { } + public System.Collections.Generic.IReadOnlyList OperationPreviews { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunContent Parameters { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrerequisiteResults { get { throw null; } } + public string ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ServicePrincipalCertificateAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ServicePrincipalCertificateAuthInfo(string clientId, System.Guid principalId, string certificate) { } public string Certificate { get { throw null; } set { } } public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } public System.Guid PrincipalId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalCertificateAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -359,8 +1002,11 @@ public partial class ServicePrincipalSecretAuthInfo : Azure.ResourceManager.Serv { public ServicePrincipalSecretAuthInfo(string clientId, System.Guid principalId, string secret) { } public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } public System.Guid PrincipalId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } public string Secret { get { throw null; } set { } } + public string UserName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalSecretAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -368,9 +1014,31 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SourceApplicationConfigurationActionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SourceApplicationConfigurationActionType(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType Enable { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType Internal { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType OptOut { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType 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.SourceApplicationConfigurationActionType left, Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType left, Azure.ResourceManager.ServiceLinker.Models.SourceApplicationConfigurationActionType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SourceConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SourceConfiguration() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerConfigurationType? ConfigType { get { throw null; } } + public string Description { get { throw null; } } + public string KeyVaultReferenceIdentity { get { throw null; } } public string Name { get { throw null; } } public string Value { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -394,6 +1062,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class SystemAssignedIdentityAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SystemAssignedIdentityAuthInfo() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public string UserName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.SystemAssignedIdentityAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -401,6 +1072,27 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TargetServiceAccessKeyPermission : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TargetServiceAccessKeyPermission(string value) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Listen { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Manage { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Read { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Send { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission Write { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission 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.TargetServiceAccessKeyPermission left, Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission left, Azure.ResourceManager.ServiceLinker.Models.TargetServiceAccessKeyPermission right) { throw null; } + public override string ToString() { throw null; } + } public abstract partial class TargetServiceBaseInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected TargetServiceBaseInfo() { } @@ -415,7 +1107,10 @@ public partial class UserAssignedIdentityAuthInfo : Azure.ResourceManager.Servic { public UserAssignedIdentityAuthInfo() { } public string ClientId { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } public string SubscriptionId { get { throw null; } set { } } + public string UserName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -423,6 +1118,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VnetSolution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VnetSolution() { } + public Azure.ResourceManager.ServiceLinker.Models.LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get { throw null; } set { } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.VnetSolution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceLinker.Models.VnetSolution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VnetSolutionType : System.IEquatable { diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs new file mode 100644 index 000000000000..96f18ffeb1fd --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public static partial class ArmServiceLinkerModelFactory + { + // Add this method back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. + /// Initializes a new instance of . + /// + /// 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. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static LinkerResourcePatch LinkerResourcePatch(TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolutionType? solutionType, ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) + { + return LinkerResourcePatch( + targetService, + authInfo, + clientType, + provisioningState, + solutionType != null ? new VnetSolution() { SolutionType = solutionType } : null, + secretStoreKeyVaultId != null ? new LinkerSecretStore() { KeyVaultId = secretStoreKeyVaultId } : null, + scope); + } + + // Add this method back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. + /// Initializes a new instance of . + /// 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. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static LinkerResourceData LinkerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolutionType? solutionType, ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) + { + return LinkerResourceData( + id, + name, + resourceType, + systemData, + targetService, + authInfo, + clientType, + provisioningState, + solutionType != null ? new VnetSolution() { SolutionType = solutionType } : null, + secretStoreKeyVaultId != null ? new LinkerSecretStore() { KeyVaultId = secretStoreKeyVaultId } : null, + scope); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/LinkerResourceData.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/LinkerResourceData.cs new file mode 100644 index 000000000000..eba67c48cacc --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/LinkerResourceData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; +using Azure.Core; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + // Add the properties back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. + public partial class LinkerResourceData + { + /// Type of VNet solution. + [EditorBrowsable(EditorBrowsableState.Never)] + public VnetSolutionType? SolutionType + { + get => VnetSolution is null ? default : VnetSolution.SolutionType; + set + { + if (VnetSolution is null) + VnetSolution = new VnetSolution(); + VnetSolution.SolutionType = value; + } + } + + /// The key vault id to store secret. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceIdentifier SecretStoreKeyVaultId + { + get => SecretStore is null ? default : SecretStore.KeyVaultId; + set + { + if (SecretStore is null) + SecretStore = new LinkerSecretStore(); + SecretStore.KeyVaultId = value; + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/Models/LinkerResourcePatch.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/Models/LinkerResourcePatch.cs new file mode 100644 index 000000000000..04b0ecdb8fe5 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/Models/LinkerResourcePatch.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + // Add the properties back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. + public partial class LinkerResourcePatch + { + /// Type of VNet solution. + [EditorBrowsable(EditorBrowsableState.Never)] + public VnetSolutionType? SolutionType + { + get => VnetSolution is null ? default : VnetSolution.SolutionType; + set + { + if (VnetSolution is null) + VnetSolution = new VnetSolution(); + VnetSolution.SolutionType = value; + } + } + + /// The key vault id to store secret. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceIdentifier SecretStoreKeyVaultId + { + get => SecretStore is null ? default : SecretStore.KeyVaultId; + set + { + if (SecretStore is null) + SecretStore = new LinkerSecretStore(); + SecretStore.KeyVaultId = value; + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs index 7dde325c0c3a..7e8190f3bb3f 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -16,6 +17,116 @@ namespace Azure.ResourceManager.ServiceLinker.Models /// Model factory for models. public static partial class ArmServiceLinkerModelFactory { + /// Initializes a new instance of . + /// Supported target resource type, extract from resource id, uppercase. + /// The authentication type. + /// Indicates some additional properties for dapr client type. + /// A new instance for mocking. + public static DaprConfigurationResourceItem DaprConfigurationResourceItem(string targetType = null, LinkerAuthType? authType = null, DaprProperties daprProperties = null) + { + return new DaprConfigurationResourceItem(targetType, authType, daprProperties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The dapr component version. + /// The dapr component type. + /// The name of a secret store dapr to retrieve secret. + /// Additional dapr metadata. + /// The dapr component scopes. + /// The runtime version supported by the properties. + /// The direction supported by the dapr binding component. + /// A new instance for mocking. + public static DaprProperties DaprProperties(string version = null, string componentType = null, string secretStoreComponent = null, IEnumerable metadata = null, IEnumerable scopes = null, string runtimeVersion = null, DaprBindingComponentDirection? bindingComponentDirection = null) + { + metadata ??= new List(); + scopes ??= new List(); + + return new DaprProperties( + version, + componentType, + secretStoreComponent, + metadata?.ToList(), + scopes?.ToList(), + runtimeVersion, + bindingComponentDirection, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// The parameters of the dryrun + /// 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 . + /// + /// + /// the result of the dryrun + /// 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 preview of the operations for creation. + /// The provisioning state. + /// A new instance for mocking. + public static ServiceLinkerDryrunData ServiceLinkerDryrunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ServiceLinkerDryrunContent parameters = null, IEnumerable prerequisiteResults = null, IEnumerable operationPreviews = null, string provisioningState = null) + { + prerequisiteResults ??= new List(); + operationPreviews ??= new List(); + + return new ServiceLinkerDryrunData( + id, + name, + resourceType, + systemData, + parameters, + prerequisiteResults?.ToList(), + operationPreviews?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The operation name. + /// The operation type. + /// The description of the operation. + /// The action defined by RBAC, refer https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format. + /// The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview. + /// A new instance for mocking. + public static DryrunOperationPreview DryrunOperationPreview(string name = null, DryrunPreviewOperationType? operationType = null, string description = null, string action = null, string scope = null) + { + return new DryrunOperationPreview( + name, + operationType, + description, + action, + scope, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The parameters of the dryrun + /// 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 . + /// + /// + /// the result of the dryrun + /// 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 preview of the operations for creation. + /// The provisioning state. + /// A new instance for mocking. + public static ServiceLinkerDryrunPatch ServiceLinkerDryrunPatch(ServiceLinkerDryrunContent parameters = null, IEnumerable prerequisiteResults = null, IEnumerable operationPreviews = null, string provisioningState = null) + { + prerequisiteResults ??= new List(); + operationPreviews ??= new List(); + + return new ServiceLinkerDryrunPatch(parameters, prerequisiteResults?.ToList(), operationPreviews?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -24,20 +135,22 @@ public static partial class ArmServiceLinkerModelFactory /// /// 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 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 available derived classes include , , , , , , and . /// /// The application client type. /// The provisioning state. - /// The VNet solution. - /// An option to store secret value in secure place. + /// The VNet solution. + /// An option to store secret value in secure place. /// connection scope in source service. + /// The network solution. + /// The connection information consumed by applications, including secrets, connection strings. /// A new instance for mocking. - public static LinkerResourceData LinkerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, TargetServiceBaseInfo targetService = null, AuthBaseInfo authInfo = null, LinkerClientType? clientType = null, string provisioningState = null, VnetSolutionType? solutionType = null, ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) + public static LinkerResourceData LinkerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, TargetServiceBaseInfo targetService = null, AuthBaseInfo authInfo = null, LinkerClientType? clientType = null, string provisioningState = null, VnetSolution vnetSolution = null, LinkerSecretStore secretStore = null, string scope = null, LinkerPublicNetworkSolution publicNetworkSolution = null, LinkerConfigurationInfo configurationInfo = null) { return new LinkerResourceData( id, @@ -48,9 +161,11 @@ public static LinkerResourceData LinkerResourceData(ResourceIdentifier id = null authInfo, clientType, provisioningState, - solutionType != null ? new VnetSolution(solutionType, serializedAdditionalRawData: null) : null, - secretStoreKeyVaultId != null ? new LinkerSecretStore(secretStoreKeyVaultId, serializedAdditionalRawData: null) : null, + vnetSolution, + secretStore, scope, + publicNetworkSolution, + configurationInfo, serializedAdditionalRawData: null); } @@ -58,40 +173,72 @@ public static LinkerResourceData LinkerResourceData(ResourceIdentifier id = null /// /// 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 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 available derived classes include , , , , , , and . /// /// The application client type. /// The provisioning state. - /// The VNet solution. - /// An option to store secret value in secure place. + /// The VNet solution. + /// An option to store secret value in secure place. /// connection scope in source service. + /// The network solution. + /// The connection information consumed by applications, including secrets, connection strings. /// A new instance for mocking. - public static LinkerResourcePatch LinkerResourcePatch(TargetServiceBaseInfo targetService = null, AuthBaseInfo authInfo = null, LinkerClientType? clientType = null, string provisioningState = null, VnetSolutionType? solutionType = null, ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) + public static LinkerResourcePatch LinkerResourcePatch(TargetServiceBaseInfo targetService = null, AuthBaseInfo authInfo = null, LinkerClientType? clientType = null, string provisioningState = null, VnetSolution vnetSolution = null, LinkerSecretStore secretStore = null, string scope = null, LinkerPublicNetworkSolution publicNetworkSolution = null, LinkerConfigurationInfo configurationInfo = null) { return new LinkerResourcePatch( targetService, authInfo, clientType, provisioningState, - solutionType != null ? new VnetSolution(solutionType, serializedAdditionalRawData: null) : null, - secretStoreKeyVaultId != null ? new LinkerSecretStore(secretStoreKeyVaultId, serializedAdditionalRawData: null) : null, + vnetSolution, + secretStore, scope, + publicNetworkSolution, + configurationInfo, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The configuration properties for source resource. + /// A new instance for mocking. + public static SourceConfigurationResult SourceConfigurationResult(IEnumerable configurations = null) + { + configurations ??= new List(); + + return new SourceConfigurationResult(configurations?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of setting. + /// The value of setting. + /// The type of setting. + /// The identity for key vault reference, system or user-assigned managed identity ID. + /// Descriptive information for the configuration. + /// A new instance for mocking. + public static SourceConfiguration SourceConfiguration(string name = null, string value = null, LinkerConfigurationType? configType = null, string keyVaultReferenceIdentity = null, string description = null) + { + return new SourceConfiguration( + name, + value, + configType, + keyVaultReferenceIdentity, + description, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// Validated linker id. + /// 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 the Linker source application. /// The resource Id of target service. /// The authentication type. /// The detail of validation result. @@ -132,23 +279,102 @@ public static LinkerValidationResultItemInfo LinkerValidationResultItemInfo(stri serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The configuration properties for source resource. - /// A new instance for mocking. - public static SourceConfigurationResult SourceConfigurationResult(IEnumerable configurations = null) + /// Initializes a new instance of . + /// The target service provider name and resource name. + /// The client type for configuration names. + /// The auth type. + /// Indicates where the secrets in configuration from. Used when secrets are from Keyvault. + /// Deprecated, please use #/definitions/DaprConfigurationList instead. + /// The configuration names to be set in compute service environment. + /// A new instance for mocking. + public static LinkerConfigurationNameItem LinkerConfigurationNameItem(string targetService = null, LinkerClientType? clientType = null, LinkerAuthType? authType = null, LinkerKeyVaultSecretSourceType? secretType = null, DaprProperties daprProperties = null, IEnumerable names = null) { - configurations ??= new List(); + names ??= new List(); - return new SourceConfigurationResult(configurations?.ToList(), serializedAdditionalRawData: null); + return new LinkerConfigurationNameItem( + targetService, + clientType, + authType, + secretType, + daprProperties, + names?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// + /// Description for the configuration name. + /// Represent the configuration is required or not. + /// A new instance for mocking. + public static LinkerConfigurationName LinkerConfigurationName(string value = null, string description = null, bool? isRequired = null) + { + return new LinkerConfigurationName(value, description, isRequired, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error code. + /// The error message. + /// A new instance for mocking. + public static BasicErrorDryrunPrerequisiteResult BasicErrorDryrunPrerequisiteResult(string code = null, string message = null) + { + return new BasicErrorDryrunPrerequisiteResult(DryrunPrerequisiteResultType.BasicError, serializedAdditionalRawData: null, code, message); + } + + /// Initializes a new instance of . + /// + /// 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. + /// The network solution. + /// The connection information consumed by applications, including secrets, connection strings. + /// A new instance for mocking. + public static ServiceLinkerCreateOrUpdateDryrunContent ServiceLinkerCreateOrUpdateDryrunContent(TargetServiceBaseInfo targetService = null, AuthBaseInfo authInfo = null, LinkerClientType? clientType = null, string provisioningState = null, VnetSolution vnetSolution = null, LinkerSecretStore secretStore = null, string scope = null, LinkerPublicNetworkSolution publicNetworkSolution = null, LinkerConfigurationInfo configurationInfo = null) + { + return new ServiceLinkerCreateOrUpdateDryrunContent( + DryrunActionName.CreateOrUpdate, + serializedAdditionalRawData: null, + targetService, + authInfo, + clientType, + provisioningState, + vnetSolution, + secretStore, + scope, + publicNetworkSolution, + configurationInfo); + } + + /// Initializes a new instance of . + /// The permission scope. + /// The permission list. + /// The recommended role to resolve permissions missing. + /// A new instance for mocking. + public static PermissionsMissingDryrunPrerequisiteResult PermissionsMissingDryrunPrerequisiteResult(string scope = null, IEnumerable permissions = null, string recommendedRole = null) + { + permissions ??= new List(); + + return new PermissionsMissingDryrunPrerequisiteResult(DryrunPrerequisiteResultType.PermissionsMissing, serializedAdditionalRawData: null, scope, permissions?.ToList(), recommendedRole); + } + + /// Initializes a new instance of . /// The name of setting. /// The value of setting. - /// A new instance for mocking. - public static SourceConfiguration SourceConfiguration(string name = null, string value = null) + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SourceConfiguration SourceConfiguration(string name, string value) { - return new SourceConfiguration(name, value, serializedAdditionalRawData: null); + return SourceConfiguration(name: name, value: value, configType: default, keyVaultReferenceIdentity: default, description: default); } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmClient.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmClient.cs index 70f5c2afafb0..6c732e747b90 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmClient.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmClient.cs @@ -8,13 +8,19 @@ using System; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceLinker.Models; namespace Azure.ResourceManager.ServiceLinker.Mocking { /// A class to add extension methods to ArmClient. public partial class MockableServiceLinkerArmClient : ArmResource { + private ClientDiagnostics _serviceLinkerDryrunLinkersClientDiagnostics; + private LinkersRestOperations _serviceLinkerDryrunLinkersRestClient; + /// Initializes a new instance of the class for mocking. protected MockableServiceLinkerArmClient() { @@ -31,12 +37,87 @@ internal MockableServiceLinkerArmClient(ArmClient client) : this(client, Resourc { } + private ClientDiagnostics ServiceLinkerDryrunLinkersClientDiagnostics => _serviceLinkerDryrunLinkersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ServiceLinkerDryrunResource.ResourceType.Namespace, Diagnostics); + private LinkersRestOperations ServiceLinkerDryrunLinkersRestClient => _serviceLinkerDryrunLinkersRestClient ??= new LinkersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ServiceLinkerDryrunResource.ResourceType)); + private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); return apiVersion; } + /// Gets a collection of ServiceLinkerDryrunResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ServiceLinkerDryrunResources and their operations over a ServiceLinkerDryrunResource. + public virtual ServiceLinkerDryrunCollection GetServiceLinkerDryruns(ResourceIdentifier scope) + { + return new ServiceLinkerDryrunCollection(Client, scope); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of dryrun. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceLinkerDryrunAsync(ResourceIdentifier scope, string dryrunName, CancellationToken cancellationToken = default) + { + return await GetServiceLinkerDryruns(scope).GetAsync(dryrunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of dryrun. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceLinkerDryrun(ResourceIdentifier scope, string dryrunName, CancellationToken cancellationToken = default) + { + return GetServiceLinkerDryruns(scope).Get(dryrunName, cancellationToken); + } + /// Gets a collection of LinkerResources in the ArmClient. /// The scope that the resource will apply against. /// An object representing collection of LinkerResources and their operations over a LinkerResource. @@ -58,7 +139,7 @@ public virtual LinkerResourceCollection GetLinkerResources(ResourceIdentifier sc /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -90,7 +171,7 @@ public virtual async Task> GetLinkerResourceAsync(Resou /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -109,6 +190,97 @@ public virtual Response GetLinkerResource(ResourceIdentifier sco return GetLinkerResources(scope).Get(linkerName, cancellationToken); } + /// + /// List the dapr configuration supported by Service Connector. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/daprConfigurations + /// + /// + /// Operation Id + /// Linkers_ListDaprConfigurations + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetServiceLinkerDaprConfigurationsAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceLinkerDryrunLinkersRestClient.CreateListDaprConfigurationsRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceLinkerDryrunLinkersRestClient.CreateListDaprConfigurationsNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DaprConfigurationResourceItem.DeserializeDaprConfigurationResourceItem(e), ServiceLinkerDryrunLinkersClientDiagnostics, Pipeline, "MockableServiceLinkerArmClient.GetServiceLinkerDaprConfigurations", "value", "nextLink", cancellationToken); + } + + /// + /// List the dapr configuration supported by Service Connector. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/daprConfigurations + /// + /// + /// Operation Id + /// Linkers_ListDaprConfigurations + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetServiceLinkerDaprConfigurations(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceLinkerDryrunLinkersRestClient.CreateListDaprConfigurationsRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceLinkerDryrunLinkersRestClient.CreateListDaprConfigurationsNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DaprConfigurationResourceItem.DeserializeDaprConfigurationResourceItem(e), ServiceLinkerDryrunLinkersClientDiagnostics, Pipeline, "MockableServiceLinkerArmClient.GetServiceLinkerDaprConfigurations", "value", "nextLink", cancellationToken); + } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual ServiceLinkerDryrunResource GetServiceLinkerDryrunResource(ResourceIdentifier id) + { + ServiceLinkerDryrunResource.ValidateResourceId(id); + return new ServiceLinkerDryrunResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual ServiceLinkerLocationDryrunResource GetServiceLinkerLocationDryrunResource(ResourceIdentifier id) + { + ServiceLinkerLocationDryrunResource.ValidateResourceId(id); + return new ServiceLinkerLocationDryrunResource(Client, id); + } + /// /// 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. @@ -120,5 +292,17 @@ public virtual LinkerResource GetLinkerResource(ResourceIdentifier id) LinkerResource.ValidateResourceId(id); return new LinkerResource(Client, id); } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual ServiceLinkerLocationConnectorResource GetServiceLinkerLocationConnectorResource(ResourceIdentifier id) + { + ServiceLinkerLocationConnectorResource.ValidateResourceId(id); + return new ServiceLinkerLocationConnectorResource(Client, id); + } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmResource.cs index 3ab29c77b49b..ce136e60676c 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmResource.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmResource.cs @@ -53,7 +53,7 @@ public virtual LinkerResourceCollection GetLinkerResources() /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetLinkerResourceAsync(strin /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerResourceGroupResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerResourceGroupResource.cs new file mode 100644 index 000000000000..513456ed8a40 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerResourceGroupResource.cs @@ -0,0 +1,180 @@ +// 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.Core; + +namespace Azure.ResourceManager.ServiceLinker.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableServiceLinkerResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableServiceLinkerResourceGroupResource() + { + } + + /// 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 MockableServiceLinkerResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ServiceLinkerLocationDryrunResources in the ResourceGroupResource. + /// The name of Azure region. + /// An object representing collection of ServiceLinkerLocationDryrunResources and their operations over a ServiceLinkerLocationDryrunResource. + public virtual ServiceLinkerLocationDryrunCollection GetServiceLinkerLocationDryruns(AzureLocation location) + { + return new ServiceLinkerLocationDryrunCollection(Client, Id, location); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceLinkerLocationDryrunAsync(AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + return await GetServiceLinkerLocationDryruns(location).GetAsync(dryrunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceLinkerLocationDryrun(AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + return GetServiceLinkerLocationDryruns(location).Get(dryrunName, cancellationToken); + } + + /// Gets a collection of ServiceLinkerLocationConnectorResources in the ResourceGroupResource. + /// The name of Azure region. + /// An object representing collection of ServiceLinkerLocationConnectorResources and their operations over a ServiceLinkerLocationConnectorResource. + public virtual ServiceLinkerLocationConnectorCollection GetServiceLinkerLocationConnectors(AzureLocation location) + { + return new ServiceLinkerLocationConnectorCollection(Client, Id, location); + } + + /// + /// Returns Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceLinkerLocationConnectorAsync(AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + return await GetServiceLinkerLocationConnectors(location).GetAsync(connectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceLinkerLocationConnector(AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + return GetServiceLinkerLocationConnectors(location).Get(connectorName, cancellationToken); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerTenantResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerTenantResource.cs new file mode 100644 index 000000000000..cd09e530f823 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerTenantResource.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class MockableServiceLinkerTenantResource : ArmResource + { + private ClientDiagnostics _configurationNamesClientDiagnostics; + private ConfigurationNamesRestOperations _configurationNamesRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableServiceLinkerTenantResource() + { + } + + /// 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 MockableServiceLinkerTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics ConfigurationNamesClientDiagnostics => _configurationNamesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ConfigurationNamesRestOperations ConfigurationNamesRestClient => _configurationNamesRestClient ??= new ConfigurationNamesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceLinker/configurationNames + /// + /// + /// Operation Id + /// ConfigurationNames_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetServiceLinkerConfigurationNamesAsync(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationNamesRestClient.CreateListRequest(filter, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfigurationNamesRestClient.CreateListNextPageRequest(nextLink, filter, skipToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => LinkerConfigurationNameItem.DeserializeLinkerConfigurationNameItem(e), ConfigurationNamesClientDiagnostics, Pipeline, "MockableServiceLinkerTenantResource.GetServiceLinkerConfigurationNames", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceLinker/configurationNames + /// + /// + /// Operation Id + /// ConfigurationNames_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetServiceLinkerConfigurationNames(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationNamesRestClient.CreateListRequest(filter, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfigurationNamesRestClient.CreateListNextPageRequest(nextLink, filter, skipToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => LinkerConfigurationNameItem.DeserializeLinkerConfigurationNameItem(e), ConfigurationNamesClientDiagnostics, Pipeline, "MockableServiceLinkerTenantResource.GetServiceLinkerConfigurationNames", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs index c1f30b097150..028e1819503d 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs @@ -9,7 +9,9 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.ResourceManager.Resources; using Azure.ResourceManager.ServiceLinker.Mocking; +using Azure.ResourceManager.ServiceLinker.Models; namespace Azure.ResourceManager.ServiceLinker { @@ -26,6 +28,112 @@ private static MockableServiceLinkerArmResource GetMockableServiceLinkerArmResou return resource.GetCachedClient(client => new MockableServiceLinkerArmResource(client, resource.Id)); } + private static MockableServiceLinkerResourceGroupResource GetMockableServiceLinkerResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableServiceLinkerResourceGroupResource(client, resource.Id)); + } + + private static MockableServiceLinkerTenantResource GetMockableServiceLinkerTenantResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableServiceLinkerTenantResource(client, resource.Id)); + } + + /// + /// Gets a collection of ServiceLinkerDryrunResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// is null. + /// An object representing collection of ServiceLinkerDryrunResources and their operations over a ServiceLinkerDryrunResource. + public static ServiceLinkerDryrunCollection GetServiceLinkerDryruns(this ArmClient client, ResourceIdentifier scope) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceLinkerArmClient(client).GetServiceLinkerDryruns(scope); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of dryrun. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetServiceLinkerDryrunAsync(this ArmClient client, ResourceIdentifier scope, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return await GetMockableServiceLinkerArmClient(client).GetServiceLinkerDryrunAsync(scope, dryrunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of dryrun. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetServiceLinkerDryrun(this ArmClient client, ResourceIdentifier scope, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceLinkerArmClient(client).GetServiceLinkerDryrun(scope, dryrunName, cancellationToken); + } + /// /// Gets a collection of LinkerResources in the ArmClient. /// @@ -57,7 +165,7 @@ public static LinkerResourceCollection GetLinkerResources(this ArmClient client, /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -96,7 +204,7 @@ public static async Task> GetLinkerResourceAsync(this A /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -122,6 +230,116 @@ public static Response GetLinkerResource(this ArmClient client, return GetMockableServiceLinkerArmClient(client).GetLinkerResource(scope, linkerName, cancellationToken); } + /// + /// List the dapr configuration supported by Service Connector. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/daprConfigurations + /// + /// + /// Operation Id + /// Linkers_ListDaprConfigurations + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The cancellation token to use. + /// is null. + public static AsyncPageable GetServiceLinkerDaprConfigurationsAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceLinkerArmClient(client).GetServiceLinkerDaprConfigurationsAsync(scope, cancellationToken); + } + + /// + /// List the dapr configuration supported by Service Connector. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/daprConfigurations + /// + /// + /// Operation Id + /// Linkers_ListDaprConfigurations + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The cancellation token to use. + /// is null. + public static Pageable GetServiceLinkerDaprConfigurations(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceLinkerArmClient(client).GetServiceLinkerDaprConfigurations(scope, cancellationToken); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ServiceLinkerDryrunResource GetServiceLinkerDryrunResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceLinkerArmClient(client).GetServiceLinkerDryrunResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ServiceLinkerLocationDryrunResource GetServiceLinkerLocationDryrunResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceLinkerArmClient(client).GetServiceLinkerLocationDryrunResource(id); + } + /// /// 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. @@ -141,6 +359,25 @@ public static LinkerResource GetLinkerResource(this ArmClient client, ResourceId return GetMockableServiceLinkerArmClient(client).GetLinkerResource(id); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ServiceLinkerLocationConnectorResource GetServiceLinkerLocationConnectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceLinkerArmClient(client).GetServiceLinkerLocationConnectorResource(id); + } + /// /// Gets a collection of LinkerResources in the ArmResource. /// @@ -171,7 +408,7 @@ public static LinkerResourceCollection GetLinkerResources(this ArmResource armRe /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -209,7 +446,7 @@ public static async Task> GetLinkerResourceAsync(this A /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -233,5 +470,265 @@ public static Response GetLinkerResource(this ArmResource armRes return GetMockableServiceLinkerArmResource(armResource).GetLinkerResource(linkerName, cancellationToken); } + + /// + /// Gets a collection of ServiceLinkerLocationDryrunResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of Azure region. + /// is null. + /// An object representing collection of ServiceLinkerLocationDryrunResources and their operations over a ServiceLinkerLocationDryrunResource. + public static ServiceLinkerLocationDryrunCollection GetServiceLinkerLocationDryruns(this ResourceGroupResource resourceGroupResource, AzureLocation location) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableServiceLinkerResourceGroupResource(resourceGroupResource).GetServiceLinkerLocationDryruns(location); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetServiceLinkerLocationDryrunAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableServiceLinkerResourceGroupResource(resourceGroupResource).GetServiceLinkerLocationDryrunAsync(location, dryrunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetServiceLinkerLocationDryrun(this ResourceGroupResource resourceGroupResource, AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableServiceLinkerResourceGroupResource(resourceGroupResource).GetServiceLinkerLocationDryrun(location, dryrunName, cancellationToken); + } + + /// + /// Gets a collection of ServiceLinkerLocationConnectorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of Azure region. + /// is null. + /// An object representing collection of ServiceLinkerLocationConnectorResources and their operations over a ServiceLinkerLocationConnectorResource. + public static ServiceLinkerLocationConnectorCollection GetServiceLinkerLocationConnectors(this ResourceGroupResource resourceGroupResource, AzureLocation location) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableServiceLinkerResourceGroupResource(resourceGroupResource).GetServiceLinkerLocationConnectors(location); + } + + /// + /// Returns Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetServiceLinkerLocationConnectorAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableServiceLinkerResourceGroupResource(resourceGroupResource).GetServiceLinkerLocationConnectorAsync(location, connectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetServiceLinkerLocationConnector(this ResourceGroupResource resourceGroupResource, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableServiceLinkerResourceGroupResource(resourceGroupResource).GetServiceLinkerLocationConnector(location, connectorName, cancellationToken); + } + + /// + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceLinker/configurationNames + /// + /// + /// Operation Id + /// ConfigurationNames_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetServiceLinkerConfigurationNamesAsync(this TenantResource tenantResource, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableServiceLinkerTenantResource(tenantResource).GetServiceLinkerConfigurationNamesAsync(filter, skipToken, cancellationToken); + } + + /// + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceLinker/configurationNames + /// + /// + /// Operation Id + /// ConfigurationNames_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetServiceLinkerConfigurationNames(this TenantResource tenantResource, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableServiceLinkerTenantResource(tenantResource).GetServiceLinkerConfigurationNames(filter, skipToken, cancellationToken); + } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs index 0bdcec9574c4..bd4642489866 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs @@ -34,6 +34,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, st private readonly ClientDiagnostics _linkerResourceLinkerClientDiagnostics; private readonly LinkerRestOperations _linkerResourceLinkerRestClient; + private readonly ClientDiagnostics _serviceLinkerDryrunLinkersClientDiagnostics; + private readonly LinkersRestOperations _serviceLinkerDryrunLinkersRestClient; private readonly LinkerResourceData _data; /// Gets the resource type for the operations. @@ -61,6 +63,9 @@ internal LinkerResource(ArmClient client, ResourceIdentifier id) : base(client, _linkerResourceLinkerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string linkerResourceLinkerApiVersion); _linkerResourceLinkerRestClient = new LinkerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, linkerResourceLinkerApiVersion); + _serviceLinkerDryrunLinkersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ServiceLinkerDryrunResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServiceLinkerDryrunResource.ResourceType, out string serviceLinkerDryrunLinkersApiVersion); + _serviceLinkerDryrunLinkersRestClient = new LinkersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceLinkerDryrunLinkersApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -100,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -140,7 +145,7 @@ public virtual async Task> GetAsync(CancellationToken c /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -168,7 +173,7 @@ public virtual Response Get(CancellationToken cancellationToken } /// - /// Delete a link. + /// Delete a Linker. /// /// /// Request Path @@ -180,7 +185,7 @@ public virtual Response Get(CancellationToken cancellationToken /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +215,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Delete a link. + /// Delete a Linker. /// /// /// Request Path @@ -222,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +257,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Operation to update an existing link. + /// Operation to update an existing Linker. /// /// /// Request Path @@ -264,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -298,7 +303,7 @@ public virtual async Task> UpdateAsync(WaitUntil wa } /// - /// Operation to update an existing link. + /// Operation to update an existing Linker. /// /// /// Request Path @@ -310,7 +315,7 @@ public virtual async Task> UpdateAsync(WaitUntil wa /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -344,39 +349,36 @@ public virtual ArmOperation Update(WaitUntil waitUntil, LinkerRe } /// - /// Validate a link. + /// Generate configurations for a Linker. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations /// /// /// Operation Id - /// Linker_Validate + /// Linkers_GenerateConfigurations /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// 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. + /// Connection Info, including format, secret store, etc. /// The cancellation token to use. - public virtual async Task> ValidateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> GenerateConfigurationsAsync(LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Validate"); + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("LinkerResource.GenerateConfigurations"); 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; + var response = await _serviceLinkerDryrunLinkersRestClient.GenerateConfigurationsAsync(Id.Parent, Id.Name, info, cancellationToken).ConfigureAwait(false); + return response; } catch (Exception e) { @@ -386,39 +388,36 @@ public virtual async Task> ValidateA } /// - /// Validate a link. + /// Generate configurations for a Linker. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations /// /// /// Operation Id - /// Linker_Validate + /// Linkers_GenerateConfigurations /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// 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. + /// Connection Info, including format, secret store, etc. /// The cancellation token to use. - public virtual ArmOperation Validate(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual Response GenerateConfigurations(LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Validate"); + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("LinkerResource.GenerateConfigurations"); 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; + var response = _serviceLinkerDryrunLinkersRestClient.GenerateConfigurations(Id.Parent, Id.Name, info, cancellationToken); + return response; } catch (Exception e) { @@ -428,7 +427,7 @@ public virtual ArmOperation Validate(WaitUntil wa } /// - /// list source configurations for a linker. + /// list source configurations for a Linker. /// /// /// Request Path @@ -440,7 +439,7 @@ public virtual ArmOperation Validate(WaitUntil wa /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -466,7 +465,7 @@ public virtual async Task> GetConfigurations } /// - /// list source configurations for a linker. + /// list source configurations for a Linker. /// /// /// Request Path @@ -478,7 +477,7 @@ public virtual async Task> GetConfigurations /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -502,5 +501,89 @@ public virtual Response GetConfigurations(Cancellatio throw; } } + + /// + /// Validate a Linker. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker + /// + /// + /// Operation Id + /// Linker_Validate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Validate a Linker. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker + /// + /// + /// Operation Id + /// Linker_Validate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + 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 index 23ce6c384ebd..a7cbbfbeeabf 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs @@ -42,7 +42,7 @@ internal LinkerResourceCollection(ArmClient client, ResourceIdentifier id) : bas } /// - /// Create or update linker resource. + /// Create or update Linker resource. /// /// /// Request Path @@ -54,7 +54,7 @@ internal LinkerResourceCollection(ArmClient client, ResourceIdentifier id) : bas /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -91,7 +91,7 @@ public virtual async Task> CreateOrUpdateAsync(Wait } /// - /// Create or update linker resource. + /// Create or update Linker resource. /// /// /// Request Path @@ -103,7 +103,7 @@ public virtual async Task> CreateOrUpdateAsync(Wait /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -152,7 +152,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -197,7 +197,7 @@ public virtual async Task> GetAsync(string linkerName, /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -230,7 +230,7 @@ public virtual Response Get(string linkerName, CancellationToken } /// - /// Returns list of Linkers which connects to the resource. + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision. /// /// /// Request Path @@ -242,7 +242,7 @@ public virtual Response Get(string linkerName, CancellationToken /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -260,7 +260,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken cance } /// - /// Returns list of Linkers which connects to the resource. + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision. /// /// /// Request Path @@ -272,7 +272,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken cance /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -302,7 +302,7 @@ public virtual Pageable GetAll(CancellationToken cancellationTok /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> ExistsAsync(string linkerName, Cancell /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -388,7 +388,7 @@ public virtual Response Exists(string linkerName, CancellationToken cancel /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource @@ -433,7 +433,7 @@ public virtual async Task> GetIfExistsAsync(str /// /// /// Default Api Version - /// 2022-05-01 + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.Serialization.cs index 37a508ff1953..2fd76f0b7f2f 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.Serialization.cs @@ -96,6 +96,30 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteNull("scope"); } } + if (Optional.IsDefined(PublicNetworkSolution)) + { + if (PublicNetworkSolution != null) + { + writer.WritePropertyName("publicNetworkSolution"u8); + writer.WriteObjectValue(PublicNetworkSolution, options); + } + else + { + writer.WriteNull("publicNetworkSolution"); + } + } + if (Optional.IsDefined(ConfigurationInfo)) + { + if (ConfigurationInfo != null) + { + writer.WritePropertyName("configurationInfo"u8); + writer.WriteObjectValue(ConfigurationInfo, options); + } + else + { + writer.WriteNull("configurationInfo"); + } + } writer.WriteEndObject(); } @@ -130,6 +154,8 @@ internal static LinkerResourceData DeserializeLinkerResourceData(JsonElement ele VnetSolution vnetSolution = default; LinkerSecretStore secretStore = default; string scope = default; + LinkerPublicNetworkSolution publicNetworkSolution = default; + LinkerConfigurationInfo configurationInfo = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -229,6 +255,26 @@ internal static LinkerResourceData DeserializeLinkerResourceData(JsonElement ele scope = property0.Value.GetString(); continue; } + if (property0.NameEquals("publicNetworkSolution"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + publicNetworkSolution = null; + continue; + } + publicNetworkSolution = LinkerPublicNetworkSolution.DeserializeLinkerPublicNetworkSolution(property0.Value, options); + continue; + } + if (property0.NameEquals("configurationInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + configurationInfo = null; + continue; + } + configurationInfo = LinkerConfigurationInfo.DeserializeLinkerConfigurationInfo(property0.Value, options); + continue; + } } continue; } @@ -250,6 +296,8 @@ internal static LinkerResourceData DeserializeLinkerResourceData(JsonElement ele vnetSolution, secretStore, scope, + publicNetworkSolution, + configurationInfo, serializedAdditionalRawData); } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs index 8db41809168e..d5bf337d0b4f 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs @@ -64,20 +64,22 @@ public LinkerResourceData() /// /// 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 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 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. + /// The network solution. + /// The connection information consumed by applications, including secrets, connection strings. /// Keeps track of any properties unknown to the library. - internal LinkerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolution vnetSolution, LinkerSecretStore secretStore, string scope, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal LinkerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolution vnetSolution, LinkerSecretStore secretStore, string scope, LinkerPublicNetworkSolution publicNetworkSolution, LinkerConfigurationInfo configurationInfo, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { TargetService = targetService; AuthInfo = authInfo; @@ -86,19 +88,21 @@ internal LinkerResourceData(ResourceIdentifier id, string name, ResourceType res VnetSolution = vnetSolution; SecretStore = secretStore; Scope = scope; + PublicNetworkSolution = publicNetworkSolution; + ConfigurationInfo = configurationInfo; _serializedAdditionalRawData = serializedAdditionalRawData; } /// /// 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 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 . + /// The available derived classes include , , , , , , and . /// public AuthBaseInfo AuthInfo { get; set; } /// The application client type. @@ -106,34 +110,14 @@ internal LinkerResourceData(ResourceIdentifier id, string name, ResourceType res /// 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; - } - } - + public VnetSolution VnetSolution { get; set; } /// 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; - } - } - + public LinkerSecretStore SecretStore { get; set; } /// connection scope in source service. public string Scope { get; set; } + /// The network solution. + public LinkerPublicNetworkSolution PublicNetworkSolution { get; set; } + /// The connection information consumed by applications, including secrets, connection strings. + public LinkerConfigurationInfo ConfigurationInfo { get; set; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerDryrunOperationSource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerDryrunOperationSource.cs new file mode 100644 index 000000000000..15fccc1259ba --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerDryrunOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker +{ + internal class ServiceLinkerDryrunOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ServiceLinkerDryrunOperationSource(ArmClient client) + { + _client = client; + } + + ServiceLinkerDryrunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerServiceLinkerContext.Default); + return new ServiceLinkerDryrunResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerServiceLinkerContext.Default); + return await Task.FromResult(new ServiceLinkerDryrunResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerLocationConnectorOperationSource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerLocationConnectorOperationSource.cs new file mode 100644 index 000000000000..3bf50ad2fdb7 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerLocationConnectorOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker +{ + internal class ServiceLinkerLocationConnectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ServiceLinkerLocationConnectorOperationSource(ArmClient client) + { + _client = client; + } + + ServiceLinkerLocationConnectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerServiceLinkerContext.Default); + return new ServiceLinkerLocationConnectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerServiceLinkerContext.Default); + return await Task.FromResult(new ServiceLinkerLocationConnectorResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerLocationDryrunOperationSource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerLocationDryrunOperationSource.cs new file mode 100644 index 000000000000..738ebf16e686 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerLocationDryrunOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker +{ + internal class ServiceLinkerLocationDryrunOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ServiceLinkerLocationDryrunOperationSource(ArmClient client) + { + _client = client; + } + + ServiceLinkerLocationDryrunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerServiceLinkerContext.Default); + return new ServiceLinkerLocationDryrunResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerServiceLinkerContext.Default); + return await Task.FromResult(new ServiceLinkerLocationDryrunResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AccessKeyInfoBase.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AccessKeyInfoBase.Serialization.cs new file mode 100644 index 000000000000..9019057de66b --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AccessKeyInfoBase.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class AccessKeyInfoBase : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessKeyInfoBase)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + } + + AccessKeyInfoBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessKeyInfoBase)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessKeyInfoBase(document.RootElement, options); + } + + internal static AccessKeyInfoBase DeserializeAccessKeyInfoBase(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList permissions = default; + LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("permissions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new TargetServiceAccessKeyPermission(item.GetString())); + } + permissions = array; + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new LinkerAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessKeyInfoBase(authType, authMode, serializedAdditionalRawData, permissions ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(AccessKeyInfoBase)} does not support writing '{options.Format}' format."); + } + } + + AccessKeyInfoBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccessKeyInfoBase(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessKeyInfoBase)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AccessKeyInfoBase.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AccessKeyInfoBase.cs new file mode 100644 index 000000000000..ea12fc3f709a --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AccessKeyInfoBase.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The access key directly from target resource properties, which target service is Azure Resource, such as Microsoft.Storage. + public partial class AccessKeyInfoBase : AuthBaseInfo + { + /// Initializes a new instance of . + public AccessKeyInfoBase() + { + Permissions = new ChangeTrackingList(); + AuthType = LinkerAuthType.AccessKey; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. + /// Keeps track of any properties unknown to the library. + /// Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure App Configuration, `Listen`, `Send` and `Manage` are for Azure Event Hub and Azure Service Bus. + internal AccessKeyInfoBase(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, IList permissions) : base(authType, authMode, serializedAdditionalRawData) + { + Permissions = permissions; + AuthType = authType; + } + + /// Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure App Configuration, `Listen`, `Send` and `Manage` are for Azure Event Hub and Azure Service Bus. + public IList Permissions { get; } + } +} 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 index 0c5ab790fb05..e074c1793c7b 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.Serialization.cs @@ -36,6 +36,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("authType"u8); writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(AuthMode)) + { + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,10 +82,13 @@ internal static AuthBaseInfo DeserializeAuthBaseInfo(JsonElement element, ModelR { switch (discriminator.GetString()) { + case "accessKey": return AccessKeyInfoBase.DeserializeAccessKeyInfoBase(element, options); + case "easyAuthMicrosoftEntraID": return EasyAuthMicrosoftEntraIdAuthInfo.DeserializeEasyAuthMicrosoftEntraIdAuthInfo(element, options); case "secret": return SecretAuthInfo.DeserializeSecretAuthInfo(element, options); case "servicePrincipalCertificate": return ServicePrincipalCertificateAuthInfo.DeserializeServicePrincipalCertificateAuthInfo(element, options); case "servicePrincipalSecret": return ServicePrincipalSecretAuthInfo.DeserializeServicePrincipalSecretAuthInfo(element, options); case "systemAssignedIdentity": return SystemAssignedIdentityAuthInfo.DeserializeSystemAssignedIdentityAuthInfo(element, options); + case "userAccount": return LinkerUserAccountAuthInfo.DeserializeLinkerUserAccountAuthInfo(element, options); case "userAssignedIdentity": return UserAssignedIdentityAuthInfo.DeserializeUserAssignedIdentityAuthInfo(element, options); } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.cs index bae83d92b23a..a20f78b54af2 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AuthBaseInfo.cs @@ -13,7 +13,7 @@ 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 . + /// The available derived classes include , , , , , , and . /// public abstract partial class AuthBaseInfo { @@ -56,14 +56,18 @@ protected AuthBaseInfo() /// Initializes a new instance of . /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. /// Keeps track of any properties unknown to the library. - internal AuthBaseInfo(LinkerAuthType authType, IDictionary serializedAdditionalRawData) + internal AuthBaseInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData) { AuthType = authType; + AuthMode = authMode; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The authentication type. internal LinkerAuthType AuthType { get; set; } + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. + public ServiceLinkerAuthMode? AuthMode { get; set; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureAppConfigProperties.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureAppConfigProperties.Serialization.cs new file mode 100644 index 000000000000..b5188fe89d53 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureAppConfigProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class AzureAppConfigProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureAppConfigProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ConnectWithKubernetesExtension)) + { + if (ConnectWithKubernetesExtension != null) + { + writer.WritePropertyName("connectWithKubernetesExtension"u8); + writer.WriteBooleanValue(ConnectWithKubernetesExtension.Value); + } + else + { + writer.WriteNull("connectWithKubernetesExtension"); + } + } + } + + AzureAppConfigProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureAppConfigProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureAppConfigProperties(document.RootElement, options); + } + + internal static AzureAppConfigProperties DeserializeAzureAppConfigProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? connectWithKubernetesExtension = default; + AzureResourceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectWithKubernetesExtension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + connectWithKubernetesExtension = null; + continue; + } + connectWithKubernetesExtension = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new AzureResourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureAppConfigProperties(type, serializedAdditionalRawData, connectWithKubernetesExtension); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(AzureAppConfigProperties)} does not support writing '{options.Format}' format."); + } + } + + AzureAppConfigProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureAppConfigProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureAppConfigProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureAppConfigProperties.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureAppConfigProperties.cs new file mode 100644 index 000000000000..bcd914ef7fd9 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureAppConfigProperties.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The resource properties when type is Azure App Configuration. + public partial class AzureAppConfigProperties : AzureResourceBaseProperties + { + /// Initializes a new instance of . + public AzureAppConfigProperties() + { + AzureResourceType = AzureResourceType.AppConfig; + } + + /// Initializes a new instance of . + /// The azure resource type. + /// Keeps track of any properties unknown to the library. + /// True if connection enables app configuration kubernetes extension. + internal AzureAppConfigProperties(AzureResourceType azureResourceType, IDictionary serializedAdditionalRawData, bool? connectWithKubernetesExtension) : base(azureResourceType, serializedAdditionalRawData) + { + ConnectWithKubernetesExtension = connectWithKubernetesExtension; + AzureResourceType = azureResourceType; + } + + /// True if connection enables app configuration kubernetes extension. + public bool? ConnectWithKubernetesExtension { 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 index cebbc41684f9..d1adba03d1e1 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.Serialization.cs @@ -77,6 +77,7 @@ internal static AzureResourceBaseProperties DeserializeAzureResourceBaseProperti { switch (discriminator.GetString()) { + case "AppConfig": return AzureAppConfigProperties.DeserializeAzureAppConfigProperties(element, options); case "KeyVault": return AzureKeyVaultProperties.DeserializeAzureKeyVaultProperties(element, options); } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.cs index 2e3630f0a31d..1d1afe29189c 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceBaseProperties.cs @@ -13,7 +13,7 @@ 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 . + /// The available derived classes include and . /// public abstract partial class AzureResourceBaseProperties { diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs index 59b5b3b8a027..3111b8db0a7c 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs @@ -27,7 +27,7 @@ public AzureResourceInfo() /// /// 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 . + /// The available derived classes include and . /// internal AzureResourceInfo(TargetServiceType targetServiceType, IDictionary serializedAdditionalRawData, ResourceIdentifier id, AzureResourceBaseProperties resourceProperties) : base(targetServiceType, serializedAdditionalRawData) { @@ -41,7 +41,7 @@ internal AzureResourceInfo(TargetServiceType targetServiceType, IDictionary /// 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 . + /// The available derived classes include and . /// public AzureResourceBaseProperties ResourceProperties { get; set; } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceManagerServiceLinkerContext.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceManagerServiceLinkerContext.cs index 099bd166da5e..2c8da7512d55 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceManagerServiceLinkerContext.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceManagerServiceLinkerContext.cs @@ -15,25 +15,54 @@ namespace Azure.ResourceManager.ServiceLinker /// Context class which will be filled in by the System.ClientModel.SourceGeneration. /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' /// + [ModelReaderWriterBuildable(typeof(AccessKeyInfoBase))] [ModelReaderWriterBuildable(typeof(AuthBaseInfo))] + [ModelReaderWriterBuildable(typeof(AzureAppConfigProperties))] [ModelReaderWriterBuildable(typeof(AzureKeyVaultProperties))] [ModelReaderWriterBuildable(typeof(AzureResourceBaseProperties))] [ModelReaderWriterBuildable(typeof(AzureResourceInfo))] + [ModelReaderWriterBuildable(typeof(BasicErrorDryrunPrerequisiteResult))] + [ModelReaderWriterBuildable(typeof(ConfigurationNameResult))] + [ModelReaderWriterBuildable(typeof(ConfigurationStore))] [ModelReaderWriterBuildable(typeof(ConfluentBootstrapServerInfo))] [ModelReaderWriterBuildable(typeof(ConfluentSchemaRegistryInfo))] + [ModelReaderWriterBuildable(typeof(DaprConfigurationList))] + [ModelReaderWriterBuildable(typeof(DaprConfigurationResourceItem))] + [ModelReaderWriterBuildable(typeof(DaprMetadata))] + [ModelReaderWriterBuildable(typeof(DaprProperties))] + [ModelReaderWriterBuildable(typeof(DryrunList))] + [ModelReaderWriterBuildable(typeof(DryrunOperationPreview))] + [ModelReaderWriterBuildable(typeof(DryrunPrerequisiteResult))] + [ModelReaderWriterBuildable(typeof(EasyAuthMicrosoftEntraIdAuthInfo))] [ModelReaderWriterBuildable(typeof(KeyVaultSecretReferenceSecretInfo))] [ModelReaderWriterBuildable(typeof(KeyVaultSecretUriSecretInfo))] - [ModelReaderWriterBuildable(typeof(LinkerList))] + [ModelReaderWriterBuildable(typeof(LinkerConfigurationInfo))] + [ModelReaderWriterBuildable(typeof(LinkerConfigurationName))] + [ModelReaderWriterBuildable(typeof(LinkerConfigurationNameItem))] + [ModelReaderWriterBuildable(typeof(LinkerFirewallRules))] + [ModelReaderWriterBuildable(typeof(LinkerPublicNetworkSolution))] [ModelReaderWriterBuildable(typeof(LinkerResource))] [ModelReaderWriterBuildable(typeof(LinkerResourceData))] [ModelReaderWriterBuildable(typeof(LinkerResourcePatch))] [ModelReaderWriterBuildable(typeof(LinkerSecretStore))] + [ModelReaderWriterBuildable(typeof(LinkerTargetFabricPlatform))] + [ModelReaderWriterBuildable(typeof(LinkerUserAccountAuthInfo))] [ModelReaderWriterBuildable(typeof(LinkerValidateOperationResult))] [ModelReaderWriterBuildable(typeof(LinkerValidationResultItemInfo))] + [ModelReaderWriterBuildable(typeof(PermissionsMissingDryrunPrerequisiteResult))] [ModelReaderWriterBuildable(typeof(RawValueSecretInfo))] + [ModelReaderWriterBuildable(typeof(ResourceList))] [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SecretAuthInfo))] [ModelReaderWriterBuildable(typeof(SecretBaseInfo))] + [ModelReaderWriterBuildable(typeof(SelfHostedServer))] + [ModelReaderWriterBuildable(typeof(ServiceLinkerCreateOrUpdateDryrunContent))] + [ModelReaderWriterBuildable(typeof(ServiceLinkerDryrunContent))] + [ModelReaderWriterBuildable(typeof(ServiceLinkerDryrunData))] + [ModelReaderWriterBuildable(typeof(ServiceLinkerDryrunPatch))] + [ModelReaderWriterBuildable(typeof(ServiceLinkerDryrunResource))] + [ModelReaderWriterBuildable(typeof(ServiceLinkerLocationConnectorResource))] + [ModelReaderWriterBuildable(typeof(ServiceLinkerLocationDryrunResource))] [ModelReaderWriterBuildable(typeof(ServicePrincipalCertificateAuthInfo))] [ModelReaderWriterBuildable(typeof(ServicePrincipalSecretAuthInfo))] [ModelReaderWriterBuildable(typeof(SourceConfiguration))] @@ -43,6 +72,8 @@ namespace Azure.ResourceManager.ServiceLinker [ModelReaderWriterBuildable(typeof(TargetServiceBaseInfo))] [ModelReaderWriterBuildable(typeof(UnknownAuthInfoBase))] [ModelReaderWriterBuildable(typeof(UnknownAzureResourcePropertiesBase))] + [ModelReaderWriterBuildable(typeof(UnknownDryrunParameters))] + [ModelReaderWriterBuildable(typeof(UnknownDryrunPrerequisiteResult))] [ModelReaderWriterBuildable(typeof(UnknownSecretInfoBase))] [ModelReaderWriterBuildable(typeof(UnknownTargetServiceBase))] [ModelReaderWriterBuildable(typeof(UserAssignedIdentityAuthInfo))] diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceType.cs index 6e972d3537ed..38f920798740 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceType.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceType.cs @@ -23,9 +23,12 @@ public AzureResourceType(string value) } private const string KeyVaultValue = "KeyVault"; + private const string AppConfigValue = "AppConfig"; /// KeyVault. public static AzureResourceType KeyVault { get; } = new AzureResourceType(KeyVaultValue); + /// AppConfig. + public static AzureResourceType AppConfig { get; } = new AzureResourceType(AppConfigValue); /// 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. diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/BasicErrorDryrunPrerequisiteResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/BasicErrorDryrunPrerequisiteResult.Serialization.cs new file mode 100644 index 000000000000..9dfbf2b077d7 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/BasicErrorDryrunPrerequisiteResult.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class BasicErrorDryrunPrerequisiteResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BasicErrorDryrunPrerequisiteResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + } + + BasicErrorDryrunPrerequisiteResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BasicErrorDryrunPrerequisiteResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBasicErrorDryrunPrerequisiteResult(document.RootElement, options); + } + + internal static BasicErrorDryrunPrerequisiteResult DeserializeBasicErrorDryrunPrerequisiteResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + DryrunPrerequisiteResultType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new DryrunPrerequisiteResultType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BasicErrorDryrunPrerequisiteResult(type, serializedAdditionalRawData, code, message); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(BasicErrorDryrunPrerequisiteResult)} does not support writing '{options.Format}' format."); + } + } + + BasicErrorDryrunPrerequisiteResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBasicErrorDryrunPrerequisiteResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BasicErrorDryrunPrerequisiteResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/BasicErrorDryrunPrerequisiteResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/BasicErrorDryrunPrerequisiteResult.cs new file mode 100644 index 000000000000..db2d818c4be6 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/BasicErrorDryrunPrerequisiteResult.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The represent of basic error. + public partial class BasicErrorDryrunPrerequisiteResult : DryrunPrerequisiteResult + { + /// Initializes a new instance of . + internal BasicErrorDryrunPrerequisiteResult() + { + ResultType = DryrunPrerequisiteResultType.BasicError; + } + + /// Initializes a new instance of . + /// The type of dryrun result. + /// Keeps track of any properties unknown to the library. + /// The error code. + /// The error message. + internal BasicErrorDryrunPrerequisiteResult(DryrunPrerequisiteResultType resultType, IDictionary serializedAdditionalRawData, string code, string message) : base(resultType, serializedAdditionalRawData) + { + Code = code; + Message = message; + ResultType = resultType; + } + + /// The error code. + public string Code { get; } + /// The error message. + public string Message { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationNameResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationNameResult.Serialization.cs new file mode 100644 index 000000000000..7eeb489410eb --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationNameResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + internal partial class ConfigurationNameResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfigurationNameResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConfigurationNameResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfigurationNameResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfigurationNameResult(document.RootElement, options); + } + + internal static ConfigurationNameResult DeserializeConfigurationNameResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LinkerConfigurationNameItem.DeserializeLinkerConfigurationNameItem(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConfigurationNameResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ConfigurationNameResult)} does not support writing '{options.Format}' format."); + } + } + + ConfigurationNameResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConfigurationNameResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfigurationNameResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationNameResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationNameResult.cs new file mode 100644 index 000000000000..4e514758eec2 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationNameResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Configuration Name list which will be set based on different target resource, client type, auth type. + internal partial class ConfigurationNameResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ConfigurationNameItem items on this page. + /// is null. + internal ConfigurationNameResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ConfigurationNameItem items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ConfigurationNameResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConfigurationNameResult() + { + } + + /// The ConfigurationNameItem items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationStore.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationStore.Serialization.cs new file mode 100644 index 000000000000..2c62fd99d16e --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationStore.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + internal partial class ConfigurationStore : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfigurationStore)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AppConfigurationId)) + { + if (AppConfigurationId != null) + { + writer.WritePropertyName("appConfigurationId"u8); + writer.WriteStringValue(AppConfigurationId); + } + else + { + writer.WriteNull("appConfigurationId"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConfigurationStore IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfigurationStore)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfigurationStore(document.RootElement, options); + } + + internal static ConfigurationStore DeserializeConfigurationStore(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appConfigurationId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appConfigurationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + appConfigurationId = null; + continue; + } + appConfigurationId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConfigurationStore(appConfigurationId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ConfigurationStore)} does not support writing '{options.Format}' format."); + } + } + + ConfigurationStore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConfigurationStore(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfigurationStore)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationStore.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationStore.cs new file mode 100644 index 000000000000..e56e0af8e890 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfigurationStore.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// An option to store configuration into different place. + internal partial class ConfigurationStore + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConfigurationStore() + { + } + + /// Initializes a new instance of . + /// The app configuration id to store configuration. + /// Keeps track of any properties unknown to the library. + internal ConfigurationStore(string appConfigurationId, IDictionary serializedAdditionalRawData) + { + AppConfigurationId = appConfigurationId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The app configuration id to store configuration. + public string AppConfigurationId { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprBindingComponentDirection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprBindingComponentDirection.cs new file mode 100644 index 000000000000..f55ad7683c94 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprBindingComponentDirection.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The direction supported by the dapr binding component. + public readonly partial struct DaprBindingComponentDirection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DaprBindingComponentDirection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InputValue = "input"; + private const string OutputValue = "output"; + + /// input. + public static DaprBindingComponentDirection Input { get; } = new DaprBindingComponentDirection(InputValue); + /// output. + public static DaprBindingComponentDirection Output { get; } = new DaprBindingComponentDirection(OutputValue); + /// Determines if two values are the same. + public static bool operator ==(DaprBindingComponentDirection left, DaprBindingComponentDirection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DaprBindingComponentDirection left, DaprBindingComponentDirection right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DaprBindingComponentDirection(string value) => new DaprBindingComponentDirection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DaprBindingComponentDirection other && Equals(other); + /// + public bool Equals(DaprBindingComponentDirection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationList.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationList.Serialization.cs new file mode 100644 index 000000000000..6386a12e4a5d --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationList.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + internal partial class DaprConfigurationList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprConfigurationList)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprConfigurationList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprConfigurationList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprConfigurationList(document.RootElement, options); + } + + internal static DaprConfigurationList DeserializeDaprConfigurationList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DaprConfigurationResourceItem.DeserializeDaprConfigurationResourceItem(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprConfigurationList(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(DaprConfigurationList)} does not support writing '{options.Format}' format."); + } + } + + DaprConfigurationList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprConfigurationList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprConfigurationList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationList.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationList.cs new file mode 100644 index 000000000000..164e3d572d08 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationList.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Dapr configuration list supported by Service Connector. + internal partial class DaprConfigurationList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The DaprConfigurationResource items on this page. + /// is null. + internal DaprConfigurationList(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DaprConfigurationResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DaprConfigurationList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DaprConfigurationList() + { + } + + /// The DaprConfigurationResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationResourceItem.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationResourceItem.Serialization.cs new file mode 100644 index 000000000000..623d74d54aed --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationResourceItem.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class DaprConfigurationResourceItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprConfigurationResourceItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(TargetType)) + { + writer.WritePropertyName("targetType"u8); + writer.WriteStringValue(TargetType); + } + if (Optional.IsDefined(AuthType)) + { + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.Value.ToString()); + } + if (Optional.IsDefined(DaprProperties)) + { + writer.WritePropertyName("daprProperties"u8); + writer.WriteObjectValue(DaprProperties, options); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprConfigurationResourceItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprConfigurationResourceItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprConfigurationResourceItem(document.RootElement, options); + } + + internal static DaprConfigurationResourceItem DeserializeDaprConfigurationResourceItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetType = default; + LinkerAuthType? authType = default; + DaprProperties daprProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("targetType"u8)) + { + targetType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("authType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authType = new LinkerAuthType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("daprProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daprProperties = DaprProperties.DeserializeDaprProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprConfigurationResourceItem(targetType, authType, daprProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(DaprConfigurationResourceItem)} does not support writing '{options.Format}' format."); + } + } + + DaprConfigurationResourceItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprConfigurationResourceItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprConfigurationResourceItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationResourceItem.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationResourceItem.cs new file mode 100644 index 000000000000..5e32a5cc8b17 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprConfigurationResourceItem.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Represent one resource of the dapr configuration list. + public partial class DaprConfigurationResourceItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DaprConfigurationResourceItem() + { + } + + /// Initializes a new instance of . + /// Supported target resource type, extract from resource id, uppercase. + /// The authentication type. + /// Indicates some additional properties for dapr client type. + /// Keeps track of any properties unknown to the library. + internal DaprConfigurationResourceItem(string targetType, LinkerAuthType? authType, DaprProperties daprProperties, IDictionary serializedAdditionalRawData) + { + TargetType = targetType; + AuthType = authType; + DaprProperties = daprProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Supported target resource type, extract from resource id, uppercase. + public string TargetType { get; } + /// The authentication type. + public LinkerAuthType? AuthType { get; } + /// Indicates some additional properties for dapr client type. + public DaprProperties DaprProperties { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadata.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadata.Serialization.cs new file mode 100644 index 000000000000..657ed6ff11dd --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadata.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class DaprMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprMetadata)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(SecretRef)) + { + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Required)) + { + writer.WritePropertyName("required"u8); + writer.WriteStringValue(Required.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprMetadata(document.RootElement, options); + } + + internal static DaprMetadata DeserializeDaprMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + string secretRef = default; + string description = default; + DaprMetadataRequired? required = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("required"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + required = new DaprMetadataRequired(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprMetadata( + name, + value, + secretRef, + description, + required, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(DaprMetadata)} does not support writing '{options.Format}' format."); + } + } + + DaprMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadata.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadata.cs new file mode 100644 index 000000000000..03a8a299b65a --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadata.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The dapr component metadata. + public partial class DaprMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprMetadata() + { + } + + /// Initializes a new instance of . + /// Metadata property name. + /// Metadata property value. + /// The secret name where dapr could get value. + /// The description of the metadata, returned from configuration api. + /// The value indicating whether the metadata is required or not. + /// Keeps track of any properties unknown to the library. + internal DaprMetadata(string name, string value, string secretRef, string description, DaprMetadataRequired? required, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + SecretRef = secretRef; + Description = description; + Required = required; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Metadata property name. + public string Name { get; set; } + /// Metadata property value. + public string Value { get; set; } + /// The secret name where dapr could get value. + public string SecretRef { get; set; } + /// The description of the metadata, returned from configuration api. + public string Description { get; set; } + /// The value indicating whether the metadata is required or not. + public DaprMetadataRequired? Required { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadataRequired.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadataRequired.cs new file mode 100644 index 000000000000..47181816501c --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprMetadataRequired.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The value indicating whether the metadata is required or not. + public readonly partial struct DaprMetadataRequired : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DaprMetadataRequired(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrueValue = "true"; + private const string FalseValue = "false"; + + /// true. + public static DaprMetadataRequired True { get; } = new DaprMetadataRequired(TrueValue); + /// false. + public static DaprMetadataRequired False { get; } = new DaprMetadataRequired(FalseValue); + /// Determines if two values are the same. + public static bool operator ==(DaprMetadataRequired left, DaprMetadataRequired right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DaprMetadataRequired left, DaprMetadataRequired right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DaprMetadataRequired(string value) => new DaprMetadataRequired(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DaprMetadataRequired other && Equals(other); + /// + public bool Equals(DaprMetadataRequired other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprProperties.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprProperties.Serialization.cs new file mode 100644 index 000000000000..0145f50de130 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprProperties.Serialization.cs @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class DaprProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Version)) + { + if (Version != null) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + else + { + writer.WriteNull("version"); + } + } + if (Optional.IsDefined(ComponentType)) + { + if (ComponentType != null) + { + writer.WritePropertyName("componentType"u8); + writer.WriteStringValue(ComponentType); + } + else + { + writer.WriteNull("componentType"); + } + } + if (Optional.IsDefined(SecretStoreComponent)) + { + if (SecretStoreComponent != null) + { + writer.WritePropertyName("secretStoreComponent"u8); + writer.WriteStringValue(SecretStoreComponent); + } + else + { + writer.WriteNull("secretStoreComponent"); + } + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Scopes)) + { + writer.WritePropertyName("scopes"u8); + writer.WriteStartArray(); + foreach (var item in Scopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(RuntimeVersion)) + { + if (RuntimeVersion != null) + { + writer.WritePropertyName("runtimeVersion"u8); + writer.WriteStringValue(RuntimeVersion); + } + else + { + writer.WriteNull("runtimeVersion"); + } + } + if (options.Format != "W" && Optional.IsDefined(BindingComponentDirection)) + { + if (BindingComponentDirection != null) + { + writer.WritePropertyName("bindingComponentDirection"u8); + writer.WriteStringValue(BindingComponentDirection.Value.ToString()); + } + else + { + writer.WriteNull("bindingComponentDirection"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprProperties(document.RootElement, options); + } + + internal static DaprProperties DeserializeDaprProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + string componentType = default; + string secretStoreComponent = default; + IList metadata = default; + IList scopes = default; + string runtimeVersion = default; + DaprBindingComponentDirection? bindingComponentDirection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + version = null; + continue; + } + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("componentType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + componentType = null; + continue; + } + componentType = property.Value.GetString(); + continue; + } + if (property.NameEquals("secretStoreComponent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + secretStoreComponent = null; + continue; + } + secretStoreComponent = property.Value.GetString(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DaprMetadata.DeserializeDaprMetadata(item, options)); + } + metadata = array; + continue; + } + if (property.NameEquals("scopes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scopes = array; + continue; + } + if (property.NameEquals("runtimeVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + runtimeVersion = null; + continue; + } + runtimeVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("bindingComponentDirection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + bindingComponentDirection = null; + continue; + } + bindingComponentDirection = new DaprBindingComponentDirection(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprProperties( + version, + componentType, + secretStoreComponent, + metadata ?? new ChangeTrackingList(), + scopes ?? new ChangeTrackingList(), + runtimeVersion, + bindingComponentDirection, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(DaprProperties)} does not support writing '{options.Format}' format."); + } + } + + DaprProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprProperties.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprProperties.cs new file mode 100644 index 000000000000..8106dd09f895 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DaprProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Indicates some additional properties for dapr client type. + public partial class DaprProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprProperties() + { + Metadata = new ChangeTrackingList(); + Scopes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The dapr component version. + /// The dapr component type. + /// The name of a secret store dapr to retrieve secret. + /// Additional dapr metadata. + /// The dapr component scopes. + /// The runtime version supported by the properties. + /// The direction supported by the dapr binding component. + /// Keeps track of any properties unknown to the library. + internal DaprProperties(string version, string componentType, string secretStoreComponent, IList metadata, IList scopes, string runtimeVersion, DaprBindingComponentDirection? bindingComponentDirection, IDictionary serializedAdditionalRawData) + { + Version = version; + ComponentType = componentType; + SecretStoreComponent = secretStoreComponent; + Metadata = metadata; + Scopes = scopes; + RuntimeVersion = runtimeVersion; + BindingComponentDirection = bindingComponentDirection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The dapr component version. + public string Version { get; set; } + /// The dapr component type. + public string ComponentType { get; set; } + /// The name of a secret store dapr to retrieve secret. + public string SecretStoreComponent { get; set; } + /// Additional dapr metadata. + public IList Metadata { get; } + /// The dapr component scopes. + public IList Scopes { get; } + /// The runtime version supported by the properties. + public string RuntimeVersion { get; } + /// The direction supported by the dapr binding component. + public DaprBindingComponentDirection? BindingComponentDirection { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunActionName.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunActionName.cs new file mode 100644 index 000000000000..d537bf3803ea --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunActionName.cs @@ -0,0 +1,48 @@ +// 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 name of action for you dryrun job. + internal readonly partial struct DryrunActionName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DryrunActionName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreateOrUpdateValue = "createOrUpdate"; + + /// createOrUpdate. + public static DryrunActionName CreateOrUpdate { get; } = new DryrunActionName(CreateOrUpdateValue); + /// Determines if two values are the same. + public static bool operator ==(DryrunActionName left, DryrunActionName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DryrunActionName left, DryrunActionName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DryrunActionName(string value) => new DryrunActionName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DryrunActionName other && Equals(other); + /// + public bool Equals(DryrunActionName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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/DryrunList.Serialization.cs similarity index 73% rename from sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs rename to sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunList.Serialization.cs index 28f69ea4c1eb..3f32c3243c71 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunList.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ServiceLinker.Models { - internal partial class LinkerList : IUtf8JsonSerializable, IJsonModel + internal partial class DryrunList : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,34 +28,34 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LinkerList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DryrunList)} does not support writing '{format}' format."); } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(NextLink)) { if (NextLink != null) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } else { writer.WriteNull("nextLink"); } } - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -73,19 +73,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - LinkerList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DryrunList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LinkerList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DryrunList)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLinkerList(document.RootElement, options); + return DeserializeDryrunList(document.RootElement, options); } - internal static LinkerList DeserializeLinkerList(JsonElement element, ModelReaderWriterOptions options = null) + internal static DryrunList DeserializeDryrunList(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,34 +93,34 @@ internal static LinkerList DeserializeLinkerList(JsonElement element, ModelReade { return null; } - string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("nextLink"u8)) + if (property.NameEquals("value"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - nextLink = null; continue; } - nextLink = property.Value.GetString(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(item, options)); + } + value = array; continue; } - if (property.NameEquals("value"u8)) + if (property.NameEquals("nextLink"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + nextLink = null; continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(LinkerResourceData.DeserializeLinkerResourceData(item, options)); - } - value = array; + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -129,38 +129,38 @@ internal static LinkerList DeserializeLinkerList(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new LinkerList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new DryrunList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); default: - throw new FormatException($"The model {nameof(LinkerList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DryrunList)} does not support writing '{options.Format}' format."); } } - LinkerList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DryrunList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeLinkerList(document.RootElement, options); + return DeserializeDryrunList(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LinkerList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DryrunList)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunList.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunList.cs new file mode 100644 index 000000000000..49ef897f7a8c --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunList.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The list of dryrun. + internal partial class DryrunList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DryrunList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The DryrunResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DryrunList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The DryrunResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunOperationPreview.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunOperationPreview.Serialization.cs new file mode 100644 index 000000000000..786ffa0e9080 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunOperationPreview.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class DryrunOperationPreview : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DryrunOperationPreview)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(OperationType)) + { + writer.WritePropertyName("operationType"u8); + writer.WriteStringValue(OperationType.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action); + } + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DryrunOperationPreview IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DryrunOperationPreview)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDryrunOperationPreview(document.RootElement, options); + } + + internal static DryrunOperationPreview DeserializeDryrunOperationPreview(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + DryrunPreviewOperationType? operationType = default; + string description = default; + string action = default; + string scope = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationType = new DryrunPreviewOperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("action"u8)) + { + action = property.Value.GetString(); + continue; + } + if (property.NameEquals("scope"u8)) + { + scope = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DryrunOperationPreview( + name, + operationType, + description, + action, + scope, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(DryrunOperationPreview)} does not support writing '{options.Format}' format."); + } + } + + DryrunOperationPreview IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDryrunOperationPreview(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DryrunOperationPreview)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunOperationPreview.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunOperationPreview.cs new file mode 100644 index 000000000000..a696fed12951 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunOperationPreview.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The preview of the operations for creation. + public partial class DryrunOperationPreview + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DryrunOperationPreview() + { + } + + /// Initializes a new instance of . + /// The operation name. + /// The operation type. + /// The description of the operation. + /// The action defined by RBAC, refer https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format. + /// The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview. + /// Keeps track of any properties unknown to the library. + internal DryrunOperationPreview(string name, DryrunPreviewOperationType? operationType, string description, string action, string scope, IDictionary serializedAdditionalRawData) + { + Name = name; + OperationType = operationType; + Description = description; + Action = action; + Scope = scope; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The operation name. + public string Name { get; } + /// The operation type. + public DryrunPreviewOperationType? OperationType { get; } + /// The description of the operation. + public string Description { get; } + /// The action defined by RBAC, refer https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format. + public string Action { get; } + /// The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview. + public string Scope { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResult.Serialization.cs new file mode 100644 index 000000000000..3d501cbcdcfc --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResult.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + [PersistableModelProxy(typeof(UnknownDryrunPrerequisiteResult))] + public partial class DryrunPrerequisiteResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResultType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DryrunPrerequisiteResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDryrunPrerequisiteResult(document.RootElement, options); + } + + internal static DryrunPrerequisiteResult DeserializeDryrunPrerequisiteResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "basicError": return BasicErrorDryrunPrerequisiteResult.DeserializeBasicErrorDryrunPrerequisiteResult(element, options); + case "permissionsMissing": return PermissionsMissingDryrunPrerequisiteResult.DeserializePermissionsMissingDryrunPrerequisiteResult(element, options); + } + } + return UnknownDryrunPrerequisiteResult.DeserializeUnknownDryrunPrerequisiteResult(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support writing '{options.Format}' format."); + } + } + + DryrunPrerequisiteResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDryrunPrerequisiteResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResult.cs new file mode 100644 index 000000000000..737206611b2e --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// + /// A result of dryrun + /// 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 DryrunPrerequisiteResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DryrunPrerequisiteResult() + { + } + + /// Initializes a new instance of . + /// The type of dryrun result. + /// Keeps track of any properties unknown to the library. + internal DryrunPrerequisiteResult(DryrunPrerequisiteResultType resultType, IDictionary serializedAdditionalRawData) + { + ResultType = resultType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of dryrun result. + internal DryrunPrerequisiteResultType ResultType { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResultType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResultType.cs new file mode 100644 index 000000000000..9f8b996e500c --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPrerequisiteResultType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The type of dryrun result. + internal readonly partial struct DryrunPrerequisiteResultType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DryrunPrerequisiteResultType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BasicErrorValue = "basicError"; + private const string PermissionsMissingValue = "permissionsMissing"; + + /// basicError. + public static DryrunPrerequisiteResultType BasicError { get; } = new DryrunPrerequisiteResultType(BasicErrorValue); + /// permissionsMissing. + public static DryrunPrerequisiteResultType PermissionsMissing { get; } = new DryrunPrerequisiteResultType(PermissionsMissingValue); + /// Determines if two values are the same. + public static bool operator ==(DryrunPrerequisiteResultType left, DryrunPrerequisiteResultType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DryrunPrerequisiteResultType left, DryrunPrerequisiteResultType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DryrunPrerequisiteResultType(string value) => new DryrunPrerequisiteResultType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DryrunPrerequisiteResultType other && Equals(other); + /// + public bool Equals(DryrunPrerequisiteResultType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPreviewOperationType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPreviewOperationType.cs new file mode 100644 index 000000000000..d347ddbe018d --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/DryrunPreviewOperationType.cs @@ -0,0 +1,54 @@ +// 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 operation type. + public readonly partial struct DryrunPreviewOperationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DryrunPreviewOperationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConfigConnectionValue = "configConnection"; + private const string ConfigNetworkValue = "configNetwork"; + private const string ConfigAuthValue = "configAuth"; + + /// configConnection. + public static DryrunPreviewOperationType ConfigConnection { get; } = new DryrunPreviewOperationType(ConfigConnectionValue); + /// configNetwork. + public static DryrunPreviewOperationType ConfigNetwork { get; } = new DryrunPreviewOperationType(ConfigNetworkValue); + /// configAuth. + public static DryrunPreviewOperationType ConfigAuth { get; } = new DryrunPreviewOperationType(ConfigAuthValue); + /// Determines if two values are the same. + public static bool operator ==(DryrunPreviewOperationType left, DryrunPreviewOperationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DryrunPreviewOperationType left, DryrunPreviewOperationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DryrunPreviewOperationType(string value) => new DryrunPreviewOperationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DryrunPreviewOperationType other && Equals(other); + /// + public bool Equals(DryrunPreviewOperationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/EasyAuthMicrosoftEntraIdAuthInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/EasyAuthMicrosoftEntraIdAuthInfo.Serialization.cs new file mode 100644 index 000000000000..88dce0d9089d --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/EasyAuthMicrosoftEntraIdAuthInfo.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class EasyAuthMicrosoftEntraIdAuthInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EasyAuthMicrosoftEntraIdAuthInfo)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(Secret)) + { + writer.WritePropertyName("secret"u8); + writer.WriteStringValue(Secret); + } + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + } + + EasyAuthMicrosoftEntraIdAuthInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EasyAuthMicrosoftEntraIdAuthInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEasyAuthMicrosoftEntraIdAuthInfo(document.RootElement, options); + } + + internal static EasyAuthMicrosoftEntraIdAuthInfo DeserializeEasyAuthMicrosoftEntraIdAuthInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clientId = default; + string secret = default; + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("secret"u8)) + { + secret = property.Value.GetString(); + continue; + } + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new LinkerAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EasyAuthMicrosoftEntraIdAuthInfo( + authType, + authMode, + serializedAdditionalRawData, + clientId, + secret, + deleteOrUpdateBehavior); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(EasyAuthMicrosoftEntraIdAuthInfo)} does not support writing '{options.Format}' format."); + } + } + + EasyAuthMicrosoftEntraIdAuthInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEasyAuthMicrosoftEntraIdAuthInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EasyAuthMicrosoftEntraIdAuthInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/EasyAuthMicrosoftEntraIdAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/EasyAuthMicrosoftEntraIdAuthInfo.cs new file mode 100644 index 000000000000..89b99047e9ed --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/EasyAuthMicrosoftEntraIdAuthInfo.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The authentication info when authType is EasyAuth Microsoft Entra ID. + public partial class EasyAuthMicrosoftEntraIdAuthInfo : AuthBaseInfo + { + /// Initializes a new instance of . + public EasyAuthMicrosoftEntraIdAuthInfo() + { + AuthType = LinkerAuthType.EasyAuthMicrosoftEntraId; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. + /// Keeps track of any properties unknown to the library. + /// Application clientId for EasyAuth Microsoft Entra ID. + /// Application Secret for EasyAuth Microsoft Entra ID. + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + internal EasyAuthMicrosoftEntraIdAuthInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, string clientId, string secret, LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior) : base(authType, authMode, serializedAdditionalRawData) + { + ClientId = clientId; + Secret = secret; + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + AuthType = authType; + } + + /// Application clientId for EasyAuth Microsoft Entra ID. + public string ClientId { get; set; } + /// Application Secret for EasyAuth Microsoft Entra ID. + public string Secret { get; set; } + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { 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 index e7cf966adfc8..0e4e8dc2e1a2 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerAuthType.cs @@ -27,6 +27,9 @@ public LinkerAuthType(string value) private const string ServicePrincipalSecretValue = "servicePrincipalSecret"; private const string ServicePrincipalCertificateValue = "servicePrincipalCertificate"; private const string SecretValue = "secret"; + private const string AccessKeyValue = "accessKey"; + private const string UserAccountValue = "userAccount"; + private const string EasyAuthMicrosoftEntraIdValue = "easyAuthMicrosoftEntraID"; /// systemAssignedIdentity. public static LinkerAuthType SystemAssignedIdentity { get; } = new LinkerAuthType(SystemAssignedIdentityValue); @@ -38,6 +41,12 @@ public LinkerAuthType(string value) public static LinkerAuthType ServicePrincipalCertificate { get; } = new LinkerAuthType(ServicePrincipalCertificateValue); /// secret. public static LinkerAuthType Secret { get; } = new LinkerAuthType(SecretValue); + /// accessKey. + public static LinkerAuthType AccessKey { get; } = new LinkerAuthType(AccessKeyValue); + /// userAccount. + public static LinkerAuthType UserAccount { get; } = new LinkerAuthType(UserAccountValue); + /// easyAuthMicrosoftEntraID. + public static LinkerAuthType EasyAuthMicrosoftEntraId { get; } = new LinkerAuthType(EasyAuthMicrosoftEntraIdValue); /// 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. diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs index 892157939c47..99c0333483e0 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs @@ -32,6 +32,9 @@ public LinkerClientType(string value) private const string DjangoValue = "django"; private const string NodejsValue = "nodejs"; private const string SpringBootValue = "springBoot"; + private const string KafkaSpringBootValue = "kafka-springBoot"; + private const string JmsSpringBootValue = "jms-springBoot"; + private const string DaprValue = "dapr"; /// none. public static LinkerClientType None { get; } = new LinkerClientType(NoneValue); @@ -53,6 +56,12 @@ public LinkerClientType(string value) public static LinkerClientType Nodejs { get; } = new LinkerClientType(NodejsValue); /// springBoot. public static LinkerClientType SpringBoot { get; } = new LinkerClientType(SpringBootValue); + /// kafka-springBoot. + public static LinkerClientType KafkaSpringBoot { get; } = new LinkerClientType(KafkaSpringBootValue); + /// jms-springBoot. + public static LinkerClientType JmsSpringBoot { get; } = new LinkerClientType(JmsSpringBootValue); + /// dapr. + public static LinkerClientType Dapr { get; } = new LinkerClientType(DaprValue); /// Determines if two values are the same. public static bool operator ==(LinkerClientType left, LinkerClientType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationInfo.Serialization.cs new file mode 100644 index 000000000000..62faf262bdc0 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationInfo.Serialization.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class LinkerConfigurationInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerConfigurationInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (Optional.IsCollectionDefined(CustomizedKeys)) + { + writer.WritePropertyName("customizedKeys"u8); + writer.WriteStartObject(); + foreach (var item in CustomizedKeys) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(DaprProperties)) + { + writer.WritePropertyName("daprProperties"u8); + writer.WriteObjectValue(DaprProperties, options); + } + if (Optional.IsCollectionDefined(AdditionalConfigurations)) + { + writer.WritePropertyName("additionalConfigurations"u8); + writer.WriteStartObject(); + foreach (var item in AdditionalConfigurations) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(AdditionalConnectionStringProperties)) + { + writer.WritePropertyName("additionalConnectionStringProperties"u8); + writer.WriteStartObject(); + foreach (var item in AdditionalConnectionStringProperties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(ConfigurationStore)) + { + if (ConfigurationStore != null) + { + writer.WritePropertyName("configurationStore"u8); + writer.WriteObjectValue(ConfigurationStore, options); + } + else + { + writer.WriteNull("configurationStore"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LinkerConfigurationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerConfigurationInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkerConfigurationInfo(document.RootElement, options); + } + + internal static LinkerConfigurationInfo DeserializeLinkerConfigurationInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + SourceApplicationConfigurationActionType? action = default; + IDictionary customizedKeys = default; + DaprProperties daprProperties = default; + IDictionary additionalConfigurations = default; + IDictionary additionalConnectionStringProperties = default; + ConfigurationStore configurationStore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("action"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + action = new SourceApplicationConfigurationActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("customizedKeys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + customizedKeys = dictionary; + continue; + } + if (property.NameEquals("daprProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daprProperties = DaprProperties.DeserializeDaprProperties(property.Value, options); + continue; + } + if (property.NameEquals("additionalConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + additionalConfigurations = dictionary; + continue; + } + if (property.NameEquals("additionalConnectionStringProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + additionalConnectionStringProperties = dictionary; + continue; + } + if (property.NameEquals("configurationStore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + configurationStore = null; + continue; + } + configurationStore = ConfigurationStore.DeserializeConfigurationStore(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkerConfigurationInfo( + deleteOrUpdateBehavior, + action, + customizedKeys ?? new ChangeTrackingDictionary(), + daprProperties, + additionalConfigurations ?? new ChangeTrackingDictionary(), + additionalConnectionStringProperties ?? new ChangeTrackingDictionary(), + configurationStore, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(LinkerConfigurationInfo)} does not support writing '{options.Format}' format."); + } + } + + LinkerConfigurationInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkerConfigurationInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkerConfigurationInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationInfo.cs new file mode 100644 index 000000000000..7f38c766582b --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationInfo.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The configuration information, used to generate configurations or save to applications. + public partial class LinkerConfigurationInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LinkerConfigurationInfo() + { + CustomizedKeys = new ChangeTrackingDictionary(); + AdditionalConfigurations = new ChangeTrackingDictionary(); + AdditionalConnectionStringProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source. + /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations. + /// Indicates some additional properties for dapr client type. + /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations. + /// A dictionary of additional properties to be added in the end of connection string. + /// An option to store configuration into different place. + /// Keeps track of any properties unknown to the library. + internal LinkerConfigurationInfo(LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, SourceApplicationConfigurationActionType? action, IDictionary customizedKeys, DaprProperties daprProperties, IDictionary additionalConfigurations, IDictionary additionalConnectionStringProperties, ConfigurationStore configurationStore, IDictionary serializedAdditionalRawData) + { + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + Action = action; + CustomizedKeys = customizedKeys; + DaprProperties = daprProperties; + AdditionalConfigurations = additionalConfigurations; + AdditionalConnectionStringProperties = additionalConnectionStringProperties; + ConfigurationStore = configurationStore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source. + public SourceApplicationConfigurationActionType? Action { get; set; } + /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations. + public IDictionary CustomizedKeys { get; } + /// Indicates some additional properties for dapr client type. + public DaprProperties DaprProperties { get; set; } + /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations. + public IDictionary AdditionalConfigurations { get; } + /// A dictionary of additional properties to be added in the end of connection string. + public IDictionary AdditionalConnectionStringProperties { get; } + /// An option to store configuration into different place. + internal ConfigurationStore ConfigurationStore { get; set; } + /// The app configuration id to store configuration. + public string AppConfigurationId + { + get => ConfigurationStore is null ? default : ConfigurationStore.AppConfigurationId; + set + { + if (ConfigurationStore is null) + ConfigurationStore = new ConfigurationStore(); + ConfigurationStore.AppConfigurationId = value; + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationName.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationName.Serialization.cs new file mode 100644 index 000000000000..97c3536b7066 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationName.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class LinkerConfigurationName : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerConfigurationName)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(IsRequired)) + { + writer.WritePropertyName("required"u8); + writer.WriteBooleanValue(IsRequired.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LinkerConfigurationName IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerConfigurationName)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkerConfigurationName(document.RootElement, options); + } + + internal static LinkerConfigurationName DeserializeLinkerConfigurationName(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string value = default; + string description = default; + bool? required = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("required"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + required = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkerConfigurationName(value, description, required, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(LinkerConfigurationName)} does not support writing '{options.Format}' format."); + } + } + + LinkerConfigurationName IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkerConfigurationName(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkerConfigurationName)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationName.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationName.cs new file mode 100644 index 000000000000..e743daeb40b5 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationName.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The configuration names. + public partial class LinkerConfigurationName + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal LinkerConfigurationName() + { + } + + /// Initializes a new instance of . + /// + /// Description for the configuration name. + /// Represent the configuration is required or not. + /// Keeps track of any properties unknown to the library. + internal LinkerConfigurationName(string value, string description, bool? isRequired, IDictionary serializedAdditionalRawData) + { + Value = value; + Description = description; + IsRequired = isRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the value. + public string Value { get; } + /// Description for the configuration name. + public string Description { get; } + /// Represent the configuration is required or not. + public bool? IsRequired { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationNameItem.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationNameItem.Serialization.cs new file mode 100644 index 000000000000..8031597b1503 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationNameItem.Serialization.cs @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class LinkerConfigurationNameItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerConfigurationNameItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(TargetService)) + { + if (TargetService != null) + { + writer.WritePropertyName("targetService"u8); + writer.WriteStringValue(TargetService); + } + else + { + writer.WriteNull("targetService"); + } + } + if (Optional.IsDefined(ClientType)) + { + if (ClientType != null) + { + writer.WritePropertyName("clientType"u8); + writer.WriteStringValue(ClientType.Value.ToString()); + } + else + { + writer.WriteNull("clientType"); + } + } + if (Optional.IsDefined(AuthType)) + { + if (AuthType != null) + { + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.Value.ToString()); + } + else + { + writer.WriteNull("authType"); + } + } + if (Optional.IsDefined(SecretType)) + { + if (SecretType != null) + { + writer.WritePropertyName("secretType"u8); + writer.WriteStringValue(SecretType.Value.ToString()); + } + else + { + writer.WriteNull("secretType"); + } + } + if (Optional.IsDefined(DaprProperties)) + { + if (DaprProperties != null) + { + writer.WritePropertyName("daprProperties"u8); + writer.WriteObjectValue(DaprProperties, options); + } + else + { + writer.WriteNull("daprProperties"); + } + } + if (Optional.IsCollectionDefined(Names)) + { + if (Names != null) + { + writer.WritePropertyName("names"u8); + writer.WriteStartArray(); + foreach (var item in Names) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("names"); + } + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LinkerConfigurationNameItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerConfigurationNameItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkerConfigurationNameItem(document.RootElement, options); + } + + internal static LinkerConfigurationNameItem DeserializeLinkerConfigurationNameItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetService = default; + LinkerClientType? clientType = default; + LinkerAuthType? authType = default; + LinkerKeyVaultSecretSourceType? secretType = default; + DaprProperties daprProperties = default; + IReadOnlyList names = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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) + { + targetService = null; + continue; + } + targetService = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + clientType = null; + continue; + } + clientType = new LinkerClientType(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("secretType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + secretType = null; + continue; + } + secretType = new LinkerKeyVaultSecretSourceType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("daprProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + daprProperties = null; + continue; + } + daprProperties = DaprProperties.DeserializeDaprProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("names"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + names = null; + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(LinkerConfigurationName.DeserializeLinkerConfigurationName(item, options)); + } + names = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkerConfigurationNameItem( + targetService, + clientType, + authType, + secretType, + daprProperties, + names ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(LinkerConfigurationNameItem)} does not support writing '{options.Format}' format."); + } + } + + LinkerConfigurationNameItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkerConfigurationNameItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkerConfigurationNameItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationNameItem.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationNameItem.cs new file mode 100644 index 000000000000..066545453f55 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationNameItem.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The LinkerConfigurationNameItem. + public partial class LinkerConfigurationNameItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal LinkerConfigurationNameItem() + { + Names = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The target service provider name and resource name. + /// The client type for configuration names. + /// The auth type. + /// Indicates where the secrets in configuration from. Used when secrets are from Keyvault. + /// Deprecated, please use #/definitions/DaprConfigurationList instead. + /// The configuration names to be set in compute service environment. + /// Keeps track of any properties unknown to the library. + internal LinkerConfigurationNameItem(string targetService, LinkerClientType? clientType, LinkerAuthType? authType, LinkerKeyVaultSecretSourceType? secretType, DaprProperties daprProperties, IReadOnlyList names, IDictionary serializedAdditionalRawData) + { + TargetService = targetService; + ClientType = clientType; + AuthType = authType; + SecretType = secretType; + DaprProperties = daprProperties; + Names = names; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The target service provider name and resource name. + public string TargetService { get; } + /// The client type for configuration names. + public LinkerClientType? ClientType { get; } + /// The auth type. + public LinkerAuthType? AuthType { get; } + /// Indicates where the secrets in configuration from. Used when secrets are from Keyvault. + public LinkerKeyVaultSecretSourceType? SecretType { get; } + /// Deprecated, please use #/definitions/DaprConfigurationList instead. + public DaprProperties DaprProperties { get; } + /// The configuration names to be set in compute service environment. + public IReadOnlyList Names { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationType.cs new file mode 100644 index 000000000000..5c8865d3ce67 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerConfigurationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Type of configuration to determine whether the configuration can be modified after creation. KeyvaultSecret means the configuration references a key vault secret, such as App Service/ACA key vault reference. Default means the configuration is real value, such as user name, raw secret, etc. + public readonly partial struct LinkerConfigurationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LinkerConfigurationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string KeyVaultSecretValue = "KeyVaultSecret"; + + /// Default. + public static LinkerConfigurationType Default { get; } = new LinkerConfigurationType(DefaultValue); + /// KeyVaultSecret. + public static LinkerConfigurationType KeyVaultSecret { get; } = new LinkerConfigurationType(KeyVaultSecretValue); + /// Determines if two values are the same. + public static bool operator ==(LinkerConfigurationType left, LinkerConfigurationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LinkerConfigurationType left, LinkerConfigurationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LinkerConfigurationType(string value) => new LinkerConfigurationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LinkerConfigurationType other && Equals(other); + /// + public bool Equals(LinkerConfigurationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerDeleteOrUpdateBehavior.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerDeleteOrUpdateBehavior.cs new file mode 100644 index 000000000000..360fda71abd4 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerDeleteOrUpdateBehavior.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The cleanup behavior to indicate whether clean up operation when resource is deleted or updated. + public readonly partial struct LinkerDeleteOrUpdateBehavior : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LinkerDeleteOrUpdateBehavior(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string ForcedCleanupValue = "ForcedCleanup"; + + /// Default. + public static LinkerDeleteOrUpdateBehavior Default { get; } = new LinkerDeleteOrUpdateBehavior(DefaultValue); + /// ForcedCleanup. + public static LinkerDeleteOrUpdateBehavior ForcedCleanup { get; } = new LinkerDeleteOrUpdateBehavior(ForcedCleanupValue); + /// Determines if two values are the same. + public static bool operator ==(LinkerDeleteOrUpdateBehavior left, LinkerDeleteOrUpdateBehavior right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LinkerDeleteOrUpdateBehavior left, LinkerDeleteOrUpdateBehavior right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LinkerDeleteOrUpdateBehavior(string value) => new LinkerDeleteOrUpdateBehavior(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LinkerDeleteOrUpdateBehavior other && Equals(other); + /// + public bool Equals(LinkerDeleteOrUpdateBehavior other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerFirewallRules.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerFirewallRules.Serialization.cs new file mode 100644 index 000000000000..c0141f746637 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerFirewallRules.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class LinkerFirewallRules : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerFirewallRules)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IPRanges)) + { + writer.WritePropertyName("ipRanges"u8); + writer.WriteStartArray(); + foreach (var item in IPRanges) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AzureServices)) + { + writer.WritePropertyName("azureServices"u8); + writer.WriteStringValue(AzureServices.Value.ToString()); + } + if (Optional.IsDefined(CallerClientIP)) + { + writer.WritePropertyName("callerClientIP"u8); + writer.WriteStringValue(CallerClientIP.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LinkerFirewallRules IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerFirewallRules)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkerFirewallRules(document.RootElement, options); + } + + internal static LinkerFirewallRules DeserializeLinkerFirewallRules(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ipRanges = default; + LinkerTargetServiceFirewallRulesAllowType? azureServices = default; + LinkerTargetServiceFirewallRulesAllowType? callerClientIP = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipRanges"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipRanges = array; + continue; + } + if (property.NameEquals("azureServices"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureServices = new LinkerTargetServiceFirewallRulesAllowType(property.Value.GetString()); + continue; + } + if (property.NameEquals("callerClientIP"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + callerClientIP = new LinkerTargetServiceFirewallRulesAllowType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkerFirewallRules(ipRanges ?? new ChangeTrackingList(), azureServices, callerClientIP, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(LinkerFirewallRules)} does not support writing '{options.Format}' format."); + } + } + + LinkerFirewallRules IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkerFirewallRules(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkerFirewallRules)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerFirewallRules.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerFirewallRules.cs new file mode 100644 index 000000000000..d5822d054a45 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerFirewallRules.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Target service's firewall rules. to allow connections from source service. + public partial class LinkerFirewallRules + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LinkerFirewallRules() + { + IPRanges = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. + /// Allow Azure services to access the target service if true. + /// Allow caller client IP to access the target service if true. the property is used when connecting local application to target service. + /// Keeps track of any properties unknown to the library. + internal LinkerFirewallRules(IList ipRanges, LinkerTargetServiceFirewallRulesAllowType? azureServices, LinkerTargetServiceFirewallRulesAllowType? callerClientIP, IDictionary serializedAdditionalRawData) + { + IPRanges = ipRanges; + AzureServices = azureServices; + CallerClientIP = callerClientIP; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. + public IList IPRanges { get; } + /// Allow Azure services to access the target service if true. + public LinkerTargetServiceFirewallRulesAllowType? AzureServices { get; set; } + /// Allow caller client IP to access the target service if true. the property is used when connecting local application to target service. + public LinkerTargetServiceFirewallRulesAllowType? CallerClientIP { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerKeyVaultSecretSourceType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerKeyVaultSecretSourceType.cs new file mode 100644 index 000000000000..5f09dc50001a --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerKeyVaultSecretSourceType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The type of secret source. + public readonly partial struct LinkerKeyVaultSecretSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LinkerKeyVaultSecretSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RawValueValue = "rawValue"; + private const string KeyVaultSecretValue = "keyVaultSecret"; + + /// rawValue. + public static LinkerKeyVaultSecretSourceType RawValue { get; } = new LinkerKeyVaultSecretSourceType(RawValueValue); + /// keyVaultSecret. + public static LinkerKeyVaultSecretSourceType KeyVaultSecret { get; } = new LinkerKeyVaultSecretSourceType(KeyVaultSecretValue); + /// Determines if two values are the same. + public static bool operator ==(LinkerKeyVaultSecretSourceType left, LinkerKeyVaultSecretSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LinkerKeyVaultSecretSourceType left, LinkerKeyVaultSecretSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LinkerKeyVaultSecretSourceType(string value) => new LinkerKeyVaultSecretSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LinkerKeyVaultSecretSourceType other && Equals(other); + /// + public bool Equals(LinkerKeyVaultSecretSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerPublicNetworkSolution.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerPublicNetworkSolution.Serialization.cs new file mode 100644 index 000000000000..66de85e0b1ac --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerPublicNetworkSolution.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class LinkerPublicNetworkSolution : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerPublicNetworkSolution)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (Optional.IsDefined(FirewallRules)) + { + writer.WritePropertyName("firewallRules"u8); + writer.WriteObjectValue(FirewallRules, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LinkerPublicNetworkSolution IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerPublicNetworkSolution)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkerPublicNetworkSolution(document.RootElement, options); + } + + internal static LinkerPublicNetworkSolution DeserializeLinkerPublicNetworkSolution(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + SourceApplicationConfigurationActionType? action = default; + LinkerFirewallRules firewallRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("action"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + action = new SourceApplicationConfigurationActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("firewallRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firewallRules = LinkerFirewallRules.DeserializeLinkerFirewallRules(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkerPublicNetworkSolution(deleteOrUpdateBehavior, action, firewallRules, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(LinkerPublicNetworkSolution)} does not support writing '{options.Format}' format."); + } + } + + LinkerPublicNetworkSolution IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkerPublicNetworkSolution(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkerPublicNetworkSolution)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerPublicNetworkSolution.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerPublicNetworkSolution.cs new file mode 100644 index 000000000000..b93650c503b8 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerPublicNetworkSolution.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Indicates public network solution, include firewall rules. + public partial class LinkerPublicNetworkSolution + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LinkerPublicNetworkSolution() + { + } + + /// Initializes a new instance of . + /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting. + /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration. + /// Describe firewall rules of target service to make sure source application could connect to the target. + /// Keeps track of any properties unknown to the library. + internal LinkerPublicNetworkSolution(LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, SourceApplicationConfigurationActionType? action, LinkerFirewallRules firewallRules, IDictionary serializedAdditionalRawData) + { + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + Action = action; + FirewallRules = firewallRules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration. + public SourceApplicationConfigurationActionType? Action { get; set; } + /// Describe firewall rules of target service to make sure source application could connect to the target. + public LinkerFirewallRules FirewallRules { get; set; } + } +} 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 index f4db2a1362ff..b1b4eb4332ad 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs @@ -92,6 +92,30 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("scope"); } } + if (Optional.IsDefined(PublicNetworkSolution)) + { + if (PublicNetworkSolution != null) + { + writer.WritePropertyName("publicNetworkSolution"u8); + writer.WriteObjectValue(PublicNetworkSolution, options); + } + else + { + writer.WriteNull("publicNetworkSolution"); + } + } + if (Optional.IsDefined(ConfigurationInfo)) + { + if (ConfigurationInfo != null) + { + writer.WritePropertyName("configurationInfo"u8); + writer.WriteObjectValue(ConfigurationInfo, options); + } + else + { + writer.WriteNull("configurationInfo"); + } + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -137,6 +161,8 @@ internal static LinkerResourcePatch DeserializeLinkerResourcePatch(JsonElement e VnetSolution vnetSolution = default; LinkerSecretStore secretStore = default; string scope = default; + LinkerPublicNetworkSolution publicNetworkSolution = default; + LinkerConfigurationInfo configurationInfo = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -212,6 +238,26 @@ internal static LinkerResourcePatch DeserializeLinkerResourcePatch(JsonElement e scope = property0.Value.GetString(); continue; } + if (property0.NameEquals("publicNetworkSolution"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + publicNetworkSolution = null; + continue; + } + publicNetworkSolution = LinkerPublicNetworkSolution.DeserializeLinkerPublicNetworkSolution(property0.Value, options); + continue; + } + if (property0.NameEquals("configurationInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + configurationInfo = null; + continue; + } + configurationInfo = LinkerConfigurationInfo.DeserializeLinkerConfigurationInfo(property0.Value, options); + continue; + } } continue; } @@ -229,6 +275,8 @@ internal static LinkerResourcePatch DeserializeLinkerResourcePatch(JsonElement e vnetSolution, secretStore, scope, + publicNetworkSolution, + configurationInfo, serializedAdditionalRawData); } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs index 34b1d74da55b..907c0fcaae58 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs @@ -7,11 +7,10 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ServiceLinker.Models { - /// A linker to be updated. + /// A Linker to be updated. public partial class LinkerResourcePatch { /// @@ -55,20 +54,22 @@ 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 . + /// 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 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. + /// The network solution. + /// The connection information consumed by applications, including secrets, connection strings. /// Keeps track of any properties unknown to the library. - internal LinkerResourcePatch(TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolution vnetSolution, LinkerSecretStore secretStore, string scope, IDictionary serializedAdditionalRawData) + internal LinkerResourcePatch(TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolution vnetSolution, LinkerSecretStore secretStore, string scope, LinkerPublicNetworkSolution publicNetworkSolution, LinkerConfigurationInfo configurationInfo, IDictionary serializedAdditionalRawData) { TargetService = targetService; AuthInfo = authInfo; @@ -77,19 +78,21 @@ internal LinkerResourcePatch(TargetServiceBaseInfo targetService, AuthBaseInfo a VnetSolution = vnetSolution; SecretStore = secretStore; Scope = scope; + PublicNetworkSolution = publicNetworkSolution; + ConfigurationInfo = configurationInfo; _serializedAdditionalRawData = serializedAdditionalRawData; } /// /// 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 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 . + /// The available derived classes include , , , , , , and . /// public AuthBaseInfo AuthInfo { get; set; } /// The application client type. @@ -97,34 +100,14 @@ internal LinkerResourcePatch(TargetServiceBaseInfo targetService, AuthBaseInfo a /// 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; - } - } - + public VnetSolution VnetSolution { get; set; } /// 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; - } - } - + public LinkerSecretStore SecretStore { get; set; } /// connection scope in source service. public string Scope { get; set; } + /// The network solution. + public LinkerPublicNetworkSolution PublicNetworkSolution { get; set; } + /// The connection information consumed by applications, including secrets, connection strings. + public LinkerConfigurationInfo ConfigurationInfo { 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 index b8d49bd82a33..a7556372b4ea 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { - internal partial class LinkerSecretStore : IUtf8JsonSerializable, IJsonModel + public partial class LinkerSecretStore : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -46,6 +46,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("keyVaultId"); } } + if (Optional.IsDefined(KeyVaultSecretName)) + { + if (KeyVaultSecretName != null) + { + writer.WritePropertyName("keyVaultSecretName"u8); + writer.WriteStringValue(KeyVaultSecretName); + } + else + { + writer.WriteNull("keyVaultSecretName"); + } + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -84,6 +96,7 @@ internal static LinkerSecretStore DeserializeLinkerSecretStore(JsonElement eleme return null; } ResourceIdentifier keyVaultId = default; + string keyVaultSecretName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -98,13 +111,23 @@ internal static LinkerSecretStore DeserializeLinkerSecretStore(JsonElement eleme keyVaultId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("keyVaultSecretName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + keyVaultSecretName = null; + continue; + } + keyVaultSecretName = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new LinkerSecretStore(keyVaultId, serializedAdditionalRawData); + return new LinkerSecretStore(keyVaultId, keyVaultSecretName, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs index 3ffff2e53c63..bc1f1eb6f1f8 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { /// An option to store secret value in secure place. - internal partial class LinkerSecretStore + public partial class LinkerSecretStore { /// /// Keeps track of any properties unknown to the library. @@ -53,14 +53,18 @@ public LinkerSecretStore() /// Initializes a new instance of . /// The key vault id to store secret. + /// The key vault secret name to store secret, only valid when storing one secret. /// Keeps track of any properties unknown to the library. - internal LinkerSecretStore(ResourceIdentifier keyVaultId, IDictionary serializedAdditionalRawData) + internal LinkerSecretStore(ResourceIdentifier keyVaultId, string keyVaultSecretName, IDictionary serializedAdditionalRawData) { KeyVaultId = keyVaultId; + KeyVaultSecretName = keyVaultSecretName; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The key vault id to store secret. public ResourceIdentifier KeyVaultId { get; set; } + /// The key vault secret name to store secret, only valid when storing one secret. + public string KeyVaultSecretName { get; set; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetFabricPlatform.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetFabricPlatform.Serialization.cs new file mode 100644 index 000000000000..a9ed00f6c301 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetFabricPlatform.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class LinkerTargetFabricPlatform : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerTargetFabricPlatform)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Endpoint)) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + } + } + + LinkerTargetFabricPlatform IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerTargetFabricPlatform)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkerTargetFabricPlatform(document.RootElement, options); + } + + internal static LinkerTargetFabricPlatform DeserializeLinkerTargetFabricPlatform(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpoint = default; + TargetServiceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkerTargetFabricPlatform(type, serializedAdditionalRawData, endpoint); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(LinkerTargetFabricPlatform)} does not support writing '{options.Format}' format."); + } + } + + LinkerTargetFabricPlatform IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkerTargetFabricPlatform(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkerTargetFabricPlatform)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetFabricPlatform.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetFabricPlatform.cs new file mode 100644 index 000000000000..f13239663e14 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetFabricPlatform.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The service properties when target service type is FabricPlatform. + public partial class LinkerTargetFabricPlatform : TargetServiceBaseInfo + { + /// Initializes a new instance of . + public LinkerTargetFabricPlatform() + { + TargetServiceType = TargetServiceType.FabricPlatform; + } + + /// Initializes a new instance of . + /// The target service type. + /// Keeps track of any properties unknown to the library. + /// The endpoint of service. + internal LinkerTargetFabricPlatform(TargetServiceType targetServiceType, IDictionary serializedAdditionalRawData, string endpoint) : base(targetServiceType, serializedAdditionalRawData) + { + Endpoint = endpoint; + TargetServiceType = targetServiceType; + } + + /// The endpoint of service. + public string Endpoint { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetServiceFirewallRulesAllowType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetServiceFirewallRulesAllowType.cs new file mode 100644 index 000000000000..bbd27c9ac68e --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerTargetServiceFirewallRulesAllowType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Whether to allow firewall rules. + public readonly partial struct LinkerTargetServiceFirewallRulesAllowType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LinkerTargetServiceFirewallRulesAllowType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrueValue = "true"; + private const string FalseValue = "false"; + + /// true. + public static LinkerTargetServiceFirewallRulesAllowType True { get; } = new LinkerTargetServiceFirewallRulesAllowType(TrueValue); + /// false. + public static LinkerTargetServiceFirewallRulesAllowType False { get; } = new LinkerTargetServiceFirewallRulesAllowType(FalseValue); + /// Determines if two values are the same. + public static bool operator ==(LinkerTargetServiceFirewallRulesAllowType left, LinkerTargetServiceFirewallRulesAllowType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LinkerTargetServiceFirewallRulesAllowType left, LinkerTargetServiceFirewallRulesAllowType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LinkerTargetServiceFirewallRulesAllowType(string value) => new LinkerTargetServiceFirewallRulesAllowType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LinkerTargetServiceFirewallRulesAllowType other && Equals(other); + /// + public bool Equals(LinkerTargetServiceFirewallRulesAllowType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerUserAccountAuthInfo.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerUserAccountAuthInfo.Serialization.cs new file mode 100644 index 000000000000..9b0a7de968f9 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerUserAccountAuthInfo.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class LinkerUserAccountAuthInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerUserAccountAuthInfo)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(UserName)) + { + if (UserName != null) + { + writer.WritePropertyName("userName"u8); + writer.WriteStringValue(UserName); + } + else + { + writer.WriteNull("userName"); + } + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + LinkerUserAccountAuthInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkerUserAccountAuthInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkerUserAccountAuthInfo(document.RootElement, options); + } + + internal static LinkerUserAccountAuthInfo DeserializeLinkerUserAccountAuthInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string userName = default; + Guid? principalId = default; + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + IList roles = default; + LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("userName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userName = null; + continue; + } + userName = property.Value.GetString(); + continue; + } + if (property.NameEquals("principalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + roles = array; + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new LinkerAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkerUserAccountAuthInfo( + authType, + authMode, + serializedAdditionalRawData, + userName, + principalId, + deleteOrUpdateBehavior, + roles ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(LinkerUserAccountAuthInfo)} does not support writing '{options.Format}' format."); + } + } + + LinkerUserAccountAuthInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkerUserAccountAuthInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkerUserAccountAuthInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerUserAccountAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerUserAccountAuthInfo.cs new file mode 100644 index 000000000000..370935d34871 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerUserAccountAuthInfo.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The authentication info when authType is user account. + public partial class LinkerUserAccountAuthInfo : AuthBaseInfo + { + /// Initializes a new instance of . + public LinkerUserAccountAuthInfo() + { + Roles = new ChangeTrackingList(); + AuthType = LinkerAuthType.UserAccount; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. + /// Keeps track of any properties unknown to the library. + /// Username created in the database which is mapped to a user in AAD. + /// Principal Id for user account. + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + /// Optional, this value specifies the Azure roles to be assigned. Automatically. + internal LinkerUserAccountAuthInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, string userName, Guid? principalId, LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, IList roles) : base(authType, authMode, serializedAdditionalRawData) + { + UserName = userName; + PrincipalId = principalId; + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + Roles = roles; + AuthType = authType; + } + + /// Username created in the database which is mapped to a user in AAD. + public string UserName { get; set; } + /// Principal Id for user account. + public Guid? PrincipalId { get; set; } + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + /// Optional, this value specifies the Azure roles to be assigned. Automatically. + public IList Roles { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.cs index b0abe0b61df4..8a58fc721a11 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidateOperationResult.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { - /// The validation operation result for a linker. + /// The validation operation result for a Linker. public partial class LinkerValidateOperationResult { /// @@ -53,13 +53,13 @@ internal LinkerValidateOperationResult() } /// Initializes a new instance of . - /// Validated linker id. + /// 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 the Linker source application. /// The resource Id of target service. /// The authentication type. /// The detail of validation result. @@ -79,7 +79,7 @@ internal LinkerValidateOperationResult(ResourceIdentifier resourceId, string sta _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Validated linker id. + /// Validated Linker id. public ResourceIdentifier ResourceId { get; } /// Validation operation status. public string Status { get; } @@ -91,7 +91,7 @@ internal LinkerValidateOperationResult(ResourceIdentifier resourceId, string sta public DateTimeOffset? ReportStartOn { get; } /// The end time of the validation report. public DateTimeOffset? ReportEndOn { get; } - /// The resource id of the linker source application. + /// The resource id of the Linker source application. public ResourceIdentifier SourceId { get; } /// The resource Id of target service. public ResourceIdentifier TargetId { get; } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.cs index e7c102f9fc3c..ffcf0cf5b852 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerValidationResultItemInfo.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { - /// The validation item for a linker. + /// The validation item for a Linker. public partial class LinkerValidationResultItemInfo { /// diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/PermissionsMissingDryrunPrerequisiteResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/PermissionsMissingDryrunPrerequisiteResult.Serialization.cs new file mode 100644 index 000000000000..ddfe2393e9dc --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/PermissionsMissingDryrunPrerequisiteResult.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class PermissionsMissingDryrunPrerequisiteResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PermissionsMissingDryrunPrerequisiteResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RecommendedRole)) + { + writer.WritePropertyName("recommendedRole"u8); + writer.WriteStringValue(RecommendedRole); + } + } + + PermissionsMissingDryrunPrerequisiteResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PermissionsMissingDryrunPrerequisiteResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePermissionsMissingDryrunPrerequisiteResult(document.RootElement, options); + } + + internal static PermissionsMissingDryrunPrerequisiteResult DeserializePermissionsMissingDryrunPrerequisiteResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string scope = default; + IReadOnlyList permissions = default; + string recommendedRole = default; + DryrunPrerequisiteResultType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scope"u8)) + { + scope = property.Value.GetString(); + continue; + } + if (property.NameEquals("permissions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + permissions = array; + continue; + } + if (property.NameEquals("recommendedRole"u8)) + { + recommendedRole = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new DryrunPrerequisiteResultType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PermissionsMissingDryrunPrerequisiteResult(type, serializedAdditionalRawData, scope, permissions ?? new ChangeTrackingList(), recommendedRole); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(PermissionsMissingDryrunPrerequisiteResult)} does not support writing '{options.Format}' format."); + } + } + + PermissionsMissingDryrunPrerequisiteResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePermissionsMissingDryrunPrerequisiteResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PermissionsMissingDryrunPrerequisiteResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/PermissionsMissingDryrunPrerequisiteResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/PermissionsMissingDryrunPrerequisiteResult.cs new file mode 100644 index 000000000000..1dc8ce481022 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/PermissionsMissingDryrunPrerequisiteResult.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The represent of missing permissions. + public partial class PermissionsMissingDryrunPrerequisiteResult : DryrunPrerequisiteResult + { + /// Initializes a new instance of . + internal PermissionsMissingDryrunPrerequisiteResult() + { + Permissions = new ChangeTrackingList(); + ResultType = DryrunPrerequisiteResultType.PermissionsMissing; + } + + /// Initializes a new instance of . + /// The type of dryrun result. + /// Keeps track of any properties unknown to the library. + /// The permission scope. + /// The permission list. + /// The recommended role to resolve permissions missing. + internal PermissionsMissingDryrunPrerequisiteResult(DryrunPrerequisiteResultType resultType, IDictionary serializedAdditionalRawData, string scope, IReadOnlyList permissions, string recommendedRole) : base(resultType, serializedAdditionalRawData) + { + Scope = scope; + Permissions = permissions; + RecommendedRole = recommendedRole; + ResultType = resultType; + } + + /// The permission scope. + public string Scope { get; } + /// The permission list. + public IReadOnlyList Permissions { get; } + /// The recommended role to resolve permissions missing. + public string RecommendedRole { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ResourceList.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ResourceList.Serialization.cs new file mode 100644 index 000000000000..b2879d75749c --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ResourceList.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + internal partial class ResourceList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + if (NextLink != null) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + else + { + writer.WriteNull("nextLink"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResourceList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceList(document.RootElement, options); + } + + internal static ResourceList DeserializeResourceList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LinkerResourceData.DeserializeLinkerResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + nextLink = null; + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ResourceList)} does not support writing '{options.Format}' format."); + } + } + + ResourceList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ResourceList.cs similarity index 73% rename from sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs rename to sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ResourceList.cs index 03dbf27871a4..be2b50a3b2c3 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ResourceList.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { /// The list of Linker. - internal partial class LinkerList + internal partial class ResourceList { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,26 @@ internal partial class LinkerList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal LinkerList() + /// Initializes a new instance of . + internal ResourceList() { Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The link used to get the next page of Linker list. - /// The list of Linkers. + /// Initializes a new instance of . + /// The LinkerResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal LinkerList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal ResourceList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - NextLink = nextLink; Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link used to get the next page of Linker list. - public string NextLink { get; } - /// The list of Linkers. + /// The LinkerResource items on this page. public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } 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 index 78b585f95552..769145e57e74 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.Serialization.cs @@ -84,6 +84,7 @@ internal static SecretAuthInfo DeserializeSecretAuthInfo(JsonElement element, Mo string name = default; SecretBaseInfo secretInfo = default; LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -113,13 +114,22 @@ internal static SecretAuthInfo DeserializeSecretAuthInfo(JsonElement element, Mo authType = new LinkerAuthType(property.Value.GetString()); continue; } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new SecretAuthInfo(authType, serializedAdditionalRawData, name, secretInfo); + return new SecretAuthInfo(authType, authMode, serializedAdditionalRawData, name, secretInfo); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs index c114d03deb1f..e6f931affae6 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs @@ -21,6 +21,7 @@ public SecretAuthInfo() /// Initializes a new instance of . /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. /// Keeps track of any properties unknown to the library. /// Username or account name for secret auth. /// @@ -28,7 +29,7 @@ public SecretAuthInfo() /// 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, IDictionary serializedAdditionalRawData, string name, SecretBaseInfo secretInfo) : base(authType, serializedAdditionalRawData) + internal SecretAuthInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, string name, SecretBaseInfo secretInfo) : base(authType, authMode, serializedAdditionalRawData) { Name = name; SecretInfo = secretInfo; diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SelfHostedServer.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SelfHostedServer.Serialization.cs new file mode 100644 index 000000000000..c547c3ce8c76 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SelfHostedServer.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class SelfHostedServer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfHostedServer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Endpoint)) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + } + } + + SelfHostedServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfHostedServer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSelfHostedServer(document.RootElement, options); + } + + internal static SelfHostedServer DeserializeSelfHostedServer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpoint = default; + TargetServiceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SelfHostedServer(type, serializedAdditionalRawData, endpoint); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(SelfHostedServer)} does not support writing '{options.Format}' format."); + } + } + + SelfHostedServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSelfHostedServer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SelfHostedServer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SelfHostedServer.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SelfHostedServer.cs new file mode 100644 index 000000000000..50f5b760a708 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SelfHostedServer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The service properties when target service type is SelfHostedServer. + public partial class SelfHostedServer : TargetServiceBaseInfo + { + /// Initializes a new instance of . + public SelfHostedServer() + { + TargetServiceType = TargetServiceType.SelfHostedServer; + } + + /// Initializes a new instance of . + /// The target service type. + /// Keeps track of any properties unknown to the library. + /// The endpoint of service. + internal SelfHostedServer(TargetServiceType targetServiceType, IDictionary serializedAdditionalRawData, string endpoint) : base(targetServiceType, serializedAdditionalRawData) + { + Endpoint = endpoint; + TargetServiceType = targetServiceType; + } + + /// The endpoint of service. + public string Endpoint { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerAuthMode.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerAuthMode.cs new file mode 100644 index 000000000000..edccad8ea8e6 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerAuthMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Indicates how to apply the authentication configuration operations. + public readonly partial struct ServiceLinkerAuthMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceLinkerAuthMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OptInAllAuthValue = "optInAllAuth"; + private const string OptOutAllAuthValue = "optOutAllAuth"; + + /// Default authentication configuration according to the authentication type. + public static ServiceLinkerAuthMode OptInAllAuth { get; } = new ServiceLinkerAuthMode(OptInAllAuthValue); + /// Skip all authentication configuration such as enabling managed identity and granting RBAC roles. + public static ServiceLinkerAuthMode OptOutAllAuth { get; } = new ServiceLinkerAuthMode(OptOutAllAuthValue); + /// Determines if two values are the same. + public static bool operator ==(ServiceLinkerAuthMode left, ServiceLinkerAuthMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceLinkerAuthMode left, ServiceLinkerAuthMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ServiceLinkerAuthMode(string value) => new ServiceLinkerAuthMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceLinkerAuthMode other && Equals(other); + /// + public bool Equals(ServiceLinkerAuthMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerCreateOrUpdateDryrunContent.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerCreateOrUpdateDryrunContent.Serialization.cs new file mode 100644 index 000000000000..5a829740092e --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerCreateOrUpdateDryrunContent.Serialization.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class ServiceLinkerCreateOrUpdateDryrunContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerCreateOrUpdateDryrunContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(TargetService)) + { + writer.WritePropertyName("targetService"u8); + writer.WriteObjectValue(TargetService, options); + } + if (Optional.IsDefined(AuthInfo)) + { + writer.WritePropertyName("authInfo"u8); + writer.WriteObjectValue(AuthInfo, options); + } + if (Optional.IsDefined(ClientType)) + { + writer.WritePropertyName("clientType"u8); + writer.WriteStringValue(ClientType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + if (Optional.IsDefined(VnetSolution)) + { + if (VnetSolution != null) + { + writer.WritePropertyName("vNetSolution"u8); + writer.WriteObjectValue(VnetSolution, options); + } + else + { + writer.WriteNull("vNetSolution"); + } + } + if (Optional.IsDefined(SecretStore)) + { + if (SecretStore != null) + { + writer.WritePropertyName("secretStore"u8); + writer.WriteObjectValue(SecretStore, options); + } + else + { + writer.WriteNull("secretStore"); + } + } + if (Optional.IsDefined(Scope)) + { + if (Scope != null) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + else + { + writer.WriteNull("scope"); + } + } + if (Optional.IsDefined(PublicNetworkSolution)) + { + if (PublicNetworkSolution != null) + { + writer.WritePropertyName("publicNetworkSolution"u8); + writer.WriteObjectValue(PublicNetworkSolution, options); + } + else + { + writer.WriteNull("publicNetworkSolution"); + } + } + if (Optional.IsDefined(ConfigurationInfo)) + { + if (ConfigurationInfo != null) + { + writer.WritePropertyName("configurationInfo"u8); + writer.WriteObjectValue(ConfigurationInfo, options); + } + else + { + writer.WriteNull("configurationInfo"); + } + } + } + + ServiceLinkerCreateOrUpdateDryrunContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerCreateOrUpdateDryrunContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceLinkerCreateOrUpdateDryrunContent(document.RootElement, options); + } + + internal static ServiceLinkerCreateOrUpdateDryrunContent DeserializeServiceLinkerCreateOrUpdateDryrunContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TargetServiceBaseInfo targetService = default; + AuthBaseInfo authInfo = default; + LinkerClientType? clientType = default; + string provisioningState = default; + VnetSolution vnetSolution = default; + LinkerSecretStore secretStore = default; + string scope = default; + LinkerPublicNetworkSolution publicNetworkSolution = default; + LinkerConfigurationInfo configurationInfo = default; + DryrunActionName actionName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetService"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetService = TargetServiceBaseInfo.DeserializeTargetServiceBaseInfo(property.Value, options); + continue; + } + if (property.NameEquals("authInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authInfo = AuthBaseInfo.DeserializeAuthBaseInfo(property.Value, options); + continue; + } + if (property.NameEquals("clientType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientType = new LinkerClientType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + provisioningState = property.Value.GetString(); + continue; + } + if (property.NameEquals("vNetSolution"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + vnetSolution = null; + continue; + } + vnetSolution = VnetSolution.DeserializeVnetSolution(property.Value, options); + continue; + } + if (property.NameEquals("secretStore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + secretStore = null; + continue; + } + secretStore = LinkerSecretStore.DeserializeLinkerSecretStore(property.Value, options); + continue; + } + if (property.NameEquals("scope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + scope = null; + continue; + } + scope = property.Value.GetString(); + continue; + } + if (property.NameEquals("publicNetworkSolution"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + publicNetworkSolution = null; + continue; + } + publicNetworkSolution = LinkerPublicNetworkSolution.DeserializeLinkerPublicNetworkSolution(property.Value, options); + continue; + } + if (property.NameEquals("configurationInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + configurationInfo = null; + continue; + } + configurationInfo = LinkerConfigurationInfo.DeserializeLinkerConfigurationInfo(property.Value, options); + continue; + } + if (property.NameEquals("actionName"u8)) + { + actionName = new DryrunActionName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceLinkerCreateOrUpdateDryrunContent( + actionName, + serializedAdditionalRawData, + targetService, + authInfo, + clientType, + provisioningState, + vnetSolution, + secretStore, + scope, + publicNetworkSolution, + configurationInfo); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ServiceLinkerCreateOrUpdateDryrunContent)} does not support writing '{options.Format}' format."); + } + } + + ServiceLinkerCreateOrUpdateDryrunContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceLinkerCreateOrUpdateDryrunContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceLinkerCreateOrUpdateDryrunContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerCreateOrUpdateDryrunContent.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerCreateOrUpdateDryrunContent.cs new file mode 100644 index 000000000000..329eafdecfd2 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerCreateOrUpdateDryrunContent.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// The dryrun parameters for creation or update a linker. + public partial class ServiceLinkerCreateOrUpdateDryrunContent : ServiceLinkerDryrunContent + { + /// Initializes a new instance of . + public ServiceLinkerCreateOrUpdateDryrunContent() + { + ActionName = DryrunActionName.CreateOrUpdate; + } + + /// Initializes a new instance of . + /// The name of action for you dryrun job. + /// Keeps track of any properties unknown to the library. + /// + /// 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. + /// The network solution. + /// The connection information consumed by applications, including secrets, connection strings. + internal ServiceLinkerCreateOrUpdateDryrunContent(DryrunActionName actionName, IDictionary serializedAdditionalRawData, TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolution vnetSolution, LinkerSecretStore secretStore, string scope, LinkerPublicNetworkSolution publicNetworkSolution, LinkerConfigurationInfo configurationInfo) : base(actionName, serializedAdditionalRawData) + { + TargetService = targetService; + AuthInfo = authInfo; + ClientType = clientType; + ProvisioningState = provisioningState; + VnetSolution = vnetSolution; + SecretStore = secretStore; + Scope = scope; + PublicNetworkSolution = publicNetworkSolution; + ConfigurationInfo = configurationInfo; + ActionName = actionName; + } + + /// + /// 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. + public VnetSolution VnetSolution { get; set; } + /// An option to store secret value in secure place. + public LinkerSecretStore SecretStore { get; set; } + /// connection scope in source service. + public string Scope { get; set; } + /// The network solution. + public LinkerPublicNetworkSolution PublicNetworkSolution { get; set; } + /// The connection information consumed by applications, including secrets, connection strings. + public LinkerConfigurationInfo ConfigurationInfo { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunContent.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunContent.Serialization.cs new file mode 100644 index 000000000000..1cf05ed517e8 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunContent.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + [PersistableModelProxy(typeof(UnknownDryrunParameters))] + public partial class ServiceLinkerDryrunContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("actionName"u8); + writer.WriteStringValue(ActionName.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ServiceLinkerDryrunContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceLinkerDryrunContent(document.RootElement, options); + } + + internal static ServiceLinkerDryrunContent DeserializeServiceLinkerDryrunContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("actionName", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "createOrUpdate": return ServiceLinkerCreateOrUpdateDryrunContent.DeserializeServiceLinkerCreateOrUpdateDryrunContent(element, options); + } + } + return UnknownDryrunParameters.DeserializeUnknownDryrunParameters(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support writing '{options.Format}' format."); + } + } + + ServiceLinkerDryrunContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceLinkerDryrunContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunContent.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunContent.cs new file mode 100644 index 000000000000..de00bbf87679 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// + /// The parameters of the dryrun + /// 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 ServiceLinkerDryrunContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ServiceLinkerDryrunContent() + { + } + + /// Initializes a new instance of . + /// The name of action for you dryrun job. + /// Keeps track of any properties unknown to the library. + internal ServiceLinkerDryrunContent(DryrunActionName actionName, IDictionary serializedAdditionalRawData) + { + ActionName = actionName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of action for you dryrun job. + internal DryrunActionName ActionName { get; set; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunPatch.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunPatch.Serialization.cs new file mode 100644 index 000000000000..8c608f593db0 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunPatch.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + public partial class ServiceLinkerDryrunPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunPatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PrerequisiteResults)) + { + writer.WritePropertyName("prerequisiteResults"u8); + writer.WriteStartArray(); + foreach (var item in PrerequisiteResults) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(OperationPreviews)) + { + writer.WritePropertyName("operationPreviews"u8); + writer.WriteStartArray(); + foreach (var item in OperationPreviews) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ServiceLinkerDryrunPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceLinkerDryrunPatch(document.RootElement, options); + } + + internal static ServiceLinkerDryrunPatch DeserializeServiceLinkerDryrunPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceLinkerDryrunContent parameters = default; + IReadOnlyList prerequisiteResults = default; + IReadOnlyList operationPreviews = default; + string provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("parameters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parameters = ServiceLinkerDryrunContent.DeserializeServiceLinkerDryrunContent(property0.Value, options); + continue; + } + if (property0.NameEquals("prerequisiteResults"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DryrunPrerequisiteResult.DeserializeDryrunPrerequisiteResult(item, options)); + } + prerequisiteResults = array; + continue; + } + if (property0.NameEquals("operationPreviews"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DryrunOperationPreview.DeserializeDryrunOperationPreview(item, options)); + } + operationPreviews = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceLinkerDryrunPatch(parameters, prerequisiteResults ?? new ChangeTrackingList(), operationPreviews ?? new ChangeTrackingList(), provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunPatch)} does not support writing '{options.Format}' format."); + } + } + + ServiceLinkerDryrunPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceLinkerDryrunPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunPatch.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunPatch.cs new file mode 100644 index 000000000000..f4c52a95778b --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServiceLinkerDryrunPatch.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// a dryrun job to be updated. + public partial class ServiceLinkerDryrunPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ServiceLinkerDryrunPatch() + { + PrerequisiteResults = new ChangeTrackingList(); + OperationPreviews = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The parameters of the dryrun + /// 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 . + /// + /// + /// the result of the dryrun + /// 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 preview of the operations for creation. + /// The provisioning state. + /// Keeps track of any properties unknown to the library. + internal ServiceLinkerDryrunPatch(ServiceLinkerDryrunContent parameters, IReadOnlyList prerequisiteResults, IReadOnlyList operationPreviews, string provisioningState, IDictionary serializedAdditionalRawData) + { + Parameters = parameters; + PrerequisiteResults = prerequisiteResults; + OperationPreviews = operationPreviews; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The parameters of the dryrun + /// 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 ServiceLinkerDryrunContent Parameters { get; set; } + /// + /// the result of the dryrun + /// 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 IReadOnlyList PrerequisiteResults { get; } + /// the preview of the operations for creation. + public IReadOnlyList OperationPreviews { get; } + /// The provisioning state. + public string ProvisioningState { get; } + } +} 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 index f965237412d0..c897d067eede 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.Serialization.cs @@ -41,6 +41,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteStringValue(PrincipalId); writer.WritePropertyName("certificate"u8); writer.WriteStringValue(Certificate); + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } } ServicePrincipalCertificateAuthInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -66,7 +81,10 @@ internal static ServicePrincipalCertificateAuthInfo DeserializeServicePrincipalC string clientId = default; Guid principalId = default; string certificate = default; + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + IList roles = default; LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -86,18 +104,58 @@ internal static ServicePrincipalCertificateAuthInfo DeserializeServicePrincipalC certificate = property.Value.GetString(); continue; } + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + roles = array; + continue; + } if (property.NameEquals("authType"u8)) { authType = new LinkerAuthType(property.Value.GetString()); continue; } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ServicePrincipalCertificateAuthInfo(authType, serializedAdditionalRawData, clientId, principalId, certificate); + return new ServicePrincipalCertificateAuthInfo( + authType, + authMode, + serializedAdditionalRawData, + clientId, + principalId, + certificate, + deleteOrUpdateBehavior, + roles ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs index 23612cfecbc2..2a0bf710a535 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs @@ -26,20 +26,26 @@ public ServicePrincipalCertificateAuthInfo(string clientId, Guid principalId, st ClientId = clientId; PrincipalId = principalId; Certificate = certificate; + Roles = new ChangeTrackingList(); AuthType = LinkerAuthType.ServicePrincipalCertificate; } /// Initializes a new instance of . /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. /// Keeps track of any properties unknown to the library. /// Application clientId for servicePrincipal auth. /// Principal Id for servicePrincipal auth. /// ServicePrincipal certificate for servicePrincipal auth. - internal ServicePrincipalCertificateAuthInfo(LinkerAuthType authType, IDictionary serializedAdditionalRawData, string clientId, Guid principalId, string certificate) : base(authType, serializedAdditionalRawData) + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + /// Optional, this value specifies the Azure roles to be assigned. Automatically. + internal ServicePrincipalCertificateAuthInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, string clientId, Guid principalId, string certificate, LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, IList roles) : base(authType, authMode, serializedAdditionalRawData) { ClientId = clientId; PrincipalId = principalId; Certificate = certificate; + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + Roles = roles; AuthType = authType; } @@ -54,5 +60,9 @@ internal ServicePrincipalCertificateAuthInfo() public Guid PrincipalId { get; set; } /// ServicePrincipal certificate for servicePrincipal auth. public string Certificate { get; set; } + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + /// Optional, this value specifies the Azure roles to be assigned. Automatically. + public IList Roles { get; } } } 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 index a4824d217fbf..ad1b945cee73 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.Serialization.cs @@ -35,12 +35,39 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(UserName)) + { + if (UserName != null) + { + writer.WritePropertyName("userName"u8); + writer.WriteStringValue(UserName); + } + else + { + writer.WriteNull("userName"); + } + } writer.WritePropertyName("clientId"u8); writer.WriteStringValue(ClientId); writer.WritePropertyName("principalId"u8); writer.WriteStringValue(PrincipalId); writer.WritePropertyName("secret"u8); writer.WriteStringValue(Secret); + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } } ServicePrincipalSecretAuthInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -63,14 +90,28 @@ internal static ServicePrincipalSecretAuthInfo DeserializeServicePrincipalSecret { return null; } + string userName = default; string clientId = default; Guid principalId = default; string secret = default; + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + IList roles = default; LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("userName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userName = null; + continue; + } + userName = property.Value.GetString(); + continue; + } if (property.NameEquals("clientId"u8)) { clientId = property.Value.GetString(); @@ -86,18 +127,59 @@ internal static ServicePrincipalSecretAuthInfo DeserializeServicePrincipalSecret secret = property.Value.GetString(); continue; } + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + roles = array; + continue; + } if (property.NameEquals("authType"u8)) { authType = new LinkerAuthType(property.Value.GetString()); continue; } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ServicePrincipalSecretAuthInfo(authType, serializedAdditionalRawData, clientId, principalId, secret); + return new ServicePrincipalSecretAuthInfo( + authType, + authMode, + serializedAdditionalRawData, + userName, + clientId, + principalId, + secret, + deleteOrUpdateBehavior, + roles ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs index 7e8323b5bc3a..09a9d4a65b05 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs @@ -26,20 +26,28 @@ public ServicePrincipalSecretAuthInfo(string clientId, Guid principalId, string ClientId = clientId; PrincipalId = principalId; Secret = secret; + Roles = new ChangeTrackingList(); AuthType = LinkerAuthType.ServicePrincipalSecret; } /// Initializes a new instance of . /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. /// Keeps track of any properties unknown to the library. + /// Username created in the database which is mapped to a user in AAD. /// ServicePrincipal application clientId for servicePrincipal auth. /// Principal Id for servicePrincipal auth. /// Secret for servicePrincipal auth. - internal ServicePrincipalSecretAuthInfo(LinkerAuthType authType, IDictionary serializedAdditionalRawData, string clientId, Guid principalId, string secret) : base(authType, serializedAdditionalRawData) + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + /// Optional, this value specifies the Azure roles to be assigned. Automatically. + internal ServicePrincipalSecretAuthInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, string userName, string clientId, Guid principalId, string secret, LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, IList roles) : base(authType, authMode, serializedAdditionalRawData) { + UserName = userName; ClientId = clientId; PrincipalId = principalId; Secret = secret; + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + Roles = roles; AuthType = authType; } @@ -48,11 +56,17 @@ internal ServicePrincipalSecretAuthInfo() { } + /// Username created in the database which is mapped to a user in AAD. + public string UserName { get; set; } /// 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; } + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + /// Optional, this value specifies the Azure roles to be assigned. Automatically. + public IList Roles { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceApplicationConfigurationActionType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceApplicationConfigurationActionType.cs new file mode 100644 index 000000000000..21a8b7e6ce81 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceApplicationConfigurationActionType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + public readonly partial struct SourceApplicationConfigurationActionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SourceApplicationConfigurationActionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InternalValue = "Internal"; + private const string EnableValue = "enable"; + private const string OptOutValue = "optOut"; + + /// Internal. + public static SourceApplicationConfigurationActionType Internal { get; } = new SourceApplicationConfigurationActionType(InternalValue); + /// enable. + public static SourceApplicationConfigurationActionType Enable { get; } = new SourceApplicationConfigurationActionType(EnableValue); + /// optOut. + public static SourceApplicationConfigurationActionType OptOut { get; } = new SourceApplicationConfigurationActionType(OptOutValue); + /// Determines if two values are the same. + public static bool operator ==(SourceApplicationConfigurationActionType left, SourceApplicationConfigurationActionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SourceApplicationConfigurationActionType left, SourceApplicationConfigurationActionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SourceApplicationConfigurationActionType(string value) => new SourceApplicationConfigurationActionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SourceApplicationConfigurationActionType other && Equals(other); + /// + public bool Equals(SourceApplicationConfigurationActionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} 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 index e37c55a9f43d..5b77701091c3 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.Serialization.cs @@ -51,6 +51,35 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("value"); } } + if (options.Format != "W" && Optional.IsDefined(ConfigType)) + { + writer.WritePropertyName("configType"u8); + writer.WriteStringValue(ConfigType.Value.ToString()); + } + if (Optional.IsDefined(KeyVaultReferenceIdentity)) + { + if (KeyVaultReferenceIdentity != null) + { + writer.WritePropertyName("keyVaultReferenceIdentity"u8); + writer.WriteStringValue(KeyVaultReferenceIdentity); + } + else + { + writer.WriteNull("keyVaultReferenceIdentity"); + } + } + if (Optional.IsDefined(Description)) + { + if (Description != null) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + else + { + writer.WriteNull("description"); + } + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -90,6 +119,9 @@ internal static SourceConfiguration DeserializeSourceConfiguration(JsonElement e } string name = default; string value = default; + LinkerConfigurationType? configType = default; + string keyVaultReferenceIdentity = default; + string description = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -109,13 +141,48 @@ internal static SourceConfiguration DeserializeSourceConfiguration(JsonElement e value = property.Value.GetString(); continue; } + if (property.NameEquals("configType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configType = new LinkerConfigurationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyVaultReferenceIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + keyVaultReferenceIdentity = null; + continue; + } + keyVaultReferenceIdentity = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + description = null; + continue; + } + description = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new SourceConfiguration(name, value, serializedAdditionalRawData); + return new SourceConfiguration( + name, + value, + configType, + keyVaultReferenceIdentity, + description, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.cs index dc442dc31c78..9eb51db967d9 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SourceConfiguration.cs @@ -53,11 +53,17 @@ internal SourceConfiguration() /// Initializes a new instance of . /// The name of setting. /// The value of setting. + /// The type of setting. + /// The identity for key vault reference, system or user-assigned managed identity ID. + /// Descriptive information for the configuration. /// Keeps track of any properties unknown to the library. - internal SourceConfiguration(string name, string value, IDictionary serializedAdditionalRawData) + internal SourceConfiguration(string name, string value, LinkerConfigurationType? configType, string keyVaultReferenceIdentity, string description, IDictionary serializedAdditionalRawData) { Name = name; Value = value; + ConfigType = configType; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + Description = description; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -65,5 +71,11 @@ internal SourceConfiguration(string name, string value, IDictionary The value of setting. public string Value { get; } + /// The type of setting. + public LinkerConfigurationType? ConfigType { get; } + /// The identity for key vault reference, system or user-assigned managed identity ID. + public string KeyVaultReferenceIdentity { get; } + /// Descriptive information for the configuration. + public string Description { 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 index 687cee39f2c0..3b7e0f8c0355 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.Serialization.cs @@ -35,6 +35,33 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(UserName)) + { + if (UserName != null) + { + writer.WritePropertyName("userName"u8); + writer.WriteStringValue(UserName); + } + else + { + writer.WriteNull("userName"); + } + } + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } } SystemAssignedIdentityAuthInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -57,23 +84,75 @@ internal static SystemAssignedIdentityAuthInfo DeserializeSystemAssignedIdentity { return null; } + string userName = default; + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + IList roles = default; LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("userName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userName = null; + continue; + } + userName = property.Value.GetString(); + continue; + } + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + roles = array; + continue; + } if (property.NameEquals("authType"u8)) { authType = new LinkerAuthType(property.Value.GetString()); continue; } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new SystemAssignedIdentityAuthInfo(authType, serializedAdditionalRawData); + return new SystemAssignedIdentityAuthInfo( + authType, + authMode, + serializedAdditionalRawData, + userName, + deleteOrUpdateBehavior, + roles ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs index f513a6235300..404303f5638a 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs @@ -16,15 +16,30 @@ public partial class SystemAssignedIdentityAuthInfo : AuthBaseInfo /// Initializes a new instance of . public SystemAssignedIdentityAuthInfo() { + Roles = new ChangeTrackingList(); AuthType = LinkerAuthType.SystemAssignedIdentity; } /// Initializes a new instance of . /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. /// Keeps track of any properties unknown to the library. - internal SystemAssignedIdentityAuthInfo(LinkerAuthType authType, IDictionary serializedAdditionalRawData) : base(authType, serializedAdditionalRawData) + /// Username created in the database which is mapped to a user in AAD. + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + /// Optional, this value specifies the Azure role to be assigned. + internal SystemAssignedIdentityAuthInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, string userName, LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, IList roles) : base(authType, authMode, serializedAdditionalRawData) { + UserName = userName; + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + Roles = roles; AuthType = authType; } + + /// Username created in the database which is mapped to a user in AAD. + public string UserName { get; set; } + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + /// Optional, this value specifies the Azure role to be assigned. + public IList Roles { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceAccessKeyPermission.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceAccessKeyPermission.cs new file mode 100644 index 000000000000..4f861691fb91 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceAccessKeyPermission.cs @@ -0,0 +1,60 @@ +// 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 TargetServiceAccessKeyPermission. + public readonly partial struct TargetServiceAccessKeyPermission : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TargetServiceAccessKeyPermission(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadValue = "Read"; + private const string WriteValue = "Write"; + private const string ListenValue = "Listen"; + private const string SendValue = "Send"; + private const string ManageValue = "Manage"; + + /// Read. + public static TargetServiceAccessKeyPermission Read { get; } = new TargetServiceAccessKeyPermission(ReadValue); + /// Write. + public static TargetServiceAccessKeyPermission Write { get; } = new TargetServiceAccessKeyPermission(WriteValue); + /// Listen. + public static TargetServiceAccessKeyPermission Listen { get; } = new TargetServiceAccessKeyPermission(ListenValue); + /// Send. + public static TargetServiceAccessKeyPermission Send { get; } = new TargetServiceAccessKeyPermission(SendValue); + /// Manage. + public static TargetServiceAccessKeyPermission Manage { get; } = new TargetServiceAccessKeyPermission(ManageValue); + /// Determines if two values are the same. + public static bool operator ==(TargetServiceAccessKeyPermission left, TargetServiceAccessKeyPermission right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TargetServiceAccessKeyPermission left, TargetServiceAccessKeyPermission right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TargetServiceAccessKeyPermission(string value) => new TargetServiceAccessKeyPermission(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TargetServiceAccessKeyPermission other && Equals(other); + /// + public bool Equals(TargetServiceAccessKeyPermission other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} 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 index c79ffad6cb77..7c1570e2b6f6 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.Serialization.cs @@ -80,6 +80,8 @@ internal static TargetServiceBaseInfo DeserializeTargetServiceBaseInfo(JsonEleme case "AzureResource": return AzureResourceInfo.DeserializeAzureResourceInfo(element, options); case "ConfluentBootstrapServer": return ConfluentBootstrapServerInfo.DeserializeConfluentBootstrapServerInfo(element, options); case "ConfluentSchemaRegistry": return ConfluentSchemaRegistryInfo.DeserializeConfluentSchemaRegistryInfo(element, options); + case "FabricPlatform": return LinkerTargetFabricPlatform.DeserializeLinkerTargetFabricPlatform(element, options); + case "SelfHostedServer": return SelfHostedServer.DeserializeSelfHostedServer(element, options); } } return UnknownTargetServiceBase.DeserializeUnknownTargetServiceBase(element, options); diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.cs index a1d41b573014..c07542d1d58e 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceBaseInfo.cs @@ -13,7 +13,7 @@ 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 . + /// The available derived classes include , , , and . /// public abstract partial class TargetServiceBaseInfo { diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceType.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceType.cs index ac4c15936c77..a4d018337093 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceType.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/TargetServiceType.cs @@ -25,6 +25,8 @@ public TargetServiceType(string value) private const string AzureResourceValue = "AzureResource"; private const string ConfluentBootstrapServerValue = "ConfluentBootstrapServer"; private const string ConfluentSchemaRegistryValue = "ConfluentSchemaRegistry"; + private const string SelfHostedServerValue = "SelfHostedServer"; + private const string FabricPlatformValue = "FabricPlatform"; /// AzureResource. public static TargetServiceType AzureResource { get; } = new TargetServiceType(AzureResourceValue); @@ -32,6 +34,10 @@ public TargetServiceType(string value) public static TargetServiceType ConfluentBootstrapServer { get; } = new TargetServiceType(ConfluentBootstrapServerValue); /// ConfluentSchemaRegistry. public static TargetServiceType ConfluentSchemaRegistry { get; } = new TargetServiceType(ConfluentSchemaRegistryValue); + /// SelfHostedServer. + public static TargetServiceType SelfHostedServer { get; } = new TargetServiceType(SelfHostedServerValue); + /// FabricPlatform. + public static TargetServiceType FabricPlatform { get; } = new TargetServiceType(FabricPlatformValue); /// 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. 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 index 6b288b34c3be..1dd79dcc353c 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.Serialization.cs @@ -58,6 +58,7 @@ internal static UnknownAuthInfoBase DeserializeUnknownAuthInfoBase(JsonElement e return null; } LinkerAuthType authType = "Unknown"; + ServiceLinkerAuthMode? authMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -67,13 +68,22 @@ internal static UnknownAuthInfoBase DeserializeUnknownAuthInfoBase(JsonElement e authType = new LinkerAuthType(property.Value.GetString()); continue; } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownAuthInfoBase(authType, serializedAdditionalRawData); + return new UnknownAuthInfoBase(authType, authMode, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.cs index a7f0a42073c5..24e6cf4ec044 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownAuthInfoBase.cs @@ -15,8 +15,9 @@ internal partial class UnknownAuthInfoBase : AuthBaseInfo { /// Initializes a new instance of . /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. /// Keeps track of any properties unknown to the library. - internal UnknownAuthInfoBase(LinkerAuthType authType, IDictionary serializedAdditionalRawData) : base(authType, serializedAdditionalRawData) + internal UnknownAuthInfoBase(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData) : base(authType, authMode, serializedAdditionalRawData) { AuthType = authType; } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunParameters.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunParameters.Serialization.cs new file mode 100644 index 000000000000..8c83921d6496 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunParameters.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + internal partial class UnknownDryrunParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ServiceLinkerDryrunContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceLinkerDryrunContent(document.RootElement, options); + } + + internal static UnknownDryrunParameters DeserializeUnknownDryrunParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DryrunActionName actionName = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("actionName"u8)) + { + actionName = new DryrunActionName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDryrunParameters(actionName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support writing '{options.Format}' format."); + } + } + + ServiceLinkerDryrunContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceLinkerDryrunContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunParameters.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunParameters.cs new file mode 100644 index 000000000000..77ec17cfbfd0 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunParameters.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Unknown version of DryrunParameters. + internal partial class UnknownDryrunParameters : ServiceLinkerDryrunContent + { + /// Initializes a new instance of . + /// The name of action for you dryrun job. + /// Keeps track of any properties unknown to the library. + internal UnknownDryrunParameters(DryrunActionName actionName, IDictionary serializedAdditionalRawData) : base(actionName, serializedAdditionalRawData) + { + ActionName = actionName; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDryrunParameters() + { + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunPrerequisiteResult.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunPrerequisiteResult.Serialization.cs new file mode 100644 index 000000000000..351a4731e8dd --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunPrerequisiteResult.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + internal partial class UnknownDryrunPrerequisiteResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DryrunPrerequisiteResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDryrunPrerequisiteResult(document.RootElement, options); + } + + internal static UnknownDryrunPrerequisiteResult DeserializeUnknownDryrunPrerequisiteResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DryrunPrerequisiteResultType type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new DryrunPrerequisiteResultType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDryrunPrerequisiteResult(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support writing '{options.Format}' format."); + } + } + + DryrunPrerequisiteResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDryrunPrerequisiteResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DryrunPrerequisiteResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunPrerequisiteResult.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunPrerequisiteResult.cs new file mode 100644 index 000000000000..40a87c33f496 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UnknownDryrunPrerequisiteResult.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceLinker.Models +{ + /// Unknown version of DryrunPrerequisiteResult. + internal partial class UnknownDryrunPrerequisiteResult : DryrunPrerequisiteResult + { + /// Initializes a new instance of . + /// The type of dryrun result. + /// Keeps track of any properties unknown to the library. + internal UnknownDryrunPrerequisiteResult(DryrunPrerequisiteResultType resultType, IDictionary serializedAdditionalRawData) : base(resultType, serializedAdditionalRawData) + { + ResultType = resultType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDryrunPrerequisiteResult() + { + } + } +} 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 index 548a8bbaea7f..e48e98c1ae57 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.Serialization.cs @@ -35,6 +35,18 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(UserName)) + { + if (UserName != null) + { + writer.WritePropertyName("userName"u8); + writer.WriteStringValue(UserName); + } + else + { + writer.WriteNull("userName"); + } + } if (Optional.IsDefined(ClientId)) { writer.WritePropertyName("clientId"u8); @@ -45,6 +57,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("subscriptionId"u8); writer.WriteStringValue(SubscriptionId); } + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } } UserAssignedIdentityAuthInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -67,13 +94,27 @@ internal static UserAssignedIdentityAuthInfo DeserializeUserAssignedIdentityAuth { return null; } + string userName = default; string clientId = default; string subscriptionId = default; + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; + IList roles = default; LinkerAuthType authType = default; + ServiceLinkerAuthMode? authMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("userName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userName = null; + continue; + } + userName = property.Value.GetString(); + continue; + } if (property.NameEquals("clientId"u8)) { clientId = property.Value.GetString(); @@ -84,18 +125,58 @@ internal static UserAssignedIdentityAuthInfo DeserializeUserAssignedIdentityAuth subscriptionId = property.Value.GetString(); continue; } + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + roles = array; + continue; + } if (property.NameEquals("authType"u8)) { authType = new LinkerAuthType(property.Value.GetString()); continue; } + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServiceLinkerAuthMode(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new UserAssignedIdentityAuthInfo(authType, serializedAdditionalRawData, clientId, subscriptionId); + return new UserAssignedIdentityAuthInfo( + authType, + authMode, + serializedAdditionalRawData, + userName, + clientId, + subscriptionId, + deleteOrUpdateBehavior, + roles ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs index 3ed5ae45e742..d25225a14a06 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs @@ -16,24 +16,38 @@ public partial class UserAssignedIdentityAuthInfo : AuthBaseInfo /// Initializes a new instance of . public UserAssignedIdentityAuthInfo() { + Roles = new ChangeTrackingList(); AuthType = LinkerAuthType.UserAssignedIdentity; } /// Initializes a new instance of . /// The authentication type. + /// Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication setup. Default is optInAllAuth. /// Keeps track of any properties unknown to the library. + /// Username created in the database which is mapped to a user in AAD. /// Client Id for userAssignedIdentity. /// Subscription id for userAssignedIdentity. - internal UserAssignedIdentityAuthInfo(LinkerAuthType authType, IDictionary serializedAdditionalRawData, string clientId, string subscriptionId) : base(authType, serializedAdditionalRawData) + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + /// Optional, this value specifies the Azure role to be assigned. + internal UserAssignedIdentityAuthInfo(LinkerAuthType authType, ServiceLinkerAuthMode? authMode, IDictionary serializedAdditionalRawData, string userName, string clientId, string subscriptionId, LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, IList roles) : base(authType, authMode, serializedAdditionalRawData) { + UserName = userName; ClientId = clientId; SubscriptionId = subscriptionId; + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; + Roles = roles; AuthType = authType; } + /// Username created in the database which is mapped to a user in AAD. + public string UserName { get; set; } /// Client Id for userAssignedIdentity. public string ClientId { get; set; } /// Subscription id for userAssignedIdentity. public string SubscriptionId { get; set; } + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + /// Optional, this value specifies the Azure role to be assigned. + public IList Roles { get; } } } 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 index 6cfc1561da52..ecc985f8189a 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { - internal partial class VnetSolution : IUtf8JsonSerializable, IJsonModel + public partial class VnetSolution : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -46,6 +46,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("type"); } } + if (Optional.IsDefined(DeleteOrUpdateBehavior)) + { + writer.WritePropertyName("deleteOrUpdateBehavior"u8); + writer.WriteStringValue(DeleteOrUpdateBehavior.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -84,6 +89,7 @@ internal static VnetSolution DeserializeVnetSolution(JsonElement element, ModelR return null; } VnetSolutionType? type = default; + LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -98,13 +104,22 @@ internal static VnetSolution DeserializeVnetSolution(JsonElement element, ModelR type = new VnetSolutionType(property.Value.GetString()); continue; } + if (property.NameEquals("deleteOrUpdateBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOrUpdateBehavior = new LinkerDeleteOrUpdateBehavior(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new VnetSolution(type, serializedAdditionalRawData); + return new VnetSolution(type, deleteOrUpdateBehavior, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs index 51a448e7a8da..5b17bb70aae8 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models { /// The VNet solution for linker. - internal partial class VnetSolution + public partial class VnetSolution { /// /// Keeps track of any properties unknown to the library. @@ -52,14 +52,18 @@ public VnetSolution() /// Initializes a new instance of . /// Type of VNet solution. + /// Indicates whether to clean up previous operation when Linker is updating or deleting. /// Keeps track of any properties unknown to the library. - internal VnetSolution(VnetSolutionType? solutionType, IDictionary serializedAdditionalRawData) + internal VnetSolution(VnetSolutionType? solutionType, LinkerDeleteOrUpdateBehavior? deleteOrUpdateBehavior, IDictionary serializedAdditionalRawData) { SolutionType = solutionType; + DeleteOrUpdateBehavior = deleteOrUpdateBehavior; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Type of VNet solution. public VnetSolutionType? SolutionType { get; set; } + /// Indicates whether to clean up previous operation when Linker is updating or deleting. + public LinkerDeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/ConfigurationNamesRestOperations.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/ConfigurationNamesRestOperations.cs new file mode 100644 index 000000000000..60652a3ed4a0 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/ConfigurationNamesRestOperations.cs @@ -0,0 +1,197 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + internal partial class ConfigurationNamesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConfigurationNamesRestOperations. + /// 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 ConfigurationNamesRestOperations(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 ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string filter, string skipToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.ServiceLinker/configurationNames", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string filter, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.ServiceLinker/configurationNames", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + public async Task> ListAsync(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(filter, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConfigurationNameResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConfigurationNameResult.DeserializeConfigurationNameResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + public Response List(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(filter, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConfigurationNameResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConfigurationNameResult.DeserializeConfigurationNameResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string filter, string skipToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string filter, string skipToken) + { + 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; + } + + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// The URL to the next page of results. + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink, filter, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConfigurationNameResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConfigurationNameResult.DeserializeConfigurationNameResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// The URL to the next page of results. + /// OData filter options. + /// OData skipToken option for pagination. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink, filter, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConfigurationNameResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConfigurationNameResult.DeserializeConfigurationNameResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/ConnectorRestOperations.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/ConnectorRestOperations.cs new file mode 100644 index 000000000000..df775aaa928c --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/ConnectorRestOperations.cs @@ -0,0 +1,1366 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + internal partial class ConnectorRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectorRestOperations. + /// 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 ConnectorRestOperations(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 ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource provision. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ResourceList.DeserializeResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource provision. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ResourceList.DeserializeResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns Connector resource for a given name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, location, connectorName); + 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, ModelSerializationExtensions.JsonDocumentOptions, 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 Connector resource for a given name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, location, connectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LinkerResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + 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 RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update Connector resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// Connector details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, location, connectorName, 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 Connector resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// Connector details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, location, connectorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Operation to update an existing Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// Connector details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, location, connectorName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Operation to update an existing Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// Connector details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, location, connectorName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, location, connectorName); + 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 Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, location, connectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGenerateConfigurationsRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerConfigurationInfo info) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendPath("/generateConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGenerateConfigurationsRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerConfigurationInfo info) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendPath("/generateConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (info != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(info, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Generate configurations for a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// Connection Info, including format, secret store, etc. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GenerateConfigurationsAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateGenerateConfigurationsRequest(subscriptionId, resourceGroupName, location, connectorName, info); + 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, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Generate configurations for a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// Connection Info, including format, secret store, etc. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GenerateConfigurations(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateGenerateConfigurationsRequest(subscriptionId, resourceGroupName, location, connectorName, info); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SourceConfigurationResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateValidateRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateValidateRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Validate a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ValidateAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, location, connectorName); + 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 Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the LinkerResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Validate(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, location, connectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDryrunRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDryrunRequest(string subscriptionId, string resourceGroupName, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// list dryrun jobs. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListDryrunAsync(string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListDryrunRequest(subscriptionId, resourceGroupName, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// list dryrun jobs. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListDryrun(string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListDryrunRequest(subscriptionId, resourceGroupName, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDryrunRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDryrunRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// get a dryrun job. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetDryrunAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateGetDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceLinkerDryrunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceLinkerDryrunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// get a dryrun job. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetDryrun(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateGetDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceLinkerDryrunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceLinkerDryrunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateDryrunRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateDryrunRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// create a dryrun job to do necessary check before actual creation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// dryrun resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateDryrunAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName, 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 a dryrun job to do necessary check before actual creation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// dryrun resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateDryrun(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateDryrunRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateDryrunRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// update a dryrun job to do necessary check before actual creation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// dryrun resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateDryrunAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// update a dryrun job to do necessary check before actual creation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// dryrun resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response UpdateDryrun(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteDryrunRequestUri(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteDryrunRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceLinker/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// delete a dryrun job. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteDryrunAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateDeleteDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// delete a dryrun job. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the DryrunResource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response DeleteDryrun(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateDeleteDryrunRequest(subscriptionId, resourceGroupName, location, dryrunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location) + { + 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 connector which connects to the resource, which supports to config the target service during the resource provision. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ResourceList.DeserializeResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource provision. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ResourceList.DeserializeResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDryrunNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDryrunNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location) + { + 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; + } + + /// list dryrun jobs. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListDryrunNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListDryrunNextPageRequest(nextLink, subscriptionId, resourceGroupName, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// list dryrun jobs. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListDryrunNextPage(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListDryrunNextPageRequest(nextLink, subscriptionId, resourceGroupName, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs index 0ffe24b4af73..6fc84628c929 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs @@ -32,7 +32,7 @@ public LinkerRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-01"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -64,11 +64,11 @@ internal HttpMessage CreateListRequest(string resourceUri) return message; } - /// Returns list of Linkers which connects to the resource. + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision. /// 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) + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); @@ -78,9 +78,9 @@ public async Task> ListAsync(string resourceUri, Cancellati { case 200: { - LinkerList value = default; + ResourceList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = LinkerList.DeserializeLinkerList(document.RootElement); + value = ResourceList.DeserializeResourceList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -88,11 +88,11 @@ public async Task> ListAsync(string resourceUri, Cancellati } } - /// Returns list of Linkers which connects to the resource. + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision. /// 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) + public Response List(string resourceUri, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); @@ -102,9 +102,9 @@ public Response List(string resourceUri, CancellationToken cancellat { case 200: { - LinkerList value = default; + ResourceList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = LinkerList.DeserializeLinkerList(document.RootElement); + value = ResourceList.DeserializeResourceList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -234,7 +234,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string link return message; } - /// Create or update linker resource. + /// Create or update Linker resource. /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The name Linker resource. /// Linker details. @@ -259,7 +259,7 @@ public async Task CreateOrUpdateAsync(string resourceUri, string linke } } - /// Create or update linker resource. + /// Create or update Linker resource. /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The name Linker resource. /// Linker details. @@ -284,7 +284,7 @@ public Response CreateOrUpdate(string resourceUri, string linkerName, LinkerReso } } - internal RequestUriBuilder CreateDeleteRequestUri(string resourceUri, string linkerName) + internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string linkerName, LinkerResourcePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -296,11 +296,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string resourceUri, string lin return uri; } - internal HttpMessage CreateDeleteRequest(string resourceUri, string linkerName) + internal HttpMessage CreateUpdateRequest(string resourceUri, string linkerName, LinkerResourcePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/", false); @@ -310,59 +310,65 @@ internal HttpMessage CreateDeleteRequest(string resourceUri, string linkerName) 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, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete a link. + /// Operation to update an existing Linker. /// 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. + /// , 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) + 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 = CreateDeleteRequest(resourceUri, linkerName); + using var message = CreateUpdateRequest(resourceUri, linkerName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete a link. + /// Operation to update an existing Linker. /// 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. + /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response Delete(string resourceUri, string linkerName, CancellationToken cancellationToken = default) + 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 = CreateDeleteRequest(resourceUri, linkerName); + using var message = CreateUpdateRequest(resourceUri, linkerName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string linkerName, LinkerResourcePatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string resourceUri, string linkerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -374,11 +380,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string lin return uri; } - internal HttpMessage CreateUpdateRequest(string resourceUri, string linkerName, LinkerResourcePatch patch) + internal HttpMessage CreateDeleteRequest(string resourceUri, string linkerName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/", false); @@ -388,65 +394,59 @@ internal HttpMessage CreateUpdateRequest(string resourceUri, string linkerName, 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, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Operation to update an existing link. + /// Delete a Linker. /// 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. + /// 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) + public async Task DeleteAsync(string resourceUri, string linkerName, 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); + using var message = CreateDeleteRequest(resourceUri, linkerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Operation to update an existing link. + /// Delete a Linker. /// 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. + /// 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) + public Response Delete(string resourceUri, string linkerName, 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); + using var message = CreateDeleteRequest(resourceUri, linkerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateValidateRequestUri(string resourceUri, string linkerName) + internal RequestUriBuilder CreateListConfigurationsRequestUri(string resourceUri, string linkerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -454,12 +454,12 @@ internal RequestUriBuilder CreateValidateRequestUri(string resourceUri, string l uri.AppendPath(resourceUri, false); uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); uri.AppendPath(linkerName, true); - uri.AppendPath("/validateLinker", false); + uri.AppendPath("/listConfigurations", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateValidateRequest(string resourceUri, string linkerName) + internal HttpMessage CreateListConfigurationsRequest(string resourceUri, string linkerName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -470,7 +470,7 @@ internal HttpMessage CreateValidateRequest(string resourceUri, string linkerName uri.AppendPath(resourceUri, false); uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); uri.AppendPath(linkerName, true); - uri.AppendPath("/validateLinker", false); + uri.AppendPath("/listConfigurations", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -478,53 +478,61 @@ internal HttpMessage CreateValidateRequest(string resourceUri, string linkerName return message; } - /// Validate a link. + /// 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 ValidateAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) + public async Task> ListConfigurationsAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - using var message = CreateValidateRequest(resourceUri, linkerName); + using var message = CreateListConfigurationsRequest(resourceUri, linkerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + SourceConfigurationResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Validate a link. + /// 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 Validate(string resourceUri, string linkerName, CancellationToken cancellationToken = default) + public Response ListConfigurations(string resourceUri, string linkerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - using var message = CreateValidateRequest(resourceUri, linkerName); + using var message = CreateListConfigurationsRequest(resourceUri, linkerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + SourceConfigurationResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListConfigurationsRequestUri(string resourceUri, string linkerName) + internal RequestUriBuilder CreateValidateRequestUri(string resourceUri, string linkerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -532,12 +540,12 @@ internal RequestUriBuilder CreateListConfigurationsRequestUri(string resourceUri uri.AppendPath(resourceUri, false); uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); uri.AppendPath(linkerName, true); - uri.AppendPath("/listConfigurations", false); + uri.AppendPath("/validateLinker", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListConfigurationsRequest(string resourceUri, string linkerName) + internal HttpMessage CreateValidateRequest(string resourceUri, string linkerName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -548,7 +556,7 @@ internal HttpMessage CreateListConfigurationsRequest(string resourceUri, string uri.AppendPath(resourceUri, false); uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); uri.AppendPath(linkerName, true); - uri.AppendPath("/listConfigurations", false); + uri.AppendPath("/validateLinker", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -556,55 +564,47 @@ internal HttpMessage CreateListConfigurationsRequest(string resourceUri, string return message; } - /// list source configurations for a linker. + /// Validate 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) + public async Task ValidateAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - using var message = CreateListConfigurationsRequest(resourceUri, linkerName); + using var message = CreateValidateRequest(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, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// list source configurations for a linker. + /// Validate 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) + public Response Validate(string resourceUri, string linkerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - using var message = CreateListConfigurationsRequest(resourceUri, linkerName); + using var message = CreateValidateRequest(resourceUri, linkerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - SourceConfigurationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -632,12 +632,12 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceU return message; } - /// Returns list of Linkers which connects to the resource. + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision. /// 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) + public async Task> ListNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(resourceUri, nameof(resourceUri)); @@ -648,9 +648,9 @@ public async Task> ListNextPageAsync(string nextLink, strin { case 200: { - LinkerList value = default; + ResourceList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = LinkerList.DeserializeLinkerList(document.RootElement); + value = ResourceList.DeserializeResourceList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -658,12 +658,12 @@ public async Task> ListNextPageAsync(string nextLink, strin } } - /// Returns list of Linkers which connects to the resource. + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision. /// 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) + public Response ListNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(resourceUri, nameof(resourceUri)); @@ -674,9 +674,9 @@ public Response ListNextPage(string nextLink, string resourceUri, Ca { case 200: { - LinkerList value = default; + ResourceList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = LinkerList.DeserializeLinkerList(document.RootElement); + value = ResourceList.DeserializeResourceList(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkersRestOperations.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkersRestOperations.cs new file mode 100644 index 000000000000..22421c20cfe8 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkersRestOperations.cs @@ -0,0 +1,766 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + internal partial class LinkersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of LinkersRestOperations. + /// 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 LinkersRestOperations(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 ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListDaprConfigurationsRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.ServiceLinker/daprConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDaprConfigurationsRequest(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/daprConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the dapr configuration supported by Service Connector. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The cancellation token to use. + /// is null. + public async Task> ListDaprConfigurationsAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDaprConfigurationsRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprConfigurationList.DeserializeDaprConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the dapr configuration supported by Service Connector. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The cancellation token to use. + /// is null. + public Response ListDaprConfigurations(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDaprConfigurationsRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprConfigurationList.DeserializeDaprConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDryrunRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.ServiceLinker/dryruns", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDryrunRequest(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/dryruns", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// list dryrun jobs. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The cancellation token to use. + /// is null. + public async Task> ListDryrunAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDryrunRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// list dryrun jobs. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The cancellation token to use. + /// is null. + public Response ListDryrun(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDryrunRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDryrunRequestUri(string resourceUri, string dryrunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.ServiceLinker/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDryrunRequest(string resourceUri, string dryrunName) + { + 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/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// get a dryrun job. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetDryrunAsync(string resourceUri, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateGetDryrunRequest(resourceUri, dryrunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceLinkerDryrunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceLinkerDryrunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// get a dryrun job. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response GetDryrun(string resourceUri, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateGetDryrunRequest(resourceUri, dryrunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceLinkerDryrunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceLinkerDryrunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateDryrunRequestUri(string resourceUri, string dryrunName, ServiceLinkerDryrunData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.ServiceLinker/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateDryrunRequest(string resourceUri, string dryrunName, ServiceLinkerDryrunData 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/dryruns/", false); + uri.AppendPath(dryrunName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// create a dryrun job to do necessary check before actual creation. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun resource. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task CreateDryrunAsync(string resourceUri, string dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateDryrunRequest(resourceUri, dryrunName, 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 a dryrun job to do necessary check before actual creation. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun resource. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response CreateDryrun(string resourceUri, string dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateDryrunRequest(resourceUri, dryrunName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateDryrunRequestUri(string resourceUri, string dryrunName, ServiceLinkerDryrunPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.ServiceLinker/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateDryrunRequest(string resourceUri, string dryrunName, ServiceLinkerDryrunPatch 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/dryruns/", false); + uri.AppendPath(dryrunName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// add a dryrun job to do necessary check before actual creation. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun resource. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task UpdateDryrunAsync(string resourceUri, string dryrunName, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateDryrunRequest(resourceUri, dryrunName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// add a dryrun job to do necessary check before actual creation. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun resource. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response UpdateDryrun(string resourceUri, string dryrunName, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateDryrunRequest(resourceUri, dryrunName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteDryrunRequestUri(string resourceUri, string dryrunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.ServiceLinker/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteDryrunRequest(string resourceUri, string dryrunName) + { + 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/dryruns/", false); + uri.AppendPath(dryrunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// delete a dryrun job. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task DeleteDryrunAsync(string resourceUri, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateDeleteDryrunRequest(resourceUri, dryrunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// delete a dryrun job. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response DeleteDryrun(string resourceUri, string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var message = CreateDeleteDryrunRequest(resourceUri, dryrunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGenerateConfigurationsRequestUri(string resourceUri, string linkerName, LinkerConfigurationInfo info) + { + 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("/generateConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGenerateConfigurationsRequest(string resourceUri, string linkerName, LinkerConfigurationInfo info) + { + 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("/generateConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (info != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(info, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Generate configurations for a Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// Connection Info, including format, secret store, etc. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GenerateConfigurationsAsync(string resourceUri, string linkerName, LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); + + using var message = CreateGenerateConfigurationsRequest(resourceUri, linkerName, info); + 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, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Generate configurations for a Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// Connection Info, including format, secret store, etc. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response GenerateConfigurations(string resourceUri, string linkerName, LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); + + using var message = CreateGenerateConfigurationsRequest(resourceUri, linkerName, info); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SourceConfigurationResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SourceConfigurationResult.DeserializeSourceConfigurationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDaprConfigurationsNextPageRequestUri(string nextLink, string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDaprConfigurationsNextPageRequest(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; + } + + /// List the dapr configuration supported by Service Connector. + /// 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> ListDaprConfigurationsNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDaprConfigurationsNextPageRequest(nextLink, resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprConfigurationList.DeserializeDaprConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the dapr configuration supported by Service Connector. + /// 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 ListDaprConfigurationsNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDaprConfigurationsNextPageRequest(nextLink, resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprConfigurationList.DeserializeDaprConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDryrunNextPageRequestUri(string nextLink, string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDryrunNextPageRequest(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; + } + + /// list dryrun jobs. + /// 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> ListDryrunNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDryrunNextPageRequest(nextLink, resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// list dryrun jobs. + /// 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 ListDryrunNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListDryrunNextPageRequest(nextLink, resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DryrunList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DryrunList.DeserializeDryrunList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunCollection.cs new file mode 100644 index 000000000000..4737d51a9bbe --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunCollection.cs @@ -0,0 +1,483 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +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 GetServiceLinkerDryruns method from an instance of . + /// + public partial class ServiceLinkerDryrunCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serviceLinkerDryrunLinkersClientDiagnostics; + private readonly LinkersRestOperations _serviceLinkerDryrunLinkersRestClient; + + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerDryrunCollection() + { + } + + /// 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 ServiceLinkerDryrunCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceLinkerDryrunLinkersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ServiceLinkerDryrunResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServiceLinkerDryrunResource.ResourceType, out string serviceLinkerDryrunLinkersApiVersion); + _serviceLinkerDryrunLinkersRestClient = new LinkersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceLinkerDryrunLinkersApiVersion); + } + + /// + /// create a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_CreateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 of dryrun. + /// dryrun resource. + /// 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 dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serviceLinkerDryrunLinkersRestClient.CreateDryrunAsync(Id, dryrunName, data, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerDryrunOperationSource(Client), _serviceLinkerDryrunLinkersClientDiagnostics, Pipeline, _serviceLinkerDryrunLinkersRestClient.CreateCreateDryrunRequest(Id, dryrunName, 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 a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_CreateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 of dryrun. + /// dryrun resource. + /// 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 dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serviceLinkerDryrunLinkersRestClient.CreateDryrun(Id, dryrunName, data, cancellationToken); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerDryrunOperationSource(Client), _serviceLinkerDryrunLinkersClientDiagnostics, Pipeline, _serviceLinkerDryrunLinkersRestClient.CreateCreateDryrunRequest(Id, dryrunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of dryrun. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.Get"); + scope.Start(); + try + { + var response = await _serviceLinkerDryrunLinkersRestClient.GetDryrunAsync(Id, dryrunName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of dryrun. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.Get"); + scope.Start(); + try + { + var response = _serviceLinkerDryrunLinkersRestClient.GetDryrun(Id, dryrunName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// list dryrun jobs + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns + /// + /// + /// Operation Id + /// Linkers_ListDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _serviceLinkerDryrunLinkersRestClient.CreateListDryrunRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceLinkerDryrunLinkersRestClient.CreateListDryrunNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceLinkerDryrunResource(Client, ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(e)), _serviceLinkerDryrunLinkersClientDiagnostics, Pipeline, "ServiceLinkerDryrunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// list dryrun jobs + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns + /// + /// + /// Operation Id + /// Linkers_ListDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _serviceLinkerDryrunLinkersRestClient.CreateListDryrunRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceLinkerDryrunLinkersRestClient.CreateListDryrunNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceLinkerDryrunResource(Client, ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(e)), _serviceLinkerDryrunLinkersClientDiagnostics, Pipeline, "ServiceLinkerDryrunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of dryrun. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.Exists"); + scope.Start(); + try + { + var response = await _serviceLinkerDryrunLinkersRestClient.GetDryrunAsync(Id, dryrunName, 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/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of dryrun. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.Exists"); + scope.Start(); + try + { + var response = _serviceLinkerDryrunLinkersRestClient.GetDryrun(Id, dryrunName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of dryrun. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _serviceLinkerDryrunLinkersRestClient.GetDryrunAsync(Id, dryrunName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of dryrun. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunCollection.GetIfExists"); + scope.Start(); + try + { + var response = _serviceLinkerDryrunLinkersRestClient.GetDryrun(Id, dryrunName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerDryrunResource(Client, response.Value), 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/ServiceLinkerDryrunData.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunData.Serialization.cs new file mode 100644 index 000000000000..d07ab61c73dd --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunData.Serialization.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + public partial class ServiceLinkerDryrunData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PrerequisiteResults)) + { + writer.WritePropertyName("prerequisiteResults"u8); + writer.WriteStartArray(); + foreach (var item in PrerequisiteResults) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(OperationPreviews)) + { + writer.WritePropertyName("operationPreviews"u8); + writer.WriteStartArray(); + foreach (var item in OperationPreviews) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + writer.WriteEndObject(); + } + + ServiceLinkerDryrunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceLinkerDryrunData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceLinkerDryrunData(document.RootElement, options); + } + + internal static ServiceLinkerDryrunData DeserializeServiceLinkerDryrunData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ServiceLinkerDryrunContent parameters = default; + IReadOnlyList prerequisiteResults = default; + IReadOnlyList operationPreviews = default; + string provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerServiceLinkerContext.Default); + 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("parameters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parameters = ServiceLinkerDryrunContent.DeserializeServiceLinkerDryrunContent(property0.Value, options); + continue; + } + if (property0.NameEquals("prerequisiteResults"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DryrunPrerequisiteResult.DeserializeDryrunPrerequisiteResult(item, options)); + } + prerequisiteResults = array; + continue; + } + if (property0.NameEquals("operationPreviews"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DryrunOperationPreview.DeserializeDryrunOperationPreview(item, options)); + } + operationPreviews = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceLinkerDryrunData( + id, + name, + type, + systemData, + parameters, + prerequisiteResults ?? new ChangeTrackingList(), + operationPreviews ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerServiceLinkerContext.Default); + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunData)} does not support writing '{options.Format}' format."); + } + } + + ServiceLinkerDryrunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceLinkerDryrunData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceLinkerDryrunData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunData.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunData.cs new file mode 100644 index 000000000000..345700855709 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunData.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + /// + /// A class representing the ServiceLinkerDryrun data model. + /// a dryrun job resource + /// + public partial class ServiceLinkerDryrunData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ServiceLinkerDryrunData() + { + PrerequisiteResults = new ChangeTrackingList(); + OperationPreviews = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// The parameters of the dryrun + /// 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 . + /// + /// + /// the result of the dryrun + /// 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 preview of the operations for creation. + /// The provisioning state. + /// Keeps track of any properties unknown to the library. + internal ServiceLinkerDryrunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ServiceLinkerDryrunContent parameters, IReadOnlyList prerequisiteResults, IReadOnlyList operationPreviews, string provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Parameters = parameters; + PrerequisiteResults = prerequisiteResults; + OperationPreviews = operationPreviews; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The parameters of the dryrun + /// 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 ServiceLinkerDryrunContent Parameters { get; set; } + /// + /// the result of the dryrun + /// 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 IReadOnlyList PrerequisiteResults { get; } + /// the preview of the operations for creation. + public IReadOnlyList OperationPreviews { get; } + /// The provisioning state. + public string ProvisioningState { get; } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunResource.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunResource.Serialization.cs new file mode 100644 index 000000000000..3092da0bd61d --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ServiceLinker +{ + public partial class ServiceLinkerDryrunResource : IJsonModel + { + private static ServiceLinkerDryrunData s_dataDeserializationInstance; + private static ServiceLinkerDryrunData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ServiceLinkerDryrunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerServiceLinkerContext.Default); + + ServiceLinkerDryrunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerServiceLinkerContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunResource.cs new file mode 100644 index 000000000000..18ef321d0ebd --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerDryrunResource.cs @@ -0,0 +1,350 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + /// + /// A Class representing a ServiceLinkerDryrun 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 GetServiceLinkerDryrunResource method. + /// Otherwise you can get one from its parent resource using the GetServiceLinkerDryrun method. + /// + public partial class ServiceLinkerDryrunResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The resourceUri. + /// The dryrunName. + public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string dryrunName) + { + var resourceId = $"{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _serviceLinkerDryrunLinkersClientDiagnostics; + private readonly LinkersRestOperations _serviceLinkerDryrunLinkersRestClient; + private readonly ServiceLinkerDryrunData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ServiceLinker/dryruns"; + + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerDryrunResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServiceLinkerDryrunResource(ArmClient client, ServiceLinkerDryrunData 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 ServiceLinkerDryrunResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceLinkerDryrunLinkersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serviceLinkerDryrunLinkersApiVersion); + _serviceLinkerDryrunLinkersRestClient = new LinkersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceLinkerDryrunLinkersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 ServiceLinkerDryrunData 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)); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunResource.Get"); + scope.Start(); + try + { + var response = await _serviceLinkerDryrunLinkersRestClient.GetDryrunAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunResource.Get"); + scope.Start(); + try + { + var response = _serviceLinkerDryrunLinkersRestClient.GetDryrun(Id.Parent, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// delete a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_DeleteDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunResource.Delete"); + scope.Start(); + try + { + var response = await _serviceLinkerDryrunLinkersRestClient.DeleteDryrunAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _serviceLinkerDryrunLinkersRestClient.CreateDeleteDryrunRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ServiceLinkerArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// delete a dryrun job + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_DeleteDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunResource.Delete"); + scope.Start(); + try + { + var response = _serviceLinkerDryrunLinkersRestClient.DeleteDryrun(Id.Parent, Id.Name, cancellationToken); + var uri = _serviceLinkerDryrunLinkersRestClient.CreateDeleteDryrunRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ServiceLinkerArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// add a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_UpdateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// dryrun resource. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunResource.Update"); + scope.Start(); + try + { + var response = await _serviceLinkerDryrunLinkersRestClient.UpdateDryrunAsync(Id.Parent, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerDryrunOperationSource(Client), _serviceLinkerDryrunLinkersClientDiagnostics, Pipeline, _serviceLinkerDryrunLinkersRestClient.CreateUpdateDryrunRequest(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; + } + } + + /// + /// add a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Linkers_UpdateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// dryrun resource. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serviceLinkerDryrunLinkersClientDiagnostics.CreateScope("ServiceLinkerDryrunResource.Update"); + scope.Start(); + try + { + var response = _serviceLinkerDryrunLinkersRestClient.UpdateDryrun(Id.Parent, Id.Name, patch, cancellationToken); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerDryrunOperationSource(Client), _serviceLinkerDryrunLinkersClientDiagnostics, Pipeline, _serviceLinkerDryrunLinkersRestClient.CreateUpdateDryrunRequest(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; + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorCollection.cs new file mode 100644 index 000000000000..83e5293839bc --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorCollection.cs @@ -0,0 +1,497 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +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 GetServiceLinkerLocationConnectors method from an instance of . + /// + public partial class ServiceLinkerLocationConnectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serviceLinkerLocationConnectorConnectorClientDiagnostics; + private readonly ConnectorRestOperations _serviceLinkerLocationConnectorConnectorRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerLocationConnectorCollection() + { + } + + /// 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. + /// The name of Azure region. + internal ServiceLinkerLocationConnectorCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _serviceLinkerLocationConnectorConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ServiceLinkerLocationConnectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServiceLinkerLocationConnectorResource.ResourceType, out string serviceLinkerLocationConnectorConnectorApiVersion); + _serviceLinkerLocationConnectorConnectorRestClient = new ConnectorRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceLinkerLocationConnectorConnectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Connector resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 of the LinkerResource. + /// Connector 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 connectorName, LinkerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationConnectorOperationSource(Client), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, 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 Connector resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 of the LinkerResource. + /// Connector 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 connectorName, LinkerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, data, cancellationToken); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationConnectorOperationSource(Client), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.Get"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.Get"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource provision. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors + /// + /// + /// Operation Id + /// Connector_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _serviceLinkerLocationConnectorConnectorRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceLinkerLocationConnectorConnectorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceLinkerLocationConnectorResource(Client, LinkerResourceData.DeserializeLinkerResourceData(e)), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, "ServiceLinkerLocationConnectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource provision. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors + /// + /// + /// Operation Id + /// Connector_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _serviceLinkerLocationConnectorConnectorRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceLinkerLocationConnectorConnectorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceLinkerLocationConnectorResource(Client, LinkerResourceData.DeserializeLinkerResourceData(e)), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, "ServiceLinkerLocationConnectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.Exists"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, 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 + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.Exists"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LinkerResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), connectorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationConnectorResource(Client, response.Value), 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/ServiceLinkerLocationConnectorResource.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorResource.Serialization.cs new file mode 100644 index 000000000000..e157ac1590eb --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ServiceLinker +{ + public partial class ServiceLinkerLocationConnectorResource : IJsonModel + { + private static LinkerResourceData s_dataDeserializationInstance; + private static LinkerResourceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + LinkerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerServiceLinkerContext.Default); + + LinkerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerServiceLinkerContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorResource.cs new file mode 100644 index 000000000000..15504be01e22 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationConnectorResource.cs @@ -0,0 +1,511 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + /// + /// A Class representing a ServiceLinkerLocationConnector 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 GetServiceLinkerLocationConnectorResource method. + /// Otherwise you can get one from its parent resource using the GetServiceLinkerLocationConnector method. + /// + public partial class ServiceLinkerLocationConnectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The location. + /// The connectorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, AzureLocation location, string connectorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _serviceLinkerLocationConnectorConnectorClientDiagnostics; + private readonly ConnectorRestOperations _serviceLinkerLocationConnectorConnectorRestClient; + private readonly LinkerResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ServiceLinker/locations/connectors"; + + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerLocationConnectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServiceLinkerLocationConnectorResource(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 ServiceLinkerLocationConnectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceLinkerLocationConnectorConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serviceLinkerLocationConnectorConnectorApiVersion); + _serviceLinkerLocationConnectorConnectorRestClient = new ConnectorRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceLinkerLocationConnectorConnectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Get"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns Connector resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Get"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Delete"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(_serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), 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 Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Delete"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var operation = new ServiceLinkerArmOperation(_serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), 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 Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Connector 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 = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Update"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationConnectorOperationSource(Client), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), 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 Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Connector 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 = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Update"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, patch, cancellationToken); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationConnectorOperationSource(Client), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generate configurations for a Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/generateConfigurations + /// + /// + /// Operation Id + /// Connector_GenerateConfigurations + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Connection Info, including format, secret store, etc. + /// The cancellation token to use. + public virtual async Task> GenerateConfigurationsAsync(LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.GenerateConfigurations"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.GenerateConfigurationsAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, info, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generate configurations for a Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/generateConfigurations + /// + /// + /// Operation Id + /// Connector_GenerateConfigurations + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Connection Info, including format, secret store, etc. + /// The cancellation token to use. + public virtual Response GenerateConfigurations(LinkerConfigurationInfo info = null, CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.GenerateConfigurations"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.GenerateConfigurations(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, info, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Validate a Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/validate + /// + /// + /// Operation Id + /// Connector_Validate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Validate"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationConnectorConnectorRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new LinkerValidateOperationResultOperationSource(), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateValidateRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Validate a Connector. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/validate + /// + /// + /// Operation Id + /// Connector_Validate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerLocationConnectorConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationConnectorResource.Validate"); + scope.Start(); + try + { + var response = _serviceLinkerLocationConnectorConnectorRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var operation = new ServiceLinkerArmOperation(new LinkerValidateOperationResultOperationSource(), _serviceLinkerLocationConnectorConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationConnectorConnectorRestClient.CreateValidateRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunCollection.cs new file mode 100644 index 000000000000..9b7656621efb --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunCollection.cs @@ -0,0 +1,497 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +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 GetServiceLinkerLocationDryruns method from an instance of . + /// + public partial class ServiceLinkerLocationDryrunCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serviceLinkerLocationDryrunConnectorClientDiagnostics; + private readonly ConnectorRestOperations _serviceLinkerLocationDryrunConnectorRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerLocationDryrunCollection() + { + } + + /// 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. + /// The name of Azure region. + internal ServiceLinkerLocationDryrunCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _serviceLinkerLocationDryrunConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ServiceLinkerLocationDryrunResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServiceLinkerLocationDryrunResource.ResourceType, out string serviceLinkerLocationDryrunConnectorApiVersion); + _serviceLinkerLocationDryrunConnectorRestClient = new ConnectorRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceLinkerLocationDryrunConnectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// create a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_CreateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 of the DryrunResource. + /// dryrun resource. + /// 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 dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationDryrunConnectorRestClient.CreateDryrunAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, data, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationDryrunOperationSource(Client), _serviceLinkerLocationDryrunConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationDryrunConnectorRestClient.CreateCreateDryrunRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, 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 a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_CreateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 of the DryrunResource. + /// dryrun resource. + /// 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 dryrunName, ServiceLinkerDryrunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serviceLinkerLocationDryrunConnectorRestClient.CreateDryrun(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, data, cancellationToken); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationDryrunOperationSource(Client), _serviceLinkerLocationDryrunConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationDryrunConnectorRestClient.CreateCreateDryrunRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.Get"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationDryrunConnectorRestClient.GetDryrunAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.Get"); + scope.Start(); + try + { + var response = _serviceLinkerLocationDryrunConnectorRestClient.GetDryrun(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// list dryrun jobs + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns + /// + /// + /// Operation Id + /// Connector_ListDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _serviceLinkerLocationDryrunConnectorRestClient.CreateListDryrunRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceLinkerLocationDryrunConnectorRestClient.CreateListDryrunNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceLinkerLocationDryrunResource(Client, ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(e)), _serviceLinkerLocationDryrunConnectorClientDiagnostics, Pipeline, "ServiceLinkerLocationDryrunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// list dryrun jobs + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns + /// + /// + /// Operation Id + /// Connector_ListDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _serviceLinkerLocationDryrunConnectorRestClient.CreateListDryrunRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceLinkerLocationDryrunConnectorRestClient.CreateListDryrunNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceLinkerLocationDryrunResource(Client, ServiceLinkerDryrunData.DeserializeServiceLinkerDryrunData(e)), _serviceLinkerLocationDryrunConnectorClientDiagnostics, Pipeline, "ServiceLinkerLocationDryrunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.Exists"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationDryrunConnectorRestClient.GetDryrunAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, 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 + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.Exists"); + scope.Start(); + try + { + var response = _serviceLinkerLocationDryrunConnectorRestClient.GetDryrun(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationDryrunConnectorRestClient.GetDryrunAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the DryrunResource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dryrunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dryrunName, nameof(dryrunName)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunCollection.GetIfExists"); + scope.Start(); + try + { + var response = _serviceLinkerLocationDryrunConnectorRestClient.GetDryrun(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_location), dryrunName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationDryrunResource(Client, response.Value), 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/ServiceLinkerLocationDryrunResource.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunResource.Serialization.cs new file mode 100644 index 000000000000..dd466abb5187 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ServiceLinker +{ + public partial class ServiceLinkerLocationDryrunResource : IJsonModel + { + private static ServiceLinkerDryrunData s_dataDeserializationInstance; + private static ServiceLinkerDryrunData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ServiceLinkerDryrunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerServiceLinkerContext.Default); + + ServiceLinkerDryrunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerServiceLinkerContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunResource.cs new file mode 100644 index 000000000000..cef0707ec0f9 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ServiceLinkerLocationDryrunResource.cs @@ -0,0 +1,353 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceLinker.Models; + +namespace Azure.ResourceManager.ServiceLinker +{ + /// + /// A Class representing a ServiceLinkerLocationDryrun 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 GetServiceLinkerLocationDryrunResource method. + /// Otherwise you can get one from its parent resource using the GetServiceLinkerLocationDryrun method. + /// + public partial class ServiceLinkerLocationDryrunResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The location. + /// The dryrunName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, AzureLocation location, string dryrunName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _serviceLinkerLocationDryrunConnectorClientDiagnostics; + private readonly ConnectorRestOperations _serviceLinkerLocationDryrunConnectorRestClient; + private readonly ServiceLinkerDryrunData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ServiceLinker/locations/dryruns"; + + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerLocationDryrunResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServiceLinkerLocationDryrunResource(ArmClient client, ServiceLinkerDryrunData 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 ServiceLinkerLocationDryrunResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceLinkerLocationDryrunConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serviceLinkerLocationDryrunConnectorApiVersion); + _serviceLinkerLocationDryrunConnectorRestClient = new ConnectorRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceLinkerLocationDryrunConnectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 ServiceLinkerDryrunData 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)); + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunResource.Get"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationDryrunConnectorRestClient.GetDryrunAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// get a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_GetDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunResource.Get"); + scope.Start(); + try + { + var response = _serviceLinkerLocationDryrunConnectorRestClient.GetDryrun(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceLinkerLocationDryrunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// delete a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_DeleteDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunResource.Delete"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationDryrunConnectorRestClient.DeleteDryrunAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _serviceLinkerLocationDryrunConnectorRestClient.CreateDeleteDryrunRequestUri(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ServiceLinkerArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// delete a dryrun job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_DeleteDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunResource.Delete"); + scope.Start(); + try + { + var response = _serviceLinkerLocationDryrunConnectorRestClient.DeleteDryrun(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var uri = _serviceLinkerLocationDryrunConnectorRestClient.CreateDeleteDryrunRequestUri(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ServiceLinkerArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// update a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_UpdateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// dryrun resource. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunResource.Update"); + scope.Start(); + try + { + var response = await _serviceLinkerLocationDryrunConnectorRestClient.UpdateDryrunAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationDryrunOperationSource(Client), _serviceLinkerLocationDryrunConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationDryrunConnectorRestClient.CreateUpdateDryrunRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), 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; + } + } + + /// + /// update a dryrun job to do necessary check before actual creation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName} + /// + /// + /// Operation Id + /// Connector_UpdateDryrun + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// dryrun resource. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ServiceLinkerDryrunPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serviceLinkerLocationDryrunConnectorClientDiagnostics.CreateScope("ServiceLinkerLocationDryrunResource.Update"); + scope.Start(); + try + { + var response = _serviceLinkerLocationDryrunConnectorRestClient.UpdateDryrun(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, patch, cancellationToken); + var operation = new ServiceLinkerArmOperation(new ServiceLinkerLocationDryrunOperationSource(Client), _serviceLinkerLocationDryrunConnectorClientDiagnostics, Pipeline, _serviceLinkerLocationDryrunConnectorRestClient.CreateUpdateDryrunRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md index 5e3755f348c3..d9264d2cc377 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true 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: https://github.com/Azure/azure-rest-api-specs/blob/0e3900b050a2b449ab87d65ccb5413a362489eec/specification/servicelinker/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -20,12 +20,18 @@ modelerfour: deserialize-null-collection-as-null-value: true use-model-reader-writer: true +# mgmt-debug: +# show-serialized-names: true + rename-mapping: TargetServiceBase: TargetServiceBaseInfo + TargetServiceBase.type: TargetServiceType AzureResource: AzureResourceInfo + AzureResource.id: -|arm-id ConfluentBootstrapServer: ConfluentBootstrapServerInfo ConfluentSchemaRegistry: ConfluentSchemaRegistryInfo AzureResourcePropertiesBase: AzureResourceBaseProperties + AzureResourcePropertiesBase.type: AzureResourceType SecretInfoBase: SecretBaseInfo ValueSecretInfo: RawValueSecretInfo AuthInfoBase: AuthBaseInfo @@ -39,6 +45,28 @@ rename-mapping: ValidationResultItem: LinkerValidationResultItemInfo ValidationResultStatus: LinkerValidationResultStatus AzureKeyVaultProperties.connectAsKubernetesCsiDriver: DoesConnectAsKubernetesCsiDriver + DryrunParameters: ServiceLinkerDryrunContent + CreateOrUpdateDryrunParameters: ServiceLinkerCreateOrUpdateDryrunContent + ConfigurationResult: SourceConfigurationResult + LinkerPatch: LinkerResourcePatch + ActionType: SourceApplicationConfigurationActionType + AllowType: LinkerTargetServiceFirewallRulesAllowType + AuthMode: ServiceLinkerAuthMode + ConfigurationInfo: LinkerConfigurationInfo + ConfigurationName: LinkerConfigurationName + ConfigurationNameItem: LinkerConfigurationNameItem + ConfigurationName.required : IsRequired + FirewallRules: LinkerFirewallRules + DaprConfigurationResource: DaprConfigurationResourceItem + DryrunResource: ServiceLinkerDryrun + AccessKeyPermissions: TargetServiceAccessKeyPermission + DeleteOrUpdateBehavior: LinkerDeleteOrUpdateBehavior + DryrunPatch: ServiceLinkerDryrunPatch + FabricPlatform: LinkerTargetFabricPlatform + PublicNetworkSolution: LinkerPublicNetworkSolution + SecretSourceType: LinkerKeyVaultSecretSourceType + UserAccountAuthInfo: LinkerUserAccountAuthInfo + VnetSolution: LinkerVnetSolution format-by-name-rules: 'tenantId': 'uuid' @@ -79,12 +107,14 @@ acronym-mapping: generate-arm-resource-extensions: - /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} -directive: - - from: servicelinker.json - where: $.definitions - transform: > - $.AzureResource.properties.id['x-ms-format'] = 'arm-id'; - $.TargetServiceBase.properties.type['x-ms-client-name'] = 'TargetServiceType'; - $.AzureResourcePropertiesBase.properties.type['x-ms-client-name'] = 'AzureResourceType'; +request-path-to-resource-name: + /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}: LinkerResource + /{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}: ServiceLinkerDryrun + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}: ServiceLinkerLocationDryrun + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}: ServiceLinkerLocationConnector + +override-operation-name: + ConfigurationNames_List: GetServiceLinkerConfigurationNames + Linkers_ListDaprConfigurations: GetServiceLinkerDaprConfigurations ``` diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ArmClientExtensions.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ArmClientExtensions.cs new file mode 100644 index 000000000000..e87a1e555cc6 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ArmClientExtensions.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_ArmClientExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetServiceLinkerDaprConfigurations_GetDaprConfigurations() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/GetDaprConfigurations.json + // this example is just showing the usage of "Linkers_ListDaprConfigurations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // invoke the operation and iterate over the result + ResourceIdentifier scope = null; + await foreach (DaprConfigurationResourceItem item in client.GetServiceLinkerDaprConfigurationsAsync(scope)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResource.cs index 8d054d7ee825..7e43507598af 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResource.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResource.cs @@ -18,9 +18,9 @@ public partial class Sample_LinkerResource { [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_Link() + public async Task Get_Linker() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Linker.json // this example is just showing the usage of "Linker_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -47,9 +47,9 @@ public async Task Get_Link() [Test] [Ignore("Only validating compilation of examples")] - public async Task Delete_DeleteLink() + public async Task Delete_DeleteLinker() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/DeleteLink.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/DeleteLinker.json // this example is just showing the usage of "Linker_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -72,9 +72,9 @@ public async Task Delete_DeleteLink() [Test] [Ignore("Only validating compilation of examples")] - public async Task Update_PatchLink() + public async Task Update_PatchLinker() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PatchLink.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/PatchLinker.json // this example is just showing the usage of "Linker_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,10 +110,10 @@ public async Task Update_PatchLink() [Test] [Ignore("Only validating compilation of examples")] - public async Task Validate_ValidateLinkSuccess() + public async Task GenerateConfigurations_GenerateConfiguration() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ValidateLinkSuccess.json - // this example is just showing the usage of "Linker_Validate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/LinkerGenerateConfigurations.json + // this example is just showing the usage of "Linkers_GenerateConfigurations" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -128,8 +128,14 @@ public async Task Validate_ValidateLinkSuccess() LinkerResource linkerResource = client.GetLinkerResource(linkerResourceId); // invoke the operation - ArmOperation lro = await linkerResource.ValidateAsync(WaitUntil.Completed); - LinkerValidateOperationResult result = lro.Value; + LinkerConfigurationInfo info = new LinkerConfigurationInfo + { + CustomizedKeys = +{ +["ASL_DocumentDb_ConnectionString"] = "MyConnectionstring" +}, + }; + SourceConfigurationResult result = await linkerResource.GenerateConfigurationsAsync(info: info); Console.WriteLine($"Succeeded: {result}"); } @@ -138,7 +144,7 @@ public async Task Validate_ValidateLinkSuccess() [Ignore("Only validating compilation of examples")] public async Task GetConfigurations_GetConfiguration() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/GetConfigurations.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/GetConfigurations.json // this example is just showing the usage of "Linker_ListConfigurations" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,7 +154,7 @@ public async Task GetConfigurations_GetConfiguration() // this example assumes you already have this LinkerResource created on azure // for more information of creating LinkerResource, please refer to the document of LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.App/containerApps/test-app"; string linkerName = "linkName"; ResourceIdentifier linkerResourceId = LinkerResource.CreateResourceIdentifier(resourceUri, linkerName); LinkerResource linkerResource = client.GetLinkerResource(linkerResourceId); @@ -158,5 +164,31 @@ public async Task GetConfigurations_GetConfiguration() Console.WriteLine($"Succeeded: {result}"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Validate_ValidateLinkerSuccess() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ValidateLinkerSuccess.json + // this example is just showing the usage of "Linker_Validate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LinkerResource created on azure + // for more information of creating LinkerResource, please refer to the document of LinkerResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + string linkerName = "linkName"; + ResourceIdentifier linkerResourceId = LinkerResource.CreateResourceIdentifier(resourceUri, linkerName); + LinkerResource linkerResource = client.GetLinkerResource(linkerResourceId); + + // invoke the operation + ArmOperation lro = await linkerResource.ValidateAsync(WaitUntil.Completed); + LinkerValidateOperationResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResourceCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResourceCollection.cs index c149ff903358..07bfa58ae331 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResourceCollection.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_LinkerResourceCollection.cs @@ -18,9 +18,9 @@ public partial class Sample_LinkerResourceCollection { [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutLink() + public async Task CreateOrUpdate_PutLinker() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLink.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/PutLinker.json // this example is just showing the usage of "Linker_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,87 +48,10 @@ public async Task CreateOrUpdate_PutLink() Value = "secret", }, }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, linkerName, data); - LinkerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - LinkerResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutLinkWithSecretStore() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLinkWithSecretStore.json - // this example is just showing the usage of "Linker_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - LinkerResourceCollection collection = client.GetLinkerResources(new ResourceIdentifier(resourceUri)); - - // invoke the operation - string linkerName = "linkName"; - LinkerResourceData data = new LinkerResourceData - { - TargetService = new AzureResourceInfo + VnetSolution = new VnetSolution { - Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - AuthInfo = new SecretAuthInfo(), - SecretStoreKeyVaultId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/test-kv"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, linkerName, data); - LinkerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - LinkerResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutLinkWithServiceEndpoint() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLinkWithServiceEndpoint.json - // this example is just showing the usage of "Linker_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - LinkerResourceCollection collection = client.GetLinkerResources(new ResourceIdentifier(resourceUri)); - - // invoke the operation - string linkerName = "linkName"; - LinkerResourceData data = new LinkerResourceData - { - TargetService = new AzureResourceInfo - { - Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db"), - }, - AuthInfo = new SecretAuthInfo - { - Name = "name", - SecretInfo = new KeyVaultSecretUriSecretInfo - { - Value = "https://vault-name.vault.azure.net/secrets/secret-name/00000000000000000000000000000000", - }, + SolutionType = VnetSolutionType.ServiceEndpoint, }, - SolutionType = VnetSolutionType.ServiceEndpoint, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, linkerName, data); LinkerResource result = lro.Value; @@ -142,9 +65,9 @@ public async Task CreateOrUpdate_PutLinkWithServiceEndpoint() [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_Link() + public async Task Get_Linker() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Linker.json // this example is just showing the usage of "Linker_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,9 +92,9 @@ public async Task Get_Link() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetAll_LinkList() + public async Task GetAll_LinkerList() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/LinkList.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/LinkerList.json // this example is just showing the usage of "Linker_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -198,9 +121,9 @@ public async Task GetAll_LinkList() [Test] [Ignore("Only validating compilation of examples")] - public async Task Exists_Link() + public async Task Exists_Linker() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Linker.json // this example is just showing the usage of "Linker_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -221,9 +144,9 @@ public async Task Exists_Link() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_Link() + public async Task GetIfExists_Linker() { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Linker.json // this example is just showing the usage of "Linker_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerDryrunCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerDryrunCollection.cs new file mode 100644 index 000000000000..1b3f618603bb --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerDryrunCollection.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_ServiceLinkerDryrunCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/PutDryrun.json + // this example is just showing the usage of "Linkers_CreateDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // get the collection of this ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + ServiceLinkerDryrunCollection collection = client.GetServiceLinkerDryruns(new ResourceIdentifier(resourceUri)); + + // invoke the operation + string dryrunName = "dryrunName"; + ServiceLinkerDryrunData data = new ServiceLinkerDryrunData + { + Parameters = new ServiceLinkerCreateOrUpdateDryrunContent + { + TargetService = new AzureResourceInfo + { + Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), + }, + AuthInfo = new SecretAuthInfo + { + Name = "name", + SecretInfo = new RawValueSecretInfo + { + Value = "secret", + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dryrunName, data); + ServiceLinkerDryrunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/GetDryrun.json + // this example is just showing the usage of "Linkers_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // get the collection of this ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + ServiceLinkerDryrunCollection collection = client.GetServiceLinkerDryruns(new ResourceIdentifier(resourceUri)); + + // invoke the operation + string dryrunName = "dryrunName"; + ServiceLinkerDryrunResource result = await collection.GetAsync(dryrunName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ListDryrun.json + // this example is just showing the usage of "Linkers_ListDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // get the collection of this ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + ServiceLinkerDryrunCollection collection = client.GetServiceLinkerDryruns(new ResourceIdentifier(resourceUri)); + + // invoke the operation and iterate over the result + await foreach (ServiceLinkerDryrunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/GetDryrun.json + // this example is just showing the usage of "Linkers_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // get the collection of this ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + ServiceLinkerDryrunCollection collection = client.GetServiceLinkerDryruns(new ResourceIdentifier(resourceUri)); + + // invoke the operation + string dryrunName = "dryrunName"; + bool result = await collection.ExistsAsync(dryrunName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/GetDryrun.json + // this example is just showing the usage of "Linkers_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // get the collection of this ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + ServiceLinkerDryrunCollection collection = client.GetServiceLinkerDryruns(new ResourceIdentifier(resourceUri)); + + // invoke the operation + string dryrunName = "dryrunName"; + NullableResponse response = await collection.GetIfExistsAsync(dryrunName); + ServiceLinkerDryrunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerDryrunResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerDryrunResource.cs new file mode 100644 index 000000000000..37f4cf169858 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerDryrunResource.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_ServiceLinkerDryrunResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/GetDryrun.json + // this example is just showing the usage of "Linkers_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerDryrunResource created on azure + // for more information of creating ServiceLinkerDryrunResource, please refer to the document of ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + string dryrunName = "dryrunName"; + ResourceIdentifier serviceLinkerDryrunResourceId = ServiceLinkerDryrunResource.CreateResourceIdentifier(resourceUri, dryrunName); + ServiceLinkerDryrunResource serviceLinkerDryrun = client.GetServiceLinkerDryrunResource(serviceLinkerDryrunResourceId); + + // invoke the operation + ServiceLinkerDryrunResource result = await serviceLinkerDryrun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/DeleteDryrun.json + // this example is just showing the usage of "Linkers_DeleteDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerDryrunResource created on azure + // for more information of creating ServiceLinkerDryrunResource, please refer to the document of ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + string dryrunName = "dryrunName"; + ResourceIdentifier serviceLinkerDryrunResourceId = ServiceLinkerDryrunResource.CreateResourceIdentifier(resourceUri, dryrunName); + ServiceLinkerDryrunResource serviceLinkerDryrun = client.GetServiceLinkerDryrunResource(serviceLinkerDryrunResourceId); + + // invoke the operation + await serviceLinkerDryrun.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PatchDryrun() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/PatchDryrun.json + // this example is just showing the usage of "Linkers_UpdateDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerDryrunResource created on azure + // for more information of creating ServiceLinkerDryrunResource, please refer to the document of ServiceLinkerDryrunResource + string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; + string dryrunName = "dryrunName"; + ResourceIdentifier serviceLinkerDryrunResourceId = ServiceLinkerDryrunResource.CreateResourceIdentifier(resourceUri, dryrunName); + ServiceLinkerDryrunResource serviceLinkerDryrun = client.GetServiceLinkerDryrunResource(serviceLinkerDryrunResourceId); + + // invoke the operation + ServiceLinkerDryrunPatch patch = new ServiceLinkerDryrunPatch + { + Parameters = new ServiceLinkerCreateOrUpdateDryrunContent + { + TargetService = new AzureResourceInfo + { + Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), + }, + AuthInfo = new SecretAuthInfo + { + Name = "name", + SecretInfo = new RawValueSecretInfo + { + Value = "secret", + }, + }, + }, + }; + ArmOperation lro = await serviceLinkerDryrun.UpdateAsync(WaitUntil.Completed, patch); + ServiceLinkerDryrunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationConnectorCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationConnectorCollection.cs new file mode 100644 index 000000000000..ab3283536b6c --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationConnectorCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_ServiceLinkerLocationConnectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutConnector() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/PutConnector.json + // this example is just showing the usage of "Connector_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationConnectorResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationConnectorCollection collection = resourceGroupResource.GetServiceLinkerLocationConnectors(location); + + // invoke the operation + string connectorName = "connectorName"; + LinkerResourceData data = new LinkerResourceData + { + TargetService = new AzureResourceInfo + { + Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), + }, + AuthInfo = new SecretAuthInfo(), + SecretStore = new LinkerSecretStore + { + KeyVaultId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/test-kv"), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, connectorName, data); + ServiceLinkerLocationConnectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LinkerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_Connector() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Connectors.json + // this example is just showing the usage of "Connector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationConnectorResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationConnectorCollection collection = resourceGroupResource.GetServiceLinkerLocationConnectors(location); + + // invoke the operation + string connectorName = "connectorName"; + ServiceLinkerLocationConnectorResource result = await collection.GetAsync(connectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LinkerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ConnectorList() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorList.json + // this example is just showing the usage of "Connector_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationConnectorResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationConnectorCollection collection = resourceGroupResource.GetServiceLinkerLocationConnectors(location); + + // invoke the operation and iterate over the result + await foreach (ServiceLinkerLocationConnectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LinkerResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_Connector() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Connectors.json + // this example is just showing the usage of "Connector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationConnectorResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationConnectorCollection collection = resourceGroupResource.GetServiceLinkerLocationConnectors(location); + + // invoke the operation + string connectorName = "connectorName"; + bool result = await collection.ExistsAsync(connectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_Connector() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Connectors.json + // this example is just showing the usage of "Connector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationConnectorResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationConnectorCollection collection = resourceGroupResource.GetServiceLinkerLocationConnectors(location); + + // invoke the operation + string connectorName = "connectorName"; + NullableResponse response = await collection.GetIfExistsAsync(connectorName); + ServiceLinkerLocationConnectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LinkerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationConnectorResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationConnectorResource.cs new file mode 100644 index 000000000000..5fd7cfba6eab --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationConnectorResource.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_ServiceLinkerLocationConnectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_Connector() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/Connectors.json + // this example is just showing the usage of "Connector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationConnectorResource created on azure + // for more information of creating ServiceLinkerLocationConnectorResource, please refer to the document of ServiceLinkerLocationConnectorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string connectorName = "connectorName"; + ResourceIdentifier serviceLinkerLocationConnectorResourceId = ServiceLinkerLocationConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, connectorName); + ServiceLinkerLocationConnectorResource serviceLinkerLocationConnector = client.GetServiceLinkerLocationConnectorResource(serviceLinkerLocationConnectorResourceId); + + // invoke the operation + ServiceLinkerLocationConnectorResource result = await serviceLinkerLocationConnector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LinkerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteConnector() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/DeleteConnector.json + // this example is just showing the usage of "Connector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationConnectorResource created on azure + // for more information of creating ServiceLinkerLocationConnectorResource, please refer to the document of ServiceLinkerLocationConnectorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string connectorName = "connectorName"; + ResourceIdentifier serviceLinkerLocationConnectorResourceId = ServiceLinkerLocationConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, connectorName); + ServiceLinkerLocationConnectorResource serviceLinkerLocationConnector = client.GetServiceLinkerLocationConnectorResource(serviceLinkerLocationConnectorResourceId); + + // invoke the operation + await serviceLinkerLocationConnector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PatchConnector() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/PatchConnector.json + // this example is just showing the usage of "Connector_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationConnectorResource created on azure + // for more information of creating ServiceLinkerLocationConnectorResource, please refer to the document of ServiceLinkerLocationConnectorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string connectorName = "connectorName"; + ResourceIdentifier serviceLinkerLocationConnectorResourceId = ServiceLinkerLocationConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, connectorName); + ServiceLinkerLocationConnectorResource serviceLinkerLocationConnector = client.GetServiceLinkerLocationConnectorResource(serviceLinkerLocationConnectorResourceId); + + // invoke the operation + LinkerResourcePatch patch = new LinkerResourcePatch + { + TargetService = new AzureResourceInfo + { + Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), + }, + AuthInfo = new ServicePrincipalSecretAuthInfo("name", Guid.Parse("id"), "secret"), + }; + ArmOperation lro = await serviceLinkerLocationConnector.UpdateAsync(WaitUntil.Completed, patch); + ServiceLinkerLocationConnectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LinkerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GenerateConfigurations_GenerateConfiguration() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/GenerateConfigurations.json + // this example is just showing the usage of "Connector_GenerateConfigurations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationConnectorResource created on azure + // for more information of creating ServiceLinkerLocationConnectorResource, please refer to the document of ServiceLinkerLocationConnectorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string connectorName = "connectorName"; + ResourceIdentifier serviceLinkerLocationConnectorResourceId = ServiceLinkerLocationConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, connectorName); + ServiceLinkerLocationConnectorResource serviceLinkerLocationConnector = client.GetServiceLinkerLocationConnectorResource(serviceLinkerLocationConnectorResourceId); + + // invoke the operation + LinkerConfigurationInfo info = new LinkerConfigurationInfo + { + CustomizedKeys = +{ +["ASL_DocumentDb_ConnectionString"] = "MyConnectionstring" +}, + }; + SourceConfigurationResult result = await serviceLinkerLocationConnector.GenerateConfigurationsAsync(info: info); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Validate_ValidateConnectorSuccess() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ValidateConnectorSuccess.json + // this example is just showing the usage of "Connector_Validate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationConnectorResource created on azure + // for more information of creating ServiceLinkerLocationConnectorResource, please refer to the document of ServiceLinkerLocationConnectorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string connectorName = "connectorName"; + ResourceIdentifier serviceLinkerLocationConnectorResourceId = ServiceLinkerLocationConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, connectorName); + ServiceLinkerLocationConnectorResource serviceLinkerLocationConnector = client.GetServiceLinkerLocationConnectorResource(serviceLinkerLocationConnectorResourceId); + + // invoke the operation + ArmOperation lro = await serviceLinkerLocationConnector.ValidateAsync(WaitUntil.Completed); + LinkerValidateOperationResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationDryrunCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationDryrunCollection.cs new file mode 100644 index 000000000000..be286a748ac7 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationDryrunCollection.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_ServiceLinkerLocationDryrunCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ConnectorDryrunCreate() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunCreate.json + // this example is just showing the usage of "Connector_CreateDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationDryrunResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationDryrunCollection collection = resourceGroupResource.GetServiceLinkerLocationDryruns(location); + + // invoke the operation + string dryrunName = "dryrunName"; + ServiceLinkerDryrunData data = new ServiceLinkerDryrunData + { + Parameters = new ServiceLinkerCreateOrUpdateDryrunContent + { + TargetService = new AzureResourceInfo + { + Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), + }, + AuthInfo = new SecretAuthInfo + { + Name = "name", + SecretInfo = new RawValueSecretInfo + { + Value = "secret", + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dryrunName, data); + ServiceLinkerLocationDryrunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ConnectorDryrunGet() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunGet.json + // this example is just showing the usage of "Connector_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationDryrunResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationDryrunCollection collection = resourceGroupResource.GetServiceLinkerLocationDryruns(location); + + // invoke the operation + string dryrunName = "dryrunName"; + ServiceLinkerLocationDryrunResource result = await collection.GetAsync(dryrunName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ConnectorDryrunList() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunList.json + // this example is just showing the usage of "Connector_ListDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationDryrunResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationDryrunCollection collection = resourceGroupResource.GetServiceLinkerLocationDryruns(location); + + // invoke the operation and iterate over the result + await foreach (ServiceLinkerLocationDryrunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ConnectorDryrunGet() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunGet.json + // this example is just showing the usage of "Connector_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationDryrunResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationDryrunCollection collection = resourceGroupResource.GetServiceLinkerLocationDryruns(location); + + // invoke the operation + string dryrunName = "dryrunName"; + bool result = await collection.ExistsAsync(dryrunName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ConnectorDryrunGet() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunGet.json + // this example is just showing the usage of "Connector_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServiceLinkerLocationDryrunResource + AzureLocation location = new AzureLocation("westus"); + ServiceLinkerLocationDryrunCollection collection = resourceGroupResource.GetServiceLinkerLocationDryruns(location); + + // invoke the operation + string dryrunName = "dryrunName"; + NullableResponse response = await collection.GetIfExistsAsync(dryrunName); + ServiceLinkerLocationDryrunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationDryrunResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationDryrunResource.cs new file mode 100644 index 000000000000..c4d1f967f051 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_ServiceLinkerLocationDryrunResource.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_ServiceLinkerLocationDryrunResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ConnectorDryrunGet() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunGet.json + // this example is just showing the usage of "Connector_GetDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationDryrunResource created on azure + // for more information of creating ServiceLinkerLocationDryrunResource, please refer to the document of ServiceLinkerLocationDryrunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string dryrunName = "dryrunName"; + ResourceIdentifier serviceLinkerLocationDryrunResourceId = ServiceLinkerLocationDryrunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, dryrunName); + ServiceLinkerLocationDryrunResource serviceLinkerLocationDryrun = client.GetServiceLinkerLocationDryrunResource(serviceLinkerLocationDryrunResourceId); + + // invoke the operation + ServiceLinkerLocationDryrunResource result = await serviceLinkerLocationDryrun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ConnectorDryrunDelete() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunDelete.json + // this example is just showing the usage of "Connector_DeleteDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationDryrunResource created on azure + // for more information of creating ServiceLinkerLocationDryrunResource, please refer to the document of ServiceLinkerLocationDryrunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string dryrunName = "dryrunName"; + ResourceIdentifier serviceLinkerLocationDryrunResourceId = ServiceLinkerLocationDryrunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, dryrunName); + ServiceLinkerLocationDryrunResource serviceLinkerLocationDryrun = client.GetServiceLinkerLocationDryrunResource(serviceLinkerLocationDryrunResourceId); + + // invoke the operation + await serviceLinkerLocationDryrun.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ConnectorDryrunUpdate() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConnectorDryrunUpdate.json + // this example is just showing the usage of "Connector_UpdateDryrun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceLinkerLocationDryrunResource created on azure + // for more information of creating ServiceLinkerLocationDryrunResource, please refer to the document of ServiceLinkerLocationDryrunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "test-rg"; + AzureLocation location = new AzureLocation("westus"); + string dryrunName = "dryrunName"; + ResourceIdentifier serviceLinkerLocationDryrunResourceId = ServiceLinkerLocationDryrunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, location, dryrunName); + ServiceLinkerLocationDryrunResource serviceLinkerLocationDryrun = client.GetServiceLinkerLocationDryrunResource(serviceLinkerLocationDryrunResourceId); + + // invoke the operation + ServiceLinkerDryrunPatch patch = new ServiceLinkerDryrunPatch + { + Parameters = new ServiceLinkerCreateOrUpdateDryrunContent + { + TargetService = new AzureResourceInfo + { + Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), + }, + AuthInfo = new SecretAuthInfo + { + Name = "name", + SecretInfo = new RawValueSecretInfo + { + Value = "secret", + }, + }, + }, + }; + ArmOperation lro = await serviceLinkerLocationDryrun.UpdateAsync(WaitUntil.Completed, patch); + ServiceLinkerLocationDryrunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceLinkerDryrunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_TenantResourceExtensions.cs new file mode 100644 index 000000000000..df0153b61716 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/tests/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceLinker.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceLinker.Samples +{ + public partial class Sample_TenantResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetServiceLinkerConfigurationNames_GetConfigurationNames() + { + // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ConfigurationNamesList.json + // this example is just showing the usage of "ConfigurationNames_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + TenantResource tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; + + // invoke the operation and iterate over the result + await foreach (LinkerConfigurationNameItem item in tenantResource.GetServiceLinkerConfigurationNamesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +}